Browse Source

Merge remote-tracking branch 'remotes/origin/master' into dev_dingding

master
jianjun 3 years ago
parent
commit
89b2800faa
  1. 24
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java
  2. 31
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EnterprisePatrolRemindTask.java
  3. 35
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java
  4. 7
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java
  5. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseChartFormDTO.java
  6. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseChartResultDTO.java
  7. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java
  8. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  9. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  10. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java
  11. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java
  12. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java
  13. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java
  14. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java
  15. 36
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  16. 44
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java
  17. 79
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  18. 12
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java
  19. 9
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java
  20. 14
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java
  21. 18
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java
  22. 3
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java
  23. 5
      epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java
  24. 6
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java
  25. 8
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java
  26. 11
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java
  27. 33
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java
  28. 4
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql
  29. 5
      epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml
  30. 2
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java
  31. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java
  32. 15
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java
  33. 11
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml
  34. 15
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java
  35. 36
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java
  36. 10
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java
  37. 14
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java
  38. 9
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java
  39. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java
  40. 10
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java
  41. 13
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java
  42. 2
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.10__add_principal.sql
  43. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.11__add_principal_staff_id.sql
  44. 27
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml
  45. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointNucleicMonitoringDTO.java
  46. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java
  47. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java
  48. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java
  49. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  50. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  51. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java
  52. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  53. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java
  54. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  55. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointNucleicMonitoringEntity.java
  56. 16
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java
  57. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java
  58. 11
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  59. 56
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointAppServiceImpl.java
  60. 17
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java
  61. 183
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  62. 1
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.68__alter_ic_point_nucleic_monitoring_enable.sql
  63. 11
      epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml
  64. 58
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

24
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/IdCardRegexUtils.java

@ -1,10 +1,15 @@
package com.epmet.commons.tools.utils;
import com.epmet.commons.tools.enums.IdCardTypeEnum;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.DateTimeException;
import java.time.LocalDate;
import java.time.Period;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -50,6 +55,7 @@ public class IdCardRegexUtils {
private String birthdayMonth;
private String birthdayDay;
private String sex;
private Integer age;
}
/**
@ -116,7 +122,17 @@ public class IdCardRegexUtils {
String month = matcher.group("month");
String day = matcher.group("day");
String sex = matcher.group("sex");
return new ParsedContent(year, month, day, sex);
// ------- 年龄Start----------
Integer age;
try {
LocalDate birthday = LocalDate.of(Integer.parseInt(year), Integer.parseInt(month), Integer.parseInt(day));
age = Period.between(birthday, LocalDate.now()).getYears();
} catch (DateTimeException e) {
throw new EpmetException("身份证号解析年龄失败:" + ExceptionUtils.getErrorStackTrace(e));
}
// ------- 年龄End----------
return new ParsedContent(year, month, day, sex, age);
}
// 其他类型暂时不可解析
@ -130,4 +146,10 @@ public class IdCardRegexUtils {
public IdCardTypeEnum getTypeEnum() {
return idCardType;
}
public static void main(String[] args) {
IdCardRegexUtils parse = IdCardRegexUtils.parse("370282198801303017");
ParsedContent parsedResult = parse.getParsedResult();
System.out.println(parsedResult);
}
}

31
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EnterprisePatrolRemindTask.java

@ -0,0 +1,31 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.GovOrgOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/9/6 17:35
*/
@Component("enterprisePatrolRemindTask")
@Slf4j
public class EnterprisePatrolRemindTask implements ITask {
@Resource
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public void run(String params) {
log.info("EnterprisePatrolRemindTask定时任务正在执行,参数为:{}", params);
Result result = govOrgOpenFeignClient.sendEnterprisePatrolRemindMessage();
if (result.success()) {
log.info("EnterprisePatrolRemindTask定时任务执行成功");
} else {
log.error("EnterprisePatrolRemindTask定时任务执行失败:" + result.getMsg());
}
}
}

35
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ic/IcUpdateYlfnTask.java

@ -0,0 +1,35 @@
package com.epmet.task.ic;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.task.ITask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* desc:定时弥补数据 保证数据的一致性
*/
@Slf4j
@Component("icUpdateYlfnTask")
public class IcUpdateYlfnTask implements ITask {
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 执行定时任务接口
*
* @param params 参数多参数使用JSON数据
*/
@Override
public void run(String params) {
Result result = epmetUserOpenFeignClient.updateYlfn();
if (result.success()) {
log.info("icUpdateYlfnTask定时任务正在执行定时任务执行成功");
} else {
log.warn("icUpdateYlfnTask定时任务正在执行定时任务执行失败:" + result.getMsg());
}
}
}

7
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java

@ -57,4 +57,11 @@ public interface SmsTemplateConstant {
* ${name}给您指派了一个新的需求请服务完成后尽快反馈谢谢合作
*/
String DEMAND_SERVICE_TEM="SMS_247645013";
/**
* 模板名称: 数字社区-企事业单位复巡查消息提醒模板
* 模板CODE: SMS_251056077
* 模板内容: ${name}最近一次巡查结果不合格请在${date}再次巡查
*/
String ENTERPRISE_PATROL_TEM="SMS_251056077";
}

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/HouseChartFormDTO.java

