5426007d3f9e47673e9a2abe796b908df40d9fae.svn-base 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. package cn.com.goldenwater.dcproj.model;
  2. import java.io.Serializable;
  3. import java.util.*;
  4. import java.util.concurrent.atomic.AtomicInteger;
  5. import cn.com.goldenwater.core.model.BaseBean;
  6. import cn.com.goldenwater.dcproj.annotation.ExcelImport;
  7. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  8. import io.swagger.annotations.ApiModelProperty;
  9. import org.apache.commons.collections.CollectionUtils;
  10. @JsonIgnoreProperties(value = {"handler","hibernateLazyInitializer"})
  11. public class BisInspPlanMonth extends BaseBean implements Serializable {
  12. // 序号
  13. @ExcelImport(titleName = "序号", order = 1, notNull = true, width = 5)
  14. @ApiModelProperty(value = "序号", name = "ordr")
  15. private Long ordr;
  16. // 行政区代码
  17. //@ExcelImport(titleName = "行政区代码", order = 2, notNull = true, width = 13)
  18. @ApiModelProperty(value = "行政区代码", name = "adCode")
  19. private String adCode;
  20. // 事项内容
  21. @ExcelImport(titleName = "事项内容", order = 8, width = 40)
  22. @ApiModelProperty(value = "事项内容", name = "chkTitle")
  23. private String chkTitle;
  24. // 年月
  25. @ExcelImport(titleName = "年月", order = 5, width = 14)
  26. @ApiModelProperty(value = "年月", name = "chkMonth")
  27. private Date chkMonth;
  28. // 检查实施单位
  29. @ExcelImport(titleName = "检查实施单位", order = 6)
  30. @ApiModelProperty(value = "检查实施单位", name = "chkDep")
  31. private String chkDep;
  32. // 检查组
  33. @ExcelImport(titleName = "检查组", order = 7, notNull = true)
  34. @ApiModelProperty(value = "检查组", name = "chkGrp")
  35. private String chkGrp;
  36. // 拟检查开始时间(到日)
  37. @ExcelImport(titleName = "拟检查开始时间(到日)", order = 9, notNull = true, width = 14)
  38. @ApiModelProperty(value = "拟检查开始时间(到日)", name = "planSttm")
  39. private Date planSttm;
  40. // 拟检查结束时间(到日)
  41. @ExcelImport(titleName = "拟检查结束时间(到日)", order = 10, notNull = true, width = 14)
  42. @ApiModelProperty(value = "拟检查结束时间(到日)", name = "planEntm")
  43. private Date planEntm;
  44. // 是否到市水利局现场
  45. @ExcelImport(titleName = "是否到市水利(水务)局", order = 11, notNull = true, width = 15)
  46. @ApiModelProperty(value = "是否到市水利局现场", name = "leadDep")
  47. private String leadDep;
  48. // 到市水利局现场名称
  49. @ExcelImport(titleName = "水利(水务)局名称", order = 12, width = 20)
  50. @ApiModelProperty(value = "水利(水务)局名称", name = "joinDep")
  51. private String joinDep;
  52. // 检查区域市水利(水务)局
  53. @ApiModelProperty(value = "检查区域市水利(水务)局", name = "chkCity")
  54. @ExcelImport(titleName = "行政区划(市)", order = 13, width = 40, isImport = false)
  55. private String chkCity;
  56. // 检查区区、县(市)
  57. @ApiModelProperty(value = "检查区区、县(市)", name = "chkCountry")
  58. @ExcelImport(titleName = "行政区划(区县)", order = 14, width = 40, isImport = false)
  59. private String chkCountry;
  60. // 项目数量
  61. @ExcelImport(titleName = "项目数量", order = 15, notNull = true)
  62. @ApiModelProperty(value = "项目数量", name = "chkSize")
  63. private Long chkSize;
  64. // 开展方式
  65. @ExcelImport(titleName = "开展方式", order = 16, notNull = true)
  66. @ApiModelProperty(value = "开展方式", name = "chkType")
  67. private String chkType;
  68. // 联络人
  69. @ExcelImport(titleName = "联络人", order = 17, notNull = true)
  70. @ApiModelProperty(value = "联络人", name = "chkPers")
  71. private String chkPers;
  72. // 联络人联系方式
  73. @ExcelImport(titleName = "联络人联系方式", order = 18, notNull = true, width = 14)
  74. @ApiModelProperty(value = "联络人联系方式", name = "chkPersTel")
  75. private String chkPersTel;
  76. // 统筹调度意见
  77. @ExcelImport(titleName = "统筹调度意见", order = 19, width = 25)
  78. @ApiModelProperty(value = "统筹调度意见", name = "chkNote")
  79. private String chkNote;
  80. // 创建人
  81. @ApiModelProperty(value = "创建人", name = "persId")
  82. private String persId;
  83. // 创建时间
  84. @ApiModelProperty(value = "创建时间", name = "intm")
  85. private Date intm;
  86. // 修改时间
  87. @ApiModelProperty(value = "修改时间", name = "uptm")
  88. private Date uptm;
  89. // 数据状态(0:正常;9:删除)
  90. @ApiModelProperty(value = "数据状态(0:正常;9:删除)", name = "dataStat")
  91. private String dataStat;
  92. // ID
  93. @ApiModelProperty(value = "ID", name = "id")
  94. private String id;
  95. @ApiModelProperty(value = "重复表示颜色", name = "color")
  96. private String color;
  97. @ExcelImport(titleName = "行政区划(市)", order = 13, width = 40, isExport = false)
  98. private String chkCityCode;
  99. @ExcelImport(titleName = "行政区划(区县)", order = 14, width = 40, isExport = false)
  100. private String chkCountryCode;
  101. private List<BisInspPlanMonthArea> area;
  102. private boolean isRepeat;
  103. private String repeatId;
  104. // 年度检查计划id
  105. @ApiModelProperty(value="年度检查计划id",name="yearPlanId")
  106. private String yearPlanId;
  107. // 年度检查计划名称
  108. @ApiModelProperty(value="年度检查计划名称",name="yearChkName")
  109. @ExcelImport(titleName = "年度检查计划名称", order = 2, width = 35)
  110. private String yearChkName;
  111. // 年度检查类别
  112. @ApiModelProperty(value="年度检查类别",name="yearChkType")
  113. @ExcelImport(titleName = "年度检查类别", order = 3, width = 35)
  114. private String yearChkType;
  115. // 组织检查处室
  116. @ApiModelProperty(value="组织检查处室",name="organDep")
  117. private String organDep;
  118. public String getOrganDep() {
  119. return organDep;
  120. }
  121. public void setOrganDep(String organDep) {
  122. this.organDep = organDep;
  123. }
  124. public BisInspPlanMonth() {
  125. }
  126. public Long getOrdr() {
  127. return ordr;
  128. }
  129. public void setOrdr(Long ordr) {
  130. this.ordr = ordr;
  131. }
  132. public String getAdCode() {
  133. return adCode;
  134. }
  135. public void setAdCode(String adCode) {
  136. this.adCode = adCode;
  137. }
  138. public String getChkTitle() {
  139. return chkTitle;
  140. }
  141. public void setChkTitle(String chkTitle) {
  142. this.chkTitle = chkTitle;
  143. }
  144. public Date getChkMonth() {
  145. return chkMonth;
  146. }
  147. public void setChkMonth(Date chkMonth) {
  148. this.chkMonth = chkMonth;
  149. }
  150. public String getChkDep() {
  151. return chkDep;
  152. }
  153. public void setChkDep(String chkDep) {
  154. this.chkDep = chkDep;
  155. }
  156. public String getChkGrp() {
  157. return chkGrp;
  158. }
  159. public void setChkGrp(String chkGrp) {
  160. this.chkGrp = chkGrp;
  161. }
  162. public Date getPlanSttm() {
  163. return planSttm;
  164. }
  165. public void setPlanSttm(Date planSttm) {
  166. this.planSttm = planSttm;
  167. }
  168. public Date getPlanEntm() {
  169. return planEntm;
  170. }
  171. public void setPlanEntm(Date planEntm) {
  172. this.planEntm = planEntm;
  173. }
  174. public String getLeadDep() {
  175. return leadDep;
  176. }
  177. public void setLeadDep(String leadDep) {
  178. this.leadDep = leadDep;
  179. }
  180. public String getJoinDep() {
  181. return joinDep;
  182. }
  183. public void setJoinDep(String joinDep) {
  184. this.joinDep = joinDep;
  185. }
  186. public String getChkCity() {
  187. return chkCity;
  188. }
  189. public void setChkCity(String chkCity) {
  190. this.chkCity = chkCity;
  191. }
  192. public String getChkCountry() {
  193. return chkCountry;
  194. }
  195. public void setChkCountry(String chkCountry) {
  196. this.chkCountry = chkCountry;
  197. }
  198. public Long getChkSize() {
  199. return chkSize;
  200. }
  201. public void setChkSize(Long chkSize) {
  202. this.chkSize = chkSize;
  203. }
  204. public String getChkType() {
  205. return chkType;
  206. }
  207. public void setChkType(String chkType) {
  208. this.chkType = chkType;
  209. }
  210. public String getChkPers() {
  211. return chkPers;
  212. }
  213. public void setChkPers(String chkPers) {
  214. this.chkPers = chkPers;
  215. }
  216. public String getChkPersTel() {
  217. return chkPersTel;
  218. }
  219. public void setChkPersTel(String chkPersTel) {
  220. this.chkPersTel = chkPersTel;
  221. }
  222. public String getChkNote() {
  223. return chkNote;
  224. }
  225. public void setChkNote(String chkNote) {
  226. this.chkNote = chkNote;
  227. }
  228. public String getPersId() {
  229. return persId;
  230. }
  231. public void setPersId(String persId) {
  232. this.persId = persId;
  233. }
  234. public Date getIntm() {
  235. return intm;
  236. }
  237. public void setIntm(Date intm) {
  238. this.intm = intm;
  239. }
  240. public Date getUptm() {
  241. return uptm;
  242. }
  243. public void setUptm(Date uptm) {
  244. this.uptm = uptm;
  245. }
  246. public String getDataStat() {
  247. return dataStat;
  248. }
  249. public void setDataStat(String dataStat) {
  250. this.dataStat = dataStat;
  251. }
  252. public String getId() {
  253. return id;
  254. }
  255. public void setId(String id) {
  256. this.id = id;
  257. }
  258. public List<BisInspPlanMonthArea> getArea() {
  259. return area;
  260. }
  261. public void setArea(List<BisInspPlanMonthArea> area) { this.area = area; }
  262. public boolean isRepeat() {
  263. return isRepeat;
  264. }
  265. public void setRepeat(boolean repeat) {
  266. isRepeat = repeat;
  267. }
  268. public String getRepeatId() {
  269. return repeatId;
  270. }
  271. public void setRepeatId(String repeatId) {
  272. this.repeatId = repeatId;
  273. }
  274. public String getChkCityCode() {
  275. return chkCityCode;
  276. }
  277. public void setChkCityCode(String chkCityCode) {
  278. this.chkCityCode = chkCityCode;
  279. }
  280. public String getChkCountryCode() {
  281. return chkCountryCode;
  282. }
  283. public void setChkCountryCode(String chkCountryCode) {
  284. this.chkCountryCode = chkCountryCode;
  285. }
  286. public String getColor() {
  287. return color;
  288. }
  289. public void setColor(String color) {
  290. this.color = color;
  291. }
  292. public String getYearPlanId() {
  293. return yearPlanId;
  294. }
  295. public void setYearPlanId(String yearPlanId) {
  296. this.yearPlanId = yearPlanId;
  297. }
  298. public String getYearChkName() {
  299. return yearChkName;
  300. }
  301. public void setYearChkName(String yearChkName) {
  302. this.yearChkName = yearChkName;
  303. }
  304. public String getYearChkType() {
  305. return yearChkType;
  306. }
  307. public void setYearChkType(String yearChkType) {
  308. this.yearChkType = yearChkType;
  309. }
  310. public void verifyRepeat(BisInspPlanMonth obj, Map<String, String> idAndColorMap, AtomicInteger colorCount) {
  311. List<String> cityCountryCode1 = obj.getChkCountry() == null ? new ArrayList<>() : Arrays.asList(obj.getChkCountryCode().split(","));
  312. List<String> cityCountryCode2 = this.getChkCountry() == null ? new ArrayList<>() : Arrays.asList(this.getChkCountryCode().split(","));
  313. Collection union = CollectionUtils.intersection(cityCountryCode1, cityCountryCode2);
  314. if(union.size() > 0) {
  315. this.setRepeatId(this.getRepeatId() + "," + obj.getId());
  316. this.setRepeat(true);
  317. String color1 = idAndColorMap.get(this.getId());
  318. String color2 = idAndColorMap.get(obj.getId());
  319. String newColor = "";
  320. if (color1 == null && color2 == null) { //生成新颜色
  321. newColor = colorCount.getAndIncrement() + "";
  322. } else if (color1 != null && color2 != null && !color1.equals(color2)) { //合并颜色
  323. newColor = colorCount.getAndIncrement() + "";
  324. String finalNewColor = newColor;
  325. idAndColorMap.forEach((k, v) -> {
  326. if(v.equals(color1) || v.equals(color2)){
  327. idAndColorMap.put(k, finalNewColor);
  328. }
  329. });
  330. } else {
  331. if (color1 != null) {newColor = color1;}
  332. if (color2 != null) {newColor = color2;}
  333. }
  334. idAndColorMap.put(this.getId(), newColor);
  335. idAndColorMap.put(obj.getId(), newColor);
  336. }
  337. }
  338. }