AppPersonBasicInfoController.java 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494
  1. package com.sooka.sponest.mobile.comprehensive.personBasicInfoController;
  2. import com.alibaba.fastjson.JSONArray;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.ruoyi.common.core.domain.DictKeys;
  5. import com.ruoyi.common.core.web.domain.AjaxResult;
  6. import com.ruoyi.common.core.web.page.PageDomain;
  7. import com.ruoyi.common.core.web.page.TableDataInfo;
  8. import com.ruoyi.common.core.web.page.TableSupport;
  9. import com.ruoyi.common.security.utils.DictUtils;
  10. import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.domain.*;
  11. import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.service.RemotePersonBasicInfoService;
  12. import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentBiggas;
  13. import org.springframework.web.bind.annotation.*;
  14. import javax.annotation.Resource;
  15. import java.util.*;
  16. import static com.ruoyi.common.security.utils.DictUtils.getComprehensiveDictCacheToMap;
  17. /**
  18. * @Author LG
  19. * @Date 2023/9/8 - 9:38
  20. */
  21. @RestController
  22. @RequestMapping("/AppPersonBasicInfoController")
  23. public class AppPersonBasicInfoController {
  24. @Resource
  25. private RemotePersonBasicInfoService personBasicInfoService;
  26. /**
  27. * 查询人员信息列表
  28. */
  29. @GetMapping("/PersonBasicInfo/list")
  30. public AjaxResult list(PersonBasicInfo info) {
  31. PageDomain pageDomain = TableSupport.buildPageRequest();
  32. Integer pageNum = pageDomain.getPageNum();
  33. Integer pageSize = pageDomain.getPageSize();
  34. Integer delFlag = info.getDelFlag();
  35. List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getList(pageNum, pageSize, delFlag).getRows();
  36. Map<String, Object> comprehensiveSexMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别字典值
  37. Map<String, Object> comprehensiveNationMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族字典值
  38. Map<String, Object> comprehensiveMaritalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_MARITAL_STATUS);//婚姻状况字典值
  39. Map<String, Object> comprehensiveEducationalBackgroundMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历字典值
  40. Map<String, Object> comprehensiveReligiousBeliefMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF);//宗教信仰字典值
  41. Map<String, Object> comprehensivePoliticalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌字典值
  42. Map<String, Object> comprehensiveOccupationalCategoryMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY);//职业类别字典值
  43. Map<String, Object> comprehensiveCityCodeMap = DictUtils.getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);//2260
  44. for (HashMap<String, Object> row : rows) {
  45. row.put("genderLabel", comprehensiveSexMap.get(row.get("gender")));//性别字典值
  46. row.put("nationLabel", comprehensiveNationMap.get(row.get("nation")));//民族字典值
  47. row.put("maritalStatusLabel", comprehensiveMaritalStatusMap.get(row.get("maritalStatus")));//婚姻状况字典值
  48. row.put("educationLabel", comprehensiveEducationalBackgroundMap.get(row.get("education")));//学历字典值
  49. row.put("religiousBeliefLabel", null == row.get("religiousBelief") ? null : comprehensiveReligiousBeliefMap.get(row.get("religiousBelief")));//宗教信仰字典值
  50. row.put("politicalOutlookLabel", comprehensivePoliticalStatusMap.get(row.get("politicalOutlook")));//政治面貌字典值
  51. row.put("occupationalCategoryLabel", comprehensiveOccupationalCategoryMap.get(row.get("occupationalCategory")));//职业类别字典值
  52. row.put("householdRegistrationLabel", comprehensiveCityCodeMap.get(row.get("householdRegistration")));//户籍地 2260
  53. row.put("nativePlaceLabel", comprehensiveCityCodeMap.get(row.get("nativePlace")));//籍贯 2260
  54. }
  55. return AjaxResult.success(rows);
  56. }
  57. /**
  58. * 查询人员信息详情
  59. */
  60. @GetMapping("/PersonBasicInfo/edit")
  61. public AjaxResult getInfo(EnvironmentBiggas biggas) {
  62. AjaxResult ajaxResult = personBasicInfoService.getEdit(biggas.getId());
  63. if ("200".equals(ajaxResult.get("code").toString())) {
  64. Map<String, Object> data = (Map<String, Object>) ajaxResult.get("data");
  65. HashMap<String, Object> basicInfo = (HashMap<String, Object>) data.get("basicInfo");
  66. setPersonBasicInfo(basicInfo);
  67. List<HashMap<String, Object>> userBinds = (List<HashMap<String, Object>>) basicInfo.get("userBinds");
  68. ArrayList<HashMap<String, Object>> otherInfo = (ArrayList<HashMap<String, Object>>) data.get("otherInfo");
  69. Map<String, Object> result = new HashMap<>();
  70. result.put("basicInfo",data.get("basicInfo"));
  71. userBinds.forEach(bind -> {
  72. otherInfo.stream()
  73. .filter(info -> info.get("id").equals(bind.get("otherPersonId")))
  74. .findFirst()
  75. .ifPresent(info -> setLabel(info, (Integer) bind.get("otherPersonType")));
  76. });
  77. otherInfo.forEach(bind ->{
  78. switch(String.valueOf(bind.get("otherPersonType"))){
  79. case "1":
  80. setRegisteredPopulation(bind);
  81. RegisteredPopulationInfo registeredPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), RegisteredPopulationInfo.class);
  82. result.put("registeredPopulation", registeredPopulationInfo);
  83. break;
  84. case "2":
  85. setFloatingPopulation(bind);
  86. FloatingPopulationInfo floatingPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), FloatingPopulationInfo.class);
  87. result.put("floatingPopulation", floatingPopulationInfo);
  88. break;
  89. case "3":
  90. setLeftBehindPerson(bind);
  91. LeftBehindPersonInfo leftBehindPersonInfo = JSONObject.toJavaObject(new JSONObject(bind), LeftBehindPersonInfo.class);
  92. result.put("leftBehindPerson", leftBehindPersonInfo);
  93. break;
  94. case "4":
  95. setCampusAroundPerson(bind);
  96. CampusAroundPersonInfo campusAroundPersonInfo = JSONObject.toJavaObject(new JSONObject(bind), CampusAroundPersonInfo.class);
  97. result.put("campusAroundPerson", campusAroundPersonInfo);
  98. break;
  99. case "5":
  100. setPrisonReleased(bind);
  101. PrisonReleasedInfo prisonReleasedInfo = JSONObject.toJavaObject(new JSONObject(bind), PrisonReleasedInfo.class);
  102. result.put("prisonReleased", prisonReleasedInfo);
  103. break;
  104. case "6":
  105. setCommunityCorrectionStaff(bind);
  106. CommunityCorrectionStaffInfo communityCorrectionStaffInfo = JSONObject.toJavaObject(new JSONObject(bind), CommunityCorrectionStaffInfo.class);
  107. result.put("communityCorrectionStaff", communityCorrectionStaffInfo);
  108. break;
  109. case "7":
  110. setPsychosisPopulation(bind);
  111. PsychosisPopulationInfo psychosisPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), PsychosisPopulationInfo.class);
  112. result.put("psychosisPopulation", psychosisPopulationInfo);
  113. break;
  114. case "8":
  115. setDrugAddict(bind);
  116. DrugAddictInfo drugAddictInfo = JSONObject.toJavaObject(new JSONObject(bind), DrugAddictInfo.class);
  117. result.put("drugAddict", drugAddictInfo);
  118. break;
  119. case "9":
  120. setAidsRisk(bind);
  121. AidsRiskInfo aidsRiskInfo = JSONObject.toJavaObject(new JSONObject(bind), AidsRiskInfo.class);
  122. result.put("aidsRisk", aidsRiskInfo);
  123. break;
  124. case "10":
  125. setKeyYouth(bind);
  126. KeyYouthInfo keyYouthInfo = JSONObject.toJavaObject(new JSONObject(bind), KeyYouthInfo.class);
  127. result.put("keyYouth", keyYouthInfo);
  128. break;
  129. }
  130. });
  131. return AjaxResult.success(result);
  132. } else {
  133. return ajaxResult;
  134. }
  135. }
  136. /**
  137. * 根据给定的人员类型,设置字典中文值
  138. */
  139. private void setLabel(HashMap<String, Object> json, Integer type) {
  140. switch (type) {
  141. case 1:
  142. setRegisteredPopulation(json);
  143. break;
  144. case 2:
  145. setFloatingPopulation(json);
  146. break;
  147. case 3:
  148. setLeftBehindPerson(json);
  149. break;
  150. case 4:
  151. setCampusAroundPerson(json);
  152. break;
  153. case 5:
  154. setPrisonReleased(json);
  155. break;
  156. case 6:
  157. setCommunityCorrectionStaff(json);
  158. break;
  159. case 7:
  160. setPsychosisPopulation(json);
  161. break;
  162. case 8:
  163. setDrugAddict(json);
  164. break;
  165. case 9:
  166. setAidsRisk(json);
  167. break;
  168. case 10:
  169. setKeyYouth(json);
  170. break;
  171. }
  172. json.put("otherPersonType", type);
  173. }
  174. /**
  175. * 新增人员信息
  176. */
  177. @PostMapping("/PersonBasicInfo")
  178. public AjaxResult add(@RequestBody String json) {
  179. return personBasicInfoService.add(dataToList(json));
  180. }
  181. /**
  182. * 修改人员信息
  183. */
  184. @PostMapping("/PersonBasicInfo/put")
  185. public AjaxResult edit(@RequestBody String json) {
  186. return personBasicInfoService.edit(dataToList(json));
  187. }
  188. /**
  189. * 数据格式转换,将JSONString类型替换为List
  190. */
  191. private String dataToList(String json){
  192. JSONObject jsonObject = JSONObject.parseObject(json);
  193. Set<String> strings = jsonObject.keySet();
  194. JSONArray list = new JSONArray();
  195. list.add(jsonObject.getJSONObject("basicInfo"));
  196. strings.remove("basicInfo");
  197. for (String string : strings) {
  198. list.add(jsonObject.getJSONObject(string));
  199. }
  200. return JSONArray.toJSONString(list);
  201. }
  202. /**
  203. * 删除人员信息
  204. */
  205. @GetMapping("/PersonBasicInfo/del")
  206. public AjaxResult remove(@RequestParam("id") List<String> id) {
  207. return personBasicInfoService.del(id.toArray(new String[0]));
  208. }
  209. /**
  210. * 审核删除人员信息
  211. * state = 2 通过, state = 1 拒绝
  212. */
  213. @GetMapping("/PersonBasicInfo/delInfo")
  214. public AjaxResult delInfo(@RequestParam("id") String id, @RequestParam("state") String state){
  215. return personBasicInfoService.delInfo(id, state);
  216. }
  217. /**
  218. * 设置人员基础信息字典值
  219. */
  220. private void setPersonBasicInfo(HashMap<String, Object> basicInfo) {//0
  221. Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);
  222. basicInfo.put("genderLabel", getDictData(DictKeys.COMPREHENSIVE_SEX, String.valueOf(basicInfo.get("gender"))));//性别字典值
  223. basicInfo.put("nationLabel", getDictData(DictKeys.COMPREHENSIVE_NATION, String.valueOf(basicInfo.get("nation"))));//民族字典值
  224. basicInfo.put("maritalStatusLabel", getDictData(DictKeys.COMPREHENSIVE_MARITAL_STATUS, String.valueOf(basicInfo.get("maritalStatus"))));//婚姻状况字典值
  225. basicInfo.put("educationLabel", getDictData(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND, String.valueOf(basicInfo.get("education"))));//学历字典值
  226. basicInfo.put("religiousBeliefLabel", null == basicInfo.get("religiousBelief") ? null : getDictData(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF, String.valueOf(basicInfo.get("religiousBelief"))));//宗教信仰字典值
  227. basicInfo.put("politicalOutlookLabel", getDictData(DictKeys.COMPREHENSIVE_POLITICAL_STATUS, String.valueOf(basicInfo.get("politicalOutlook"))));//政治面貌字典值
  228. basicInfo.put("occupationalCategoryLabel", getDictData(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY, String.valueOf(basicInfo.get("occupationalCategory"))));//职业类别字典值
  229. basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(String.valueOf(basicInfo.get("householdRegistration"))));
  230. basicInfo.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(String.valueOf(basicInfo.get("nativePlace"))));
  231. // basicInfo.put("householdRegistrationLabel", getDictData(DictKeys.COMPREHENSIVE_CITY_CODE, String.valueOf(basicInfo.get("householdRegistration"))));//户籍地 2260
  232. // basicInfo.put("nativePlaceLabel", getDictData(DictKeys.COMPREHENSIVE_CITY_CODE, String.valueOf(basicInfo.get("nativePlace"))));//籍贯 2260
  233. }
  234. /**
  235. * 设置户籍人口字典值
  236. */
  237. private void setRegisteredPopulation(HashMap<String, Object> json) {//1
  238. json.put("entryIdentityLabel", getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_IDENTIFICATION, String.valueOf(json.get("entryIdentity"))));//人户一致标识
  239. json.put("accountRelationshipLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("accountRelationship"))));//与户主关系
  240. }
  241. /**
  242. * 设置流动人口字典值
  243. */
  244. private void setFloatingPopulation(HashMap<String, Object> json) {//2
  245. json.put("inflowCauselabel", getDictData(DictKeys.COMPREHENSIVE_INFLOW_REASON, String.valueOf(json.get("inflowCause"))));//流入原因
  246. json.put("focusPeopleLabel", "1".equals(json.get("focusPeople")) ? "是" : "否");//是否重点关注人员
  247. json.put("certificationTypeLabel", null == json.get("certificationType") ? null : getDictData(DictKeys.COMPREHENSIVE_CERTIFICATION_TYPE, String.valueOf(json.get("certificationType"))));//办证类型
  248. json.put("domicileTypeLabel", getDictData(DictKeys.COMPREHENSIVE_RESIDENCE_TYPE, String.valueOf(json.get("domicileType"))));//住所类型
  249. }
  250. /**
  251. * 设置留守人口字典值
  252. */
  253. private void setLeftBehindPerson(HashMap<String, Object> json) {//3
  254. json.put("entryIdentityLabel", getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_IDENTIFICATION, String.valueOf(json.get("entryIdentity"))));//人户一致标识
  255. json.put("leftBehindTypeLabel", getDictData(DictKeys.COMPREHENSIVE_LEFT_BEHIND_PERSONNEL_TYPE, String.valueOf(json.get("leftBehindType"))));//留守人员类型
  256. json.put("healthStatusLabel", null == json.get("healthStatus") ? null : getDictData(DictKeys.COMPREHENSIVE_HEALTH_STATUS, String.valueOf(json.get("healthStatus"))));//健康状况
  257. json.put("leftBehindRelationshipLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("leftBehindRelationship"))));//与留守人员关系
  258. json.put("keyFamilyHealthStatusLabel", null == json.get("keyFamilyHealthStatus") ? null : getDictData(DictKeys.COMPREHENSIVE_HEALTH_STATUS, String.valueOf(json.get("keyFamilyHealthStatus"))));//家庭主要成员健康状况
  259. }
  260. /**
  261. * 设置校园周边重点人员字典值
  262. */
  263. private void setCampusAroundPerson(HashMap<String, Object> json) {//4
  264. json.put("harmLevelLabel", getDictData(DictKeys.COMPREHENSIVE_DEGREE_OF_HARM, String.valueOf(json.get("harmLevel"))));//危害程度
  265. json.put("focusPeopleLabel", "1".equals(json.get("focusPeople")) ? "是" : "否");//是否关注
  266. }
  267. /**
  268. * 设置刑满释放人员字典值
  269. */
  270. private void setPrisonReleased(HashMap<String, Object> json) {//5
  271. json.put("originalChargeLabel", getDictData(DictKeys.COMPREHENSIVE_OFFENCES_CLASSIFICATION, String.valueOf(json.get("originalCharge"))));//原罪名
  272. json.put("recidivismLabel", "1".equals(json.get("recidivism")) ? "是" : "否");//是否累犯
  273. json.put("riskAssessmentTypeLabel", getDictData(DictKeys.COMPREHENSIVE_HAZARD_ASSESSMENT_TYPE, String.valueOf(json.get("riskAssessmentType"))));//危险性评估类型
  274. json.put("linkUpStatusLabel", getDictData(DictKeys.COMPREHENSIVE_CONNECTION, String.valueOf(json.get("linkUpStatus"))));//衔接情况
  275. json.put("placementStatusLabel", getDictData(DictKeys.COMPREHENSIVE_PLACEMENT, String.valueOf(json.get("placementStatus"))));//安置情况
  276. json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否重新犯罪
  277. }
  278. /**
  279. * 设置社区矫正人员字典值
  280. */
  281. private void setCommunityCorrectionStaff(HashMap<String, Object> json) {//6
  282. json.put("caseCategoryLabel", getDictData(DictKeys.COMPREHENSIVE_CASE_CATEGORY, String.valueOf(json.get("caseCategory"))));//案件类别
  283. json.put("correctiveReleaseTypeLabel", null == json.get("correctiveReleaseType") ? null : getDictData(DictKeys.COMPREHENSIVE_CORRECTIVE_RELEASE_TYPE, String.valueOf(json.get("correctiveReleaseType"))));//矫正解除(终止)类型
  284. json.put("receivingModeLabel", getDictData(DictKeys.COMPREHENSIVE_RECEIVING_METHOD, String.valueOf(json.get("receivingMode"))));//接收方式
  285. json.put("correctionClassLabel", getDictData(DictKeys.COMPREHENSIVE_CORRECTIVE_CATEGORY, String.valueOf(json.get("correctionClass"))));//矫正类别
  286. json.put("tubeLabel", "1".equals(json.get("tube")) ? "是" : "否");//是否有脱管
  287. json.put("leakingPipesLabel", "1".equals(json.get("leakingPipes")) ? "是" : "否");//是否有漏管
  288. json.put("recidivismLabel", null == json.get("recidivism") ? null : "1".equals(json.get("recidivism")) ? "是" : "否");//是否累惯犯
  289. json.put("establishCorrectionTeamLabel", "1".equals(json.get("establishCorrectionTeam")) ? "是" : "否");//是否建立矫正小组
  290. json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否重新犯罪
  291. json.put("fourHistoriesListLabel", getDictDataList(DictKeys.COMPREHENSIVE_FOUR_HISTORIES_SITUATION, (List<String>) json.get("fourHistoriesList")));//“四史”情况
  292. json.put("threeStepListLabel", getDictDataList(DictKeys.COMPREHENSIVE_THREE_INVOLVED_SITUATION, (List<String>) json.get("threeStepList")));//“三涉”情况
  293. json.put("correctionTeamCompositionListLabel", getDictDataList(DictKeys.COMPREHENSIVE_CORRECTIONS_TEAM_COMPOSITION_TYPE, (List<String>) json.get("correctionTeamCompositionList")));//矫正小组人员组成情况
  294. }
  295. /**
  296. * 设置肇事肇祸及严重精神障碍患者字典值
  297. */
  298. private void setPsychosisPopulation(HashMap<String, Object> json) {//7
  299. json.put("familyEconomicSituationLabel", null == json.get("familyEconomicSituation") ? null : getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_FINANCIAL_SITUATION, String.valueOf(json.get("familyEconomicSituation"))));//家庭经济状况
  300. json.put("subsistenceAllowanceLabel", "1".equals(json.get("subsistenceAllowance")) ? "是" : "否");//是否纳入低保
  301. json.put("diagnosisTypeLabel", getDictData(DictKeys.COMPREHENSIVE_CURRENT_DIAGNOSTIC, String.valueOf(json.get("diagnosisType"))));//目前诊断类型
  302. json.put("historyCausingAccidentsLabel", "1".equals(json.get("historyCausingAccidents")) ? "有" : "无");//有无肇事肇祸史
  303. json.put("riskAssessmentLevelLabel", getDictData(DictKeys.COMPREHENSIVE_HAZARD_ASSESSMENT, String.valueOf(json.get("riskAssessmentLevel"))));//目前危险性评估等级
  304. json.put("treatmentSituationLabel", getDictData(DictKeys.COMPREHENSIVE_TREATMENT_CONDITIONS, String.valueOf(json.get("treatmentSituation"))));//治疗情况
  305. json.put("reasonsHospitalizationListLabel", getDictDataList(DictKeys.COMPREHENSIVE_HOSPITALIZATION_REASONS, (List<String>) json.get("reasonsHospitalizationList")));//实施住院治疗原因
  306. json.put("participatingManagersListLabel", getDictDataList(DictKeys.COMPREHENSIVE_MANAGERS, (List<String>) json.get("participatingManagersList")));//参与管理人员
  307. json.put("assistanceSituationListLabel", getDictDataList(DictKeys.COMPREHENSIVE_HELP_SITUATION, (List<String>) json.get("assistanceSituationList")));//帮扶情况
  308. }
  309. /**
  310. * 设置吸毒人员字典值
  311. */
  312. private void setDrugAddict(HashMap<String, Object> json) {//8
  313. json.put("controlSituationLabel", getDictData(DictKeys.COMPREHENSIVE_GOVERNANCE, String.valueOf(json.get("controlSituation"))));//管控情况
  314. json.put("criminalHistoryLabel", null == json.get("criminalHistory") ? null : "1".equals(json.get("criminalHistory")) ? "有" : "无");//有无犯罪史
  315. json.put("drugUseLabel", getDictData(DictKeys.COMPREHENSIVE_CASE_CONSEQUENCE, String.valueOf(json.get("drugUse"))));//吸毒原因
  316. json.put("drugAbuseLabel", null == json.get("drugAbuse") ? null : getDictData(DictKeys.COMPREHENSIVE_CASE_CONSEQUENCE, String.valueOf(json.get("drugAbuse"))));//吸毒后果
  317. }
  318. /**
  319. * 设置艾滋病危险人员字典值
  320. */
  321. private void setAidsRisk(HashMap<String, Object> json) {//9
  322. json.put("routeInfectionLabel", getDictData(DictKeys.COMPREHENSIVE_ROUTE_OF_INFECTION, String.valueOf(json.get("routeInfection"))));//感染途径
  323. json.put("criminalHistoryLabel", "1".equals(json.get("criminalHistory")) ? "是" : "否");//是否有违法犯罪史
  324. json.put("caseCategoryLabel", null == json.get("caseCategory") ? null : getDictData(DictKeys.COMPREHENSIVE_CASE_CATEGORY, String.valueOf(json.get("caseCategory"))));//案件类别
  325. json.put("concernTypeLabel", getDictData(DictKeys.COMPREHENSIVE_TYPE_OF_CONCERN, String.valueOf(json.get("concernType"))));//关注类型
  326. json.put("admissionSituationLabel", null == json.get("admissionSituation") ? null : getDictData(DictKeys.COMPREHENSIVE_ADMISSION_TO_INERTIA, String.valueOf(json.get("admissionSituation"))));//收治情况
  327. }
  328. /**
  329. * 设置重点青少年字典值
  330. */
  331. private void setKeyYouth(HashMap<String, Object> json) {//10
  332. json.put("personTypeLabel", null == json.get("personType") ? null : getDictData(DictKeys.COMPREHENSIVE_TYPE_OF_PERSON, String.valueOf(json.get("personType"))));//人员类型
  333. json.put("familySituationLabel", getDictData(DictKeys.COMPREHENSIVE_FAMILY_INERTIA, String.valueOf(json.get("familySituation"))));//家庭情况
  334. json.put("guardianRelationLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("guardianRelation"))));//与监护人关系
  335. json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否违法犯罪
  336. json.put("meansAssistanceLabel", getDictData(DictKeys.COMPREHENSIVE_MEANS_OF_HELP, String.valueOf(json.get("meansAssistance"))));//帮扶手段
  337. }
  338. private String getDictData(String dictKey, String value) {
  339. return DictUtils.getDictDataByValue(dictKey, value);
  340. }
  341. private List<String> getDictDataList(String dictKey, List<String> values) {
  342. return DictUtils.getDictDataListByValue(dictKey, values);
  343. }
  344. /**
  345. * 查询其他人员类型列表
  346. */
  347. @GetMapping("/PersonBasicInfo/getOtherList")
  348. public AjaxResult getOtherList(PersonBasicInfo personBasicInfo){
  349. PageDomain pageDomain = TableSupport.buildPageRequest();
  350. Integer pageNum = pageDomain.getPageNum();
  351. Integer pageSize = pageDomain.getPageSize();
  352. Integer delFlag = personBasicInfo.getDelFlag();
  353. Integer personType = personBasicInfo.getPersonType();
  354. List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getOtherList(pageNum, pageSize, delFlag, personType).getRows();
  355. Map<String, Object> comprehensiveSexMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_SEX);//性别字典值
  356. Map<String, Object> comprehensiveNationMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_NATION);//民族字典值
  357. Map<String, Object> comprehensiveMaritalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_MARITAL_STATUS);//婚姻状况字典值
  358. Map<String, Object> comprehensiveEducationalBackgroundMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_EDUCATIONAL_BACKGROUND);//学历字典值
  359. Map<String, Object> comprehensiveReligiousBeliefMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_RELIGIOUS_BELIEF);//宗教信仰字典值
  360. Map<String, Object> comprehensivePoliticalStatusMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_POLITICAL_STATUS);//政治面貌字典值
  361. Map<String, Object> comprehensiveOccupationalCategoryMap = DictUtils.getDictCacheToMap(DictKeys.COMPREHENSIVE_OCCUPATIONAL_CATEGORY);//职业类别字典值
  362. Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
  363. if( null != rows && !rows.isEmpty()){
  364. for (HashMap row : rows) {
  365. row.put("genderLabel", comprehensiveSexMap.get(row.get("gender")));//性别字典值
  366. row.put("nationLabel", comprehensiveNationMap.get(row.get("nation")));//民族字典值
  367. row.put("maritalStatusLabel", comprehensiveMaritalStatusMap.get(row.get("maritalStatus")));//婚姻状况字典值
  368. row.put("educationLabel", comprehensiveEducationalBackgroundMap.get(row.get("education")));//学历字典值
  369. row.put("religiousBeliefLabel", null == row.get("religiousBelief") ? null : comprehensiveReligiousBeliefMap.get(row.get("religiousBelief")));//宗教信仰字典值
  370. row.put("politicalOutlookLabel", comprehensivePoliticalStatusMap.get(row.get("politicalOutlook")));//政治面貌字典值
  371. row.put("occupationalCategoryLabel", comprehensiveOccupationalCategoryMap.get(row.get("occupationalCategory")));//职业类别字典值
  372. row.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(row.get("householdRegistration")));//户籍地 2260
  373. row.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(row.get("nativePlace")));//籍贯 2260
  374. }
  375. return AjaxResult.success(rows);
  376. }else{
  377. return AjaxResult.error(500, "list is null!");
  378. }
  379. }
  380. /**
  381. * 查询其他类型人员详情
  382. */
  383. @GetMapping("/PersonBasicInfo/getOtherEdit")
  384. public AjaxResult getOtherEdit(OtherPersonInfo otherPersonInfo){
  385. AjaxResult otherEdit = personBasicInfoService.getOtherEdit(otherPersonInfo.getBasicId(), otherPersonInfo.getPersonType());
  386. if ("200".equals(otherEdit.get("code").toString())){
  387. Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
  388. HashMap<String, HashMap<String, Object>> data = (HashMap<String, HashMap<String, Object>>) otherEdit.get("data");
  389. setPersonBasicInfo(data.get("basicInfo"));
  390. if (!comprehensiveDictCacheToMap.isEmpty()) {
  391. data.computeIfPresent("basicInfo", (key, basicInfo) -> {
  392. basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(basicInfo.get("householdRegistration")));// 户籍地 2260
  393. basicInfo.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(basicInfo.get("nativePlace")));// 籍贯 2260
  394. return basicInfo;
  395. });
  396. }
  397. switch (otherPersonInfo.getPersonType()){
  398. case 1:
  399. setRegisteredPopulation(data.get("otherInfo"));
  400. data.put("registeredPopulation", data.remove("otherInfo"));
  401. break;
  402. case 2:
  403. setFloatingPopulation(data.get("otherInfo"));
  404. data.put("floatingPopulation", data.remove("otherInfo"));
  405. break;
  406. case 3:
  407. setLeftBehindPerson(data.get("otherInfo"));
  408. data.put("leftBehindPerson", data.remove("otherInfo"));
  409. break;
  410. case 4:
  411. setCampusAroundPerson(data.get("otherInfo"));
  412. data.put("campusAroundPerson", data.remove("otherInfo"));
  413. break;
  414. case 5:
  415. setPrisonReleased(data.get("otherInfo"));
  416. data.put("prisonReleased", data.remove("otherInfo"));
  417. break;
  418. case 6:
  419. setCommunityCorrectionStaff(data.get("otherInfo"));
  420. data.put("communityCorrectionStaff", data.remove("otherInfo"));
  421. break;
  422. case 7:
  423. setPsychosisPopulation(data.get("otherInfo"));
  424. data.put("psychosisPopulation", data.remove("otherInfo"));
  425. break;
  426. case 8:
  427. setDrugAddict(data.get("otherInfo"));
  428. data.put("drugAddict", data.remove("otherInfo"));
  429. break;
  430. case 9:
  431. setAidsRisk(data.get("otherInfo"));
  432. data.put("aidsRisk", data.remove("otherInfo"));
  433. break;
  434. case 10:
  435. setKeyYouth(data.get("otherInfo"));
  436. data.put("keyYouth", data.remove("otherInfo"));
  437. break;
  438. default:
  439. break;
  440. }
  441. return AjaxResult.success(data);
  442. }else{
  443. return AjaxResult.error(otherEdit.get("code").toString(), otherEdit.get("msg"));
  444. }
  445. }
  446. /**
  447. * 查询全部有效的用户信息
  448. */
  449. @GetMapping("/PersonBasicInfo/getAllUserInfo")
  450. public AjaxResult getAllUserInfo(PersonBasicInfo personBasicInfo){
  451. AjaxResult allUserInfo = personBasicInfoService.getAllUserInfo(personBasicInfo.getName());
  452. if ("200".equals(allUserInfo.get("code").toString())){
  453. Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
  454. List<Map<String, Object>> data = (List<Map<String, Object>>) allUserInfo.get("data");
  455. for (Map<String, Object> map : data) {
  456. map.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(map.get("householdRegistration")));// 户籍地 2260
  457. map.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(map.get("nativePlace")));// 籍贯 2260
  458. map.put("currentResidencePlaceLabel", comprehensiveDictCacheToMap.get(map.get("currentResidencePlace")));// 2260
  459. }
  460. }
  461. return allUserInfo;
  462. }
  463. }