@ -21,6 +21,14 @@ public class HouseChartFormDTO implements Serializable {
* 组织网格小区类型 agency grid village
*/
private String orgType;
/**
* 数据类型1出租 0自住 2闲置 3未售出
*/
private String rentType;
private Integer pageNo = 1;
private Integer pageSize = 20;
private Boolean isPage = true;
//token这信息
private String customerId;

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseChartResultDTO.java

@ -47,6 +47,14 @@ public class HouseChartResultDTO implements Serializable {
* 房屋闲置总数占比保留两位小数带百分号的
*/
private Double xzHouseRatio = 0.0;
/**
* 房屋未售出总数
*/
private Integer wscHouseTotal = 0;
/**
* 房屋未售出总数占比保留两位小数带百分号的
*/
private Double wscHouseRatio = 0.0;
@JsonIgnore
private Integer num;

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubUserHouseListResultDTO.java

@ -50,6 +50,14 @@ public class SubUserHouseListResultDTO implements Serializable {
* 房屋闲置总数占比保留两位小数带百分号的
*/
private Double xzHouseRatio = 0.0;
/**
* 房屋未售出总数
*/
private Integer wscHouseTotal = 0;
/**
* 房屋未售出总数占比保留两位小数带百分号的
*/
private Double wscHouseRatio = 0.0;
/**
* 居民总数
*/

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -712,4 +712,7 @@ public interface GovOrgOpenFeignClient {
@PostMapping("/gov/org/department/notsyncdept")
Result<CheckStaffInfoResultDTO> notSyncDept(@RequestBody CheckStaffInfoFormDTO formDTO);
@PostMapping("/gov/org/enterprise/sendEnterprisePatrolRemindMessage")
Result sendEnterprisePatrolRemindMessage();
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -464,6 +464,11 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "notSyncDept", formDTO);
}
@Override
public Result sendEnterprisePatrolRemindMessage() {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "sendEnterprisePatrolRemindMessage", null);
}
@Override
public Result<List<CustomerGridStaffListResultDTO>> gridStaff(CustomerGridStaffListFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridStaffList", dto);

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -617,4 +617,16 @@ public class HouseController implements ResultDataResolver {
return new Result();
}
/**
* @Author sun
* @Description 人房概览房屋统计数点击查询列表/详情
**/
@PostMapping("housestatislistdetail")
@MaskResponse(fieldNames = {"ownerIdCard", "ownerPhone"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD, MaskResponse.MASK_TYPE_MOBILE})
public Result<PageData<IcHouseListResultDTO>> houseStatisListDetail(@LoginUser TokenDto tokenDto, @RequestBody HouseChartFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData<IcHouseListResultDTO>>().ok(houseService.houseStatisListDetail(formDTO));
}
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcEnterpriseController.java

@ -301,4 +301,18 @@ public class IcEnterpriseController implements ResultDataResolver {
icEnterpriseService.execAsyncExcelImport(fileSavePath, rstData.getTaskId(),tokenDto.getCustomerId(),tokenDto.getUserId());
return new Result();
}
/**
* 复查消息提醒
*
* @Param
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/9/6 17:31
*/
@PostMapping("sendEnterprisePatrolRemindMessage")
public Result sendEnterprisePatrolRemindMessage() {
icEnterpriseService.sendEnterprisePatrolRemindMessage();
return new Result();
}
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcHouseDao.java

@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ImportGeneralDTO;
import com.epmet.dto.form.CheckHouseInfoFormDTO;
import com.epmet.dto.form.GetHouseInfoToCollectFormDTO;
import com.epmet.dto.form.HouseChartFormDTO;
import com.epmet.dto.form.IcHouseListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.CustomerOrgParameterEntity;
@ -209,4 +210,5 @@ public interface IcHouseDao extends BaseDao<IcHouseEntity> {
*/
IcHouseEntity getHouseInfoByName(CheckHouseInfoFormDTO formDTO);
List<IcHouseListResultDTO> houseStatisListDetail(HouseChartFormDTO formDTO);
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/HouseService.java

@ -195,4 +195,6 @@ public interface HouseService {
Result<IcHouseInfoCollectResultDTO> getHouseInfoToCollect(GetHouseInfoToCollectFormDTO formDTO);
PageData<ReportHouseTestResultDTO> listHouses4ReportTest(String houseId, Integer pageNo, Integer pageSize);
PageData<IcHouseListResultDTO> houseStatisListDetail(HouseChartFormDTO formDTO);
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcEnterpriseService.java

@ -68,4 +68,14 @@ public interface IcEnterpriseService extends BaseService<IcEnterpriseEntity> {
PageData<EnterpriseDetailDTO> list(EnterprisePageFormDTO formDTO);
void execAsyncExcelImport(Path fileSavePath, String taskId, String customerId, String userId);
/**
* 复查消息提醒
*
* @Param
* @Return
* @Author zhaoqifeng
* @Date 2022/9/6 17:30
*/
void sendEnterprisePatrolRemindMessage();
}

36
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -703,14 +703,17 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
resultDTO.setZzHouseTotal(l.getNum());
} else if (l.getRentFlag() == 1) {
resultDTO.setCzHouseTotal(l.getNum());
} else {
} else if (l.getRentFlag() == 2) {
resultDTO.setXzHouseTotal(l.getNum());
} else if (l.getRentFlag() == 3) {
resultDTO.setWscHouseTotal(l.getNum());
}
});
resultDTO.setHouseTotal(houseTotal.get());
resultDTO.setZzHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getZzHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getZzHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setCzHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getCzHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getCzHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setXzHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getXzHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getXzHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setWscHouseRatio(Double.valueOf((resultDTO.getHouseTotal() == 0 || resultDTO.getWscHouseTotal() > resultDTO.getHouseTotal()) ? "0" : numberFormat.format(((float) resultDTO.getWscHouseTotal() / (float) resultDTO.getHouseTotal()) * 100)));
resultDTO.setOrgId(formDTO.getOrgId());
resultDTO.setOrgType(formDTO.getOrgType());
return resultDTO;
@ -946,6 +949,8 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
dto.setCzHouseRatio(h.getCzHouseRatio());
dto.setXzHouseTotal(h.getXzHouseTotal());
dto.setXzHouseRatio(h.getXzHouseRatio());
dto.setWscHouseTotal(h.getWscHouseTotal());
dto.setWscHouseRatio(h.getWscHouseRatio());
}
}
for (UserChartResultDTO u : userResult.getData()) {
@ -1330,4 +1335,33 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
return new PageData<>(houseDtos, pi.getTotal());
}
@Override
public PageData<IcHouseListResultDTO> houseStatisListDetail(HouseChartFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
//1.判断入参是否有值,没有值则赋值当前工作人员缓存中所属组织信息
if (StringUtils.isEmpty(formDTO.getOrgId())) {
//获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
//2.按条件查询房屋信息数据
List<IcHouseListResultDTO> list = icHouseDao.houseStatisListDetail(formDTO);
//3.封装数据并返回
list.forEach(item -> {
item.setHouseType(HouseTypeEnums.getTypeValue(item.getHouseTypeKey()));
item.setPurpose(HousePurposeEnums.getTypeValue(item.getPurposeKey()));
});
PageInfo<IcHouseListResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
}

44
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcEnterpriseServiceImpl.java

@ -19,15 +19,14 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.FileUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.*;
import com.epmet.dto.SysDictDataDTO;
import com.epmet.dto.form.EnterpriseFormDTO;
import com.epmet.dto.form.EnterprisePageFormDTO;
import com.epmet.dto.form.EnterprisePatrolFormDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcEnterpriseEntity;
import com.epmet.entity.IcEnterprisePatrolAttachmentEntity;
@ -36,6 +35,7 @@ import com.epmet.excel.EnterpriseImportExcelDTO;
import com.epmet.excel.handler.IcEnterpriseExcelImportListener;
import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.service.CoverageService;
import com.epmet.service.IcEnterpriseService;
@ -55,14 +55,12 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -90,6 +88,8 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
private CoverageService coverageService;
@Autowired
private CustomerGridDao customerGridDao;
@Resource
private EpmetMessageOpenFeignClient messageOpenFeignClient;
/**
* 企事业单位巡查新增/编辑
@ -400,6 +400,34 @@ public class IcEnterpriseServiceImpl extends BaseServiceImpl<IcEnterpriseDao, Ic
}
@Override
public void sendEnterprisePatrolRemindMessage() {
//一天后
Date afterThreeDayDate=DateUtils.calDateBaseDay(new Date(), NumConstant.ONE);
String dateId= DateUtils.format(afterThreeDayDate, DateUtils.DATE_PATTERN_YYYYMMDD);
LambdaQueryWrapper<IcEnterprisePatrolRecordEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.apply("DATE_FORMAT(REVIEW_TIME,'%Y%m%d') = " + dateId);
List<IcEnterprisePatrolRecordEntity> list = enterprisePatrolRecordDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
List<SendSmsFormDTO> smsList=new ArrayList<>();
list.forEach(item -> {
IcEnterpriseEntity enterprise = baseDao.selectById(item.getEnterpriseId());
if (null != enterprise) {
SendSmsFormDTO sms = new SendSmsFormDTO();
sms.setCustomerId(item.getCustomerId());
sms.setMobile(item.getMobile());
sms.setAliyunTemplateCode(SmsTemplateConstant.ENTERPRISE_PATROL_TEM);
Map<String, String> paramMap = new HashMap<>();
paramMap.put("name",enterprise.getPlaceOrgName());
paramMap.put("date",DateUtils.format(item.getReviewTime(),DateUtils.DATE_PATTERN));
sms.setParamMap(paramMap);
smsList.add(sms);
}
});
messageOpenFeignClient.sendMsg(smsList);
}
}
private CustomerStaffInfoCacheResult queryCurrentStaff(String customerId, String userId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null == staffInfo) {

79
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -559,5 +559,84 @@
and DOOR_NAME = #{homeName}
</select>
<select id="houseStatisListDetail" resultType="com.epmet.dto.result.IcHouseListResultDTO">
SELECT
concat(b.building_name,'-',d.unit_num,'-',a.door_name) as houseName,
c.neighbor_hood_name as neighborHoodName,
b.building_name as buildingName,
CONCAT(d.unit_num,'单元') as unitNum,
a.door_name as doorName,
(
case when a.rent_flag = '0' then '自住'
when a.rent_flag = '1' then '出租'
when a.rent_flag = '2' then '闲置'
when a.rent_flag = '3' then '未出售'
else '' end
) as rentFlag,
a.owner_name as ownerName,
a.owner_phone as ownerPhone,
a.owner_id_card as ownerIdCard,
a.house_code,
a.id as houseId,
c.id as neighborHoodId,
b.id as buildingId,
a.building_unit_id as unitNumKey,
a.house_type as houseTypeKey,
a.purpose as purposeKey,
CAST(a.rent_flag AS CHAR) as rentFlagKey,
c.agency_id as agencyId,
ag.organization_name agencyName,
c.grid_id as gridId,
gr.grid_name,
IFNULL(a.sort,0) as sort,
IFNULL(a.remark,'') AS remark,
a.customer_id
FROM
ic_house a
LEFT JOIN ic_building b on a.building_id = b.id and b.del_flag = '0'
LEFT JOIN ic_neighbor_hood c on a.neighbor_hood_id = c.id and c.del_flag = '0'
LEFT JOIN ic_building_unit d on a.building_unit_id = d.id and d.del_flag = '0'
LEFT JOIN customer_grid gr on gr.id = c.grid_id and gr.del_flag = '0'
LEFT JOIN customer_agency ag on ag.id = c.agency_id and ag.del_flag = '0'
WHERE
a.del_flag = '0'
<if test="rentType != null and rentType.trim() != ''">
AND a.rent_flag = #{rentType}
</if>
<choose>
<when test='orgType == "agency"'>
AND a.neighbor_hood_id IN (
select a.id from ic_neighbor_hood a
<!-- 排除掉无效组织、网格数据 -->
inner join customer_agency b on a.agency_id = b.id and b.del_flag = '0'
inner join customer_grid c on a.grid_id = c.id and c.del_flag = '0'
where a.del_flag = '0'
and (a.agency_id = #{orgId} OR a.agency_pids LIKE CONCAT('%', #{orgId}, '%'))
)
</when>
<when test='orgType == "grid"'>
AND a.neighbor_hood_id IN (
select id from ic_neighbor_hood
where del_flag = '0'
and grid_id = #{orgId}
)
</when>
<otherwise>
AND a.neighbor_hood_id IN (
select id from ic_neighbor_hood
where del_flag = '0'
and id = #{orgId}
)
</otherwise>
</choose>
ORDER BY
a.sort,
CONVERT(c.NEIGHBOR_HOOD_NAME using gbk),
CONVERT(b.BUILDING_NAME USING gbk),
CONVERT(d.UNIT_NAME USING gbk),
CAST(a.DOOR_NAME AS SIGNED),
CONVERT(a.DOOR_NAME using gbk)
</select>
</mapper>

12
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/GridInfoPingyinServiceImpl.java

@ -79,6 +79,12 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
if (null == result.getData() || result.getData().size() < NumConstant.ONE) {
return;
}
// 根据编码长度判断 grid_level
// 14位 =》06 社区、村
// 9位= 》04 乡镇
// 6位 -》03 县
// 19位 =>07网格
// 2.封装数据
List<GridInfoPingyinEntity> gridInfoList = new ArrayList<>();
result.getData().forEach(ag -> {
@ -176,6 +182,12 @@ public class GridInfoPingyinServiceImpl extends BaseServiceImpl<GridInfoPingyinD
return;
}
// 根据编码长度判断 grid_level
// 14位 =》06 社区、村
// 9位= 》04 乡镇
// 6位 -》03 县
// 19位 =>07网格
// 2.封装数据
List<GridInfoPingyinEntity> gridInfoList = new ArrayList<>();
result.getData().forEach(ag -> {

9
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/IcResiCategoryStatsConfigFormDTO.java

@ -74,5 +74,12 @@ public class IcResiCategoryStatsConfigFormDTO implements Serializable {
private Integer level2;
private Integer level3;
/**
* 自动匹配开启1不匹配0
*/
private String autoMatching;
/**
* 育龄妇女年龄范围英文逗号隔开的数字例如18,49
*/
private String ylfnValue;
}

