From 2174d56cd94037fd7475048fd61a7d8e14d1602c Mon Sep 17 00:00:00 2001 From: "java_cuibaocheng@163.com" Date: Wed, 1 Nov 2023 17:28:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=8F=A3=E6=96=B0=E5=A2=9E=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=20-=20cbc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/areatree/AreaTreeController.java | 45 +++- .../api/areatree/AreaTreeAppController.java | 140 ++++++++++ .../PopulationInfoAppController.java | 12 +- .../route/correct/CorrectRouteController.java | 4 +- .../route/cult/CultRouteController.java | 4 +- .../route/dispute/DisputeRouteController.java | 4 +- .../route/drug/DrugRouteController.java | 4 +- .../petition/PetitionRouteController.java | 4 +- .../route/release/ReleaseRouteController.java | 4 +- .../security/SecurityRouteController.java | 4 +- .../populationinfo/IPopulationInfoDao.java | 2 + .../populationinfo/PopulationInfoBaseDTO.java | 247 ++++++++++++++++++ .../IPopulationInfoService.java | 3 + .../impl/PopulationInfoServiceImpl.java | 57 +++- .../mapper/areatree/areatree-mapper.xml | 8 +- .../populationinfo/population-info-mapper.xml | 59 +++++ .../templates/populationinfo/save.html | 63 ++++- .../templates/populationinfo/update.html | 3 +- 18 files changed, 639 insertions(+), 28 deletions(-) create mode 100644 src/main/java/com/cm/population/controller/app/api/areatree/AreaTreeAppController.java create mode 100644 src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java diff --git a/src/main/java/com/cm/population/controller/api/areatree/AreaTreeController.java b/src/main/java/com/cm/population/controller/api/areatree/AreaTreeController.java index f6b3227..a0c58b3 100644 --- a/src/main/java/com/cm/population/controller/api/areatree/AreaTreeController.java +++ b/src/main/java/com/cm/population/controller/api/areatree/AreaTreeController.java @@ -14,6 +14,7 @@ import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.population.pojo.dtos.areatree.AreaZtreeDTO; import com.cm.population.pojo.dtos.correct.CorrectDTO; +import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO; import com.cm.population.pojo.vos.correct.CorrectVO; import com.cm.population.service.correct.ICorrectService; import com.cm.population.service.populationinfo.IPopulationInfoService; @@ -38,6 +39,32 @@ public class AreaTreeController extends AbstractController { @Autowired private IPopulationInfoService iPopulationInfoService; + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("get/{areaCode}") + public Map get(@PathVariable("areaCode") String areaCode) { + DataAreaDTO dto = iPopulationInfoService.getAreaByCode(areaCode); + Map objectMap = new HashMap<>(); + objectMap.put("label", dto.getAreaName()); + objectMap.put("code", dto.getAreaCode()); + objectMap.put("value", dto.getAreaId()); + objectMap.put("leaf", true); + return objectMap; + } + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("newtree") + public List> tree1(String id) { + String parentId = id == null ? "0" : id; + List list = iPopulationInfoService.listAreaTree(parentId); + List> result = new ArrayList<>(); + for(AreaZtreeDTO dto : list) { + Map objectMap = new HashMap<>(); + objectMap.put("label", dto.getName()); + objectMap.put("code", dto.getAreaCode()); + objectMap.put("value", dto.getId()); + result.add(objectMap); + } + return result; + } @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("huji") @@ -56,7 +83,7 @@ public class AreaTreeController extends AbstractController { zTreeDTO1.setIsParent(true); list.add(zTreeDTO1); AreaZtreeDTO zTreeDTO2 = new AreaZtreeDTO(); - zTreeDTO2.setId("baotou.getAreaId()"); + zTreeDTO2.setId(baotou.getAreaId()); zTreeDTO2.setName("包头市(非高新区)"); zTreeDTO2.setTitle("包头市(非高新区)"); zTreeDTO2.setIsParent(true); @@ -78,7 +105,7 @@ public class AreaTreeController extends AbstractController { getParent(names, dto.getpId()); dto.setTitle(StringUtils.join(names, "/")); } - if (dataAreaDTO.getAreaCode().equals("150200000000")) { + if (dataAreaDTO != null && dataAreaDTO.getAreaCode().equals("150200000000")) { Iterator iterator = list.iterator(); while(iterator.hasNext()) { ZTreeDTO zTreeDTO = iterator.next(); @@ -100,7 +127,7 @@ public class AreaTreeController extends AbstractController { public List tree(String id) { String parentId = id; if (StringUtils.isEmpty(id)) { - parentId = "752234"; // 默认查找全国 + parentId = "752234"; } List list = iPopulationInfoService.listAreaTree(parentId); for(AreaZtreeDTO dto : list) { @@ -120,9 +147,11 @@ public class AreaTreeController extends AbstractController { @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) @PostMapping("list") public List list(String id) { + PopulationInfoBaseDTO dto1 = iPopulationInfoService.getBase("b20004a6-0c8e-4fe3-a9af-998aeab53513"); + System.out.println(dto1); String parentId = id; if (StringUtils.isEmpty(id)) { - parentId = "752234"; // 默认查找全国 + parentId = "0"; // 默认查找全国 } List list = iPopulationInfoService.listAreaTree(parentId); for(AreaZtreeDTO dto : list) { @@ -142,4 +171,12 @@ public class AreaTreeController extends AbstractController { } } + public void getParentBaoTou(ArrayList names, String pId) { + DataAreaDTO areaDTO = iPopulationInfoService.getAreaById(pId); + if(areaDTO != null && !areaDTO.getAreaLevel().equals("1") && !areaDTO.getAreaLevel().equals("0")) { + names.add(0, areaDTO.getAreaName()); + getParentBaoTou(names, areaDTO.getAreaParentId()); + } + } + } \ No newline at end of file diff --git a/src/main/java/com/cm/population/controller/app/api/areatree/AreaTreeAppController.java b/src/main/java/com/cm/population/controller/app/api/areatree/AreaTreeAppController.java new file mode 100644 index 0000000..98af0da --- /dev/null +++ b/src/main/java/com/cm/population/controller/app/api/areatree/AreaTreeAppController.java @@ -0,0 +1,140 @@ +package com.cm.population.controller.app.api.areatree; + +import com.cm.common.base.AbstractController; +import com.cm.common.constants.ISystemConstant; +import com.cm.common.plugin.pojo.dtos.dataarea.DataAreaDTO; +import com.cm.common.pojo.dtos.ZTreeDTO; +import com.cm.common.result.ErrorResult; +import com.cm.population.pojo.dtos.areatree.AreaZtreeDTO; +import com.cm.population.service.populationinfo.IPopulationInfoService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.*; + +/** + * @ClassName: CorrectController + * @Description: 特殊人口-社区矫正 + * @Author: CodeFactory + * @Date: 2023-10-25 11:40:23 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "特殊人口-社区矫正接口") +@RestController +@RequestMapping(ISystemConstant.APP_PREFIX + "/areatree") +public class AreaTreeAppController extends AbstractController { + + @Autowired + private IPopulationInfoService iPopulationInfoService; + + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("huji") + public List huji(String id) { + // 查找包头市 + DataAreaDTO baotou = iPopulationInfoService.getAreaByCode("150200000000"); + // 查找包头稀土高新技术产业开发区 + DataAreaDTO gaoxin = iPopulationInfoService.getAreaByCode("150271000000"); + String parentId = id; + if (StringUtils.isEmpty(id)) { + List list = new ArrayList<>(); + AreaZtreeDTO zTreeDTO1 = new AreaZtreeDTO(); + zTreeDTO1.setId("0"); + zTreeDTO1.setName("非包头市"); + zTreeDTO1.setTitle("非包头市"); + zTreeDTO1.setIsParent(true); + list.add(zTreeDTO1); + AreaZtreeDTO zTreeDTO2 = new AreaZtreeDTO(); + zTreeDTO2.setId(baotou.getAreaId()); + zTreeDTO2.setName("包头市(非高新区)"); + zTreeDTO2.setTitle("包头市(非高新区)"); + zTreeDTO2.setIsParent(true); + list.add(zTreeDTO2); + AreaZtreeDTO zTreeDTO3 = new AreaZtreeDTO(); + zTreeDTO3.setId(gaoxin.getAreaId()); + zTreeDTO3.setName("包头市(高新区)"); + zTreeDTO3.setTitle("包头市(高新区)"); + zTreeDTO3.setIsParent(true); + list.add(zTreeDTO3); + return list; + } + DataAreaDTO dataAreaDTO = iPopulationInfoService.getAreaById(parentId); + Map params = new HashMap<>(); + List list = iPopulationInfoService.listAreaTree(parentId); + for(AreaZtreeDTO dto : list) { + ArrayList names = new ArrayList<>(); + names.add(dto.getName()); + getParent(names, dto.getpId()); + dto.setTitle(StringUtils.join(names, "/")); + } + if (dataAreaDTO.getAreaCode().equals("150200000000")) { + Iterator iterator = list.iterator(); + while(iterator.hasNext()) { + ZTreeDTO zTreeDTO = iterator.next(); + if (zTreeDTO.getId().equals(gaoxin.getAreaId())) { + iterator.remove(); + } + } + } + return list; + } + + /** + * 高新区地区 + * @param id + * @return + */ + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("tree") + public List tree(String id) { + String parentId = id; + if (StringUtils.isEmpty(id)) { + parentId = "752234"; + } + List list = iPopulationInfoService.listAreaTree(parentId); + for(AreaZtreeDTO dto : list) { + ArrayList names = new ArrayList<>(); + names.add(dto.getName()); + getParent(names, dto.getpId()); + dto.setTitle(StringUtils.join(names, "/")); + } + return list; + } + + /** + * 全国地区属 + * @param id + * @return + */ + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list") + public List list(String id) { + String parentId = id; + if (StringUtils.isEmpty(id)) { + parentId = "0"; // 默认查找全国 + } + List list = iPopulationInfoService.listAreaTree(parentId); + for(AreaZtreeDTO dto : list) { + ArrayList names = new ArrayList<>(); + names.add(dto.getName()); + getParent(names, dto.getpId()); + dto.setTitle(StringUtils.join(names, "/")); + } + return list; + } + + public void getParent(ArrayList names, String pId) { + DataAreaDTO areaDTO = iPopulationInfoService.getAreaById(pId); + if(areaDTO != null) { + names.add(0, areaDTO.getAreaName()); + getParent(names, areaDTO.getAreaParentId()); + } + } + +} \ No newline at end of file diff --git a/src/main/java/com/cm/population/controller/app/api/populationinfo/PopulationInfoAppController.java b/src/main/java/com/cm/population/controller/app/api/populationinfo/PopulationInfoAppController.java index e096494..207635e 100644 --- a/src/main/java/com/cm/population/controller/app/api/populationinfo/PopulationInfoAppController.java +++ b/src/main/java/com/cm/population/controller/app/api/populationinfo/PopulationInfoAppController.java @@ -81,12 +81,22 @@ public class PopulationInfoAppController extends AbstractController { return populationInfoService.get(populationInfoId); } + @ApiOperation(value = "基础人口按身份证查询", notes = "基础人口按身份证查询") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("query/{idcard}") + public PopulationInfoDTO query(@RequestHeader("token") String token, @PathVariable("idcard") String idcard) { + return populationInfoService.getByIdcard(idcard); + } + @ApiOperation(value = "基础人口信息列表", notes = "基础人口信息列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header") }) @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) - @GetMapping("list") + @GetMapping("list") public List list(@RequestHeader("token") String token) { Map params = requestParams(); return populationInfoService.list(params); diff --git a/src/main/java/com/cm/population/controller/route/correct/CorrectRouteController.java b/src/main/java/com/cm/population/controller/route/correct/CorrectRouteController.java index b84c4c9..975633f 100644 --- a/src/main/java/com/cm/population/controller/route/correct/CorrectRouteController.java +++ b/src/main/java/com/cm/population/controller/route/correct/CorrectRouteController.java @@ -37,8 +37,8 @@ public class CorrectRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("correct/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/controller/route/cult/CultRouteController.java b/src/main/java/com/cm/population/controller/route/cult/CultRouteController.java index 579179e..f3214bc 100644 --- a/src/main/java/com/cm/population/controller/route/cult/CultRouteController.java +++ b/src/main/java/com/cm/population/controller/route/cult/CultRouteController.java @@ -40,8 +40,8 @@ public class CultRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("cult/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/controller/route/dispute/DisputeRouteController.java b/src/main/java/com/cm/population/controller/route/dispute/DisputeRouteController.java index b2434fa..c3bdfa2 100644 --- a/src/main/java/com/cm/population/controller/route/dispute/DisputeRouteController.java +++ b/src/main/java/com/cm/population/controller/route/dispute/DisputeRouteController.java @@ -40,8 +40,8 @@ public class DisputeRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("dispute/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/controller/route/drug/DrugRouteController.java b/src/main/java/com/cm/population/controller/route/drug/DrugRouteController.java index 0cbccca..91e4454 100644 --- a/src/main/java/com/cm/population/controller/route/drug/DrugRouteController.java +++ b/src/main/java/com/cm/population/controller/route/drug/DrugRouteController.java @@ -40,8 +40,8 @@ public class DrugRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("drug/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/controller/route/petition/PetitionRouteController.java b/src/main/java/com/cm/population/controller/route/petition/PetitionRouteController.java index 832a9d2..258e69f 100644 --- a/src/main/java/com/cm/population/controller/route/petition/PetitionRouteController.java +++ b/src/main/java/com/cm/population/controller/route/petition/PetitionRouteController.java @@ -40,8 +40,8 @@ public class PetitionRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("petition/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/controller/route/release/ReleaseRouteController.java b/src/main/java/com/cm/population/controller/route/release/ReleaseRouteController.java index e159a96..e8e60ce 100644 --- a/src/main/java/com/cm/population/controller/route/release/ReleaseRouteController.java +++ b/src/main/java/com/cm/population/controller/route/release/ReleaseRouteController.java @@ -35,8 +35,8 @@ public class ReleaseRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("release/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/controller/route/security/SecurityRouteController.java b/src/main/java/com/cm/population/controller/route/security/SecurityRouteController.java index 8abe57c..278100d 100644 --- a/src/main/java/com/cm/population/controller/route/security/SecurityRouteController.java +++ b/src/main/java/com/cm/population/controller/route/security/SecurityRouteController.java @@ -40,8 +40,8 @@ public class SecurityRouteController extends AbstractController { } @GetMapping("list") - public ModelAndView list(String populitionInfoId) { - PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populitionInfoId); + public ModelAndView list(String populationInfoId) { + PopulationInfoDTO populationInfoDTO = iPopulationInfoService.get(populationInfoId); ModelAndView mv = new ModelAndView("security/list"); mv.addObject("dto", populationInfoDTO); return mv; diff --git a/src/main/java/com/cm/population/dao/populationinfo/IPopulationInfoDao.java b/src/main/java/com/cm/population/dao/populationinfo/IPopulationInfoDao.java index 18ee191..c056768 100644 --- a/src/main/java/com/cm/population/dao/populationinfo/IPopulationInfoDao.java +++ b/src/main/java/com/cm/population/dao/populationinfo/IPopulationInfoDao.java @@ -5,6 +5,7 @@ import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; import com.cm.population.pojo.bos.populationinfo.PopulationInfoBO; +import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO; import com.cm.population.pojo.pos.populationinfo.PopulationInfoPO; import com.cm.population.pojo.dtos.populationinfo.PopulationInfoDTO; import org.springframework.stereotype.Repository; @@ -116,4 +117,5 @@ public interface IPopulationInfoDao { */ Integer count(Map params) throws SearchException; + PopulationInfoBaseDTO getBase(Map params); } \ No newline at end of file diff --git a/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java b/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java new file mode 100644 index 0000000..3f66b26 --- /dev/null +++ b/src/main/java/com/cm/population/pojo/dtos/populationinfo/PopulationInfoBaseDTO.java @@ -0,0 +1,247 @@ +package com.cm.population.pojo.dtos.populationinfo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.StringUtils; + +@ApiModel +public class PopulationInfoBaseDTO { + + @ApiModelProperty(name = "isCult", value = "是否为涉邪人员(是或否)") + private String isCult = "否"; + @ApiModelProperty(name = "isDrug", value = "是否为吸毒人员(是或否)") + private String isDrug = "否"; + @ApiModelProperty(name = "isDispute", value = "是否有矛盾纠纷(是或否)") + private String isDispute = "否"; + @ApiModelProperty(name = "isPetition", value = "是否为重点上访户(是或否)") + private String isPetition = "否"; + @ApiModelProperty(name = "isCorrect", value = "是否为社区矫正(是或否)") + private String isCorrect = "否"; + @ApiModelProperty(name = "isRelease", value = "是否为刑满释放(是或否)") + private String isRelease = "否"; + @ApiModelProperty(name = "isSecurity", value = "是否有社会治安记录(是或否)") + private String isSecurity = "否"; + @ApiModelProperty(name = "isOldage", value = "是否为老年人(是或否)") + private String isOldage = "否"; + @ApiModelProperty(name = "isDisability", value = "是否为残疾人(是或否)") + private String isDisability = "否"; + @ApiModelProperty(name = "isMilitary", value = "是否为军人(是或否)") + private String isMilitary = "否"; + @ApiModelProperty(name = "isSuccour", value = "是否为社会救助(是或否)") + private String isSuccour = "否"; + @ApiModelProperty(name = "isParty", value = "是否为党员(是或否)") + private String isParty = "否"; + @ApiModelProperty(name = "populationInfoId", value = "人口ID") + private String populationInfoId; + @ApiModelProperty(name = "name", value = "姓名") + private String name; + @ApiModelProperty(name = "idcard", value = "证件") + private String idcard; + @ApiModelProperty(name = "idcardType", value = "证件类型") + private String idcardType; + @ApiModelProperty(name = "birthday", value = "生日") + private String birthday; + @ApiModelProperty(name = "sex", value = "性别") + private String sex; + @ApiModelProperty(name = "nation", value = "民族") + private String nation; + @ApiModelProperty(name = "education", value = "文化程度") + private String education; + @ApiModelProperty(name = "phone", value = "联系电话") + private String phone; + + public String getIsCult() { + return isCult; + } + + public void setIsCult(String isCult) { + this.isCult = isCult; + } + + public String getIsDrug() { + return isDrug; + } + + public void setIsDrug(String isDrug) { + this.isDrug = isDrug; + } + + public String getIsDispute() { + return isDispute; + } + + public void setIsDispute(String isDispute) { + this.isDispute = isDispute; + } + + public String getIsPetition() { + return isPetition; + } + + public void setIsPetition(String isPetition) { + this.isPetition = isPetition; + } + + public String getIsCorrect() { + return isCorrect; + } + + public void setIsCorrect(String isCorrect) { + this.isCorrect = isCorrect; + } + + public String getIsRelease() { + return isRelease; + } + + public void setIsRelease(String isRelease) { + this.isRelease = isRelease; + } + + public String getIsSecurity() { + return isSecurity; + } + + public void setIsSecurity(String isSecurity) { + this.isSecurity = isSecurity; + } + + public String getIsOldage() { + return StringUtils.isEmpty(isOldage) ? "否" : isOldage; + } + + public void setIsOldage(String isOldage) { + this.isOldage = isOldage; + } + + public String getIsDisability() { + return StringUtils.isEmpty(isDisability) ? "否" : isDisability; + } + + public void setIsDisability(String isDisability) { + this.isDisability = isDisability; + } + + public String getIsMilitary() { + return StringUtils.isEmpty(isMilitary) ? "否" : isMilitary; + } + + public void setIsMilitary(String isMilitary) { + this.isMilitary = isMilitary; + } + + public String getIsSuccour() { + return StringUtils.isEmpty(isSuccour) ? "否" : isSuccour; + } + + public void setIsSuccour(String isSuccour) { + this.isSuccour = isSuccour; + } + + public String getIsParty() { + return StringUtils.isEmpty(isParty) ? "否" : isParty; + } + + public void setIsParty(String isParty) { + this.isParty = isParty; + } + + public String getPopulationInfoId() { + return populationInfoId; + } + + public void setPopulationInfoId(String populationInfoId) { + this.populationInfoId = populationInfoId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public String getIdcardType() { + return idcardType; + } + + public void setIdcardType(String idcardType) { + this.idcardType = idcardType; + } + + public String getBirthday() { + return birthday; + } + + public void setBirthday(String birthday) { + this.birthday = birthday; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + + public String getNation() { + return nation; + } + + public void setNation(String nation) { + this.nation = nation; + } + + public String getEducation() { + return education; + } + + public void setEducation(String education) { + this.education = education; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + @Override + public String toString() { + return "PopulationInfoBaseDTO{" + + "isCult='" + isCult + '\'' + + ", isDrug='" + isDrug + '\'' + + ", isDispute='" + isDispute + '\'' + + ", isPetition='" + isPetition + '\'' + + ", isCorrect='" + isCorrect + '\'' + + ", isRelease='" + isRelease + '\'' + + ", isSecurity='" + isSecurity + '\'' + + ", isOldage='" + isOldage + '\'' + + ", isDisability='" + isDisability + '\'' + + ", isMilitary='" + getIsMilitary() + '\'' + + ", isSuccour='" + isSuccour + '\'' + + ", isParty='" + isParty + '\'' + + ", populationInfoId='" + populationInfoId + '\'' + + ", name='" + name + '\'' + + ", idcard='" + idcard + '\'' + + ", idcardType='" + idcardType + '\'' + + ", birthday='" + birthday + '\'' + + ", sex='" + sex + '\'' + + ", nation='" + nation + '\'' + + ", education='" + education + '\'' + + ", phone='" + phone + '\'' + + '}'; + } +} diff --git a/src/main/java/com/cm/population/service/populationinfo/IPopulationInfoService.java b/src/main/java/com/cm/population/service/populationinfo/IPopulationInfoService.java index db1b38b..470492a 100644 --- a/src/main/java/com/cm/population/service/populationinfo/IPopulationInfoService.java +++ b/src/main/java/com/cm/population/service/populationinfo/IPopulationInfoService.java @@ -4,6 +4,7 @@ import com.cm.common.plugin.pojo.dtos.dataarea.DataAreaDTO; import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResultList; import com.cm.population.pojo.dtos.areatree.AreaZtreeDTO; +import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO; import com.cm.population.pojo.dtos.populationinfo.PopulationInfoDTO; import com.cm.population.pojo.vos.populationinfo.PopulationInfoVO; import com.cm.population.pojo.bos.populationinfo.PopulationInfoBO; @@ -24,6 +25,8 @@ public interface IPopulationInfoService { DataAreaDTO getAreaById(String id); List listAreaTree(String parentId); + PopulationInfoBaseDTO getBase(String populationInfoId); + /** * 新增基础人口信息 * diff --git a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java index c627f19..4207159 100644 --- a/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java +++ b/src/main/java/com/cm/population/service/populationinfo/impl/PopulationInfoServiceImpl.java @@ -11,11 +11,26 @@ import com.cm.common.utils.UUIDUtil; import com.cm.population.dao.areatree.IAreatreeDao; import com.cm.population.dao.populationinfo.IPopulationInfoDao; import com.cm.population.pojo.dtos.areatree.AreaZtreeDTO; +import com.cm.population.pojo.dtos.correct.CorrectDTO; +import com.cm.population.pojo.dtos.cult.CultDTO; +import com.cm.population.pojo.dtos.dispute.DisputeDTO; +import com.cm.population.pojo.dtos.drug.DrugDTO; +import com.cm.population.pojo.dtos.petition.PetitionDTO; +import com.cm.population.pojo.dtos.populationinfo.PopulationInfoBaseDTO; import com.cm.population.pojo.dtos.populationinfo.PopulationInfoDTO; +import com.cm.population.pojo.dtos.release.ReleaseDTO; +import com.cm.population.pojo.dtos.security.SecurityDTO; import com.cm.population.pojo.vos.populationinfo.PopulationInfoVO; import com.cm.population.pojo.bos.populationinfo.PopulationInfoBO; import com.cm.population.pojo.pos.populationinfo.PopulationInfoPO; +import com.cm.population.service.correct.ICorrectService; +import com.cm.population.service.cult.ICultService; +import com.cm.population.service.dispute.IDisputeService; +import com.cm.population.service.drug.IDrugService; +import com.cm.population.service.petition.IPetitionService; import com.cm.population.service.populationinfo.IPopulationInfoService; +import com.cm.population.service.release.IReleaseService; +import com.cm.population.service.security.ISecurityService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; @@ -66,6 +81,44 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul } return list; } + @Autowired + private ICorrectService iCorrectService; + @Autowired + private ICultService iCultService; + @Autowired + private IDisputeService iDisputeService; + @Autowired + private IDrugService iDrugService; + @Autowired + private IPetitionService iPetitionService; + @Autowired + private IReleaseService iReleaseService; + @Autowired + private ISecurityService iSecurityService; + @Override + public PopulationInfoBaseDTO getBase(String populationInfoId) { + Map query = new HashMap<>(); + query.put("populationInfoId", populationInfoId); + PopulationInfoBaseDTO dto = populationInfoDao.getBase(query); + if (dto == null) { + return null; + } + List correct = iCorrectService.list(query); + List cult = iCultService.list(query); + List dispute = iDisputeService.list(query); + List drug = iDrugService.list(query); + List petition = iPetitionService.list(query); + List release = iReleaseService.list(query); + List security = iSecurityService.list(query); + dto.setIsCorrect(correct.size() > 0 ? "是" : "否"); + dto.setIsCult(cult.size() > 0 ? "是" : "否"); + dto.setIsDispute(dispute.size() > 0 ? "是" : "否"); + dto.setIsDrug(drug.size() > 0 ? "是" : "否"); + dto.setIsPetition(petition.size() > 0 ? "是" : "否"); + dto.setIsRelease(release.size() > 0 ? "是" : "否"); + dto.setIsSecurity(security.size() > 0 ? "是" : "否"); + return dto; + } @Override public void save(PopulationInfoVO populationInfoVO) { @@ -92,7 +145,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul String areaCode = populationInfoVO.getDomicileAreaCode(); if(areaCode.startsWith("150271")) { //包头稀土高新技术产业开发区 populationInfoVO.setDomicileAddressType("3"); - }else if(areaCode.startsWith("150200")) { //包头市 + }else if(areaCode.startsWith("1502")) { //包头市 populationInfoVO.setDomicileAddressType("2"); }else { //非包头市 populationInfoVO.setDomicileAddressType("1"); @@ -148,7 +201,7 @@ public class PopulationInfoServiceImpl extends AbstractService implements IPopul String areaCode = populationInfoVO.getDomicileAreaCode(); if(areaCode.startsWith("150271")) { //包头稀土高新技术产业开发区 populationInfoVO.setDomicileAddressType("3"); - }else if(areaCode.startsWith("150200")) { //包头市 + }else if(areaCode.startsWith("1502")) { //包头市 populationInfoVO.setDomicileAddressType("2"); }else { //非包头市 populationInfoVO.setDomicileAddressType("1"); diff --git a/src/main/resources/mybatis/mapper/areatree/areatree-mapper.xml b/src/main/resources/mybatis/mapper/areatree/areatree-mapper.xml index a3063f7..2521a24 100644 --- a/src/main/resources/mybatis/mapper/areatree/areatree-mapper.xml +++ b/src/main/resources/mybatis/mapper/areatree/areatree-mapper.xml @@ -2,6 +2,8 @@ + + @@ -26,7 +28,7 @@ - SELECT * FROM @@ -35,7 +37,7 @@ is_delete = 0 AND area_parent_id = #{areaParentId} - SELECT t1.area_id, t1.area_parent_id, @@ -71,7 +73,7 @@ - SELECT COUNT(*) FROM diff --git a/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml b/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml index dc22940..5945eb4 100644 --- a/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml +++ b/src/main/resources/mybatis/mapper/populationinfo/population-info-mapper.xml @@ -2,6 +2,23 @@ + + + + + + + + + + + + + + + + + @@ -252,7 +269,11 @@ mother_phone, relationship, domicile_address, + domicile_area_code, + domicile_area_name, origin_address, + origin_area_code, + origin_area_name, flow_time, flow_reason, flow_reasontext, @@ -269,6 +290,8 @@ disability_number, disability_carnumber, disability_address, + disability_area_code, + disability_area_name, disability_income, disability_house, disability_time, @@ -325,7 +348,11 @@ #{motherPhone}, #{relationship}, #{domicileAddress}, + #{domicileAreaCode}, + #{domicileAreaName}, #{originAddress}, + #{originAreaCode}, + #{originAreaName}, #{flowTime}, #{flowReason}, #{flowReasontext}, @@ -342,6 +369,8 @@ #{disabilityNumber}, #{disabilityCarnumber}, #{disabilityAddress}, + #{disabilityAreaCode}, + #{disabilityAreaName}, #{disabilityIncome}, #{disabilityHouse}, #{disabilityTime}, @@ -617,6 +646,36 @@ population_info_id = #{populationInfoId} + + + + + + + + +