|
@@ -0,0 +1,511 @@
|
|
|
+package com.sooka.sponest.mobile.comprehensive.personBasicInfoController;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.ruoyi.common.core.constant.HttpStatus;
|
|
|
+import com.ruoyi.common.core.domain.DictKeys;
|
|
|
+import com.ruoyi.common.core.utils.StringUtils;
|
|
|
+import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.web.page.PageDomain;
|
|
|
+import com.ruoyi.common.core.web.page.TableSupport;
|
|
|
+import com.ruoyi.common.security.utils.DictUtils;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.domain.*;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.service.RemotePersonBasicInfoService;
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentBiggas;
|
|
|
+import org.apache.commons.collections4.MapUtils;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+import static com.ruoyi.common.core.domain.DictKeys.*;
|
|
|
+import static com.ruoyi.common.security.utils.DictUtils.getComprehensiveDictCacheToMap;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Author LG
|
|
|
+ * @Date 2023/9/8 - 9:38
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/AppPersonBasicInfoController")
|
|
|
+public class AppPersonBasicInfoController {
|
|
|
+ @Resource
|
|
|
+ private RemotePersonBasicInfoService personBasicInfoService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询人员信息列表
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/list")
|
|
|
+ public AjaxResult list(PersonBasicInfo info) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ //noinspection unchecked
|
|
|
+ List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getList(
|
|
|
+ info.getName(),
|
|
|
+ pageDomain.getPageNum(),
|
|
|
+ pageDomain.getPageSize(),
|
|
|
+ info.getDelFlag(),
|
|
|
+ info.getTotal()
|
|
|
+ ).get("data");
|
|
|
+ if (StringUtils.isNotEmpty(rows)) {
|
|
|
+ setDictValue(rows);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(rows);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询人员信息详情
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/edit")
|
|
|
+ public AjaxResult getInfo(EnvironmentBiggas biggas) {
|
|
|
+ AjaxResult ajaxResult = personBasicInfoService.getEdit(biggas.getId());
|
|
|
+ if ("200".equals(ajaxResult.get("code").toString())) {
|
|
|
+ Map<String, Object> data = (Map<String, Object>) ajaxResult.get("data");
|
|
|
+ HashMap<String, Object> basicInfo = (HashMap<String, Object>) data.get("basicInfo");
|
|
|
+ setPersonBasicInfo(basicInfo, null, null);
|
|
|
+ List<HashMap<String, Object>> userBinds = (List<HashMap<String, Object>>) basicInfo.get("userBinds");
|
|
|
+ ArrayList<HashMap<String, Object>> otherInfo = (ArrayList<HashMap<String, Object>>) data.get("otherInfo");
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("basicInfo", data.get("basicInfo"));
|
|
|
+ userBinds.forEach(bind -> {
|
|
|
+ otherInfo.stream()
|
|
|
+ .filter(info -> info.get("id").equals(bind.get("otherPersonId")))
|
|
|
+ .findFirst()
|
|
|
+ .ifPresent(info -> setLabel(info, (Integer) bind.get("otherPersonType")));
|
|
|
+ });
|
|
|
+ otherInfo.forEach(bind -> {
|
|
|
+ switch (String.valueOf(bind.get("otherPersonType"))) {
|
|
|
+ case "1":
|
|
|
+ setRegisteredPopulation(bind);
|
|
|
+ RegisteredPopulationInfo registeredPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), RegisteredPopulationInfo.class);
|
|
|
+ result.put("registeredPopulation", registeredPopulationInfo);
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ setFloatingPopulation(bind);
|
|
|
+ FloatingPopulationInfo floatingPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), FloatingPopulationInfo.class);
|
|
|
+ result.put("floatingPopulation", floatingPopulationInfo);
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ setLeftBehindPerson(bind);
|
|
|
+ LeftBehindPersonInfo leftBehindPersonInfo = JSONObject.toJavaObject(new JSONObject(bind), LeftBehindPersonInfo.class);
|
|
|
+ result.put("leftBehindPerson", leftBehindPersonInfo);
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ setCampusAroundPerson(bind);
|
|
|
+ CampusAroundPersonInfo campusAroundPersonInfo = JSONObject.toJavaObject(new JSONObject(bind), CampusAroundPersonInfo.class);
|
|
|
+ result.put("campusAroundPerson", campusAroundPersonInfo);
|
|
|
+ break;
|
|
|
+ case "5":
|
|
|
+ setPrisonReleased(bind);
|
|
|
+ PrisonReleasedInfo prisonReleasedInfo = JSONObject.toJavaObject(new JSONObject(bind), PrisonReleasedInfo.class);
|
|
|
+ result.put("prisonReleased", prisonReleasedInfo);
|
|
|
+ break;
|
|
|
+ case "6":
|
|
|
+ setCommunityCorrectionStaff(bind);
|
|
|
+ CommunityCorrectionStaffInfo communityCorrectionStaffInfo = JSONObject.toJavaObject(new JSONObject(bind), CommunityCorrectionStaffInfo.class);
|
|
|
+ result.put("communityCorrectionStaff", communityCorrectionStaffInfo);
|
|
|
+ break;
|
|
|
+ case "7":
|
|
|
+ setPsychosisPopulation(bind);
|
|
|
+ PsychosisPopulationInfo psychosisPopulationInfo = JSONObject.toJavaObject(new JSONObject(bind), PsychosisPopulationInfo.class);
|
|
|
+ result.put("psychosisPopulation", psychosisPopulationInfo);
|
|
|
+ break;
|
|
|
+ case "8":
|
|
|
+ setDrugAddict(bind);
|
|
|
+ DrugAddictInfo drugAddictInfo = JSONObject.toJavaObject(new JSONObject(bind), DrugAddictInfo.class);
|
|
|
+ result.put("drugAddict", drugAddictInfo);
|
|
|
+ break;
|
|
|
+ case "9":
|
|
|
+ setAidsRisk(bind);
|
|
|
+ AidsRiskInfo aidsRiskInfo = JSONObject.toJavaObject(new JSONObject(bind), AidsRiskInfo.class);
|
|
|
+ result.put("aidsRisk", aidsRiskInfo);
|
|
|
+ break;
|
|
|
+ case "10":
|
|
|
+ setKeyYouth(bind);
|
|
|
+ KeyYouthInfo keyYouthInfo = JSONObject.toJavaObject(new JSONObject(bind), KeyYouthInfo.class);
|
|
|
+ result.put("keyYouth", keyYouthInfo);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return AjaxResult.success(result);
|
|
|
+ } else {
|
|
|
+ return ajaxResult;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 根据给定的人员类型,设置字典中文值
|
|
|
+ */
|
|
|
+ private void setLabel(HashMap<String, Object> json, Integer type) {
|
|
|
+ switch (type) {
|
|
|
+ case 1:
|
|
|
+ setRegisteredPopulation(json);
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ setFloatingPopulation(json);
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ setLeftBehindPerson(json);
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ setCampusAroundPerson(json);
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ setPrisonReleased(json);
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ setCommunityCorrectionStaff(json);
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ setPsychosisPopulation(json);
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ setDrugAddict(json);
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ setAidsRisk(json);
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ setKeyYouth(json);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ json.put("otherPersonType", type);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增人员信息
|
|
|
+ */
|
|
|
+ @PostMapping("/PersonBasicInfo")
|
|
|
+ public AjaxResult add(@RequestBody String json) {
|
|
|
+ return personBasicInfoService.add(dataToList(json));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改人员信息
|
|
|
+ */
|
|
|
+ @PostMapping("/PersonBasicInfo/put")
|
|
|
+ public AjaxResult edit(@RequestBody String json) {
|
|
|
+ return personBasicInfoService.edit(dataToList(json));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 数据格式转换,将JSONString类型替换为List
|
|
|
+ */
|
|
|
+ private String dataToList(String json) {
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(json);
|
|
|
+ Set<String> strings = jsonObject.keySet();
|
|
|
+ JSONArray list = new JSONArray();
|
|
|
+ list.add(jsonObject.getJSONObject("basicInfo"));
|
|
|
+ strings.remove("basicInfo");
|
|
|
+ for (String string : strings) {
|
|
|
+ list.add(jsonObject.getJSONObject(string));
|
|
|
+ }
|
|
|
+ return JSONArray.toJSONString(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除人员信息
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/del")
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
+ return personBasicInfoService.del(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核删除人员信息
|
|
|
+ * state = 2 通过, state = 1 拒绝
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/delInfo")
|
|
|
+ public AjaxResult delInfo(@RequestParam("id") String id, @RequestParam("state") String state) {
|
|
|
+ return personBasicInfoService.delInfo(id, state);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置人员基础信息字典值
|
|
|
+ */
|
|
|
+ private void setPersonBasicInfo(HashMap<String, Object> basicInfo, Map<String, Map<String, Object>> dictMaps, Map<String, Object> cityMaps) {//0
|
|
|
+ if(StringUtils.isEmpty(dictMaps)){
|
|
|
+ String[] dictKeys = {
|
|
|
+ COMPREHENSIVE_SEX, //性别
|
|
|
+ COMPREHENSIVE_NATION, //民族
|
|
|
+ COMPREHENSIVE_MARITAL_STATUS, //婚姻状况
|
|
|
+ COMPREHENSIVE_EDUCATIONAL_BACKGROUND, //学历
|
|
|
+ COMPREHENSIVE_RELIGIOUS_BELIEF, //宗教信仰
|
|
|
+ COMPREHENSIVE_POLITICAL_STATUS, //政治面貌
|
|
|
+ COMPREHENSIVE_OCCUPATIONAL_CATEGORY //职业类别
|
|
|
+ };
|
|
|
+ dictMaps = DictUtils.getDictCacheToMapByArray(dictKeys);
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(cityMaps)){
|
|
|
+ cityMaps = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);
|
|
|
+ }
|
|
|
+ basicInfo.put("genderLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_SEX).get(mapUtilsGetString(basicInfo, "gender")));//性别字典值
|
|
|
+ basicInfo.put("nationLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_NATION).get(mapUtilsGetString(basicInfo, "nation")));//民族字典值
|
|
|
+ basicInfo.put("maritalStatusLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_MARITAL_STATUS).get(mapUtilsGetString(basicInfo, "maritalStatus")));//婚姻状况字典值
|
|
|
+ basicInfo.put("educationLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_EDUCATIONAL_BACKGROUND).get(mapUtilsGetString(basicInfo, "education")));//学历字典值
|
|
|
+ basicInfo.put("religiousBeliefLabel", null == MapUtils.getString(basicInfo, "religiousBelief") ? null : MapUtils.getMap(dictMaps, COMPREHENSIVE_RELIGIOUS_BELIEF).get(MapUtils.getString(basicInfo, "religiousBelief")));//宗教信仰字典值
|
|
|
+ basicInfo.put("politicalOutlookLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_POLITICAL_STATUS).get(mapUtilsGetString(basicInfo, "politicalOutlook")));//政治面貌字典值
|
|
|
+ basicInfo.put("occupationalCategoryLabel", MapUtils.getMap(dictMaps, COMPREHENSIVE_OCCUPATIONAL_CATEGORY).get(mapUtilsGetString(basicInfo, "occupationalCategory")));//职业类别字典值
|
|
|
+ basicInfo.put("householdRegistrationLabel", cityMaps.get(mapUtilsGetString(basicInfo, "householdRegistration")));//户籍地 2260
|
|
|
+ basicInfo.put("nativePlaceLabel", cityMaps.get(mapUtilsGetString(basicInfo, "nativePlace")));//籍贯 2260
|
|
|
+ basicInfo.put("currentResidencePlaceLabel", cityMaps.get(mapUtilsGetString(basicInfo,"currentResidencePlace")));
|
|
|
+ basicInfo.put("isResidentLabel", "1".equals(MapUtils.getString(basicInfo, "isResident"))? "是":"否");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setDictValue(List<HashMap<String, Object>> rows){
|
|
|
+ String[] dictKeys = {
|
|
|
+ COMPREHENSIVE_SEX, //性别
|
|
|
+ COMPREHENSIVE_NATION, //民族
|
|
|
+ COMPREHENSIVE_MARITAL_STATUS, //婚姻状况
|
|
|
+ COMPREHENSIVE_EDUCATIONAL_BACKGROUND, //学历
|
|
|
+ COMPREHENSIVE_RELIGIOUS_BELIEF, //宗教信仰
|
|
|
+ COMPREHENSIVE_POLITICAL_STATUS, //政治面貌
|
|
|
+ COMPREHENSIVE_OCCUPATIONAL_CATEGORY //职业类别
|
|
|
+ };
|
|
|
+ Map<String, Map<String, Object>> dictMaps = DictUtils.getDictCacheToMapByArray(dictKeys);
|
|
|
+ Map<String, Object> cityMaps = getComprehensiveDictCacheToMap(COMPREHENSIVE_CITY_CODE);// 2260
|
|
|
+ if (null != rows && !rows.isEmpty()) {
|
|
|
+ for (HashMap<String, Object> row : rows) {
|
|
|
+ setPersonBasicInfo(row, dictMaps, cityMaps);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置户籍人口字典值
|
|
|
+ */
|
|
|
+ private void setRegisteredPopulation(HashMap<String, Object> json) {//1
|
|
|
+ json.put("entryIdentityLabel", getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_IDENTIFICATION, String.valueOf(json.get("entryIdentity"))));//人户一致标识
|
|
|
+ json.put("accountRelationshipLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("accountRelationship"))));//与户主关系
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置流动人口字典值
|
|
|
+ */
|
|
|
+ private void setFloatingPopulation(HashMap<String, Object> json) {//2
|
|
|
+ json.put("inflowCauseLabel", getDictData(DictKeys.COMPREHENSIVE_INFLOW_REASON, String.valueOf(json.get("inflowCause"))));//流入原因
|
|
|
+ json.put("focusPeopleLabel", "1".equals(json.get("focusPeople")) ? "是" : "否");//是否重点关注人员
|
|
|
+ json.put("certificationTypeLabel", null == json.get("certificationType") ? null : getDictData(DictKeys.COMPREHENSIVE_CERTIFICATION_TYPE, String.valueOf(json.get("certificationType"))));//办证类型
|
|
|
+ json.put("domicileTypeLabel", getDictData(DictKeys.COMPREHENSIVE_RESIDENCE_TYPE, String.valueOf(json.get("domicileType"))));//住所类型
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置留守人口字典值
|
|
|
+ */
|
|
|
+ private void setLeftBehindPerson(HashMap<String, Object> json) {//3
|
|
|
+ json.put("entryIdentityLabel", getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_IDENTIFICATION, String.valueOf(json.get("entryIdentity"))));//人户一致标识
|
|
|
+ json.put("leftBehindTypeLabel", getDictData(DictKeys.COMPREHENSIVE_LEFT_BEHIND_PERSONNEL_TYPE, String.valueOf(json.get("leftBehindType"))));//留守人员类型
|
|
|
+ json.put("healthStatusLabel", null == json.get("healthStatus") ? null : getDictData(DictKeys.COMPREHENSIVE_HEALTH_STATUS, String.valueOf(json.get("healthStatus"))));//健康状况
|
|
|
+ json.put("leftBehindRelationshipLabel", getDictData(DictKeys.COMPREHENSIVE_RELATION, String.valueOf(json.get("leftBehindRelationship"))));//与留守人员关系
|
|
|
+ json.put("keyFamilyHealthStatusLabel", null == json.get("keyFamilyHealthStatus") ? null : getDictData(DictKeys.COMPREHENSIVE_HEALTH_STATUS, String.valueOf(json.get("keyFamilyHealthStatus"))));//家庭主要成员健康状况
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置校园周边重点人员字典值
|
|
|
+ */
|
|
|
+ private void setCampusAroundPerson(HashMap<String, Object> json) {//4
|
|
|
+ json.put("harmLevelLabel", getDictData(DictKeys.COMPREHENSIVE_DEGREE_OF_HARM, String.valueOf(json.get("harmLevel"))));//危害程度
|
|
|
+ json.put("focusPeopleLabel", "1".equals(json.get("focusPeople")) ? "是" : "否");//是否关注
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置刑满释放人员字典值
|
|
|
+ */
|
|
|
+ private void setPrisonReleased(HashMap<String, Object> json) {//5
|
|
|
+ json.put("originalChargeLabel", getDictData(DictKeys.COMPREHENSIVE_OFFENCES_CLASSIFICATION, String.valueOf(json.get("originalCharge"))));//原罪名
|
|
|
+ json.put("recidivismLabel", "1".equals(json.get("recidivism")) ? "是" : "否");//是否累犯
|
|
|
+ json.put("riskAssessmentTypeLabel", getDictData(DictKeys.COMPREHENSIVE_HAZARD_ASSESSMENT_TYPE, String.valueOf(json.get("riskAssessmentType"))));//危险性评估类型
|
|
|
+ json.put("linkUpStatusLabel", getDictData(DictKeys.COMPREHENSIVE_CONNECTION, String.valueOf(json.get("linkUpStatus"))));//衔接情况
|
|
|
+ json.put("placementStatusLabel", getDictData(DictKeys.COMPREHENSIVE_PLACEMENT, String.valueOf(json.get("placementStatus"))));//安置情况
|
|
|
+ json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否重新犯罪
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置社区矫正人员字典值
|
|
|
+ */
|
|
|
+ private void setCommunityCorrectionStaff(HashMap<String, Object> json) {//6
|
|
|
+ json.put("caseCategoryLabel", getDictData(DictKeys.COMPREHENSIVE_CASE_CATEGORY, String.valueOf(json.get("caseCategory"))));//案件类别
|
|
|
+ json.put("correctiveReleaseTypeLabel", null == json.get("correctiveReleaseType") ? null : getDictData(DictKeys.COMPREHENSIVE_CORRECTIVE_RELEASE_TYPE, String.valueOf(json.get("correctiveReleaseType"))));//矫正解除(终止)类型
|
|
|
+ json.put("receivingModeLabel", getDictData(DictKeys.COMPREHENSIVE_RECEIVING_METHOD, String.valueOf(json.get("receivingMode"))));//接收方式
|
|
|
+ json.put("correctionClassLabel", getDictData(DictKeys.COMPREHENSIVE_CORRECTIVE_CATEGORY, String.valueOf(json.get("correctionClass"))));//矫正类别
|
|
|
+ json.put("tubeLabel", "1".equals(json.get("tube")) ? "是" : "否");//是否有脱管
|
|
|
+ json.put("leakingPipesLabel", "1".equals(json.get("leakingPipes")) ? "是" : "否");//是否有漏管
|
|
|
+ json.put("recidivismLabel", null == json.get("recidivism") ? null : "1".equals(json.get("recidivism")) ? "是" : "否");//是否累惯犯
|
|
|
+ json.put("establishCorrectionTeamLabel", "1".equals(json.get("establishCorrectionTeam")) ? "是" : "否");//是否建立矫正小组
|
|
|
+ json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否重新犯罪
|
|
|
+ json.put("fourHistoriesListLabel", getDictDataList(DictKeys.COMPREHENSIVE_FOUR_HISTORIES_SITUATION, (List<String>) json.get("fourHistoriesList")));//“四史”情况
|
|
|
+ json.put("threeStepListLabel", getDictDataList(DictKeys.COMPREHENSIVE_THREE_INVOLVED_SITUATION, (List<String>) json.get("threeStepList")));//“三涉”情况
|
|
|
+ json.put("correctionTeamCompositionListLabel", getDictDataList(DictKeys.COMPREHENSIVE_CORRECTIONS_TEAM_COMPOSITION_TYPE, (List<String>) json.get("correctionTeamCompositionList")));//矫正小组人员组成情况
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置肇事肇祸及严重精神障碍患者字典值
|
|
|
+ */
|
|
|
+ private void setPsychosisPopulation(HashMap<String, Object> json) {//7
|
|
|
+ json.put("familyEconomicSituationLabel", null == json.get("familyEconomicSituation") ? null : getDictData(DictKeys.COMPREHENSIVE_HOUSEHOLDS_FINANCIAL_SITUATION, String.valueOf(json.get("familyEconomicSituation"))));//家庭经济状况
|
|
|
+ json.put("subsistenceAllowanceLabel", "1".equals(json.get("subsistenceAllowance")) ? "是" : "否");//是否纳入低保
|
|
|
+ json.put("diagnosisTypeLabel", getDictData(DictKeys.COMPREHENSIVE_CURRENT_DIAGNOSTIC, String.valueOf(json.get("diagnosisType"))));//目前诊断类型
|
|
|
+ json.put("historyCausingAccidentsLabel", "1".equals(json.get("historyCausingAccidents")) ? "有" : "无");//有无肇事肇祸史
|
|
|
+ json.put("riskAssessmentLevelLabel", getDictData(DictKeys.COMPREHENSIVE_HAZARD_ASSESSMENT, String.valueOf(json.get("riskAssessmentLevel"))));//目前危险性评估等级
|
|
|
+ json.put("treatmentSituationLabel", getDictData(DictKeys.COMPREHENSIVE_TREATMENT_CONDITIONS, String.valueOf(json.get("treatmentSituation"))));//治疗情况
|
|
|
+ json.put("reasonsHospitalizationListLabel", getDictDataList(DictKeys.COMPREHENSIVE_HOSPITALIZATION_REASONS, (List<String>) json.get("reasonsHospitalizationList")));//实施住院治疗原因
|
|
|
+ json.put("participatingManagersListLabel", getDictDataList(DictKeys.COMPREHENSIVE_MANAGERS, (List<String>) json.get("participatingManagersList")));//参与管理人员
|
|
|
+ json.put("assistanceSituationListLabel", getDictDataList(DictKeys.COMPREHENSIVE_HELP_SITUATION, (List<String>) json.get("assistanceSituationList")));//帮扶情况
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置吸毒人员字典值
|
|
|
+ */
|
|
|
+ private void setDrugAddict(HashMap<String, Object> json) {//8
|
|
|
+ json.put("controlSituationLabel", getDictData(DictKeys.COMPREHENSIVE_GOVERNANCE, String.valueOf(json.get("controlSituation"))));//管控情况
|
|
|
+ json.put("criminalHistoryLabel", null == json.get("criminalHistory") ? null : "1".equals(json.get("criminalHistory")) ? "有" : "无");//有无犯罪史
|
|
|
+ json.put("drugUseLabel", getDictData(DictKeys.COMPREHENSIVE_CASE_REASON, String.valueOf(json.get("drugUse"))));//吸毒原因
|
|
|
+ json.put("drugAbuseLabel", null == json.get("drugAbuse") ? null : getDictData(DictKeys.COMPREHENSIVE_CASE_CONSEQUENCE, String.valueOf(json.get("drugAbuse"))));//吸毒后果
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置艾滋病危险人员字典值
|
|
|
+ */
|
|
|
+ private void setAidsRisk(HashMap<String, Object> json) {//9
|
|
|
+ json.put("routeInfectionLabel", getDictData(DictKeys.COMPREHENSIVE_ROUTE_OF_INFECTION, String.valueOf(json.get("routeInfection"))));//感染途径
|
|
|
+ json.put("criminalHistoryLabel", "1".equals(json.get("criminalHistory")) ? "是" : "否");//是否有违法犯罪史
|
|
|
+ json.put("caseCategoryLabel", null == json.get("caseCategory") ? null : getDictData(DictKeys.COMPREHENSIVE_CASE_CATEGORY, String.valueOf(json.get("caseCategory"))));//案件类别
|
|
|
+ json.put("concernTypeLabel", getDictData(DictKeys.COMPREHENSIVE_TYPE_OF_CONCERN, String.valueOf(json.get("concernType"))));//关注类型
|
|
|
+ json.put("admissionSituationLabel", null == json.get("admissionSituation") ? null : getDictData(DictKeys.COMPREHENSIVE_ADMISSION_TO_INERTIA, String.valueOf(json.get("admissionSituation"))));//收治情况
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 设置重点青少年字典值
|
|
|
+ */
|
|
|
+ private void setKeyYouth(HashMap<String, Object> json) {//10
|
|
|
+ json.put("personTypeLabel", null == json.get("personType") ? null : getDictData(COMPREHENSIVE_TYPE_OF_PERSON, mapUtilsGetString(json,"personType")));//人员类型
|
|
|
+ json.put("familySituationLabel", getDictData(COMPREHENSIVE_FAMILY_INERTIA, mapUtilsGetString(json,"familySituation")));//家庭情况
|
|
|
+ json.put("guardianRelationLabel", getDictData(COMPREHENSIVE_RELATION, mapUtilsGetString(json,"guardianRelation")));//与监护人关系
|
|
|
+ json.put("reoffendLabel", "1".equals(MapUtils.getString(json,"reoffend")) ? "是" : "否");//是否违法犯罪
|
|
|
+ json.put("meansAssistanceLabel", getDictData(COMPREHENSIVE_MEANS_OF_HELP, mapUtilsGetString(json,"meansAssistance")));//帮扶手段
|
|
|
+ }
|
|
|
+
|
|
|
+ private String getDictData(String dictKey, String value) {
|
|
|
+ return DictUtils.getDictDataByValue(dictKey, value);
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<String> getDictDataList(String dictKey, List<String> values) {
|
|
|
+ return DictUtils.getDictDataListByValue(dictKey, values);
|
|
|
+ }
|
|
|
+
|
|
|
+ private String mapUtilsGetString(Map<String, Object> map, String key) {
|
|
|
+ return MapUtils.getString(map,key);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询其他人员类型列表
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/getOtherList")
|
|
|
+ public AjaxResult getOtherList(PersonBasicInfo personBasicInfo) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ //noinspection unchecked
|
|
|
+ List<HashMap<String, Object>> rows = (List<HashMap<String, Object>>) personBasicInfoService.getOtherList(
|
|
|
+ pageDomain.getPageNum(),
|
|
|
+ pageDomain.getPageSize(),
|
|
|
+ personBasicInfo.getDelFlag(),
|
|
|
+ personBasicInfo.getPersonType(),
|
|
|
+ personBasicInfo.getTotal()
|
|
|
+ ).get("data");
|
|
|
+ if (null != rows && !rows.isEmpty()) {
|
|
|
+ setDictValue(rows);
|
|
|
+ }
|
|
|
+ return AjaxResult.success(rows);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询其他类型人员详情
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/getOtherEdit")
|
|
|
+ public AjaxResult getOtherEdit(OtherPersonInfo otherPersonInfo) {
|
|
|
+ AjaxResult otherEdit = personBasicInfoService.getOtherEdit(otherPersonInfo.getBasicId(), otherPersonInfo.getPersonType());
|
|
|
+ if ("200".equals(otherEdit.get("code").toString())) {
|
|
|
+ Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
|
|
|
+ HashMap<String, HashMap<String, Object>> data = (HashMap<String, HashMap<String, Object>>) otherEdit.get("data");
|
|
|
+ setPersonBasicInfo(data.get("basicInfo"), null , null);
|
|
|
+ if (!comprehensiveDictCacheToMap.isEmpty()) {
|
|
|
+ data.computeIfPresent("basicInfo", (key, basicInfo) -> {
|
|
|
+ basicInfo.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(basicInfo.get("householdRegistration")));// 户籍地 2260
|
|
|
+ basicInfo.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(basicInfo.get("nativePlace")));// 籍贯 2260
|
|
|
+ return basicInfo;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ switch (otherPersonInfo.getPersonType()) {
|
|
|
+ case 1:
|
|
|
+ setRegisteredPopulation(data.get("otherInfo"));
|
|
|
+ data.put("registeredPopulation", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ setFloatingPopulation(data.get("otherInfo"));
|
|
|
+ data.put("floatingPopulation", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ setLeftBehindPerson(data.get("otherInfo"));
|
|
|
+ data.put("leftBehindPerson", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ setCampusAroundPerson(data.get("otherInfo"));
|
|
|
+ data.put("campusAroundPerson", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ setPrisonReleased(data.get("otherInfo"));
|
|
|
+ data.put("prisonReleased", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ setCommunityCorrectionStaff(data.get("otherInfo"));
|
|
|
+ data.put("communityCorrectionStaff", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ setPsychosisPopulation(data.get("otherInfo"));
|
|
|
+ data.put("psychosisPopulation", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ setDrugAddict(data.get("otherInfo"));
|
|
|
+ data.put("drugAddict", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ setAidsRisk(data.get("otherInfo"));
|
|
|
+ data.put("aidsRisk", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ setKeyYouth(data.get("otherInfo"));
|
|
|
+ data.put("keyYouth", data.remove("otherInfo"));
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return AjaxResult.success(data);
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error(otherEdit.get("code").toString(), otherEdit.get("msg"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询全部有效的用户信息
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/getAllUserInfo")
|
|
|
+ public AjaxResult getAllUserInfo(PersonBasicInfo personBasicInfo) {
|
|
|
+ PageDomain pageDomain = TableSupport.buildPageRequest();
|
|
|
+ AjaxResult allUserInfo = personBasicInfoService.getAllUserInfo(personBasicInfo.getName(), pageDomain.getPageNum(), pageDomain.getPageSize());
|
|
|
+ if (HttpStatus.SUCCESS == Integer.valueOf(allUserInfo.get("code").toString())) {
|
|
|
+ Map<String, Object> comprehensiveDictCacheToMap = getComprehensiveDictCacheToMap(DictKeys.COMPREHENSIVE_CITY_CODE);// 2260
|
|
|
+ List<Map<String, Object>> data = (List<Map<String, Object>>) allUserInfo.get("data");
|
|
|
+ if (null != data) {
|
|
|
+ for (Map<String, Object> map : data) {
|
|
|
+ map.put("householdRegistrationLabel", comprehensiveDictCacheToMap.get(map.get("householdRegistration")));// 户籍地 2260
|
|
|
+ map.put("nativePlaceLabel", comprehensiveDictCacheToMap.get(map.get("nativePlace")));// 籍贯 2260
|
|
|
+ map.put("currentResidencePlaceLabel", comprehensiveDictCacheToMap.get(map.get("currentResidencePlace")));// 2260
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(allUserInfo.get("rows"));
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error(allUserInfo.get("code").toString(), allUserInfo.get("msg"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|