|
@@ -0,0 +1,259 @@
|
|
|
+package com.sooka.sponest.mobile.comprehensive.personBasicInfoController;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+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.PersonBasicInfo;
|
|
|
+import com.sooka.sponest.comprehensive.api.comprehensivePersonBasicInfo.service.RemotePersonBasicInfoService;
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.domain.EnvironmentBiggas;
|
|
|
+import com.sooka.sponest.data.api.digitalenvironment.service.RemoteBiggasService;
|
|
|
+import com.sooka.sponest.mobile.system.camera.service.AppCameraService;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @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();
|
|
|
+ Integer pageNum = pageDomain.getPageNum();
|
|
|
+ Integer pageSize = pageDomain.getPageSize();
|
|
|
+ Integer delFlag = info.getDelFlag();
|
|
|
+ return AjaxResult.success(personBasicInfoService.getList(pageNum, pageSize, delFlag).getRows());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取重点企业详细信息
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/edit")
|
|
|
+ public AjaxResult getInfo(EnvironmentBiggas biggas) {
|
|
|
+ AjaxResult ajaxResult = personBasicInfoService.getEdit(biggas.getId());
|
|
|
+
|
|
|
+ if ("200".equals(ajaxResult.get("code").toString())) {
|
|
|
+ Map<String, Object> info = (Map<String, Object>) ajaxResult.get("data");
|
|
|
+ HashMap<String, Object> basicInfo = (HashMap<String, Object>) info.get("basecInfo");
|
|
|
+ setPersonBasicInfo(basicInfo);
|
|
|
+ List<HashMap<String, Object>> userBinds = (List<HashMap<String, Object>>) basicInfo.get("userBinds");
|
|
|
+ ArrayList<HashMap<String, Object>> otherInfo = (ArrayList<HashMap<String, Object>>) info.get("otherInfo");
|
|
|
+ for (HashMap<String, Object> bind : userBinds) {
|
|
|
+ for (HashMap<String, Object> data : otherInfo) {
|
|
|
+ if (data.get("id").equals(bind.get("otherPersonId"))) {//判断绑定的id与其他类型的id是否一致
|
|
|
+ //id一致时,设置字典值
|
|
|
+ setLabel(data, (Integer) bind.get("otherPersonType"));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(info);
|
|
|
+ } 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);
|
|
|
+ /*JSONArray communityBinds = json.getJSONArray("communityBinds");
|
|
|
+ List<String> comOneList = new ArrayList<>();
|
|
|
+ List<String> comTwoList = new ArrayList<>();
|
|
|
+ List<String> comThreeList = new ArrayList<>();
|
|
|
+ for (Object communityBind : communityBinds) {
|
|
|
+ JSONObject bind = (JSONObject) JSONObject.toJSON(communityBind);
|
|
|
+ switch (bind.getString("bindType")){
|
|
|
+ case "1":
|
|
|
+ comOneList.add(bind.getString("bindValue"));
|
|
|
+ break;
|
|
|
+ case "2":
|
|
|
+ comTwoList.add(bind.getString("bindValue"));
|
|
|
+ break;
|
|
|
+ case "3":
|
|
|
+ comThreeList.add(bind.getString("bindValue"));
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ json.put("fourHistoriesListLabel",getDictDataList("comprehensive_four_histories_situation", comOneList));//“四史”情况
|
|
|
+ json.put("threeStepListLabel",getDictDataList("comprehensive_three_involved_situation", comTwoList));//“三涉”情况
|
|
|
+ json.put("correctionTeamCompositionListLabel",getDictDataList("comprehensive_corrections_team_composition_type", comThreeList));//矫正小组人员组成情况*/
|
|
|
+ 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(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改重点企业
|
|
|
+ */
|
|
|
+ @PostMapping("/PersonBasicInfo/put")
|
|
|
+ public AjaxResult edit(@RequestBody String json) {
|
|
|
+ return personBasicInfoService.edit(json);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除重点企业
|
|
|
+ */
|
|
|
+ @GetMapping("/PersonBasicInfo/del")
|
|
|
+ public AjaxResult remove(@RequestParam("id") List<String> id) {
|
|
|
+ return personBasicInfoService.del(id.toArray(new String[0]));
|
|
|
+ }
|
|
|
+
|
|
|
+ // private void setPersonBasicInfo(JSONObject basicInfo){
|
|
|
+ private void setPersonBasicInfo(HashMap<String, Object> basicInfo) {//0
|
|
|
+ basicInfo.put("genderLabel", getDictData("comprehensive_sex", String.valueOf(basicInfo.get("gender"))));//性别字典值
|
|
|
+// basicInfo.put("nativePlaceLabel", getDictData("",basicInfo.getString("nativePlace")));//籍贯字典值
|
|
|
+ basicInfo.put("nationLabel", getDictData("comprehensive_nation", String.valueOf(basicInfo.get("nation"))));//民族字典值
|
|
|
+ basicInfo.put("maritalStatusLabel", getDictData("comprehensive_marital_status", String.valueOf(basicInfo.get("maritalStatus"))));//婚庆状况字典值
|
|
|
+ basicInfo.put("educationLabel", getDictData("comprehensive_educational_background", String.valueOf(basicInfo.get("education"))));//学历字典值
|
|
|
+// basicInfo.put("householdRegistrationLabel", getDictData("",basicInfo.getString("householdRegistration")));//户籍地字典值
|
|
|
+// basicInfo.put("currentResidencePlaceLabel", getDictData("",basicInfo.getString("currentResidencePlace")));//现住地字典值
|
|
|
+ basicInfo.put("religiousBeliefLabel", null == basicInfo.get("religiousBelief") ? null : getDictData("comprehensive_religious_belief", String.valueOf(basicInfo.get("religiousBelief"))));//宗教信仰字典值
|
|
|
+ basicInfo.put("politicalOutlookLabel", getDictData("comprehensive_political_status", String.valueOf(basicInfo.get("politicalOutlook"))));//政治面貌字典值
|
|
|
+ basicInfo.put("occupationalCategoryLabel", getDictData("comprehensive_occupational_category", String.valueOf(basicInfo.get("occupationalCategory"))));//职业类别字典值
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setRegisteredPopulation(HashMap<String, Object> json) {//1
|
|
|
+ json.put("entryIdentityLabel", getDictData("comprehensive_households_identification", String.valueOf(json.get("entryIdentity"))));//人户一致标识
|
|
|
+ json.put("accountRelationshipLabel", getDictData("comprehensive_relation", String.valueOf(json.get("accountRelationship"))));//与户主关系
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setFloatingPopulation(HashMap<String, Object> json) {//2
|
|
|
+ json.put("inflowCauselabel", getDictData("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("comprehensive_certification_type", String.valueOf(json.get("certificationType"))));//办证类型
|
|
|
+ json.put("domicileTypeLabel", getDictData("comprehensive_residence_type", String.valueOf(json.get("domicileType"))));//住所类型
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setLeftBehindPerson(HashMap<String, Object> json) {//3
|
|
|
+ json.put("entryIdentityLabel", getDictData("comprehensive_households_identification", String.valueOf(json.get("entryIdentity"))));//人户一致标识
|
|
|
+ json.put("leftBehindTypeLabel", getDictData("comprehensive_left_behind_personnel_type", String.valueOf(json.get("leftBehindType"))));//留守人员类型
|
|
|
+ json.put("healthStatusLabel", null == json.get("healthStatus") ? null : getDictData("comprehensive_health_status", String.valueOf(json.get("healthStatus"))));//健康状况
|
|
|
+ json.put("leftBehindRelationshipLabel", getDictData("comprehensive_relation", String.valueOf(json.get("leftBehindRelationship"))));//与留守人员关系
|
|
|
+ json.put("keyFamilyHealthStatusLabel", null == json.get("keyFamilyHealthStatus") ? null : getDictData("comprehensive_health_status", String.valueOf(json.get("keyFamilyHealthStatus"))));//家庭主要成员健康状况
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setCampusAroundPerson(HashMap<String, Object> json) {//4
|
|
|
+ json.put("harmLevelLabel", getDictData("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("comprehensive_offences_classification", String.valueOf(json.get("originalCharge"))));//原罪名
|
|
|
+ json.put("recidivismLabel", "1".equals(json.get("recidivism")) ? "是" : "否");//是否累犯
|
|
|
+ json.put("riskAssessmentTypeLabel", getDictData("comprehensive_hazard_assessment_type", String.valueOf(json.get("riskAssessmentType"))));//危险性评估类型
|
|
|
+ json.put("linkUpStatusLabel", getDictData("comprehensive_connection", String.valueOf(json.get("linkUpStatus"))));//衔接情况
|
|
|
+ json.put("placementStatusLabel", getDictData("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("comprehensive_case_category", String.valueOf(json.get("caseCategory"))));//案件类别
|
|
|
+ json.put("receivingModeLabel", getDictData("comprehensive_receiving_method", String.valueOf(json.get("receivingMode"))));//接收方式
|
|
|
+ json.put("correctionClassLabel", getDictData("comprehensive_corrective_category", String.valueOf(json.get("correctionClass"))));//矫正类别
|
|
|
+ json.put("correctiveReleaseTypeLabel", null == json.get("correctiveReleaseType") ? null : getDictData("comprehensive_corrective_release_type", String.valueOf(json.get("correctiveReleaseType"))));//矫正解除(终止)类型
|
|
|
+ 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("comprehensive_four_histories_situation", (List<String>) json.get("fourHistoriesList")));
|
|
|
+ json.put("threeStepListLabel", getDictDataList("comprehensive_three_involved_situation", (List<String>) json.get("threeStepList")));
|
|
|
+ json.put("correctionTeamCompositionListLabel", getDictDataList("comprehensive_corrections_team_composition_type", (List<String>) json.get("correctionTeamCompositionList")));
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setPsychosisPopulation(HashMap<String, Object> json) {//7
|
|
|
+ json.put("familyEconomicSituationLabel", null == json.get("familyEconomicSituationLabel") ? null : getDictData("comprehensive_households_financial_situation", String.valueOf(json.get("familyEconomicSituationLabel"))));//家庭经济状况
|
|
|
+ json.put("subsistenceAllowanceLabel", "1".equals(json.get("subsistenceAllowance")) ? "是" : "否");//是否纳入低保
|
|
|
+ json.put("diagnosisTypeLabel", getDictData("comprehensive_current_diagnostic", String.valueOf(json.get("diagnosisType"))));//目前诊断类型
|
|
|
+ json.put("historyCausingAccidentsLabel", "1".equals(json.get("historyCausingAccidents")) ? "有" : "无");//有无肇事肇祸史
|
|
|
+ json.put("riskAssessmentLevelLabel", getDictData("comprehensive_hazard_assessment", String.valueOf(json.get("riskAssessmentLevel"))));//目前危险性评估等级
|
|
|
+ json.put("treatmentSituationLabel", getDictData("comprehensive_treatment_conditions", String.valueOf(json.get("treatmentSituation"))));//治疗情况
|
|
|
+ json.put("reasonsHospitalizationListLabel", getDictDataList("comprehensive_hospitalization_reasons", (List<String>) json.get("reasonsHospitalizationList")));//实施住院治疗原因
|
|
|
+ json.put("participatingManagersListLabel", getDictDataList("comprehensive_managers", (List<String>) json.get("participatingManagersList")));//参与管理人员
|
|
|
+ json.put("assistanceSituationListLabel", getDictDataList("comprehensive_help_situation", (List<String>) json.get("assistanceSituationList")));//帮扶情况
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setDrugAddict(HashMap<String, Object> json) {//8
|
|
|
+ json.put("controlSituationLabel", getDictData("comprehensive_governance", String.valueOf(json.get("controlSituation"))));//管控情况
|
|
|
+ json.put("criminalHistoryLabel", null == json.get("criminalHistory") ? null : "1".equals(json.get("criminalHistory")) ? "有" : "无");//有无犯罪史
|
|
|
+ json.put("drugUseLabel", getDictData("comprehensive_case_consequence", String.valueOf(json.get("drugUse"))));//吸毒原因
|
|
|
+ json.put("drugAbuseLabel", null == json.get("drugAbuse") ? null : getDictData("comprehensive_case_consequence", String.valueOf(json.get("drugAbuse"))));//吸毒后果
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setAidsRisk(HashMap<String, Object> json) {//9
|
|
|
+ json.put("routeInfectionLabel", getDictData("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("comprehensive_case_category", String.valueOf(json.get("caseCategory"))));//案件类别
|
|
|
+ json.put("concernTypeLabel", getDictData("comprehensive_type_of_concern", String.valueOf(json.get("concernType"))));//关注类型
|
|
|
+ json.put("admissionSituationLabel", null == json.get("admissionSituation") ? null : getDictData("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", String.valueOf(json.get("personType"))));//人员类型
|
|
|
+ json.put("familySituationLabel", getDictData("comprehensive_family_inertia", String.valueOf(json.get("familySituation"))));//家庭情况
|
|
|
+ json.put("guardianRelationLabel", getDictData("comprehensive_relation", String.valueOf(json.get("guardianRelation"))));//与监护人关系
|
|
|
+ json.put("reoffendLabel", "1".equals(json.get("reoffend")) ? "是" : "否");//是否违法犯罪
|
|
|
+ json.put("meansAssistanceLabel", getDictData("comprehensive_means_of_help", String.valueOf(json.get("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);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|