14
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/IcResiCategoryStatsConfigResultDTO.java

@ -44,7 +44,10 @@ public class IcResiCategoryStatsConfigResultDTO implements Serializable {
*/
private String label;
/**
* 列名
*/
private String columnName;
/**
* 管理平台分类图标
@ -84,4 +87,13 @@ public class IcResiCategoryStatsConfigResultDTO implements Serializable {
* 等级3阈值
*/
private Integer level3;
/**
* 自动匹配开启1不匹配0
*/
private String autoMatching;
/**
* 育龄妇女年龄范围英文逗号隔开的数字例如18,49
*/
private String ylfnValue;
}

18
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/YlfnValueResultDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/9/8 15:43
*/
@Data
public class YlfnValueResultDTO implements Serializable {
private static final long serialVersionUID = -1416102274320519092L;
private String customerId;
private Integer min;
private Integer max;
}

3
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java

@ -178,5 +178,6 @@ public interface OperCustomizeOpenFeignClient {
*/
@PostMapping("/oper/customize/icformitemoptions/getItemConditions")
Result<Map<String, String>> getOptionsMap(@RequestBody IcFormOptionsQueryFormDTO input);
@PostMapping("/oper/customize/icresicategorystatsconfig/getYlfnValue")
Result<List<YlfnValueResultDTO>> getYlfnValue();
}

5
epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java

@ -142,4 +142,9 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOptionsMap", input);
}
@Override
public Result<List<YlfnValueResultDTO>> getYlfnValue() {
return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getYlfnValue", null);
}
}

6
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/IcResiCategoryStatsConfigController.java

@ -26,6 +26,7 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.YlfnValueResultDTO;
import com.epmet.excel.IcResiCategoryStatsConfigExcel;
import com.epmet.service.IcResiCategoryStatsConfigService;
import org.springframework.beans.factory.annotation.Autowired;
@ -96,4 +97,9 @@ public class IcResiCategoryStatsConfigController {
return new Result<List<IcResiCategoryStatsConfigDTO>>().ok(icResiCategoryStatsConfigService.getCategoryList(dto));
}
@PostMapping("getYlfnValue")
public Result<List<YlfnValueResultDTO>> getYlfnValue() {
return new Result<List<YlfnValueResultDTO>>().ok(icResiCategoryStatsConfigService.getYlfnValue());
}
}

