diff --git a/pom.xml b/pom.xml index 61c26d9..077cf58 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 5.1.47 2.3.28 1.1.9 - 1.0.1-SNAPSHOT + 1.0.2-SNAPSHOT diff --git a/src/main/java/com/cm/population/controller/datarelease/DataReleaseController.java b/src/main/java/com/cm/population/controller/datarelease/DataReleaseController.java new file mode 100644 index 0000000..28267d5 --- /dev/null +++ b/src/main/java/com/cm/population/controller/datarelease/DataReleaseController.java @@ -0,0 +1,350 @@ +package com.cm.population.controller.datarelease; + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.service.database.IDatabaseService; +import com.cm.common.result.ErrorResult; +import com.cm.common.result.SuccessResultData; +import com.cm.common.utils.DateUtil; +import com.cm.population.dao.datarelease.IDataReleaseDao; +import com.cm.population.service.addicts.IAddictsService; +import com.cm.population.service.aids.IAidsService; +import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService; +import com.cm.population.service.censusmsg.ICensusMsgService; +import com.cm.population.service.communitycorrection.ICommunityCorrectionService; +import com.cm.population.service.floatingpopulation.IFloatingPopulationService; +import com.cm.population.service.homeperson.IHomePersonService; +import com.cm.population.service.keyteenagers.IKeyTeenagersService; +import com.cm.population.service.mentaldisorders.IMentalDisordersService; +import com.cm.population.service.overseaspersonnel.IOverseasPersonnelService; +import com.cm.population.service.releaseaftersentence.IReleaseAfterSentenceService; +import com.cm.population.utils.BigDataResult; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; + +/** + * 人口信息对外提供数据接口类 + * @author xwangs + * @create 2021-07-29 11:07 + * @description + */ +@Api(tags = ISystemConstant.API_PREFIX + "人口信息对外提供数据接口类") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/data-external-release") +public class DataReleaseController extends AbstractController { + + @Autowired + private IDataReleaseDao dataReleaseDao; + @Autowired + private IReleaseAfterSentenceService releaseAfterSentenceService; + @Autowired + private ICommunityCorrectionService communityCorrectionService; + @Autowired + private IMentalDisordersService mentalDisordersService; + @Autowired + private IAddictsService addictsService; + @Autowired + private IAidsService aidsService; + @Autowired + private IKeyTeenagersService keyTeenagersService; + @Autowired + private ICensusMsgService censusMsgService; + @Autowired + private IFloatingPopulationService floatingPopulationService; + @Autowired + private IHomePersonService homePersonService; + @Autowired + private IOverseasPersonnelService overseasPersonnelService; + @Autowired + private IBasePopulationInfoService baseInfoService; + + @ApiOperation(value = "基础人员信息-数量", notes = "基础人员信息-数量") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-person-counts") + public BigDataResult getPersonCounts(){ + Map params = requestParams(); + // {data:{value:40},list:[],msg:'加载成功',state:'200'} + if(params.get("keyCode") == null || params.get("keyCode").toString().length() == 0){ + return new BigDataResult(); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd 00:00:00"); + Map resData = new HashMap<>(4); + String keyCode = params.get("keyCode").toString(); + switch (keyCode){ + case "total" : + SuccessResultData baseInfo = baseInfoService.countBasePopulationInfo(params); + resData.put("value", baseInfo.getData()); + break; + case "month" : + // 获取本月第一天 + Date monthStr = DateUtil.monthStartDate(); + // 获取本月最后一天 + Date monthEnd= DateUtil.monthEndDate(); + params.put("startTime",sdf.format(monthStr)); + params.put("endTime",sdf.format(monthEnd)); + SuccessResultData monthBaseInfo = baseInfoService.countBasePopulationInfo(params); + resData.put("value", monthBaseInfo.getData()); + break; + case "week" : + Date weekStr = DateUtil.weekStartDate(); + Date weekEnd = DateUtil.weekEndDate(); + params.put("startTime",sdf.format(weekStr)); + params.put("endTime",sdf.format(weekEnd)); + SuccessResultData weekBaseInfo = baseInfoService.countBasePopulationInfo(params); + resData.put("value", weekBaseInfo.getData()); + break; + case "man" : + params.put("gender","46bec29f-2368-44f7-98d0-b33246e5e16d"); + SuccessResultData manInfo = baseInfoService.countBasePopulationInfo(params); + resData.put("value", manInfo.getData()); + break; + case "woman" : + params.put("gender","4a5f549a-d339-4403-8d26-9058e80499b1"); + SuccessResultData womanInfo = baseInfoService.countBasePopulationInfo(params); + resData.put("value", womanInfo.getData()); + break; + default: + // ... + } + + BigDataResult bdr = new BigDataResult(); + bdr.setData(resData); + return bdr; + } + + @ApiOperation(value = "年龄分布", notes = "年龄分布") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-age-distribution") + public BigDataResult getAgeDistribution(){ + Map params = requestParams(); + // {data:{},list:[{name:'20以下',columns:[50,100,150]},{name:'20~30',columns:[70,180,250]},{name:'30~45',columns:[90,100,190]}, + // {name:'45~55',columns:[50,45,95]},{name:'55以上',columns:[80,125,205]}],msg:'加载成功',state:'200'} + List> list = dataReleaseDao.listBasePopulationInfo(params); + if(list == null || list.size() == 0){ + return new BigDataResult(); + } + List> resList = new ArrayList<>(); + // 20岁以下 + Map resData1 = getAgeCount(0, 20, list); + resList.add(resData1); + // 20~30 + Map resData2 = getAgeCount(20, 30, list); + resList.add(resData2); + // 30~45 + Map resData3 = getAgeCount(30, 45, list); + resList.add(resData3); + // 45~55 + Map resData4 = getAgeCount(45, 55, list); + resList.add(resData4); + // 55以上 + Map resData5 = getAgeCount(55, 200, list); + resList.add(resData5); + BigDataResult bdr = new BigDataResult(); + bdr.setList(resList); + return bdr; + } + + private Map getAgeCount(int str, int end, List> list){ + String man = "46bec29f-2368-44f7-98d0-b33246e5e16d"; + String woman = "4a5f549a-d339-4403-8d26-9058e80499b1"; + int nowYear = Integer.parseInt(DateUtil.getYear()); + int manInt = 0; + int womanInt = 0; + int total = 0; + Map resData = new HashMap<>(8); + List columnsList = new ArrayList<>(); + for(Map item : list) { + int ageYear; + try{ + ageYear = Integer.parseInt(item.get("birth_date").toString().substring(0, 4)); + } catch (Exception e){ + continue; + } + if (nowYear - ageYear >= str && nowYear - ageYear < end) { + // 男性 + if (man.equals(item.get("gender").toString())) { + manInt++; + } + // 女性 + if (woman.equals(item.get("gender").toString())) { + womanInt++; + } + total++; + } + } + if(str == 0){ + resData.put("name","20以下"); + } else if(end == 200){ + resData.put("name",str + "以上"); + } else { + resData.put("name",str + "~" + end); + } + columnsList.add(manInt); + columnsList.add(womanInt); + columnsList.add(total); + resData.put("columns",columnsList); + return resData; + } + + @ApiOperation(value = "民族分布情况", notes = "民族分布情况") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-nation-info") + public BigDataResult getNationInfo(){ + Map params = requestParams(); + // {data:{},list:[{name:'汉族',value:45280}],msg:'加载成功',state:'200'} + params.put("dataParentId","a981579c-572b-4fd1-8e76-5d17df97f6a4"); + List> dictList = dataReleaseDao.listEducationDict(params); + List> list = dataReleaseDao.listNationInfo(params); + if(list == null || list.size() == 0){ + return new BigDataResult(); + } + List> resList = new ArrayList<>(); + for(Map item : list){ + Map resData = new HashMap<>(4); + String nationName = "其他"; + for (Map dictItem : dictList){ + String dataId = dictItem.get("data_id").toString(); + String nationId = item.get("nation").toString(); + if(dataId.equals(nationId)){ + nationName = dictItem.get("data_name").toString(); + } + } + resData.put("name",nationName); + resData.put("value",item.get("counts").toString()); + resList.add(resData); + } + BigDataResult bdr = new BigDataResult(); + bdr.setList(resList); + return bdr; + } + + @ApiOperation(value = "特殊人群", notes = "特殊人群") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-special-population-info") + public BigDataResult getSpecialPopulationInfo(){ + Map params = requestParams(); + //{data:{},list:[{name:'刑满释放',value:89}],msg:'加载成功',state:'200'} + List> resList = new ArrayList<>(); + // 刑满释放 + Map resData = new HashMap<>(4); + SuccessResultData releaseAfterSentence = releaseAfterSentenceService.countReleaseAfterSentence(params); + resData.put("name","刑满释放"); + resData.put("value",releaseAfterSentence.getData()); + resList.add(resData); + // 社区矫正 + resData = new HashMap<>(4); + SuccessResultData communityCorrection = communityCorrectionService.countCommunityCorrection(params); + resData.put("name","社区矫正"); + resData.put("value",communityCorrection.getData()); + resList.add(resData); + // 肇事肇祸等严重精神障碍患者 + resData = new HashMap<>(4); + SuccessResultData mentalDisorders = mentalDisordersService.countMentalDisorders(params); + resData.put("name","神障碍患"); + resData.put("value",mentalDisorders.getData()); + resList.add(resData); + // 吸毒人员 + resData = new HashMap<>(4); + SuccessResultData addicts = addictsService.countAddicts(params); + resData.put("name","吸毒人员"); + resData.put("value",addicts.getData()); + resList.add(resData); + // 艾滋病 + resData = new HashMap<>(4); + SuccessResultData aids = aidsService.countAids(params); + resData.put("name","艾滋病人"); + resData.put("value",aids.getData()); + resList.add(resData); + // 重点青少年 + resData = new HashMap<>(4); + SuccessResultData keyTeenagers = keyTeenagersService.countKeyTeenagers(params); + resData.put("name","重点\n青少年"); + resData.put("value",aids.getData()); + resList.add(resData); + BigDataResult bdr = new BigDataResult(); + bdr.setList(resList); + return bdr; + } + + @ApiOperation(value = "普通群体", notes = "普通群体") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-normal-population-info") + public BigDataResult getNormalPopulationInfo(){ + Map params = requestParams(); + // {data:{},list:[{name:'实有人口',value:89},{name:'流动人口',value:856}],msg:'加载成功',state:'200'} + List> resList = new ArrayList<>(); + // 户籍信息(实有人口) + Map resData = new HashMap<>(4); + SuccessResultData censusMsg = censusMsgService.countCensusMsg(params); + resData.put("name","实有人口"); + resData.put("value",censusMsg.getData()); + resList.add(resData); + // 流动人口 + resData = new HashMap<>(4); + SuccessResultData floating = floatingPopulationService.countFloatingPopulation(params); + resData.put("name","流动人口"); + resData.put("value",floating.getData()); + resList.add(resData); + // 留守人员 + new HashMap<>(4); + SuccessResultData homePerson = homePersonService.countHomePerson(params); + resData.put("name","留守人员"); + resData.put("value",homePerson.getData()); + resList.add(resData); + // 境外人员 + new HashMap<>(4); + SuccessResultData overseasPersonnel = overseasPersonnelService.countOverseasPersonnel(params); + resData.put("name","境外人员"); + resData.put("value",overseasPersonnel.getData()); + resList.add(resData); + BigDataResult bdr = new BigDataResult(); + bdr.setList(resList); + return bdr; + } + + @ApiOperation(value = "学历情况", notes = "学历情况") + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get-education-info") + public BigDataResult getEducationInfo(){ + Map params = requestParams(); + BigDataResult bdr = new BigDataResult(); + List> resList = new ArrayList<>(); + // {data:{},list:[['研究生教育','80','4%'],['大学本科','7000','15%']],msg:'加载成功',state:'200'} + params.put("dataParentId","d6b9f026-6ea9-456a-b48b-0c18d502523b"); + List> dictList = dataReleaseDao.listEducationDict(params); + // 查询所有人口信息 + SuccessResultData baseInfo = baseInfoService.countBasePopulationInfo(params); + int total = baseInfo.getData(); + // 查询教育程度数量列表DESC + List> educationList = dataReleaseDao.listEducationInfo(params); + for(Map education :educationList){ + List resItem = new LinkedList<>(); + String educationName = "其他"; + for(Map dictItem : dictList){ + String dataId = dictItem.get("data_id").toString(); + String educationId = education.get("education").toString(); + if(dataId.equals(educationId)){ + educationName = dictItem.get("data_name").toString(); + } + } + resItem.add(educationName); + resItem.add(education.get("counts").toString()); + BigDecimal counts = bdr.getRatio(Double.parseDouble(education.get("counts").toString()), + Double.parseDouble(total + ""), 2); + resItem.add(counts + ""); + resList.add(resItem); + } + bdr.setList(resList); + return bdr; + } +} diff --git a/src/main/java/com/cm/population/dao/datarelease/IDataReleaseDao.java b/src/main/java/com/cm/population/dao/datarelease/IDataReleaseDao.java new file mode 100644 index 0000000..e8becea --- /dev/null +++ b/src/main/java/com/cm/population/dao/datarelease/IDataReleaseDao.java @@ -0,0 +1,43 @@ +package com.cm.population.dao.datarelease; + +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @author xwangs + * @create 2021-07-29 15:57 + * @description + */ +@Repository +public interface IDataReleaseDao { + + /** + * 查询基础人员信息 + * @param params + * @return + */ + List> listBasePopulationInfo(Map params); + + /** + * 民族分布情况 limit 10 + * @param params + * @return + */ + List> listNationInfo(Map params); + + /** + * 查询data_data表 + * @param params + * @return + */ + List> listEducationDict(Map params); + + /** + * 查询教育程度数量列表DESC + * @param params + * @return + */ + List> listEducationInfo(Map params); +} diff --git a/src/main/java/com/cm/population/pojo/dtos/addicts/AddictsDTO.java b/src/main/java/com/cm/population/pojo/dtos/addicts/AddictsDTO.java index aa68003..5b6370e 100644 --- a/src/main/java/com/cm/population/pojo/dtos/addicts/AddictsDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/addicts/AddictsDTO.java @@ -18,6 +18,8 @@ public class AddictsDTO { private String addictsId; @ApiModelProperty(name = "controlInfo", value = "管控情况") private String controlInfo; + @ApiModelProperty(name = "controlInfoDictionaryName", value = "管控情况字典名称") + private String controlInfoDictionaryName; @ApiModelProperty(name = "crimeInfo", value = "犯罪情况") private String crimeInfo; @ApiModelProperty(name = "discoveryDate", value = "发现日期") @@ -222,4 +224,13 @@ public class AddictsDTO { public void setCurrentResidence(String currentResidence) { this.currentResidence = currentResidence; } + + + public String getControlInfoDictionaryName() { + return controlInfoDictionaryName == null ? "" : controlInfoDictionaryName; + } + + public void setControlInfoDictionaryName(String controlInfoDictionaryName) { + this.controlInfoDictionaryName = controlInfoDictionaryName; + } } diff --git a/src/main/java/com/cm/population/pojo/dtos/aids/AidsDTO.java b/src/main/java/com/cm/population/pojo/dtos/aids/AidsDTO.java index f3750cc..b6b250c 100644 --- a/src/main/java/com/cm/population/pojo/dtos/aids/AidsDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/aids/AidsDTO.java @@ -30,6 +30,8 @@ public class AidsDTO { private String caseCategoryDictionaryName; @ApiModelProperty(name = "treatmentInfo", value = "收治情况") private String treatmentInfo; + @ApiModelProperty(name = "treatmentInfoDictionaryName", value = "收治情况字典名称") + private String treatmentInfoDictionaryName; @ApiModelProperty(name = "treatmentOrg", value = "收治机构名称") private String treatmentOrg; @ApiModelProperty(name = "helpInfo", value = "帮扶情况") @@ -221,4 +223,12 @@ public class AidsDTO { public void setCurrentResidence(String currentResidence) { this.currentResidence = currentResidence; } + + public String getTreatmentInfoDictionaryName() { + return treatmentInfoDictionaryName == null ? "" : treatmentInfoDictionaryName; + } + + public void setTreatmentInfoDictionaryName(String treatmentInfoDictionaryName) { + this.treatmentInfoDictionaryName = treatmentInfoDictionaryName; + } } diff --git a/src/main/java/com/cm/population/pojo/dtos/communitycorrection/CommunityCorrectionDTO.java b/src/main/java/com/cm/population/pojo/dtos/communitycorrection/CommunityCorrectionDTO.java index 899180f..f4fdfd2 100644 --- a/src/main/java/com/cm/population/pojo/dtos/communitycorrection/CommunityCorrectionDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/communitycorrection/CommunityCorrectionDTO.java @@ -48,6 +48,8 @@ public class CommunityCorrectionDTO { private String originalCustodyPlace; @ApiModelProperty(name = "correctionCategory", value = "矫正类别") private String correctionCategory; + @ApiModelProperty(name = "correctionCategoryDictionaryName", value = "矫正类别字典名称") + private String correctionCategoryDictionaryName; @ApiModelProperty(name = "caseCategory", value = "案件类别") private String caseCategory; @ApiModelProperty(name = "caseCategoryDictionaryName", value = "案件类别字典名称") @@ -66,6 +68,8 @@ public class CommunityCorrectionDTO { private String correctEndDate; @ApiModelProperty(name = "receiveWay", value = "接收方式") private String receiveWay; + @ApiModelProperty(name = "receiveWayDictionaryName", value = "接收方式字典名称") + private String receiveWayDictionaryName; @ApiModelProperty(name = "fourHistoryInfo", value = "四史情况") private String fourHistoryInfo; @ApiModelProperty(name = "fourHistoryInfoDictionaryName", value = "四史情况字典名称") @@ -88,6 +92,8 @@ public class CommunityCorrectionDTO { private String correctGroupUserInfoDictionaryName; @ApiModelProperty(name = "correctRelieveType", value = "矫正解除(终止)类型") private String correctRelieveType; + @ApiModelProperty(name = "correctRelieveTypeDictionaryName", value = "矫正解除(终止)类型字典名称") + private String correctRelieveTypeDictionaryName; @ApiModelProperty(name = "isRidOfControl", value = "是否有脱管") private String isRidOfControl; @ApiModelProperty(name = "isRidOfControlDictionaryName", value = "是否有脱管字典名称") @@ -455,4 +461,28 @@ public class CommunityCorrectionDTO { public void setCurrentResidence(String currentResidence) { this.currentResidence = currentResidence; } + + public String getCorrectionCategoryDictionaryName() { + return correctionCategoryDictionaryName == null ? "" : correctionCategoryDictionaryName; + } + + public void setCorrectionCategoryDictionaryName(String correctionCategoryDictionaryName) { + this.correctionCategoryDictionaryName = correctionCategoryDictionaryName; + } + + public String getReceiveWayDictionaryName() { + return receiveWayDictionaryName == null ? "" : receiveWayDictionaryName; + } + + public void setReceiveWayDictionaryName(String receiveWayDictionaryName) { + this.receiveWayDictionaryName = receiveWayDictionaryName; + } + + public String getCorrectRelieveTypeDictionaryName() { + return correctRelieveTypeDictionaryName == null ? "" : correctRelieveTypeDictionaryName; + } + + public void setCorrectRelieveTypeDictionaryName(String correctRelieveTypeDictionaryName) { + this.correctRelieveTypeDictionaryName = correctRelieveTypeDictionaryName; + } } diff --git a/src/main/java/com/cm/population/pojo/dtos/mentaldisorders/MentalDisordersDTO.java b/src/main/java/com/cm/population/pojo/dtos/mentaldisorders/MentalDisordersDTO.java index 705278f..2e00fa9 100644 --- a/src/main/java/com/cm/population/pojo/dtos/mentaldisorders/MentalDisordersDTO.java +++ b/src/main/java/com/cm/population/pojo/dtos/mentaldisorders/MentalDisordersDTO.java @@ -24,14 +24,18 @@ public class MentalDisordersDTO { private String manageUserDictionaryName; @ApiModelProperty(name = "treatment", value = "治疗情况") private String treatment; + @ApiModelProperty(name = "treatmentDictName", value = "治疗情况") + private String treatmentDictName; @ApiModelProperty(name = "lastTroubleDate", value = "上次肇事肇祸日期") private String lastTroubleDate; @ApiModelProperty(name = "troubleNumber", value = "肇事肇祸次数") private String troubleNumber; @ApiModelProperty(name = "firstOnsetDate", value = "初次发病日期") private String firstOnsetDate; - @ApiModelProperty(name = "familyEconomy", value = "家庭经济情况") + @ApiModelProperty(name = "familyEconomy", value = "家庭经济情况-ID") private String familyEconomy; + @ApiModelProperty(name = "familyEconomyDictName", value = "家庭经济情况-典型") + private String familyEconomyDictName; @ApiModelProperty(name = "isSubsistence", value = "是否纳入低保") private String isSubsistence; @ApiModelProperty(name = "isSubsistenceDictionaryName", value = "是否纳入低保字典名称") @@ -42,14 +46,18 @@ public class MentalDisordersDTO { private String helpInfoDictionaryName; @ApiModelProperty(name = "guardianPhone", value = "监护人联系方式") private String guardianPhone; - @ApiModelProperty(name = "riskLevel", value = "目前危险性评估等级") + @ApiModelProperty(name = "riskLevel", value = "目前危险性评估等级-ID") private String riskLevel; + @ApiModelProperty(name = "riskLevelDictName", value = "目前危险性评估等级-字典名称") + private String riskLevelDictName; @ApiModelProperty(name = "receiveOrgName", value = "接收康复训练机构名称") private String receiveOrgName; @ApiModelProperty(name = "idCardNumber", value = "身份证号") private String idCardNumber; - @ApiModelProperty(name = "diagnosisType", value = "目前诊断类型") + @ApiModelProperty(name = "diagnosisType", value = "目前诊断类型-ID") private String diagnosisType; + @ApiModelProperty(name = "diagnosisTypeDictName", value = "目前诊断类型-字典") + private String diagnosisTypeDictName; @ApiModelProperty(name = "hospitalization", value = "实施住院治疗原因") private String hospitalization; @ApiModelProperty(name = "hospitalizationDictionaryName", value = "实施住院治疗原因字典名称") @@ -299,4 +307,36 @@ public class MentalDisordersDTO { public void setCurrentResidence(String currentResidence) { this.currentResidence = currentResidence; } + + public String getRiskLevelDictName() { + return riskLevelDictName == null ? "" : riskLevelDictName; + } + + public void setRiskLevelDictName(String riskLevelDictName) { + this.riskLevelDictName = riskLevelDictName; + } + + public String getFamilyEconomyDictName() { + return familyEconomyDictName == null ? "" : familyEconomyDictName; + } + + public void setFamilyEconomyDictName(String familyEconomyDictName) { + this.familyEconomyDictName = familyEconomyDictName; + } + + public String getDiagnosisTypeDictName() { + return diagnosisTypeDictName == null ? "" : diagnosisTypeDictName; + } + + public void setDiagnosisTypeDictName(String diagnosisTypeDictName) { + this.diagnosisTypeDictName = diagnosisTypeDictName; + } + + public String getTreatmentDictName() { + return treatmentDictName == null ? "" : treatmentDictName; + } + + public void setTreatmentDictName(String treatmentDictName) { + this.treatmentDictName = treatmentDictName; + } } diff --git a/src/main/java/com/cm/population/service/addicts/impl/AddictsServiceImpl.java b/src/main/java/com/cm/population/service/addicts/impl/AddictsServiceImpl.java index 84c1a09..ba7dc59 100644 --- a/src/main/java/com/cm/population/service/addicts/impl/AddictsServiceImpl.java +++ b/src/main/java/com/cm/population/service/addicts/impl/AddictsServiceImpl.java @@ -16,6 +16,7 @@ import com.cm.population.dao.addicts.IAddictsDao; import com.cm.population.dao.basepopulationinfo.IBasePopulationInfoDao; import com.cm.population.pojo.dtos.addicts.AddictsDTO; import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO; +import com.cm.population.pojo.dtos.releaseaftersentence.ReleaseAfterSentenceDTO; import com.cm.population.pojo.vos.addicts.AddictsVO; import com.cm.population.service.addicts.IAddictsService; import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService; @@ -191,9 +192,28 @@ public class AddictsServiceImpl extends AbstractService implements IAddictsServi Map params = super.getHashMap(1); params.put("addictsId", addictsId); AddictsDTO dto = addictsDao.getAddicts(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new AddictsDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict.getDictionaryName()); + } + // 吸毒原因 + if(!"".equals(dto.getDrugReason())){ + DataDictionaryDTO drugReasonDict = dataDictionaryService.getDictionaryById(dto.getDrugReason()); + dto.setDrugReasonDictionaryName(drugReasonDict == null ? dto.getDrugReason() : drugReasonDict.getDictionaryName()); + } + // 吸毒后果 + if(!"".equals(dto.getDrugResult())){ + DataDictionaryDTO drugResultDict = dataDictionaryService.getDictionaryById(dto.getDrugResult()); + dto.setDrugResultDictionaryName(drugResultDict == null ? dto.getDrugResult() : drugResultDict.getDictionaryName()); + } + // 管控情况 + if(!"".equals(dto.getControlInfo())){ + DataDictionaryDTO controlInfoDict = dataDictionaryService.getDictionaryById(dto.getControlInfo()); + dto.setControlInfoDictionaryName(controlInfoDict == null ? dto.getControlInfo() : controlInfoDict.getDictionaryName()); } return dto; } @@ -201,7 +221,30 @@ public class AddictsServiceImpl extends AbstractService implements IAddictsServi @Override public AddictsDTO getAddictsInfo(Map params) throws SearchException { AddictsDTO dto = addictsDao.getAddicts(params); - return dto == null ? new AddictsDTO() : dto; + if(dto == null){ + return new AddictsDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict == null ? dto.getGender() : genderDict.getDictionaryName()); + } + // 吸毒原因 + if(!"".equals(dto.getDrugReason())){ + DataDictionaryDTO drugReasonDict = dataDictionaryService.getDictionaryById(dto.getDrugReason()); + dto.setDrugReasonDictionaryName(drugReasonDict == null ? dto.getDrugReason() : drugReasonDict.getDictionaryName()); + } + // 吸毒后果 + if(!"".equals(dto.getDrugResult())){ + DataDictionaryDTO drugResultDict = dataDictionaryService.getDictionaryById(dto.getDrugResult()); + dto.setDrugResultDictionaryName(drugResultDict == null ? dto.getDrugResult() : drugResultDict.getDictionaryName()); + } + // 管控情况 + if(!"".equals(dto.getControlInfo())){ + DataDictionaryDTO controlInfoDict = dataDictionaryService.getDictionaryById(dto.getControlInfo()); + dto.setControlInfoDictionaryName(controlInfoDict == null ? dto.getControlInfo() : controlInfoDict.getDictionaryName()); + } + return dto; } @Override diff --git a/src/main/java/com/cm/population/service/aids/impl/AidsServiceImpl.java b/src/main/java/com/cm/population/service/aids/impl/AidsServiceImpl.java index d706ab7..537922f 100644 --- a/src/main/java/com/cm/population/service/aids/impl/AidsServiceImpl.java +++ b/src/main/java/com/cm/population/service/aids/impl/AidsServiceImpl.java @@ -192,9 +192,33 @@ public class AidsServiceImpl extends AbstractService implements IAidsService { Map params = super.getHashMap(1); params.put("aidsId", aidsId); AidsDTO dto = aidsDao.getAids(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new AidsDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict == null ? dto.getGender() : genderDict.getDictionaryName()); + } + // 感染途径 infectionRoute + if(!"".equals(dto.getInfectionRoute())){ + DataDictionaryDTO infectionRouteDict = dataDictionaryService.getDictionaryById(dto.getInfectionRoute()); + dto.setInfectionRouteDictionaryName(infectionRouteDict == null ? dto.getInfectionRoute() : infectionRouteDict.getDictionaryName()); + } + // 案件类别 caseCategory + if(!"".equals(dto.getCaseCategory())){ + DataDictionaryDTO caseCategoryDict = dataDictionaryService.getDictionaryById(dto.getCaseCategory()); + dto.setCaseCategoryDictionaryName(caseCategoryDict == null ? dto.getCaseCategory() : caseCategoryDict.getDictionaryName()); + } + // 关注类型 attentionType + if(!"".equals(dto.getAttentionType())){ + DataDictionaryDTO attentionTypeDict = dataDictionaryService.getDictionaryById(dto.getAttentionType()); + dto.setAttentionTypeDictionaryName(attentionTypeDict == null ? dto.getAttentionType() : attentionTypeDict.getDictionaryName()); + } + // 收治情况 treatmentInfo + if(!"".equals(dto.getTreatmentInfo())){ + DataDictionaryDTO treatmentInfoDict = dataDictionaryService.getDictionaryById(dto.getTreatmentInfo()); + dto.setTreatmentInfoDictionaryName(treatmentInfoDict == null ? dto.getTreatmentInfo() : treatmentInfoDict.getDictionaryName()); } return dto; } @@ -202,11 +226,35 @@ public class AidsServiceImpl extends AbstractService implements IAidsService { @Override public AidsDTO getAidsInfo(Map params) throws SearchException { AidsDTO dto = aidsDao.getAids(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new AidsDTO(); } - return dto == null ? new AidsDTO() : dto; + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict == null ? dto.getGender() : genderDict.getDictionaryName()); + } + // 感染途径 infectionRoute + if(!"".equals(dto.getInfectionRoute())){ + DataDictionaryDTO infectionRouteDict = dataDictionaryService.getDictionaryById(dto.getInfectionRoute()); + dto.setInfectionRouteDictionaryName(infectionRouteDict == null ? dto.getInfectionRoute() : infectionRouteDict.getDictionaryName()); + } + // 案件类别 caseCategory + if(!"".equals(dto.getCaseCategory())){ + DataDictionaryDTO caseCategoryDict = dataDictionaryService.getDictionaryById(dto.getCaseCategory()); + dto.setCaseCategoryDictionaryName(caseCategoryDict == null ? dto.getCaseCategory() : caseCategoryDict.getDictionaryName()); + } + // 关注类型 attentionType + if(!"".equals(dto.getAttentionType())){ + DataDictionaryDTO attentionTypeDict = dataDictionaryService.getDictionaryById(dto.getAttentionType()); + dto.setAttentionTypeDictionaryName(attentionTypeDict == null ? dto.getAttentionType() : attentionTypeDict.getDictionaryName()); + } + // 收治情况 treatmentInfo + if(!"".equals(dto.getTreatmentInfo())){ + DataDictionaryDTO treatmentInfoDict = dataDictionaryService.getDictionaryById(dto.getTreatmentInfo()); + dto.setTreatmentInfoDictionaryName(treatmentInfoDict == null ? dto.getTreatmentInfo() : treatmentInfoDict.getDictionaryName()); + } + return dto; } @Override diff --git a/src/main/java/com/cm/population/service/communitycorrection/impl/CommunityCorrectionServiceImpl.java b/src/main/java/com/cm/population/service/communitycorrection/impl/CommunityCorrectionServiceImpl.java index 677d9c3..bdc5eb8 100644 --- a/src/main/java/com/cm/population/service/communitycorrection/impl/CommunityCorrectionServiceImpl.java +++ b/src/main/java/com/cm/population/service/communitycorrection/impl/CommunityCorrectionServiceImpl.java @@ -193,9 +193,72 @@ public class CommunityCorrectionServiceImpl extends AbstractService implements I Map params = super.getHashMap(1); params.put("communityCorrectionId", communityCorrectionId); CommunityCorrectionDTO dto = communityCorrectionDao.getCommunityCorrection(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new CommunityCorrectionDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict == null ? dto.getGender() : genderDict.getDictionaryName()); + } + // 矫正类别 correctionCategory + if(!"".equals(dto.getCorrectionCategory())){ + DataDictionaryDTO correctionCategoryDict = dataDictionaryService.getDictionaryById(dto.getCorrectionCategory()); + dto.setCorrectionCategoryDictionaryName(correctionCategoryDict == null ? dto.getCorrectionCategory() : correctionCategoryDict.getDictionaryName()); + } + // 案件类型 caseCategory + if(!"".equals(dto.getCaseCategory())){ + DataDictionaryDTO caseCategoryDict = dataDictionaryService.getDictionaryById(dto.getCaseCategory()); + dto.setCaseCategoryDictionaryName(caseCategoryDict == null ? dto.getCaseCategory() : caseCategoryDict.getDictionaryName()); + } + // 接收方式 receiveWay + if(!"".equals(dto.getReceiveWay())){ + DataDictionaryDTO receiveWayDict = dataDictionaryService.getDictionaryById(dto.getReceiveWay()); + dto.setReceiveWayDictionaryName(receiveWayDict == null ? dto.getReceiveWay() : receiveWayDict.getDictionaryName()); + } + // 矫正解除(终止)类型 correctRelieveType + if(!"".equals(dto.getCorrectRelieveType())){ + DataDictionaryDTO correctRelieveTypeDict = dataDictionaryService.getDictionaryById(dto.getCorrectRelieveType()); + dto.setCorrectRelieveTypeDictionaryName(correctRelieveTypeDict == null ? dto.getCorrectRelieveType() : correctRelieveTypeDict.getDictionaryName()); + } + // "四史"情况 fourHistoryInfo + if(!"".equals(dto.getFourHistoryInfo())){ + String[] fourHistoryInfoIds = dto.getFourHistoryInfo().split(","); + String fourHistoryInfoDictName = ""; + for (String str : fourHistoryInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + if(tempDict == null){ + continue; + } + fourHistoryInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setFourHistoryInfoDictionaryName(fourHistoryInfoDictName); + } + // "三涉"情况 threeInvolveInfo + if(!"".equals(dto.getThreeInvolveInfo())){ + String[] threeInvolveInfoIds = dto.getThreeInvolveInfo().split(","); + String threeInvolveInfoDictName = ""; + for (String str : threeInvolveInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + if(tempDict == null){ + continue; + } + threeInvolveInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setThreeInvolveInfoDictionaryName(threeInvolveInfoDictName); + } + // 矫正小组人员组成情况 correctGroupUserInfo + if(!"".equals(dto.getCorrectGroupUserInfo())){ + String[] correctGroupUserInfoIds = dto.getCorrectGroupUserInfo().split(","); + String correctGroupUserInfoDictName = ""; + for (String str : correctGroupUserInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + if(tempDict == null){ + continue; + } + correctGroupUserInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setCorrectGroupUserInfoDictionaryName(correctGroupUserInfoDictName); } return dto; } @@ -203,9 +266,72 @@ public class CommunityCorrectionServiceImpl extends AbstractService implements I @Override public CommunityCorrectionDTO getCommunityCorrectionInfo(Map params) throws SearchException { CommunityCorrectionDTO dto = communityCorrectionDao.getCommunityCorrection(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new CommunityCorrectionDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict == null ? dto.getGender() : genderDict.getDictionaryName()); + } + // 矫正类别 correctionCategory + if(!"".equals(dto.getCorrectionCategory())){ + DataDictionaryDTO correctionCategoryDict = dataDictionaryService.getDictionaryById(dto.getCorrectionCategory()); + dto.setCorrectionCategoryDictionaryName(correctionCategoryDict == null ? dto.getCorrectionCategory() : correctionCategoryDict.getDictionaryName()); + } + // 案件类型 caseCategory + if(!"".equals(dto.getCaseCategory())){ + DataDictionaryDTO caseCategoryDict = dataDictionaryService.getDictionaryById(dto.getCaseCategory()); + dto.setCaseCategoryDictionaryName(caseCategoryDict == null ? dto.getCaseCategory() : caseCategoryDict.getDictionaryName()); + } + // 接收方式 receiveWay + if(!"".equals(dto.getReceiveWay())){ + DataDictionaryDTO receiveWayDict = dataDictionaryService.getDictionaryById(dto.getReceiveWay()); + dto.setReceiveWayDictionaryName(receiveWayDict == null ? dto.getReceiveWay() : receiveWayDict.getDictionaryName()); + } + // 矫正解除(终止)类型 correctRelieveType + if(!"".equals(dto.getCorrectRelieveType())){ + DataDictionaryDTO correctRelieveTypeDict = dataDictionaryService.getDictionaryById(dto.getCorrectRelieveType()); + dto.setCorrectRelieveTypeDictionaryName(correctRelieveTypeDict == null ? dto.getCorrectRelieveType() : correctRelieveTypeDict.getDictionaryName()); + } + // "四史"情况 fourHistoryInfo + if(!"".equals(dto.getFourHistoryInfo())){ + String[] fourHistoryInfoIds = dto.getFourHistoryInfo().split(","); + String fourHistoryInfoDictName = ""; + for (String str : fourHistoryInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + if(tempDict == null){ + continue; + } + fourHistoryInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setFourHistoryInfoDictionaryName(fourHistoryInfoDictName); + } + // "三涉"情况 threeInvolveInfo + if(!"".equals(dto.getThreeInvolveInfo())){ + String[] threeInvolveInfoIds = dto.getThreeInvolveInfo().split(","); + String threeInvolveInfoDictName = ""; + for (String str : threeInvolveInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + if(tempDict == null){ + continue; + } + threeInvolveInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setThreeInvolveInfoDictionaryName(threeInvolveInfoDictName); + } + // 矫正小组人员组成情况 correctGroupUserInfo + if(!"".equals(dto.getCorrectGroupUserInfo())){ + String[] correctGroupUserInfoIds = dto.getCorrectGroupUserInfo().split(","); + String correctGroupUserInfoDictName = ""; + for (String str : correctGroupUserInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + if(tempDict == null){ + continue; + } + correctGroupUserInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setCorrectGroupUserInfoDictionaryName(correctGroupUserInfoDictName); } return dto == null ? new CommunityCorrectionDTO(): dto; } diff --git a/src/main/java/com/cm/population/service/mentaldisorders/impl/MentalDisordersServiceImpl.java b/src/main/java/com/cm/population/service/mentaldisorders/impl/MentalDisordersServiceImpl.java index 6d47d7f..3052a7d 100644 --- a/src/main/java/com/cm/population/service/mentaldisorders/impl/MentalDisordersServiceImpl.java +++ b/src/main/java/com/cm/population/service/mentaldisorders/impl/MentalDisordersServiceImpl.java @@ -197,8 +197,61 @@ public class MentalDisordersServiceImpl extends AbstractService implements IMent params.put("mentalDisordersId", mentalDisordersId); MentalDisordersDTO dto = mentalDisordersDao.getMentalDisorders(params); if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict.getDictionaryName()); + } + // 家庭经济情况 + if(!"".equals(dto.getFamilyEconomy())){ + DataDictionaryDTO familyEconomyDict = dataDictionaryService.getDictionaryById(dto.getFamilyEconomy()); + dto.setFamilyEconomyDictName(familyEconomyDict.getDictionaryName()); + } + // 危险评估等级 + if(!"".equals(dto.getRiskLevel())){ + DataDictionaryDTO riskLevelDict = dataDictionaryService.getDictionaryById(dto.getRiskLevel()); + dto.setRiskLevelDictName(riskLevelDict.getDictionaryName()); + } + // 目前诊断类型 + if(!"".equals(dto.getDiagnosisType())){ + DataDictionaryDTO diagnosisTypeDict = dataDictionaryService.getDictionaryById(dto.getDiagnosisType()); + dto.setDiagnosisTypeDictName(diagnosisTypeDict.getDictionaryName()); + } + // 治疗情况 + if(!"".equals(dto.getTreatment())){ + DataDictionaryDTO treatmentDict = dataDictionaryService.getDictionaryById(dto.getTreatment()); + dto.setTreatmentDictName(treatmentDict.getDictionaryName()); + } + if(!"".equals(dto.getHospitalization())){ + // 实施住院治疗原因 + String[] hospitalizationIds = dto.getHospitalization().split(","); + String hospitalizationDictName = ""; + for (String str : hospitalizationIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + hospitalizationDictName += tempDict.getDictionaryName() + ","; + } + dto.setHospitalizationDictionaryName(hospitalizationDictName); + } + if(!"".equals(dto.getManageUser())){ + // 参与管理人员 + String[] manageUserIds = dto.getManageUser().split(","); + String manageUserDictName = ""; + for (String str : manageUserIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + manageUserDictName += tempDict.getDictionaryName() + ","; + } + dto.setManageUserDictionaryName(manageUserDictName); + } + if(!"".equals(dto.getHelpInfo())){ + // 帮扶情况 + String[] helpInfoIds = dto.getHelpInfo().split(","); + String helpInfoDictName = ""; + for (String str : helpInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + helpInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setHelpInfoDictionaryName(helpInfoDictName); + } } return dto; } @@ -206,9 +259,63 @@ public class MentalDisordersServiceImpl extends AbstractService implements IMent @Override public MentalDisordersDTO getMentalDisordersInfo(Map params) throws SearchException { MentalDisordersDTO dto = mentalDisordersDao.getMentalDisorders(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new MentalDisordersDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict.getDictionaryName()); + } + // 家庭经济情况 + if(!"".equals(dto.getFamilyEconomy())){ + DataDictionaryDTO familyEconomyDict = dataDictionaryService.getDictionaryById(dto.getFamilyEconomy()); + dto.setFamilyEconomyDictName(familyEconomyDict.getDictionaryName()); + } + // 危险评估等级 + if(!"".equals(dto.getRiskLevel())){ + DataDictionaryDTO riskLevelDict = dataDictionaryService.getDictionaryById(dto.getRiskLevel()); + dto.setRiskLevelDictName(riskLevelDict.getDictionaryName()); + } + // 目前诊断类型 + if(!"".equals(dto.getDiagnosisType())){ + DataDictionaryDTO diagnosisTypeDict = dataDictionaryService.getDictionaryById(dto.getDiagnosisType()); + dto.setDiagnosisTypeDictName(diagnosisTypeDict.getDictionaryName()); + } + // 治疗情况 + if(!"".equals(dto.getTreatment())){ + DataDictionaryDTO treatmentDict = dataDictionaryService.getDictionaryById(dto.getTreatment()); + dto.setTreatmentDictName(treatmentDict.getDictionaryName()); + } + if(!"".equals(dto.getHospitalization())){ + // 实施住院治疗原因 + String[] hospitalizationIds = dto.getHospitalization().split(","); + String hospitalizationDictName = ""; + for (String str : hospitalizationIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + hospitalizationDictName += tempDict.getDictionaryName() + ","; + } + dto.setHospitalizationDictionaryName(hospitalizationDictName); + } + if(!"".equals(dto.getManageUser())){ + // 参与管理人员 + String[] manageUserIds = dto.getManageUser().split(","); + String manageUserDictName = ""; + for (String str : manageUserIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + manageUserDictName += tempDict.getDictionaryName() + ","; + } + dto.setManageUserDictionaryName(manageUserDictName); + } + if(!"".equals(dto.getHelpInfo())){ + // 帮扶情况 + String[] helpInfoIds = dto.getHelpInfo().split(","); + String helpInfoDictName = ""; + for (String str : helpInfoIds){ + DataDictionaryDTO tempDict = dataDictionaryService.getDictionaryById(str); + helpInfoDictName += tempDict.getDictionaryName() + ","; + } + dto.setHelpInfoDictionaryName(helpInfoDictName); } return dto; } diff --git a/src/main/java/com/cm/population/service/releaseaftersentence/impl/ReleaseAfterSentenceServiceImpl.java b/src/main/java/com/cm/population/service/releaseaftersentence/impl/ReleaseAfterSentenceServiceImpl.java index 2cd8f26..b972199 100644 --- a/src/main/java/com/cm/population/service/releaseaftersentence/impl/ReleaseAfterSentenceServiceImpl.java +++ b/src/main/java/com/cm/population/service/releaseaftersentence/impl/ReleaseAfterSentenceServiceImpl.java @@ -191,9 +191,37 @@ public class ReleaseAfterSentenceServiceImpl extends AbstractService implements Map params = super.getHashMap(1); params.put("releaseAfterSentenceId", releaseAfterSentenceId); ReleaseAfterSentenceDTO dto = releaseAfterSentenceDao.getReleaseAfterSentence(params); - if(dto != null){ - DataDictionaryDTO dictDto = dataDictionaryService.getDictionaryById(dto.getGender()); - dto.setGender(dictDto.getDictionaryName()); + if(dto == null){ + return new ReleaseAfterSentenceDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict.getDictionaryName()); + } + // 原罪名 + if(!"".equals(dto.getNameOfOriginalSin())){ + DataDictionaryDTO nameOfOriginalSinDict = dataDictionaryService.getDictionaryById(dto.getNameOfOriginalSin()); + dto.setNameOfOriginalSinDictionaryName(nameOfOriginalSinDict == null ? + dto.getNameOfOriginalSin() : nameOfOriginalSinDict.getDictionaryName()); + } + // 衔接情况 + if(!"".equals(dto.getLinkUpSituation())){ + DataDictionaryDTO linkUpSituationDict = dataDictionaryService.getDictionaryById(dto.getLinkUpSituation()); + dto.setLinkUpSituationDictionaryName(linkUpSituationDict == null ? + dto.getLinkUpSituation() : linkUpSituationDict.getDictionaryName()); + } + // 安置情况 + if(!"".equals(dto.getPlacementSituation())) { + DataDictionaryDTO placementSituationDict = dataDictionaryService.getDictionaryById(dto.getPlacementSituation()); + dto.setPlacementSituationDictionaryName(placementSituationDict == null ? + dto.getPlacementSituation() : placementSituationDict.getDictionaryName()); + } + // 危险评估类型 + if(!"".equals(dto.getAssessmentRiskType())){ + DataDictionaryDTO assessmentRiskTypeDict = dataDictionaryService.getDictionaryById(dto.getAssessmentRiskType()); + dto.setAssessmentRiskTypeDictionaryName(assessmentRiskTypeDict == null ? + dto.getAssessmentRiskType() : assessmentRiskTypeDict.getDictionaryName()); } return dto; } @@ -201,7 +229,39 @@ public class ReleaseAfterSentenceServiceImpl extends AbstractService implements @Override public ReleaseAfterSentenceDTO getReleaseAfterSentenceInfo(Map params) throws SearchException { ReleaseAfterSentenceDTO dto = releaseAfterSentenceDao.getReleaseAfterSentence(params); - return dto == null ? new ReleaseAfterSentenceDTO() : dto; + if(dto == null){ + return new ReleaseAfterSentenceDTO(); + } + // 处理性别 + if(!"".equals(dto.getGender())){ + DataDictionaryDTO genderDict = dataDictionaryService.getDictionaryById(dto.getGender()); + dto.setGender(genderDict.getDictionaryName()); + } + // 原罪名 + if(!"".equals(dto.getNameOfOriginalSin())){ + DataDictionaryDTO nameOfOriginalSinDict = dataDictionaryService.getDictionaryById(dto.getNameOfOriginalSin()); + dto.setNameOfOriginalSinDictionaryName(nameOfOriginalSinDict == null ? + dto.getNameOfOriginalSin() : nameOfOriginalSinDict.getDictionaryName()); + } + // 衔接情况 + if(!"".equals(dto.getLinkUpSituation())){ + DataDictionaryDTO linkUpSituationDict = dataDictionaryService.getDictionaryById(dto.getLinkUpSituation()); + dto.setLinkUpSituationDictionaryName(linkUpSituationDict == null ? + dto.getLinkUpSituation() : linkUpSituationDict.getDictionaryName()); + } + // 安置情况 + if(!"".equals(dto.getPlacementSituation())) { + DataDictionaryDTO placementSituationDict = dataDictionaryService.getDictionaryById(dto.getPlacementSituation()); + dto.setPlacementSituationDictionaryName(placementSituationDict == null ? + dto.getPlacementSituation() : placementSituationDict.getDictionaryName()); + } + // 危险评估类型 + if(!"".equals(dto.getAssessmentRiskType())){ + DataDictionaryDTO assessmentRiskTypeDict = dataDictionaryService.getDictionaryById(dto.getAssessmentRiskType()); + dto.setAssessmentRiskTypeDictionaryName(assessmentRiskTypeDict == null ? + dto.getAssessmentRiskType() : assessmentRiskTypeDict.getDictionaryName()); + } + return dto; } @Override diff --git a/src/main/java/com/cm/population/utils/BigDataResult.java b/src/main/java/com/cm/population/utils/BigDataResult.java new file mode 100644 index 0000000..1b23ea3 --- /dev/null +++ b/src/main/java/com/cm/population/utils/BigDataResult.java @@ -0,0 +1,76 @@ +package com.cm.population.utils; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BigDataResult { + + private Map data = new HashMap(); + + private List list = new ArrayList(); + + private String msg = "加载成功"; + + private String state = "200"; + + public static BigDataResult getInstance() { + return new BigDataResult(); + } + + public Map getData() { + return data; + } + + public void setData(Map data) { + this.data = data; + } + + public List getList() { + if (list == null) { + return new ArrayList<>(); + } + return list; + } + + public void setList(List list) { + this.list = list; + } + + public String getMsg() { + return msg == null ? "" : msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public String getState() { + return state == null ? "" : state; + } + + public void setState(String state) { + this.state = state; + } + + public BigDecimal getRatio(Double val1, Double val2, int decimal){ + if(val2 == 0d || val1 == 0d){ + return new BigDecimal(0); + } + // BigDecimal.ROUND_UP 进位处理避免数值过小出现0.00 + BigDecimal ratioDecimal = new BigDecimal(( val1 / val2 ) * 100) + .setScale(decimal,BigDecimal.ROUND_UP); + return ratioDecimal; + } + + public String lastMonth() { + LocalDate today = LocalDate.now(); + today = today.minusMonths(1); + DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM"); + return formatters.format(today); + } +} \ No newline at end of file diff --git a/src/main/resources/application.yml b/src/main/resources/application-test.yml similarity index 84% rename from src/main/resources/application.yml rename to src/main/resources/application-test.yml index c4e4690..074f2ba 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application-test.yml @@ -1,6 +1,6 @@ server: - port: 8080 - url: http://192.168.0.109:8080/population + port: 8093 + url: http://49.233.36.36:58093/population title: population servlet: context-path: /population @@ -20,11 +20,11 @@ spring: max-request-size: 1GB datasource: druid: - url: jdbc:mysql://localhost:3306/db_user_management?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false + url: jdbc:mysql://localhost:3306/db_cloud_population?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false db-type: mysql driver-class-name: com.mysql.jdbc.Driver username: root - password: 123456 + password: root initial-size: 2 min-idle: 2 max-active: 5 @@ -61,7 +61,7 @@ swagger: # 文件 file: - uploadPath: /Users/wenc/Desktop/filetest + uploadPath: /Users/wanggeng/Desktop/UploadFiles imageTypes: png,jpg,jpeg,gif,blob videoTypes: mp4 audioTypes: mp3,wav,amr @@ -71,11 +71,11 @@ file: # 安全 security: oauth2: - oauth-server: http://49.233.36.36:8868/usercenter + oauth-server: http://49.233.36.36:58090/usercenter oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} client: - client-id: 3d24af9a292d40fbb58f133c63bb2abf - client-secret: elFGMTBpSGI0QlROWlpMeDh4WVArc25yMVRmeWVtOUl5RTl2ZG9uTzBiNG1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== + client-id: ba950215f6bb4d45bddd6cbcb87395e7 + client-secret: WmlVZ2M4M2ZTeTdaS25OVlFwUExac3QrOU9kdHEybVgxSmhETTdFV2F5TW1ac2wwZTJHWk5NbXh3L3h3U2c4Rg== user-authorization-uri: ${security.oauth2.oauth-server}/oauth_client/authorize access-token-uri: ${security.oauth2.oauth-server}/oauth_client/token grant-type: authorization_code diff --git a/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml b/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml new file mode 100644 index 0000000..5a14480 --- /dev/null +++ b/src/main/resources/mybatis/mapper/datarelease/datarelease-mapper.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/static/route/communitycorrection/save-communitycorrection.html b/src/main/resources/static/route/communitycorrection/save-communitycorrection.html index 6018471..cc96e7f 100644 --- a/src/main/resources/static/route/communitycorrection/save-communitycorrection.html +++ b/src/main/resources/static/route/communitycorrection/save-communitycorrection.html @@ -103,16 +103,15 @@
-
- +
+
-
- - - - -
+
+
@@ -263,11 +261,12 @@
-
- - - -
+
+
@@ -286,17 +285,12 @@
-
- - - - - - - - - -
+
+
@@ -487,7 +481,13 @@ // 初始化内容 function initData() { + initCorrectionCategorySelect(); + initReceiveWaySelect(); + initCorrectRelieveTypeSelect(); initCaseCategorySelect(); + initFourHistoryInfoCheckbox(); + initThreeInvolveInfoCheckbox(); + initCorrectGroupUserInfoCheckbox(); initOriginalSentenceStrDate(); initOriginalSentenceEndDate(); initCorrectStrDateDate(); @@ -495,6 +495,78 @@ } initData(); + // 初始矫正类别下拉选择 + function initCorrectionCategorySelect() { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/2b9d375d-f48b-4dae-b385-b8dabf06a8f9', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('correctionCategoryTemplate').innerHTML).render(data, function(html) { + document.getElementById('correctionCategoryTemplateBox').innerHTML = html; + }); + form.render('select', 'correctionCategoryTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始接收方式下拉选择 + function initReceiveWaySelect() { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/2ed3c6ea-0ce3-46a0-aff2-a45b756eee29', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('receiveWayTemplate').innerHTML).render(data, function(html) { + document.getElementById('receiveWayTemplateBox').innerHTML = html; + }); + form.render('select', 'receiveWayTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始矫正解除(终止)类型 + function initCorrectRelieveTypeSelect() { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/3f183d3a-ec08-4562-bc2f-ec4a21793fce', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('correctRelieveTypeTemplate').innerHTML).render(data, function(html) { + document.getElementById('correctRelieveTypeTemplateBox').innerHTML = html; + }); + form.render('select', 'correctRelieveTypeTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // "四史"情况 + function initFourHistoryInfoCheckbox() { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/6f5fc00e-dfe2-4c7a-bb7b-114d54ad6fb8', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('fourHistoryInfoTemplate').innerHTML).render(data, function(html) { + document.getElementById('fourHistoryInfoTemplateBox').innerHTML = html; + }); + form.render('checkbox', 'fourHistoryInfoTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // "三涉"情况 threeInvolveInfo + function initThreeInvolveInfoCheckbox() { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/34aefb4b-5918-4de7-a6b8-8e361f76c557', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('threeInvolveInfoTemplate').innerHTML).render(data, function(html) { + document.getElementById('threeInvolveInfoTemplateBox').innerHTML = html; + }); + form.render('checkbox', 'threeInvolveInfoTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 矫正小组人员组成情况 correctGroupUserInfo + function initCorrectGroupUserInfoCheckbox() { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/b30da878-2576-4e70-8a39-4eeee5ad9983', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('correctGroupUserInfoTemplate').innerHTML).render(data, function(html) { + document.getElementById('correctGroupUserInfoTemplateBox').innerHTML = html; + }); + form.render('checkbox', 'correctGroupUserInfoTemplateBox'); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + // 初始化案件类别下拉选择 function initCaseCategorySelect() { top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/e45bbd02-35b3-4f5c-bc2e-ffd924e87abb', []), {}, null, function(code, data, args) { diff --git a/src/main/resources/static/route/communitycorrection/update-communitycorrection.html b/src/main/resources/static/route/communitycorrection/update-communitycorrection.html index 8d8e44b..77e044f 100644 --- a/src/main/resources/static/route/communitycorrection/update-communitycorrection.html +++ b/src/main/resources/static/route/communitycorrection/update-communitycorrection.html @@ -84,16 +84,15 @@
-
- +
+
-
- - - - -
+
+
@@ -246,11 +244,12 @@
-
- - - -
+
+
@@ -269,17 +268,12 @@
-
- - - - - - - - - -
+
+
@@ -426,6 +420,9 @@ initOriginalSentenceEndDate(); initCorrectStrDateDate(); initCorrectEndDateDate(); + initCorrectionCategorySelect(data['correctionCategory']); + initReceiveWaySelect(data['receiveWay']); + initCorrectRelieveTypeSelect(data['correctRelieveType']); initFourHistoryInfoCheckbox(data['fourHistoryInfo']); initThreeInvolveInfoCheckbox(data['threeInvolveInfo']); initCorrectGroupUserInfoCheckbox(data['correctGroupUserInfo']); @@ -439,6 +436,105 @@ } initData(); + // 初始矫正类别下拉选择 + function initCorrectionCategorySelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/2b9d375d-f48b-4dae-b385-b8dabf06a8f9', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('correctionCategoryTemplate').innerHTML).render(data, function(html) { + document.getElementById('correctionCategoryTemplateBox').innerHTML = html; + }); + form.render('select', 'correctionCategoryTemplateBox'); + var selectObj = {}; + selectObj['correctionCategory'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始接收方式下拉选择 + function initReceiveWaySelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/2ed3c6ea-0ce3-46a0-aff2-a45b756eee29', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('receiveWayTemplate').innerHTML).render(data, function(html) { + document.getElementById('receiveWayTemplateBox').innerHTML = html; + }); + form.render('select', 'receiveWayTemplateBox'); + var selectObj = {}; + selectObj['receiveWay'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 初始矫正解除(终止)类型 + function initCorrectRelieveTypeSelect(selectValue) { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/3f183d3a-ec08-4562-bc2f-ec4a21793fce', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('correctRelieveTypeTemplate').innerHTML).render(data, function(html) { + document.getElementById('correctRelieveTypeTemplateBox').innerHTML = html; + }); + form.render('select', 'correctRelieveTypeTemplateBox'); + var selectObj = {}; + selectObj['correctRelieveType'] = selectValue; + form.val('dataForm', selectObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // "四史"情况 + function initFourHistoryInfoCheckbox(selectValues) { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/6f5fc00e-dfe2-4c7a-bb7b-114d54ad6fb8', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('fourHistoryInfoTemplate').innerHTML).render(data, function(html) { + document.getElementById('fourHistoryInfoTemplateBox').innerHTML = html; + }); + form.render('checkbox', 'fourHistoryInfoTemplateBox'); + var checkboxValue = selectValues.split(','); + var checkboxObj = {}; + for(var j = 0, checkbox = checkboxValue[j]; checkbox = checkboxValue[j++];) { + checkboxObj['fourHistoryInfo['+ checkbox +']'] = true; + } + form.val('dataForm', checkboxObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // "三涉"情况 threeInvolveInfo + function initThreeInvolveInfoCheckbox(selectValues) { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/34aefb4b-5918-4de7-a6b8-8e361f76c557', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('threeInvolveInfoTemplate').innerHTML).render(data, function(html) { + document.getElementById('threeInvolveInfoTemplateBox').innerHTML = html; + }); + form.render('checkbox', 'threeInvolveInfoTemplateBox'); + var checkboxValue = selectValues.split(','); + var checkboxObj = {}; + for(var j = 0, checkbox = checkboxValue[j]; checkbox = checkboxValue[j++];) { + checkboxObj['threeInvolveInfo['+ checkbox +']'] = true; + } + form.val('dataForm', checkboxObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + + // 矫正小组人员组成情况 correctGroupUserInfo + function initCorrectGroupUserInfoCheckbox(selectValues) { + top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/b30da878-2576-4e70-8a39-4eeee5ad9983', []), {}, null, function(code, data, args) { + laytpl(document.getElementById('correctGroupUserInfoTemplate').innerHTML).render(data, function(html) { + document.getElementById('correctGroupUserInfoTemplateBox').innerHTML = html; + }); + form.render('checkbox', 'correctGroupUserInfoTemplateBox'); + var checkboxValue = selectValues.split(','); + var checkboxObj = {}; + for(var j = 0, checkbox = checkboxValue[j]; checkbox = checkboxValue[j++];) { + checkboxObj['correctGroupUserInfo['+ checkbox +']'] = true; + } + form.val('dataForm', checkboxObj); + }, function(code, data) { + top.dialog.msg(data.msg); + }); + } + // 初始化案件类别下拉选择 function initCaseCategorySelect(selectValue) { top.restAjax.get(top.restAjax.path('api/datadictionary/listdictionarybyparentid/e45bbd02-35b3-4f5c-bc2e-ffd924e87abb', []), {}, null, function(code, data, args) { @@ -446,7 +542,6 @@ document.getElementById('caseCategorySelectTemplateBox').innerHTML = html; }); form.render('select', 'caseCategorySelectTemplateBox'); - var selectObj = {}; selectObj['caseCategory'] = selectValue; form.val('dataForm', selectObj); @@ -495,36 +590,6 @@ }); } - // 初始化"四史"情况复选 - function initFourHistoryInfoCheckbox(selectValues) { - var checkboxValue = selectValues.split(','); - var checkboxObj = {}; - for(var j = 0, checkbox = checkboxValue[j]; checkbox = checkboxValue[j++];) { - checkboxObj['fourHistoryInfo['+ checkbox +']'] = true; - } - form.val('dataForm', checkboxObj); - } - - // 初始化"三涉"情况复选 - function initThreeInvolveInfoCheckbox(selectValues) { - var checkboxValue = selectValues.split(','); - var checkboxObj = {}; - for(var j = 0, checkbox = checkboxValue[j]; checkbox = checkboxValue[j++];) { - checkboxObj['threeInvolveInfo['+ checkbox +']'] = true; - } - form.val('dataForm', checkboxObj); - } - - // 初始化矫正小组人员组成情况复选 - function initCorrectGroupUserInfoCheckbox(selectValues) { - var checkboxValue = selectValues.split(','); - var checkboxObj = {}; - for(var j = 0, checkbox = checkboxValue[j]; checkbox = checkboxValue[j++];) { - checkboxObj['correctGroupUserInfo['+ checkbox +']'] = true; - } - form.val('dataForm', checkboxObj); - } - function closeBox() { parent.layer.close(parent.layer.getFrameIndex(window.name)); }