|
@@ -4,6 +4,7 @@ import com.alibaba.cloud.commons.lang.StringUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
+import org.springblade.core.tool.utils.BeanUtil;
|
|
|
import org.springblade.modules.entity.*;
|
|
|
import org.springblade.modules.feign.*;
|
|
|
import org.springblade.modules.service.BzdzService;
|
|
@@ -25,6 +26,8 @@ public class BzdzController {
|
|
|
|
|
|
private BzdzService bzdzService;
|
|
|
|
|
|
+ private RkxxFeign rkxxFeign;
|
|
|
+
|
|
|
private SydwFeign sydwFeign;
|
|
|
|
|
|
private RhzfFwFeign rhzfFwFeign;
|
|
@@ -54,7 +57,12 @@ public class BzdzController {
|
|
|
*/
|
|
|
@GetMapping("/getLdList-pt")
|
|
|
public R getLdListPt(@RequestParam Map<String, Object> params) {
|
|
|
- params.put("gajgdm", AuthUtil.getDeptId());
|
|
|
+ Dept byId = bzdzService.selectDeptById(AuthUtil.getDeptId().split(",")[0]);
|
|
|
+ if (byId.getDeptCategory() == 7) {
|
|
|
+ params.put("gajgdm", byId.getFjId());
|
|
|
+ } else {
|
|
|
+ params.put("gajgdm", AuthUtil.getDeptId());
|
|
|
+ }
|
|
|
List<LdBzdzVO> ldList = bzdzService.getJzwList(params);
|
|
|
return R.data(GsonUtils.toGsonStr(ldList));
|
|
|
}
|
|
@@ -87,7 +95,7 @@ public class BzdzController {
|
|
|
public R bzdzDetail(@RequestParam Map<String, Object> params) {
|
|
|
BzdzEntity bzdz = bzdzService.bzdzDetail(params);
|
|
|
if (bzdz != null) {
|
|
|
- List<FzLsVO> list = bzdzService.selectFzLs(bzdz.getFzid());
|
|
|
+ List<FzLsVO> list = bzdzService.selectFzLs(bzdz.getId());
|
|
|
bzdz.setFzls(list);
|
|
|
}
|
|
|
return R.data(bzdz);
|
|
@@ -98,17 +106,7 @@ public class BzdzController {
|
|
|
*/
|
|
|
@PostMapping("fzUpdate")
|
|
|
public R fzUpdate(@RequestBody BzdzEntity bzdzEntity) {
|
|
|
- FwFzEntity fz = bzdzService.selectByFzId(bzdzEntity.getFzid());
|
|
|
- if (fz != null) {
|
|
|
- FzLsEntity fzLsEntity = new FzLsEntity();
|
|
|
- BeanUtils.copyProperties(fz, fzLsEntity);
|
|
|
- fz.setCreateUser(AuthUtil.getUserId());
|
|
|
- fz.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- fz.setCreateTime(new Date());
|
|
|
- rhzfFzLsFeign.fzlsSave(fzLsEntity);
|
|
|
- }
|
|
|
bzdzEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- bzdzEntity.setJz(Integer.valueOf(bzdzEntity.getSfzcjz()));
|
|
|
return R.data(bzdzService.fzUpdate(bzdzEntity));
|
|
|
}
|
|
|
|
|
@@ -126,7 +124,7 @@ public class BzdzController {
|
|
|
fwLsEntity.setFwMj(fwInfoEntity.getFwMj());
|
|
|
fwLsEntity.setFwJs(fwInfoEntity.getFwJs());
|
|
|
fwLsEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- fwLsEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ fwLsEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
rhzfFwLsFeign.fwlsSave(fwLsEntity);
|
|
|
fwInfoEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
fwInfoEntity.setUpdateTime(new Date());
|
|
@@ -171,14 +169,14 @@ public class BzdzController {
|
|
|
} else {
|
|
|
fwInfo.setDzType(0);
|
|
|
fwInfo.setCreateUser(AuthUtil.getUserId());
|
|
|
- fwInfo.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ fwInfo.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
rhzfFwFeign.fwSave(fwInfo);
|
|
|
if (rhzfSaveVO.getFzInfo() != null){
|
|
|
BzdzEntity bzdz = bzdzService.selectFw(fwInfo.getDzbm());
|
|
|
rhzfSaveVO.getFzInfo().setFwId(bzdz.getId());
|
|
|
rhzfSaveVO.getFzInfo().setType(0);
|
|
|
rhzfSaveVO.getFzInfo().setCreateUser(AuthUtil.getUserId());
|
|
|
- rhzfSaveVO.getFzInfo().setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ rhzfSaveVO.getFzInfo().setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
rhzfFzFeign.fzSave(rhzfSaveVO.getFzInfo());
|
|
|
}
|
|
|
}
|
|
@@ -192,18 +190,18 @@ public class BzdzController {
|
|
|
// fwInfo.setTimes(oldRecord.getTimes() + 1);
|
|
|
// fwInfoService.updateById(fwInfo);
|
|
|
// }
|
|
|
- // 保存房屋操作记录
|
|
|
+// // 保存房屋操作记录
|
|
|
// RhzfFwEntity fwLogEntity = new RhzfFwEntity();
|
|
|
// BeanUtils.copyProperties(fwInfo, fwLogEntity);
|
|
|
// fwLogEntity.setMjId(mjId);
|
|
|
// fwLogService.save(fwLogEntity);
|
|
|
- // 保存房主信息
|
|
|
+// // 保存房主信息
|
|
|
// if (null == oldRecord) {
|
|
|
// rhzfSaveVO.getFzInfo().setFwId(fwInfo.getId());
|
|
|
// rhzfSaveVO.getFzInfo().setMjId(mjId);
|
|
|
// rhzfFzFeign.fzSave(rhzfSaveVO.getFzInfo());
|
|
|
// }
|
|
|
- // 保存房主操作记录
|
|
|
+// // 保存房主操作记录
|
|
|
// RhzfFzEntity fzLogEntity = new RhzfFzEntity();
|
|
|
// BeanUtils.copyProperties(rhzfSaveVO.getFzInfo(), fzLogEntity);
|
|
|
// fzLogEntity.setMjId(mjId);
|
|
@@ -222,230 +220,230 @@ public class BzdzController {
|
|
|
return R.fail("请先创建实有房屋");
|
|
|
}
|
|
|
//if (null != rhzfSaveVO.getSyjzryList() && !rhzfSaveVO.getSyjzryList().isEmpty()) {
|
|
|
- //for (SyjzryVO syjzryVO : rhzfSaveVO.getSyjzryList()) {
|
|
|
- if (syjzryVO.getIsDeleted() != 1 && !syjzryVO.getRyType().equals("境外人口") && StringUtils.isBlank(syjzryVO.getRySfzh())) {
|
|
|
- return R.fail("请填写身份证号");
|
|
|
- }
|
|
|
- Long ryId = 0L;
|
|
|
- int type = 1; // 1=新增 2=修改 3=删除
|
|
|
- if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
- // 常住人口
|
|
|
- RyCzrkEntity czrkEntity = new RyCzrkEntity();
|
|
|
- BeanUtils.copyProperties(syjzryVO, czrkEntity);
|
|
|
- czrkEntity.setFwId(bzdz.getId());
|
|
|
- czrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
- czrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- czrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- czrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- BzdzEntity czrk = bzdzService.selectCzrkBySfzh(czrkEntity.getRySfzh());
|
|
|
- if (czrk == null) {
|
|
|
- czrkEntity.setMjId(mjId);
|
|
|
- rhzfCzrkFeign.czrkSave(czrkEntity);
|
|
|
- } else if (!czrkEntity.getDzbm().equals(czrk.getDzbm())) {
|
|
|
- RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
- ryLs.setFwId(czrk.getFwId());
|
|
|
- ryLs.setRyId(czrk.getId());
|
|
|
- ryLs.setDzbm(czrk.getDzbm());
|
|
|
- ryLs.setRyType(syjzryVO.getRyType());
|
|
|
- ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
- ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
- ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
- ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
- ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
- ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
- ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
- ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
- ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
- ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
- ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setIsDeleted(1);
|
|
|
- rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
- czrkEntity.setId(czrk.getId());
|
|
|
- rhzfCzrkFeign.czrkUpdate(czrkEntity);
|
|
|
- }
|
|
|
- ryId = bzdzService.selectCzrkId(czrkEntity);
|
|
|
- } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
- // 境外人口
|
|
|
- RyJwrkEntity jwrkEntity = new RyJwrkEntity();
|
|
|
- BeanUtils.copyProperties(syjzryVO, jwrkEntity);
|
|
|
- jwrkEntity.setFwId(bzdz.getId());
|
|
|
- jwrkEntity.setRyMz(syjzryVO.getRyYwm());
|
|
|
- jwrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
- jwrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- jwrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- jwrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- BzdzEntity jwrk = bzdzService.selectJwrkByZjhm(jwrkEntity.getRyZjhm());
|
|
|
- if (jwrk == null) {
|
|
|
- jwrkEntity.setMjId(mjId);
|
|
|
- rhzfJwrkFeign.jwrkSave(jwrkEntity);
|
|
|
- } else if (!jwrkEntity.getDzbm().equals(jwrk.getDzbm())) {
|
|
|
- RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
- ryLs.setFwId(jwrk.getFwId());
|
|
|
- ryLs.setRyId(jwrk.getId());
|
|
|
- ryLs.setDzbm(jwrk.getDzbm());
|
|
|
- ryLs.setRyType(syjzryVO.getRyType());
|
|
|
- ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
- ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
- ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
- ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
- ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
- ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
- ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
- ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
- ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
- ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
- ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setIsDeleted(1);
|
|
|
- rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
- jwrkEntity.setId(jwrk.getId());
|
|
|
- rhzfJwrkFeign.jwrkUpdate(jwrkEntity);
|
|
|
- }
|
|
|
- ryId = bzdzService.selectJwrkId(jwrkEntity);
|
|
|
- } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
- // 寄住人口
|
|
|
- RyJzrkEntity jzrkEntity = new RyJzrkEntity();
|
|
|
- BeanUtils.copyProperties(syjzryVO, jzrkEntity);
|
|
|
- jzrkEntity.setFwId(bzdz.getId());
|
|
|
- jzrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
- jzrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- jzrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- jzrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- BzdzEntity jzrk = bzdzService.selectJzrkBySfzh(jzrkEntity.getRySfzh());
|
|
|
- if (jzrk == null) {
|
|
|
- jzrkEntity.setMjId(mjId);
|
|
|
- rhzfJzrkFeign.jzrkSave(jzrkEntity);
|
|
|
- } else if (!jzrkEntity.getDzbm().equals(jzrk.getDzbm())) {
|
|
|
- RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
- ryLs.setFwId(jzrk.getFwId());
|
|
|
- ryLs.setRyId(jzrk.getId());
|
|
|
- ryLs.setDzbm(jzrk.getDzbm());
|
|
|
- ryLs.setRyType(syjzryVO.getRyType());
|
|
|
- ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
- ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
- ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
- ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
- ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
- ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
- ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
- ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
- ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
- ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
- ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setIsDeleted(1);
|
|
|
- rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
- jzrkEntity.setId(jzrk.getId());
|
|
|
- rhzfJzrkFeign.jzrkUpdate(jzrkEntity);
|
|
|
- }
|
|
|
- ryId = bzdzService.selectJzrkId(jzrkEntity);
|
|
|
- } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
- // 未落常口
|
|
|
- RyWlrkEntity wlrkEntity = new RyWlrkEntity();
|
|
|
- BeanUtils.copyProperties(syjzryVO, wlrkEntity);
|
|
|
- wlrkEntity.setFwId(bzdz.getId());
|
|
|
- wlrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
- wlrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- wlrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- wlrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- BzdzEntity wlrk = bzdzService.selectWlrkBySfzh(wlrkEntity.getRySfzh());
|
|
|
- if (wlrk == null) {
|
|
|
- wlrkEntity.setMjId(mjId);
|
|
|
- rhzfWlrkFeign.wlrkSave(wlrkEntity);
|
|
|
- } else if (!wlrkEntity.getDzbm().equals(wlrk.getDzbm())) {
|
|
|
- RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
- ryLs.setFwId(wlrk.getFwId());
|
|
|
- ryLs.setRyId(wlrk.getId());
|
|
|
- ryLs.setDzbm(wlrk.getDzbm());
|
|
|
- ryLs.setRyType(syjzryVO.getRyType());
|
|
|
- ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
- ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
- ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
- ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
- ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
- ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
- ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
- ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
- ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
- ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
- ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setIsDeleted(1);
|
|
|
- rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
- wlrkEntity.setId(wlrk.getId());
|
|
|
- rhzfWlrkFeign.wlrkUpdate(wlrkEntity);
|
|
|
- }
|
|
|
- ryId = bzdzService.selectWlrkId(wlrkEntity);
|
|
|
- } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
- // 暂住人口
|
|
|
- RyZzrkEntity zzrkEntity = new RyZzrkEntity();
|
|
|
- BeanUtils.copyProperties(syjzryVO, zzrkEntity);
|
|
|
- zzrkEntity.setFwId(bzdz.getId());
|
|
|
- zzrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
- zzrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- zzrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- zzrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- BzdzEntity zzrk = bzdzService.selectZzrkBySfzh(zzrkEntity.getRySfzh());
|
|
|
- if (zzrk == null) {
|
|
|
- zzrkEntity.setMjId(mjId);
|
|
|
- rhzfZzrkFeign.zzrkSave(zzrkEntity);
|
|
|
- } else if (!zzrkEntity.getDzbm().equals(zzrk.getDzbm())) {
|
|
|
- RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
- ryLs.setFwId(zzrk.getFwId());
|
|
|
- ryLs.setRyId(zzrk.getId());
|
|
|
- ryLs.setDzbm(zzrk.getDzbm());
|
|
|
- ryLs.setRyType(syjzryVO.getRyType());
|
|
|
- ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
- ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
- ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
- ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
- ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
- ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
- ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
- ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
- ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
- ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
- ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setIsDeleted(1);
|
|
|
- rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
- zzrkEntity.setId(zzrk.getId());
|
|
|
- rhzfZzrkFeign.zzrkUpdate(zzrkEntity);
|
|
|
- }
|
|
|
- ryId = bzdzService.selectZzrkId(zzrkEntity);
|
|
|
- }
|
|
|
- // 新增人员 需要 保存房屋_人员关系
|
|
|
- if (type == 1) {
|
|
|
- FwRyEntity fwRyEntity = new FwRyEntity();
|
|
|
- fwRyEntity.setFwId(bzdz.getId());
|
|
|
- fwRyEntity.setRyId(ryId);
|
|
|
- if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
- syjzryVO.setRyType("czrk");
|
|
|
- } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
- syjzryVO.setRyType("jwrk");
|
|
|
- } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
- syjzryVO.setRyType("jzrk");
|
|
|
- } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
- syjzryVO.setRyType("wlrk");
|
|
|
- } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
- syjzryVO.setRyType("zzrk");
|
|
|
- }
|
|
|
- fwRyEntity.setRyType(syjzryVO.getRyType());
|
|
|
- fwRyEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
- fwRyEntity.setMjId(mjId);
|
|
|
- fwRyEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- fwRyEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
- fwRyEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
- bzdzService.updateFwRy(fwRyEntity);
|
|
|
- rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
- }
|
|
|
- //}
|
|
|
+ //for (SyjzryVO syjzryVO : rhzfSaveVO.getSyjzryList()) {
|
|
|
+ if (syjzryVO.getIsDeleted() != 1 && !syjzryVO.getRyType().equals("境外人口") && StringUtils.isBlank(syjzryVO.getRySfzh())) {
|
|
|
+ return R.fail("请填写身份证号");
|
|
|
+ }
|
|
|
+ Long ryId = 0L;
|
|
|
+ int type = 1; // 1=新增 2=修改 3=删除
|
|
|
+ if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
+ // 常住人口
|
|
|
+ RyCzrkEntity czrkEntity = new RyCzrkEntity();
|
|
|
+ BeanUtils.copyProperties(syjzryVO, czrkEntity);
|
|
|
+ czrkEntity.setFwId(bzdz.getId());
|
|
|
+ czrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
+ czrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
+ czrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ czrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ BzdzEntity czrk = bzdzService.selectCzrkBySfzh(czrkEntity.getRySfzh());
|
|
|
+ if (czrk == null) {
|
|
|
+ czrkEntity.setMjId(mjId);
|
|
|
+ rhzfCzrkFeign.czrkSave(czrkEntity);
|
|
|
+ } else if (!czrkEntity.getDzbm().equals(czrk.getDzbm())) {
|
|
|
+ RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
+ ryLs.setFwId(czrk.getFwId());
|
|
|
+ ryLs.setRyId(czrk.getId());
|
|
|
+ ryLs.setDzbm(czrk.getDzbm());
|
|
|
+ ryLs.setRyType(syjzryVO.getRyType());
|
|
|
+ ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
+ ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
+ ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
+ ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
+ ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
+ ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
+ ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
+ ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
+ ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
+ ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
+ ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setIsDeleted(1);
|
|
|
+ rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
+ czrkEntity.setId(czrk.getId());
|
|
|
+ rhzfCzrkFeign.czrkUpdate(czrkEntity);
|
|
|
+ }
|
|
|
+ ryId = bzdzService.selectCzrkId(czrkEntity);
|
|
|
+ } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
+ // 境外人口
|
|
|
+ RyJwrkEntity jwrkEntity = new RyJwrkEntity();
|
|
|
+ BeanUtils.copyProperties(syjzryVO, jwrkEntity);
|
|
|
+ jwrkEntity.setFwId(bzdz.getId());
|
|
|
+ jwrkEntity.setRyMz(syjzryVO.getRyYwm());
|
|
|
+ jwrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
+ jwrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
+ jwrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ jwrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ BzdzEntity jwrk = bzdzService.selectJwrkByZjhm(jwrkEntity.getRyZjhm());
|
|
|
+ if (jwrk == null) {
|
|
|
+ jwrkEntity.setMjId(mjId);
|
|
|
+ rhzfJwrkFeign.jwrkSave(jwrkEntity);
|
|
|
+ } else if (!jwrkEntity.getDzbm().equals(jwrk.getDzbm())) {
|
|
|
+ RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
+ ryLs.setFwId(jwrk.getFwId());
|
|
|
+ ryLs.setRyId(jwrk.getId());
|
|
|
+ ryLs.setDzbm(jwrk.getDzbm());
|
|
|
+ ryLs.setRyType(syjzryVO.getRyType());
|
|
|
+ ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
+ ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
+ ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
+ ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
+ ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
+ ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
+ ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
+ ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
+ ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
+ ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
+ ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setIsDeleted(1);
|
|
|
+ rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
+ jwrkEntity.setId(jwrk.getId());
|
|
|
+ rhzfJwrkFeign.jwrkUpdate(jwrkEntity);
|
|
|
+ }
|
|
|
+ ryId = bzdzService.selectJwrkId(jwrkEntity);
|
|
|
+ } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
+ // 寄住人口
|
|
|
+ RyJzrkEntity jzrkEntity = new RyJzrkEntity();
|
|
|
+ BeanUtils.copyProperties(syjzryVO, jzrkEntity);
|
|
|
+ jzrkEntity.setFwId(bzdz.getId());
|
|
|
+ jzrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
+ jzrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
+ jzrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ jzrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ BzdzEntity jzrk = bzdzService.selectJzrkBySfzh(jzrkEntity.getRySfzh());
|
|
|
+ if (jzrk == null) {
|
|
|
+ jzrkEntity.setMjId(mjId);
|
|
|
+ rhzfJzrkFeign.jzrkSave(jzrkEntity);
|
|
|
+ } else if (!jzrkEntity.getDzbm().equals(jzrk.getDzbm())) {
|
|
|
+ RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
+ ryLs.setFwId(jzrk.getFwId());
|
|
|
+ ryLs.setRyId(jzrk.getId());
|
|
|
+ ryLs.setDzbm(jzrk.getDzbm());
|
|
|
+ ryLs.setRyType(syjzryVO.getRyType());
|
|
|
+ ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
+ ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
+ ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
+ ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
+ ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
+ ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
+ ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
+ ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
+ ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
+ ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
+ ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setIsDeleted(1);
|
|
|
+ rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
+ jzrkEntity.setId(jzrk.getId());
|
|
|
+ rhzfJzrkFeign.jzrkUpdate(jzrkEntity);
|
|
|
+ }
|
|
|
+ ryId = bzdzService.selectJzrkId(jzrkEntity);
|
|
|
+ } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
+ // 未落常口
|
|
|
+ RyWlrkEntity wlrkEntity = new RyWlrkEntity();
|
|
|
+ BeanUtils.copyProperties(syjzryVO, wlrkEntity);
|
|
|
+ wlrkEntity.setFwId(bzdz.getId());
|
|
|
+ wlrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
+ wlrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
+ wlrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ wlrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ BzdzEntity wlrk = bzdzService.selectWlrkBySfzh(wlrkEntity.getRySfzh());
|
|
|
+ if (wlrk == null) {
|
|
|
+ wlrkEntity.setMjId(mjId);
|
|
|
+ rhzfWlrkFeign.wlrkSave(wlrkEntity);
|
|
|
+ } else if (!wlrkEntity.getDzbm().equals(wlrk.getDzbm())) {
|
|
|
+ RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
+ ryLs.setFwId(wlrk.getFwId());
|
|
|
+ ryLs.setRyId(wlrk.getId());
|
|
|
+ ryLs.setDzbm(wlrk.getDzbm());
|
|
|
+ ryLs.setRyType(syjzryVO.getRyType());
|
|
|
+ ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
+ ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
+ ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
+ ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
+ ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
+ ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
+ ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
+ ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
+ ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
+ ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
+ ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setIsDeleted(1);
|
|
|
+ rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
+ wlrkEntity.setId(wlrk.getId());
|
|
|
+ rhzfWlrkFeign.wlrkUpdate(wlrkEntity);
|
|
|
+ }
|
|
|
+ ryId = bzdzService.selectWlrkId(wlrkEntity);
|
|
|
+ } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
+ // 暂住人口
|
|
|
+ RyZzrkEntity zzrkEntity = new RyZzrkEntity();
|
|
|
+ BeanUtils.copyProperties(syjzryVO, zzrkEntity);
|
|
|
+ zzrkEntity.setFwId(bzdz.getId());
|
|
|
+ zzrkEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
+ zzrkEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
+ zzrkEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ zzrkEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ BzdzEntity zzrk = bzdzService.selectZzrkBySfzh(zzrkEntity.getRySfzh());
|
|
|
+ if (zzrk == null) {
|
|
|
+ zzrkEntity.setMjId(mjId);
|
|
|
+ rhzfZzrkFeign.zzrkSave(zzrkEntity);
|
|
|
+ } else if (!zzrkEntity.getDzbm().equals(zzrk.getDzbm())) {
|
|
|
+ RhzfRyLsEntity ryLs = new RhzfRyLsEntity();
|
|
|
+ ryLs.setFwId(zzrk.getFwId());
|
|
|
+ ryLs.setRyId(zzrk.getId());
|
|
|
+ ryLs.setDzbm(zzrk.getDzbm());
|
|
|
+ ryLs.setRyType(syjzryVO.getRyType());
|
|
|
+ ryLs.setRyXm(syjzryVO.getRyXm());
|
|
|
+ ryLs.setRyXb(syjzryVO.getRyXb());
|
|
|
+ ryLs.setRySfzh(syjzryVO.getRySfzh());
|
|
|
+ ryLs.setRyDh(syjzryVO.getRyDh());
|
|
|
+ ryLs.setRyTsLb(syjzryVO.getRyTsLb());
|
|
|
+ ryLs.setZxyy(syjzryVO.getZxyy());
|
|
|
+ ryLs.setZxrq(syjzryVO.getZxrq());
|
|
|
+ ryLs.setRyXs(syjzryVO.getRyXs());
|
|
|
+ ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
+ ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
+ ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ ryLs.setIsDeleted(1);
|
|
|
+ rhzfRyLsFeign.rylsSave(ryLs);
|
|
|
+ zzrkEntity.setId(zzrk.getId());
|
|
|
+ rhzfZzrkFeign.zzrkUpdate(zzrkEntity);
|
|
|
+ }
|
|
|
+ ryId = bzdzService.selectZzrkId(zzrkEntity);
|
|
|
+ }
|
|
|
+ // 新增人员 需要 保存房屋_人员关系
|
|
|
+ if (type == 1) {
|
|
|
+ FwRyEntity fwRyEntity = new FwRyEntity();
|
|
|
+ fwRyEntity.setFwId(bzdz.getId());
|
|
|
+ fwRyEntity.setRyId(ryId);
|
|
|
+ if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
+ syjzryVO.setRyType("czrk");
|
|
|
+ } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
+ syjzryVO.setRyType("jwrk");
|
|
|
+ } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
+ syjzryVO.setRyType("jzrk");
|
|
|
+ } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
+ syjzryVO.setRyType("wlrk");
|
|
|
+ } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
+ syjzryVO.setRyType("zzrk");
|
|
|
+ }
|
|
|
+ fwRyEntity.setRyType(syjzryVO.getRyType());
|
|
|
+ fwRyEntity.setDzbm(syjzryVO.getDzbm());
|
|
|
+ fwRyEntity.setMjId(mjId);
|
|
|
+ fwRyEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
+ fwRyEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
+ fwRyEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
+ bzdzService.updateFwRy(fwRyEntity);
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ }
|
|
|
+ //}
|
|
|
//}
|
|
|
return R.success("操作成功");
|
|
|
}
|
|
@@ -471,7 +469,7 @@ public class BzdzController {
|
|
|
ryLs.setRyMz(syrkzxVO.getRyYwm());
|
|
|
ryLs.setRyZjhm(syrkzxVO.getRyZjhm());
|
|
|
ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
ryLs.setIsDeleted(1);
|
|
|
syrkzxVO.setUpdateUser(AuthUtil.getUserId());
|
|
@@ -509,7 +507,7 @@ public class BzdzController {
|
|
|
if (sydw == null) {
|
|
|
UserVO user = bzdzService.djxx(AuthUtil.getUserId());
|
|
|
sydwEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- sydwEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ sydwEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
sydwEntity.setDjrxm(AuthUtil.getUserName());
|
|
|
sydwEntity.setDjrjh(AuthUtil.getUserAccount());
|
|
|
sydwEntity.setDjrsfzh(user.getSfzh());
|
|
@@ -518,7 +516,7 @@ public class BzdzController {
|
|
|
sydwFeign.sydwSave(sydwEntity);
|
|
|
for (CyryEntity cyryEntity:sydwEntity.getCyryList()) {
|
|
|
cyryEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- cyryEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ cyryEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
cyryEntity.setDwdzbm(sydwEntity.getDzbm());
|
|
|
sydwFeign.cyrySave(cyryEntity);
|
|
|
}
|
|
@@ -554,7 +552,7 @@ public class BzdzController {
|
|
|
@PostMapping("fzzx")
|
|
|
public R fzzx(@RequestBody FwFzEntity fwFzEntity) {
|
|
|
fwFzEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- fwFzEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ fwFzEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
fwFzEntity.setCreateTime(new Date());
|
|
|
fwFzEntity.setUpdateTime(new Date());
|
|
|
fwFzEntity.setIsDeleted(1);
|
|
@@ -568,7 +566,7 @@ public class BzdzController {
|
|
|
@PostMapping("saveFz")
|
|
|
public R saveFz(@RequestBody FwFzEntity fwFzEntity) {
|
|
|
fwFzEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- fwFzEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ fwFzEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
return R.data(rhzfFzFeign.fzSave(fwFzEntity));
|
|
|
}
|
|
|
|
|
@@ -589,7 +587,10 @@ public class BzdzController {
|
|
|
public R sydwLsjl(String dzbm) {
|
|
|
List<SydwEntity> list = bzdzService.sydwLsjl(dzbm);
|
|
|
for (SydwEntity sydw:list) {
|
|
|
- List<CyryEntity> cyry = bzdzService.cyryLsjl(sydw.getDzbm());
|
|
|
+ if (sydw.getDjrsfzh() != null) {
|
|
|
+ sydw.setDjrsfzh(AESUtil.decrypt(sydw.getDjrsfzh(), "2SexR1rfjZ8CD3M6"));
|
|
|
+ }
|
|
|
+ List<CyryEntity> cyry = bzdzService.cyryLsjl(sydw.getTyshxydm());
|
|
|
sydw.setCyryList(cyry);
|
|
|
}
|
|
|
return R.data(list);
|
|
@@ -600,19 +601,18 @@ public class BzdzController {
|
|
|
*/
|
|
|
@GetMapping("selectXxBySfzh")
|
|
|
public R selectXxBySfzh(String fzSfzh) {
|
|
|
- FwFzEntity ryxx = bzdzService.selectXxBySfzh(fzSfzh);
|
|
|
- Dept dept = bzdzService.selectDeptById(AuthUtil.getDeptId());
|
|
|
- BzdzEntity dzpcs = bzdzService.selectRyxxBySfzh(fzSfzh);
|
|
|
- if (dzpcs != null && !dept.getPcsId().equals(dzpcs.getPcsjgdm()) && dept.getSjId().contains(dzpcs.getDqm())) {
|
|
|
- ryxx.setRyType("寄住人口");
|
|
|
+ RkxxEntity rkxx = rkxxFeign.rkxx(fzSfzh);
|
|
|
+ Dept dept = bzdzService.selectDeptById(AuthUtil.getDeptId().split(",")[0]);
|
|
|
+ if (rkxx != null && !dept.getPcsId().equals(rkxx.getPcsjgdm()) && dept.getSjId().contains(rkxx.getDqm())) {
|
|
|
+ rkxx.setRyType("寄住人口");
|
|
|
}
|
|
|
- if (dzpcs != null && !dept.getSjId().contains(dzpcs.getDqm())) {
|
|
|
- ryxx.setRyType("暂住人口");
|
|
|
+ if (rkxx != null && !dept.getSjId().contains(rkxx.getDqm())) {
|
|
|
+ rkxx.setRyType("暂住人口");
|
|
|
}
|
|
|
- if (dzpcs != null && dept.getPcsId().equals(dzpcs.getPcsjgdm())) {
|
|
|
- ryxx.setRyType("常住人口");
|
|
|
+ if (rkxx != null && dept.getPcsId().equals(rkxx.getPcsjgdm())) {
|
|
|
+ rkxx.setRyType("常住人口");
|
|
|
}
|
|
|
- return R.data(ryxx);
|
|
|
+ return R.data(rkxx);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -621,7 +621,7 @@ public class BzdzController {
|
|
|
@GetMapping("selectDzByDeptId")
|
|
|
public R selectDzByDeptId() {
|
|
|
List<DwdzVO> list = new ArrayList<>();
|
|
|
- List<String> dzbm = bzdzService.selectFwInfo(AuthUtil.getDeptId());
|
|
|
+ List<String> dzbm = bzdzService.selectFwInfo(AuthUtil.getDeptId().split(",")[0]);
|
|
|
for (String dz:dzbm) {
|
|
|
DwdzVO dwdzVO = bzdzService.selectDwDz(dz);
|
|
|
list.add(dwdzVO);
|
|
@@ -635,10 +635,10 @@ public class BzdzController {
|
|
|
@GetMapping("selectSyrkBySfzh")
|
|
|
public R selectSyrkBySfzh(BzdzEntity bzdzEntity) {
|
|
|
BzdzEntity bzdz = bzdzService.selectSyrkBySfzh(bzdzEntity, AuthUtil.getDeptId());
|
|
|
- if (bzdz == null) {
|
|
|
+ if (bzdz == null || bzdzEntity.getFwId().equals(bzdz.getFwId())) {
|
|
|
return R.data(null);
|
|
|
}
|
|
|
- if (bzdz.getCreateDept().toString().equals(AuthUtil.getDeptId())) {
|
|
|
+ if (bzdz.getCreateDept().toString().equals(AuthUtil.getDeptId().split(",")[0])) {
|
|
|
return R.data("你已在其他房屋录入此人口,是否将他迁入到此房屋");
|
|
|
}
|
|
|
BzdzEntity pcs = bzdzService.selectPcsByCreateDept(bzdz.getCreateDept());
|
|
@@ -650,23 +650,17 @@ public class BzdzController {
|
|
|
*/
|
|
|
@PostMapping("updateSyrkStatus")
|
|
|
public R updateSyrkStatus(@RequestBody BzdzEntity bzdzEntity) {
|
|
|
- bzdzEntity.setUpdateDept(AuthUtil.getDeptId());
|
|
|
- if (bzdzEntity.getRyType().equals("常住人口")) {
|
|
|
- // 常住人口
|
|
|
- bzdzService.czrkUpdate(bzdzEntity);
|
|
|
- } else if (bzdzEntity.getRyType().equals("境外人口")) {
|
|
|
- // 境外人口
|
|
|
- bzdzService.jwrkUpdate(bzdzEntity);
|
|
|
- } else if (bzdzEntity.getRyType().equals("寄住人口")) {
|
|
|
- // 寄住人口
|
|
|
- bzdzService.jzrkUpdate(bzdzEntity);
|
|
|
- } else if (bzdzEntity.getRyType().equals("未落人口")) {
|
|
|
- // 未落常口
|
|
|
- bzdzService.wlrkUpdate(bzdzEntity);
|
|
|
- } else if (bzdzEntity.getRyType().equals("暂住人口")) {
|
|
|
- // 暂住人口
|
|
|
- bzdzService.zzrkUpdate(bzdzEntity);
|
|
|
- }
|
|
|
+ bzdzEntity.setUpdateDept(AuthUtil.getDeptId().split(",")[0]);
|
|
|
+ // 常住人口
|
|
|
+ bzdzService.czrkUpdate(bzdzEntity);
|
|
|
+ // 境外人口
|
|
|
+ bzdzService.jwrkUpdate(bzdzEntity);
|
|
|
+ // 寄住人口
|
|
|
+ bzdzService.jzrkUpdate(bzdzEntity);
|
|
|
+ // 未落常口
|
|
|
+ bzdzService.wlrkUpdate(bzdzEntity);
|
|
|
+ // 暂住人口
|
|
|
+ bzdzService.zzrkUpdate(bzdzEntity);
|
|
|
return R.data("操作成功");
|
|
|
}
|
|
|
|
|
@@ -691,7 +685,7 @@ public class BzdzController {
|
|
|
ryLs.setRyMz(syjzryVO.getRyYwm());
|
|
|
ryLs.setRyZjhm(syjzryVO.getRyZjhm());
|
|
|
ryLs.setCreateUser(AuthUtil.getUserId());
|
|
|
- ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ ryLs.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
ryLs.setUpdateUser(AuthUtil.getUserId());
|
|
|
ryLs.setIsDeleted(1);
|
|
|
rhzfRyLsFeign.rylsSave(ryLs);
|
|
@@ -700,35 +694,161 @@ public class BzdzController {
|
|
|
fwRyEntity.setRyId(syjzryVO.getId());
|
|
|
fwRyEntity.setDzbm(syjzryVO.getNewDzbm());
|
|
|
fwRyEntity.setCreateUser(AuthUtil.getUserId());
|
|
|
- fwRyEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
+ fwRyEntity.setCreateDept(Long.valueOf(AuthUtil.getDeptId().split(",")[0]));
|
|
|
fwRyEntity.setUpdateUser(AuthUtil.getUserId());
|
|
|
bzdzService.updateFwRy(fwRyEntity);
|
|
|
- if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
- // 常住人口
|
|
|
- fwRyEntity.setRyType("czrk");
|
|
|
- rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
- bzdzService.updatePcsCzrk(syjzryVO);
|
|
|
- } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
- // 境外人口
|
|
|
- fwRyEntity.setRyType("jwrk");
|
|
|
- rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
- bzdzService.updatePcsJwrk(syjzryVO);
|
|
|
- } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
- // 寄住人口
|
|
|
- fwRyEntity.setRyType("jzrk");
|
|
|
- rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
- bzdzService.updatePcsJzrk(syjzryVO);
|
|
|
- } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
- // 未落常口
|
|
|
- fwRyEntity.setRyType("wlrk");
|
|
|
- rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
- bzdzService.updatePcsWlrk(syjzryVO);
|
|
|
- } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
- // 暂住人口
|
|
|
- fwRyEntity.setRyType("zzrk");
|
|
|
- rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
- bzdzService.updatePcsZzrk(syjzryVO);
|
|
|
+ if (syjzryVO.getRyType().equals(syjzryVO.getNewType())) {
|
|
|
+ if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
+ // 常住人口
|
|
|
+ fwRyEntity.setRyType("czrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ bzdzService.updatePcsCzrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
+ // 境外人口
|
|
|
+ fwRyEntity.setRyType("jwrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ bzdzService.updatePcsJwrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
+ // 寄住人口
|
|
|
+ fwRyEntity.setRyType("jzrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ bzdzService.updatePcsJzrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
+ // 未落常口
|
|
|
+ fwRyEntity.setRyType("wlrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ bzdzService.updatePcsWlrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
+ // 暂住人口
|
|
|
+ fwRyEntity.setRyType("zzrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ bzdzService.updatePcsZzrk(syjzryVO);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 人口类型变化,将其他人口迁移到选择的人口
|
|
|
+ if (syjzryVO.getNewType().equals("常住人口")) {
|
|
|
+ // 常住人口
|
|
|
+ fwRyEntity.setRyType("czrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ RyCzrkEntity ryCzrk = new RyCzrkEntity();
|
|
|
+ BeanUtil.copyProperties(syjzryVO, ryCzrk);
|
|
|
+ ryCzrk.setFwId(syjzryVO.getNewFwId());
|
|
|
+ ryCzrk.setCreateDept(Long.valueOf(syjzryVO.getUpdateDept()));
|
|
|
+ ryCzrk.setDzbm(syjzryVO.getNewDzbm());
|
|
|
+ ryCzrk.setStatus(1);
|
|
|
+ ryCzrk.setNewFwId(null);
|
|
|
+ ryCzrk.setUpdateDept(null);
|
|
|
+ ryCzrk.setNewDzbm(null);
|
|
|
+ ryCzrk.setNewType(null);
|
|
|
+ rhzfCzrkFeign.czrkSave(ryCzrk);
|
|
|
+ } else if (syjzryVO.getNewType().equals("境外人口")) {
|
|
|
+ // 境外人口
|
|
|
+ fwRyEntity.setRyType("jwrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ RyJwrkEntity ryJwrk = new RyJwrkEntity();
|
|
|
+ BeanUtil.copyProperties(syjzryVO, ryJwrk);
|
|
|
+ ryJwrk.setFwId(syjzryVO.getNewFwId());
|
|
|
+ ryJwrk.setCreateDept(Long.valueOf(syjzryVO.getUpdateDept()));
|
|
|
+ ryJwrk.setDzbm(syjzryVO.getNewDzbm());
|
|
|
+ ryJwrk.setStatus(1);
|
|
|
+ ryJwrk.setNewFwId(null);
|
|
|
+ ryJwrk.setUpdateDept(null);
|
|
|
+ ryJwrk.setNewDzbm(null);
|
|
|
+ ryJwrk.setNewType(null);
|
|
|
+ rhzfJwrkFeign.jwrkSave(ryJwrk);
|
|
|
+ } else if (syjzryVO.getNewType().equals("寄住人口")) {
|
|
|
+ // 寄住人口
|
|
|
+ fwRyEntity.setRyType("jzrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ RyJzrkEntity ryJzrk = new RyJzrkEntity();
|
|
|
+ BeanUtil.copyProperties(syjzryVO, ryJzrk);
|
|
|
+ ryJzrk.setFwId(syjzryVO.getNewFwId());
|
|
|
+ ryJzrk.setCreateDept(Long.valueOf(syjzryVO.getUpdateDept()));
|
|
|
+ ryJzrk.setDzbm(syjzryVO.getNewDzbm());
|
|
|
+ ryJzrk.setStatus(1);
|
|
|
+ ryJzrk.setNewFwId(null);
|
|
|
+ ryJzrk.setUpdateDept(null);
|
|
|
+ ryJzrk.setNewDzbm(null);
|
|
|
+ ryJzrk.setNewType(null);
|
|
|
+ rhzfJzrkFeign.jzrkSave(ryJzrk);
|
|
|
+ } else if (syjzryVO.getNewType().equals("未落人口")) {
|
|
|
+ // 未落常口
|
|
|
+ fwRyEntity.setRyType("wlrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ RyWlrkEntity ryWlrk = new RyWlrkEntity();
|
|
|
+ BeanUtil.copyProperties(syjzryVO, ryWlrk);
|
|
|
+ ryWlrk.setFwId(syjzryVO.getNewFwId());
|
|
|
+ ryWlrk.setCreateDept(Long.valueOf(syjzryVO.getUpdateDept()));
|
|
|
+ ryWlrk.setDzbm(syjzryVO.getNewDzbm());
|
|
|
+ ryWlrk.setStatus(1);
|
|
|
+ ryWlrk.setNewFwId(null);
|
|
|
+ ryWlrk.setUpdateDept(null);
|
|
|
+ ryWlrk.setNewDzbm(null);
|
|
|
+ ryWlrk.setNewType(null);
|
|
|
+ rhzfWlrkFeign.wlrkSave(ryWlrk);
|
|
|
+ } else if (syjzryVO.getNewType().equals("暂住人口")) {
|
|
|
+ // 暂住人口
|
|
|
+ fwRyEntity.setRyType("zzrk");
|
|
|
+ rhzfFwRyFeign.fwrySave(fwRyEntity);
|
|
|
+ RyZzrkEntity ryZzrk = new RyZzrkEntity();
|
|
|
+ BeanUtil.copyProperties(syjzryVO, ryZzrk);
|
|
|
+ ryZzrk.setFwId(syjzryVO.getNewFwId());
|
|
|
+ ryZzrk.setCreateDept(Long.valueOf(syjzryVO.getUpdateDept()));
|
|
|
+ ryZzrk.setDzbm(syjzryVO.getNewDzbm());
|
|
|
+ ryZzrk.setStatus(1);
|
|
|
+ ryZzrk.setNewFwId(null);
|
|
|
+ ryZzrk.setUpdateDept(null);
|
|
|
+ ryZzrk.setNewDzbm(null);
|
|
|
+ ryZzrk.setNewType(null);
|
|
|
+ rhzfZzrkFeign.zzrkSave(ryZzrk);
|
|
|
+ }
|
|
|
+ // 人口迁移之后,将老数据删除
|
|
|
+ if (syjzryVO.getRyType().equals("常住人口")) {
|
|
|
+ // 常住人口
|
|
|
+ bzdzService.detelePcsCzrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("境外人口")) {
|
|
|
+ // 境外人口
|
|
|
+ bzdzService.detelePcsJwrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("寄住人口")) {
|
|
|
+ // 寄住人口
|
|
|
+ bzdzService.detelePcsJzrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("未落人口")) {
|
|
|
+ // 未落常口
|
|
|
+ bzdzService.detelePcsWlrk(syjzryVO);
|
|
|
+ } else if (syjzryVO.getRyType().equals("暂住人口")) {
|
|
|
+ // 暂住人口
|
|
|
+ bzdzService.detelePcsZzrk(syjzryVO);
|
|
|
+ }
|
|
|
}
|
|
|
return R.data("操作成功");
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 从业人员查询
|
|
|
+ */
|
|
|
+ @GetMapping("cyrycx")
|
|
|
+ public R cyrycx(String fzSfzh) {
|
|
|
+ BzdzEntity cyrycx = bzdzService.cyrycx(fzSfzh);
|
|
|
+ if (cyrycx != null) {
|
|
|
+ return R.data(cyrycx);
|
|
|
+ }
|
|
|
+ return R.data("该人员没在实有人口登记");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询人口迁移数据
|
|
|
+ */
|
|
|
+ @GetMapping("selectRkqy")
|
|
|
+ public R selectRkqy() {
|
|
|
+ List<BzdzEntity> list = bzdzService.selectRkqy(AuthUtil.getDeptId());
|
|
|
+ return R.data(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过地址编码获取房屋id
|
|
|
+ */
|
|
|
+ @GetMapping("fwIdByDzbm")
|
|
|
+ public R fwIdByDzbm(String dzbm) {
|
|
|
+ return R.data(bzdzService.fwIdByDzbm(dzbm));
|
|
|
+ }
|
|
|
}
|