8
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/IcResiCategoryStatsConfigEntity.java

@ -80,4 +80,12 @@ public class IcResiCategoryStatsConfigEntity extends BaseEpmetEntity {
*/
private Integer sort;
/**
* 自动匹配开启1不匹配0
*/
private String autoMatching;
/**
* 育龄妇女年龄范围英文逗号隔开的数字例如18,49
*/
private String ylfnValue;
}

11
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/IcResiCategoryStatsConfigService.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.YlfnValueResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import java.util.List;
@ -111,4 +112,14 @@ public interface IcResiCategoryStatsConfigService extends BaseService<IcResiCate
*/
List<CustomerCategoryShowAndWarnListResultDTO> getCustomerCategoryShowAndWarnList(String customerId);
/**
* 获取育龄妇女配置
*
* @Param
* @Return {@link List< YlfnValueResultDTO>}
* @Author zhaoqifeng
* @Date 2022/9/8 15:50
*/
List<YlfnValueResultDTO> getYlfnValue();
}

33
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcResiCategoryStatsConfigServiceImpl.java

@ -22,11 +22,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcResiCategoryStatsConfigDao;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.result.CustomerCategoryShowAndWarnListResultDTO;
import com.epmet.dto.result.YlfnValueResultDTO;
import com.epmet.entity.IcResiCategoryStatsConfigEntity;
import com.epmet.redis.IcResiCategoryStatsConfigRedis;
import com.epmet.service.IcResiCategoryStatsConfigService;
@ -37,6 +40,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
/**
* 居民类别配置表
@ -137,4 +141,33 @@ public class IcResiCategoryStatsConfigServiceImpl extends BaseServiceImpl<IcResi
return new ArrayList<>();
}
/**
* 获取育龄妇女配置
*
* @Param
* @Return {@link List< YlfnValueResultDTO >}
* @Author zhaoqifeng
* @Date 2022/9/8 15:50
*/
@Override
public List<YlfnValueResultDTO> getYlfnValue() {
LambdaQueryWrapper<IcResiCategoryStatsConfigEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiCategoryStatsConfigEntity::getAutoMatching, NumConstant.ONE_STR);
wrapper.eq(IcResiCategoryStatsConfigEntity::getColumnName, "IS_YLFN");
wrapper.isNotNull(IcResiCategoryStatsConfigEntity::getYlfnValue);
wrapper.ne(IcResiCategoryStatsConfigEntity::getYlfnValue,StrConstant.EPMETY_STR);
List<IcResiCategoryStatsConfigEntity> list = baseDao.selectList(wrapper);
if(CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(item -> {
YlfnValueResultDTO dto = new YlfnValueResultDTO();
dto.setCustomerId(item.getCustomerId());
String[] ages = item.getYlfnValue().split(StrConstant.COMMA);
dto.setMin(Integer.valueOf(ages[0]));
dto.setMax(Integer.valueOf(ages[1]));
return dto;
}).collect(Collectors.toList());
}
}

4
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.38__ylfnv.sql

@ -0,0 +1,4 @@
alter table ic_resi_category_stats_config
add COLUMN `AUTO_MATCHING` varchar(1) NOT NULL DEFAULT '0' COMMENT '自动匹配:开启1;不匹配:0' after SORT;
alter table ic_resi_category_stats_config add COLUMN `YLFN_VALUE` varchar(32) DEFAULT NULL COMMENT '育龄妇女年龄范围,英文逗号隔开的数字例如:18,49' after AUTO_MATCHING;

5
epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/IcResiCategoryStatsConfigDao.xml

@ -26,6 +26,7 @@
select
a.ID as id,
a.LABEL as label,
a.COLUMN_NAME as columnName,
a.MANAGEMENT_ICON as managementIcon,
a.DATA_ICON as dataIcon,
a.HOUSE_SHOW_ICON as houseShowIcon,
@ -34,7 +35,9 @@
b.LEVEL_1 as level1,
b.LEVEL_2 as level2,
b.LEVEL_3 as level3,
b.WARN
b.WARN,
a.AUTO_MATCHING as autoMatching,
a.YLFN_VALUE as ylfnValue
from
ic_resi_category_stats_config a
left join ic_resi_category_warn_config b on a.TABLE_NAME = b.TABLE_NAME and a.COLUMN_NAME = b.COLUMN_NAME and b.DEL_FLAG =0 and b.CUSTOMER_ID = #{customerId}

2
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java

@ -43,6 +43,8 @@ public class ResiGroupMemberDTO implements Serializable {
* 用户id来源于customer_user.id
*/
private String customerUserId;
private String customerUserName;
private String customerUserMobile;
/**
* 小组id: 来源于resi_group表id

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java

@ -346,4 +346,6 @@ public interface ResiGroupDao extends BaseDao<ResiGroupEntity> {
* @date 2021.09.08 14:00:52
*/
List<GroupDetailResultDTO> listGroupsByMember(@Param("memberUserId") String memberUserId, @Param("gridId") String gridId);
List<ResiGroupMemberDTO> getMembersByGroup(@Param("ids")List<String> ids);
}

15
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java

@ -44,6 +44,7 @@ import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.ReadFlagConstant;
import com.epmet.constant.UserMessageTypeConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.UserInfoResultDTO;
import com.epmet.dto.result.UserResiInfoResultDTO;
import com.epmet.dto.result.UserRoleResultDTO;
@ -1946,6 +1947,16 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
if (CollectionUtils.isEmpty(entityList)) {
return Collections.emptyMap();
}
List<String> groupIds = entityList.stream().map(m -> m.getId()).collect(Collectors.toList());
List<ResiGroupMemberDTO> membersByGroup = baseDao.getMembersByGroup(groupIds);
Result<List<UserBaseInfoResultDTO>> listResult = epmetUserOpenFeignClient.queryUserBaseInfo(membersByGroup.stream().map(m -> m.getCustomerUserId()).collect(Collectors.toList()));
if (!listResult.success()){
throw new EpmetException("查询居民信息失败...");
}
membersByGroup.stream().forEach(m -> listResult.getData().stream().filter(u -> u.getUserId().equals(m.getCustomerUserId())).forEach(u -> {
m.setCustomerUserMobile(u.getMobile());
m.setCustomerUserName(u.getRealName());
}));
List<IcPartyOrgTreeDTO> list = entityList.stream().filter(i -> StringUtils.isNotBlank(i.getPartyOrgId())).map(item -> {
IcPartyOrgTreeDTO dto = new IcPartyOrgTreeDTO();
dto.setId(item.getId());
@ -1955,6 +1966,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou
dto.setPartyOrgName(item.getGroupName());
return dto;
}).collect(Collectors.toList());
list.stream().forEach(l -> membersByGroup.stream().filter(m -> m.getResiGroupId().equals(l.getId())).forEach(m -> {
l.setPrincipal(m.getCustomerUserName());
l.setPrincipalMobile(m.getCustomerUserMobile());
}));
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}

11
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml

@ -1072,4 +1072,15 @@
and resi_group.STATE = 'approved'
order by resi_group.CREATED_TIME desc
</select>
<select id="getMembersByGroup" resultType="com.epmet.resi.group.dto.member.ResiGroupMemberDTO">
SELECT CUSTOMER_USER_ID,RESI_GROUP_ID FROM resi_group_member
WHERE DEL_FLAG = '0'
AND GROUP_LEADER_FLAG = 'leader'
AND RESI_GROUP_ID IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</select>
</mapper>

15
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/IcPartyOrgDTO.java

@ -84,6 +84,21 @@ public class IcPartyOrgDTO implements Serializable {
*/
private String address;
/**
* 负责人
*/
private String principal;
/**
* 负责人staffId
*/
private String principalStaffId;
/**
* 联系电话
*/
private String principalMobile;
/**
* 党组织介绍
*/

36
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/EditPrincipalFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.resi.partymember.dto.partyOrg.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/9/7 15:02
* @DESC
*/
@Data
public class EditPrincipalFormDTO implements Serializable {
private static final long serialVersionUID = -1006713792388125512L;
/**
* 负责人
*/
@NotBlank(message = "principal不能为空",groups = AddGroup.class)
private String principal;
@NotBlank(message = "partyOrgId不能为空",groups = AddGroup.class)
private String partyOrgId;
/**
* 联系电话
*/
@NotBlank(message = "principalMobile不能为空",groups = AddGroup.class)
private String principalMobile;
@NotBlank(message = "principalStaffId不能为空",groups = AddGroup.class)
private String principalStaffId;
}

10
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/IcPartyOrgTreeDTO.java

@ -53,6 +53,16 @@ public class IcPartyOrgTreeDTO implements Serializable {
*/
private String partyOrgName;
/**
* 负责人
*/
private String principal;
/**
* 联系电话
*/
private String principalMobile;
private List<IcPartyOrgTreeDTO> children = new ArrayList<>();

14
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyOrgController.java

@ -14,6 +14,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.modules.partyOrg.excel.IcPartyOrgExcel;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.EditPrincipalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgListFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
@ -189,4 +190,17 @@ public class IcPartyOrgController {
return new Result<List<PartyOrgListResultDTO>>().ok(icPartyOrgService.partOrgList(formDTO.getGridId()));
}
/**
* Desc: 党组织修改负责人
* @param formDTO
* @author zxc
* @date 2022/9/7 15:04
*/
@PostMapping("editPrincipal")
public Result editPrincipal(@RequestBody EditPrincipalFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AddGroup.class);
icPartyOrgService.editPrincipal(formDTO);
return new Result();
}
}

9
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcPartyOrgDao.java

@ -3,6 +3,7 @@ package com.epmet.modules.partyOrg.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.EditPrincipalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.BranchlistTreeSubDTO;
@ -117,4 +118,12 @@ public interface IcPartyOrgDao extends BaseDao<IcPartyOrgEntity> {
List<IcPartyOrgDTO> getSelfAndSub(@Param("joinOrgId") String joinOrgId);
List<PartyOrgListResultDTO> partOrgList(@Param("agencyId") String agencyId);
/**
* Desc: 党组织修改负责人
* @param formDTO
* @author zxc
* @date 2022/9/7 15:04
*/
void editPrincipal(EditPrincipalFormDTO formDTO);
}

15
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyOrgEntity.java

@ -73,6 +73,21 @@ public class IcPartyOrgEntity extends BaseEpmetEntity {
*/
private String address;
/**
* 负责人
*/
private String principal;
/**
* 负责人staffId
*/
private String principalStaffId;
/**
* 联系电话
*/
private String principalMobile;
/**
* 党组织介绍
*/

10
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyOrgService.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.entity.IcPartyOrgEntity;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.EditPrincipalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.*;
@ -148,4 +149,13 @@ public interface IcPartyOrgService extends BaseService<IcPartyOrgEntity> {
void adjustOrgPath(List<String> customerIds);
List<PartyOrgListResultDTO> partOrgList(String gridId);
/**
* Desc: 党组织修改负责人
* @param formDTO
* @author zxc
* @date 2022/9/7 15:04
*/
void editPrincipal(EditPrincipalFormDTO formDTO);
}

13
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyOrgServiceImpl.java

@ -29,6 +29,7 @@ import com.epmet.modules.partymember.dao.IcPartyMemberDao;
import com.epmet.modules.partymember.entity.IcPartyMemberEntity;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.EditPrincipalFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.GetParentOrgFormDTO;
import com.epmet.resi.partymember.dto.partyOrg.form.PartyOrgTreeListDTO;
import com.epmet.resi.partymember.dto.partyOrg.result.*;
@ -490,4 +491,16 @@ public class IcPartyOrgServiceImpl extends BaseServiceImpl<IcPartyOrgDao, IcPart
return baseDao.partOrgList(gridInfo.getPid());
}
/**
* Desc: 党组织修改负责人
* @param formDTO
* @author zxc
* @date 2022/9/7 15:04
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void editPrincipal(EditPrincipalFormDTO formDTO) {
baseDao.editPrincipal(formDTO);
}
}

2
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.10__add_principal.sql

@ -0,0 +1,2 @@
ALTER TABLE ic_party_org ADD COLUMN PRINCIPAL VARCHAR(30) not null DEFAULT '' COMMENT '负责人' AFTER ADDRESS;
ALTER TABLE ic_party_org ADD COLUMN PRINCIPAL_MOBILE VARCHAR(30) not null DEFAULT '' COMMENT '联系方式' AFTER PRINCIPAL;

3
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/db/migration/V0.0.11__add_principal_staff_id.sql

@ -0,0 +1,3 @@
ALTER TABLE ic_party_org ADD COLUMN PRINCIPAL_STAFF_ID VARCHAR(32) DEFAULT '' COMMENT '负责人staffId' AFTER PRINCIPAL_MOBILE;
alter table ic_party_org modify PRINCIPAL_MOBILE VARCHAR(30) DEFAULT '' COMMENT '联系方式';
alter table ic_party_org modify PRINCIPAL VARCHAR(30) DEFAULT '' COMMENT '负责人';

27
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyOrgDao.xml

@ -24,6 +24,17 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 党组织修改负责人 -->
<update id="editPrincipal">
update ic_party_org
set PRINCIPAL_MOBILE = #{principalMobile},
PRINCIPAL = #{principal},
PRINCIPAL_STAFF_ID = #{principalStaffId},
UPDATED_TIME = NOW()
where id = #{partyOrgId}
</update>
<select id="getTreelist" resultType="com.epmet.resi.partymember.dto.partyOrg.result.IcPartyOrgTreeDTO">
select ID,
CUSTOMER_ID,
@ -32,7 +43,9 @@
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
PARTY_ORG_NAME,
PRINCIPAL_MOBILE,
PRINCIPAL
from ic_party_org
where DEL_FLAG=0
and CUSTOMER_ID=#{customerId}
@ -87,7 +100,9 @@
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME as label
PARTY_ORG_NAME as label,
PRINCIPAL_MOBILE,
PRINCIPAL
from ic_party_org
where DEL_FLAG=0
and CUSTOMER_ID=#{customerId}
@ -105,7 +120,9 @@
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
PARTY_ORG_NAME,
PRINCIPAL_MOBILE,
PRINCIPAL
from ic_party_org
where DEL_FLAG=0
and CUSTOMER_ID=#{customerId}
@ -124,7 +141,9 @@
AGENCY_ID,
AGENCY_PIDS,
PARTY_ORG_TYPE,
PARTY_ORG_NAME
PARTY_ORG_NAME,
PRINCIPAL_MOBILE,
PRINCIPAL
from ic_party_org
where DEL_FLAG = 0
and CUSTOMER_ID=#{customerId}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcPointNucleicMonitoringDTO.java

@ -66,6 +66,11 @@ public class IcPointNucleicMonitoringDTO implements Serializable {
*/
private String address;
/**
* 未禁用enable,已禁用disabled
*/
private String enableFlag;
/**
* 经度
*/

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserChartFormDTO.java

@ -22,6 +22,14 @@ public class UserChartFormDTO implements Serializable {
* 组织网格小区类型 agency grid village
*/
private String orgType;
/**
* 数据类型居民总数: all 常住: cz 流动: ld
*/
private String type;
private Integer pageNo = 1;
private Integer pageSize = 20;
private Boolean isPage = true;
//id集合
private List<String> idList;

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/MapInfoResultDTO.java

@ -77,6 +77,11 @@ public class MapInfoResultDTO implements Serializable {
*/
private String latitude;
/**
* 未禁用enable,已禁用disabled
*/
private String enableFlag;
}

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonDataResultDTO.java

@ -47,6 +47,8 @@ public class PersonDataResultDTO implements Serializable {
* 姓名
*/
private String name;
private String mobile;
private String isTenant;
/**
* 经济状况:包括 月收入monthlyIncome 退休金额retirementAmount

3
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -882,4 +882,7 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/icresiuser/nonDynamic/listResi")
Result<PageData<IcResiNonDynamicResultDTO>> listResiNonDynamic(@RequestBody IcResiPageNonDynamicFormDTO input);
@PostMapping("/epmetuser/icresiuser/updateYlfn")
Result updateYlfn();
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -678,4 +678,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<PageData<IcResiNonDynamicResultDTO>> listResiNonDynamic(IcResiPageNonDynamicFormDTO input) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "listResiNonDynamic", input);
}
@Override
public Result updateYlfn() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateYlfn", null);
}
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcPointAppController.java

@ -43,7 +43,17 @@ public class IcPointAppController {
return icPointAppService.getMapInfoByPointType(formDTO);
}
/**
* Desc: 核酸监测点启用禁用
* @param id
* @author zxc
* @date 2022/9/6 16:39
*/
@PostMapping("enableOrDisabled/{id}")
public Result enableOrDisabled(@PathVariable("id") String id){
icPointAppService.enableOrDisabled(id);
return new Result();
}

24
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -1411,4 +1411,28 @@ public class IcResiUserController implements ResultDataResolver {
return new Result<PageData<IcResiNonDynamicResultDTO>>().ok(page);
}
/**
* @Author sun
* @Description 人房概览居民统计数点击查询列表
**/
@PostMapping("icuserstatislist")
public Result<PageData<SearchByNameResultDTO>> icUserStatisList(@LoginUser TokenDto tokenDto, @RequestBody UserChartFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
return new Result<PageData<SearchByNameResultDTO>>().ok(icResiUserService.icUserStatisList(formDTO));
}
/**
* 更新育龄妇女状态定时任务
* @Param
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2022/9/8 17:19
*/
@PostMapping("updateYlfn")
public Result updateYlfn() {
icResiUserService.updateYlfn();
return new Result();
}
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcPointNucleicMonitoringDao.java

@ -49,4 +49,12 @@ public interface IcPointNucleicMonitoringDao extends BaseDao<IcPointNucleicMonit
*/
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO);
/**
* Desc: 核酸监测点启用禁用
* @param id
* @author zxc
* @date 2022/9/6 16:39
*/
void enableOrDisabled(@Param("id") String id);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -428,4 +428,6 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @Date 2022/6/29 17:37
*/
List<IcUserCountResultDTO> getIcUserCount(IcUserCountFormDTO formDTO);
List<SearchByNameResultDTO> icUserStatisList(UserChartFormDTO formDTO);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcPointNucleicMonitoringEntity.java

@ -1,13 +1,10 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 核酸监测点
*
@ -66,6 +63,11 @@ public class IcPointNucleicMonitoringEntity extends BaseEpmetEntity {
*/
private String address;
/**
* 未禁用enable,已禁用disabled
*/
private String enableFlag;
/**
* 经度
*/

16
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointAppService.java

@ -1,18 +1,10 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.IcPointNucleicMonitoringDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.entity.IcPointNucleicMonitoringEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.io.InputStream;
import java.util.List;
import java.util.Map;
/**
* 地图信息
@ -29,5 +21,11 @@ public interface IcPointAppService {
*/
Result<List<MapInfoResultDTO>> getMapInfoByPointType(MapInfoFormDTO formDTO);
/**
* Desc: 核酸监测点启用禁用
* @param id
* @author zxc
* @date 2022/9/6 16:39
*/
void enableOrDisabled(String id);
}

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcPointNucleicMonitoringService.java

@ -105,4 +105,12 @@ public interface IcPointNucleicMonitoringService extends BaseService<IcPointNucl
* @date 2022-06-20
*/
List<MapInfoResultDTO> getMapInfoList(MapInfoFormDTO formDTO);
/**
* Desc: 核酸监测点启用禁用
* @param id
* @author zxc
* @date 2022/9/6 16:39
*/
void enableOrDisabled(String id);
}

11
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -507,4 +507,15 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
IcUserMatchGridResultDTO icUserMatchGrid(IcUserMatchGridFormDTO formDTO);
PageData<IcResiNonDynamicResultDTO> listResiNonDynamic(Boolean fuzzy, String gridId, String name, String mobile, Integer pageNo, Integer pageSize);
PageData<SearchByNameResultDTO> icUserStatisList(UserChartFormDTO formDTO);
/**
* 更新育龄妇女状态定时任务
* @Param
* @Return
* @Author zhaoqifeng
* @Date 2022/9/8 15:45
*/
void updateYlfn();
}

56
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointAppServiceImpl.java

@ -1,58 +1,17 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dao.IcPointVaccinesInoculationDao;
import com.epmet.dto.IcPointVaccinesInoculationDTO;
import com.epmet.dto.form.ImportTaskCommonFormDTO;
import com.epmet.dto.form.MapInfoFormDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcPointVaccinesInoculationEntity;
import com.epmet.excel.IcPointVaccinesInoculationImportExcel;
import com.epmet.excel.error.PointVaccinesInoculationErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.feign.OssFeignClient;
import com.epmet.redis.IcPointVaccinesInoculationRedis;
import com.epmet.service.IcPointAppService;
import com.epmet.service.IcPointNucleicMonitoringService;
import com.epmet.service.IcPointVaccinesInoculationService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.entity.ContentType;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.*;
import java.util.stream.Collectors;
import java.util.ArrayList;
import java.util.List;
/**
* 地图信息
@ -85,4 +44,15 @@ public class IcPointAppServiceImpl implements IcPointAppService {
}
return new Result<List<MapInfoResultDTO>>().ok(mapInfoResultDTO);
}
/**
* Desc: 核酸监测点启用禁用
* @param id
* @author zxc
* @date 2022/9/6 16:39
*/
@Override
public void enableOrDisabled(String id) {
icPointNucleicMonitoringService.enableOrDisabled(id);
}
}

17
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcPointNucleicMonitoringServiceImpl.java

@ -5,7 +5,7 @@ import cn.afterturn.easypoi.excel.entity.ExportParams;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.ExceptionUtils;
@ -16,7 +16,6 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constants.ImportTaskConstants;
@ -28,10 +27,8 @@ import com.epmet.dto.form.OrgInfoPointFormDTO;
import com.epmet.dto.result.CommunityInfoResultDTO;
import com.epmet.dto.result.MapInfoResultDTO;
import com.epmet.dto.result.UploadImgResultDTO;
import com.epmet.entity.IcEpidemicSpecialAttentionEntity;
import com.epmet.entity.IcPointNucleicMonitoringEntity;
import com.epmet.excel.IcPointNucleicMonitoringImportExcel;
import com.epmet.excel.error.EpidemicSpecialAttentionErrorModel;
import com.epmet.excel.error.PointNucleicMonitoringErrorModel;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
@ -373,5 +370,17 @@ public class IcPointNucleicMonitoringServiceImpl extends BaseServiceImpl<IcPoint
return list;
}
/**
* Desc: 核酸监测点启用禁用
* @param id
* @author zxc
* @date 2022/9/6 16:39
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void enableOrDisabled(String id) {
baseDao.enableOrDisabled(id);
}
}

183
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -53,10 +53,7 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.constant.IcPlatformConstant;
import com.epmet.constant.IcResiUserConstant;
import com.epmet.constant.UserConstant;
import com.epmet.dao.IcPartyMemberDao;
import com.epmet.dao.IcResiUserDao;
import com.epmet.dao.IcVolunteerDao;
import com.epmet.dao.UserBaseInfoDao;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
@ -160,6 +157,10 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private DistributedLock distributedLock;
@Resource
private IcUserChangeRecordDao icUserChangeRecordDao;
@Resource
private IcUserChangeDetailedDao icUserChangeDetailedDao;
@ -3351,4 +3352,178 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
List<IcResiNonDynamicResultDTO> list = baseDao.selectList(query).stream().map((e) -> ConvertUtils.sourceToTarget(e, IcResiNonDynamicResultDTO.class)).collect(Collectors.toList());
return new PageData<IcResiNonDynamicResultDTO>(list, new PageInfo<>(list).getTotal(), pageSize);
}
@Override
public PageData<SearchByNameResultDTO> icUserStatisList(UserChartFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
//1.判断入参是否有值,没有值则赋值当前工作人员缓存中所属组织信息
if (StringUtils.isEmpty(formDTO.getOrgId())) {
//2.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType("agency");
}
//获取无效组织网格Id列表
if("agency".equals(formDTO.getOrgType())){
//查询组织数据时排除掉当前组织及下级无效组织列表
Result<DelAgencyGridIdResultDTO> result = govOrgOpenFeignClient.getDelAgencyGridIdList(formDTO.getOrgId());
if (!result.success()) {
throw new EpmetException(String.format("获取当前组织及下级已删除组织、网格列表失败,组织Id->%s", formDTO.getUserId()));
}
formDTO.setAgencyIdList(result.getData().getAgencyIdList());
formDTO.setGridIdList(result.getData().getGridIdList());
}
//2.按条件查询业务数据
List<SearchByNameResultDTO> list = baseDao.icUserStatisList(formDTO);
if (CollectionUtils.isEmpty(list)) {
return new PageData<SearchByNameResultDTO>(new ArrayList<>(), NumConstant.ZERO);
}
//3.封装数据
//查询小区,楼号,网格
Result<List<AllGridsByUserIdResultDTO>> gridResult = govOrgOpenFeignClient.getGridListByGridIds(list.stream().map(SearchByNameResultDTO::getGridId).collect(Collectors.toList()));
if (!gridResult.success()) {
throw new RenException(gridResult.getCode(), gridResult.getMsg());
}
Map<String, String> gridMap = gridResult.getData().stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName));
Result<List<IcNeighborHoodDTO>> neighborHoodResult = govOrgOpenFeignClient.getListByIds(list.stream().map(SearchByNameResultDTO::getNeighborHoodId).collect(Collectors.toList()));
if (!neighborHoodResult.success()) {
throw new RenException(neighborHoodResult.getCode(), neighborHoodResult.getMsg());
}
Map<String, String> neighborHoodMap = neighborHoodResult.getData().stream().collect(Collectors.toMap(IcNeighborHoodDTO::getId, IcNeighborHoodDTO::getNeighborHoodName));
Result<List<BuildingResultDTO>> buildResult = govOrgOpenFeignClient.buildingListByIds(list.stream().map(SearchByNameResultDTO::getBuildId).collect(Collectors.toList()));
if (!buildResult.success()) {
throw new RenException(buildResult.getCode(), buildResult.getMsg());
}
Map<String, String> buildMap = buildResult.getData().stream().collect(Collectors.toMap(BuildingResultDTO::getBuildingId, BuildingResultDTO::getBuildingName));
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
list.forEach(item -> {
item.setGridName(gridMap.get(item.getGridId()));
item.setNeighborHoodName(neighborHoodMap.get(item.getNeighborHoodId()));
item.setBuildNum(buildMap.get(item.getBuildId()));
item.setSort(i.getAndIncrement());
});
PageInfo<SearchByNameResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 更新育龄妇女状态定时任务
*
* @Param
* @Return
* @Author zhaoqifeng
* @Date 2022/9/8 15:45
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void updateYlfn() {
//获取育龄妇女配置
Result<List<YlfnValueResultDTO>> value = operCustomizeOpenFeignClient.getYlfnValue();
if(!value.success()) {
throw new EpmetException(value.getCode(), value.getMsg());
}
value.getData().forEach(item -> {
//查询客户下的非育龄妇女的女性居民
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getCustomerId, item.getCustomerId());
wrapper.eq(IcResiUserEntity::getGender, NumConstant.TWO_STR);
wrapper.eq(IcResiUserEntity::getStatus, NumConstant.ZERO_STR);
List<IcResiUserEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(user -> {
IdCardRegexUtils pares = IdCardRegexUtils.parse(user.getIdCard());
if (null != pares && NumConstant.ONE_STR.equals(pares.getTypeEnum().getType())) {
if (!NumConstant.ONE_STR.equals(user.getIsYlfn())) {
//将不是育龄妇女的变为育龄妇女
if (pares.getParsedResult().getAge() >= item.getMin() && pares.getParsedResult().getAge() <= item.getMax()) {
//更新育龄妇女状态
IcResiUserEntity icResiUserEntity = new IcResiUserEntity();
icResiUserEntity.setId(user.getId());
icResiUserEntity.setIsYlfn(NumConstant.ONE_STR);
baseDao.updateById(icResiUserEntity);
//添加居民变更记录
IcUserChangeRecordEntity record = new IcUserChangeRecordEntity();
record.setCustomerId(user.getCustomerId());
record.setOperatorId("APP_USER");
record.setOperatorName("自动匹配");
record.setIcUserId(user.getId());
record.setIcUserName(user.getName());
record.setType("category");
record.setTypeName("类别");
record.setBeforeChangeName("育龄妇女:否;");
record.setAfterChangeName("育龄妇女:是;");
record.setChangeTime(new Date());
icUserChangeRecordDao.insert(record);
//添加变更明细
IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity();
detail.setCustomerId(user.getCustomerId());
detail.setIcUserChangeRecordId(record.getId());
detail.setPids(user.getPids());
detail.setAgencyId(user.getAgencyId());
detail.setGridId(user.getGridId());
detail.setNeighborHoodId(user.getVillageId());
detail.setBuildingId(user.getBuildId());
detail.setBuildingUnitId(user.getUnitId());
detail.setHouseId(user.getHomeId());
detail.setIcUserId(user.getId());
detail.setType("category");
detail.setTypeName("类别");
detail.setFieldName("IS_YLFN");
detail.setValue(NumConstant.ONE);
icUserChangeDetailedDao.insert(detail);
}
} else {
//将是育龄妇女的变为非育龄妇女
if (pares.getParsedResult().getAge() < item.getMin() || pares.getParsedResult().getAge() > item.getMax()) {
//更新育龄妇女状态
IcResiUserEntity icResiUserEntity = new IcResiUserEntity();
icResiUserEntity.setId(user.getId());
icResiUserEntity.setIsYlfn(NumConstant.ZERO_STR);
baseDao.updateById(icResiUserEntity);
//添加居民变更记录
IcUserChangeRecordEntity record = new IcUserChangeRecordEntity();
record.setCustomerId(user.getCustomerId());
record.setOperatorId("APP_USER");
record.setOperatorName("自动匹配");
record.setIcUserId(user.getId());
record.setIcUserName(user.getName());
record.setType("category");
record.setTypeName("类别");
record.setBeforeChangeName("育龄妇女:是;");
record.setAfterChangeName("育龄妇女:否;");
record.setChangeTime(new Date());
icUserChangeRecordDao.insert(record);
//添加变更明细
IcUserChangeDetailedEntity detail = new IcUserChangeDetailedEntity();
detail.setCustomerId(user.getCustomerId());
detail.setIcUserChangeRecordId(record.getId());
detail.setPids(user.getPids());
detail.setAgencyId(user.getAgencyId());
detail.setGridId(user.getGridId());
detail.setNeighborHoodId(user.getVillageId());
detail.setBuildingId(user.getBuildId());
detail.setBuildingUnitId(user.getUnitId());
detail.setHouseId(user.getHomeId());
detail.setIcUserId(user.getId());
detail.setType("category");
detail.setTypeName("类别");
detail.setFieldName("IS_YLFN");
detail.setValue(NumConstant.ONE_NEG);
icUserChangeDetailedDao.insert(detail);
}
}
}
});
}
});
}
}

1
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.68__alter_ic_point_nucleic_monitoring_enable.sql

@ -0,0 +1 @@
ALTER TABLE ic_point_nucleic_monitoring ADD COLUMN ENABLE_FLAG VARCHAR(10) not null DEFAULT 'enable' COMMENT '未禁用enable,已禁用disabled' AFTER ADDRESS;

11
epmet-user/epmet-user-server/src/main/resources/mapper/IcPointNucleicMonitoringDao.xml

@ -24,6 +24,14 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<!-- 核酸监测点启用禁用 -->
<update id="enableOrDisabled">
update ic_point_nucleic_monitoring
set UPDATED_TIME = now(),
ENABLE_FLAG = case when ENABLE_FLAG = 'enable' then 'disabled' else 'enable' end
where id = #{id}
</update>
<select id="getAllAddressName" resultType="java.lang.String">
select
NAME
@ -53,6 +61,7 @@
SERVE_TIME,
MOBILE,
ADDRESS,
ENABLE_FLAG,
LONGITUDE,
LATITUDE,
DEL_FLAG,
@ -121,6 +130,7 @@
when round((st_distance_sphere(point(#{longitude},#{latitude}), point(LONGITUDE, LATITUDE))) / 1000 ,1) &lt;= 5 then '5'
else '99' end ) as kmNum,
SERVE_TIME as date,
ENABLE_FLAG,
MOBILE,
ADDRESS,
LONGITUDE,
@ -128,6 +138,7 @@
from ic_point_nucleic_monitoring
where DEL_FLAG = 0
and CUSTOMER_ID = #{customerId}
and ENABLE_FLAG = 'enable'
<if test="name != null and name != ''">
and NAME like CONCAT('%' ,#{name}, '%')
</if>

58
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -296,6 +296,8 @@
<result column="ID_CARD" property="idCard"/>
<result column="name" property="name"/>
<result column="isVolunteer" property="isVolunteer"/>
<result column="mobile" property="mobile"/>
<result column="isTenant" property="isTenant"/>
<result column="CUSTOMER_ID" property="customerId"/>
<result column="GRID_ID" property="gridId"/>
<collection property="financialSituation" ofType="com.epmet.dto.FinancialSituationDTO">
@ -310,6 +312,8 @@
YSR,
TXJE,
ID_CARD,
MOBILE,
IS_TENANT as isTenant,
IFNULL(IS_VOLUNTEER,'0') AS isVolunteer,
CUSTOMER_ID,
GRID_ID
@ -1289,4 +1293,58 @@
</choose>
</if>
</select>
<select id="icUserStatisList" resultType="com.epmet.dto.result.SearchByNameResultDTO">
SELECT
id AS userId,
`name`,
village_id AS neighborHoodId,
build_id,
grid_id,
mobile,
(
case when gender = '1'then '男'
when gender = '2' then '女'
else '未知'
end
) as gender,
id_card,
IFNULL(birthday,'') AS birthday,
IFNULL(remarks,'') AS remarks
FROM
ic_resi_user
WHERE
del_flag = '0'
AND status = '0'
AND customer_id = #{customerId}
<if test='null != type and type.trim() != "" and type == "cz" '>
AND is_floating = '0'
</if>
<if test='null != type and type.trim() != "" and type == "ld" '>
AND (is_floating != '0' or is_floating is null)
</if>
<choose>
<when test='orgType == "agency"'>
AND (agency_id = #{orgId} OR pids LIKE CONCAT('%', #{orgId}, '%'))
<if test='null != agencyIdList and agencyIdList.size() > 0'>
<foreach collection="agencyIdList" item="agencyId" open="AND agency_id NOT IN (" separator="," close=")">
#{agencyId}
</foreach>
</if>
<if test='null != gridIdList and gridIdList.size() > 0'>
<foreach collection="gridIdList" item="gridId" open="AND grid_id NOT IN (" separator="," close=")">
#{gridId}
</foreach>
</if>
</when>
<when test='orgType == "grid"'>
AND grid_id = #{orgId}
</when>
<otherwise>
AND village_id = #{orgId}
</otherwise>
</choose>
ORDER BY `name` ASC
</select>
</mapper>

Loading…
Cancel
Save