Browse Source

Merge branch 'bugfix/teamB_shuangshi' into master_yantai

dev
yujt 3 years ago
parent
commit
d9bc8c1f03
  1. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  2. 45
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java
  3. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcEpidemicSpecialAttentionDTO.java
  4. 32
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java
  5. 3
      epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql
  6. 4
      epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -813,7 +813,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
boolean party = false;
//网格指导员角色
boolean gridParty = false;
for (CustomerStaffRoleListResultDTO role : RoleList) {
//2022.7.8 pc端党建声音发布单位取消角色限制
party = true;
/*for (CustomerStaffRoleListResultDTO role : RoleList) {
if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) {
party = true;
}
@ -823,7 +825,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
if (!party && !gridParty) {
return returnDTO;
}
}*/
//4:根据不同角色查询不同数据
CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId());

45
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseInformationServiceImpl.java

@ -58,10 +58,12 @@ public class HouseInformationServiceImpl implements HouseInformationService {
*/
@Override
public CommunityCountResultDTO getCommunityCount(HouseInformationFormDTO formDTO) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (StringUtils.isEmpty(formDTO.getCommunityId())) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if(null == staffInfo) {
// CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "获取用户信息失败", "获取用户信息失败");
}
formDTO.setCommunityId(staffInfo.getAgencyId());
@ -69,7 +71,12 @@ public class HouseInformationServiceImpl implements HouseInformationService {
String orgName;
CustomerAgencyEntity agency = customerAgencyDao.selectById(formDTO.getCommunityId());
if (null == agency) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在");
agency = customerAgencyDao.selectById(staffInfo.getAgencyId());
if (null == agency) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "社区不存在", "社区不存在");
} else {
formDTO.setCommunityId(staffInfo.getAgencyId());
}
}
CustomerAgencyEntity parentAgency = customerAgencyDao.selectById(agency.getPid());
if (null == parentAgency) {
@ -122,6 +129,34 @@ public class HouseInformationServiceImpl implements HouseInformationService {
item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
});
} else {
return deleteAfetrEmergency(formDTO);
}
return new PageData<>(list, pageInfo.getTotal());
}
private PageData<GridCountListResultDTO> deleteAfetrEmergency(HouseInformationFormDTO formDTO) {
//获取工作人员所属组织
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setCommunityId(staffInfo.getAgencyId());
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<GridCountListResultDTO> list = icNeighborHoodDao.getGridList(formDTO);
PageInfo<GridCountListResultDTO> pageInfo = new PageInfo<>(list);
if (CollectionUtils.isNotEmpty(list)) {
//获取录入人口数
IcUserCountFormDTO countFormDTO = new IcUserCountFormDTO();
countFormDTO.setOrgType(NumConstant.ZERO_STR);
countFormDTO.setOrgId(formDTO.getCommunityId());
countFormDTO.setType(NumConstant.ONE_STR);
Map<String, Integer> map = getMapResult(countFormDTO);
list.forEach(item -> {
if (map.containsKey(item.getId())) {
item.setPersonCount(map.get(item.getId()));
}
item.setDifferPersonCount(item.getPersonRealCount() - item.getPersonCount());
});
}
return new PageData<>(list, pageInfo.getTotal());
}
@ -254,7 +289,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
//排序
list = list.stream().sorted(Comparator.comparing(BuildingListResultDTO::getDifferPersonCount).reversed()).collect(Collectors.toList());
//分页
list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
}
}
@ -387,7 +422,7 @@ public class HouseInformationServiceImpl implements HouseInformationService {
//排序
list = list.stream().sorted(Comparator.comparing(HomeListResultDTO::getPersonCount).reversed()).collect(Collectors.toList());
//分页
list = list.stream().skip((long)(formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
list = list.stream().skip((long) (formDTO.getPageNo() - 1) * formDTO.getPageSize()).limit(formDTO.getPageSize()).collect(Collectors.toList());
}
}

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

@ -70,7 +70,7 @@ public class IcEpidemicSpecialAttentionDTO implements Serializable {
/**
* 手机号
*/
@NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class)
// @NotBlank(message = "mobile不能为空",groups = IcEpidemicSpecialAttentionAdd.class)
private String mobile;
/**

32
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/VaccinationListResultDTO.java

@ -5,6 +5,7 @@ import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.util.regex.Pattern;
/**
* @Author zxc
@ -118,16 +119,26 @@ public class VaccinationListResultDTO implements Serializable {
this.sex = "未知";
}else {
if (this.idCard.length() == NumConstant.FIFTEEN){
if (Integer.parseInt(this.idCard.substring(NumConstant.FOURTEEN, NumConstant.FIFTEEN)) % NumConstant.TWO == NumConstant.ZERO) {
sex = "女";
} else {
sex = "男";
String substring = this.idCard.substring(NumConstant.FOURTEEN, NumConstant.FIFTEEN);
if (!isNumeric2(substring)){
this.sex = "未知";
}else {
if (Integer.parseInt(substring) % NumConstant.TWO == NumConstant.ZERO) {
sex = "女";
} else {
sex = "男";
}
}
}else if (this.idCard.length() == NumConstant.EIGHTEEN){
if (Integer.parseInt(this.idCard.substring(NumConstant.SIXTEEN).substring(NumConstant.ZERO,NumConstant.ONE)) % NumConstant.TWO == NumConstant.ZERO) {
sex = "女";
} else {
sex = "男";
String substring = this.idCard.substring(NumConstant.SIXTEEN).substring(NumConstant.ZERO, NumConstant.ONE);
if (!isNumeric2(substring)){
this.sex = "未知";
}else {
if (Integer.parseInt(substring) % NumConstant.TWO == NumConstant.ZERO) {
sex = "女";
} else {
sex = "男";
}
}
}else {
this.sex = "未知";
@ -135,4 +146,9 @@ public class VaccinationListResultDTO implements Serializable {
}
}
private static final Pattern NUMBER_PATTERN = Pattern.compile("-?\\d+(\\.\\d+)?");
public static boolean isNumeric2(String str) {
return str != null && NUMBER_PATTERN.matcher(str).matches();
}
}

3
epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.60__alter_ic_epidemic_special_attention.sql

@ -0,0 +1,3 @@
ALTER TABLE `ic_epidemic_special_attention`
MODIFY COLUMN `MOBILE` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机号';

4
epmet-user/epmet-user-server/src/main/resources/mapper/IcEpidemicSpecialAttentionDao.xml

@ -36,7 +36,7 @@
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and b.CUSTOMER_ID=a.CUSTOMER_ID
LEFT JOIN (SELECT id_card , CUSTOMER_ID, count(1) AS vaccinationCount, CREATED_TIME FROM ic_vaccine WHERE DEL_FLAG = 0 GROUP BY ID_CARD, CUSTOMER_ID) v ON (v.ID_CARD = a.ID_CARD and v.CUSTOMER_ID=a.CUSTOMER_ID)
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%')
AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')
@ -87,7 +87,7 @@
FROM ic_epidemic_special_attention a
LEFT JOIN ic_resi_user b ON a.id_card = b.id_card AND b.del_flag = '0' and a.CUSTOMER_ID = b.CUSTOMER_ID
WHERE a.DEL_FLAG = 0
AND a.ORG_ID = #{orgId}
AND concat(a.pids,':',ORG_ID) like concat('%',#{orgId},'%')
AND a.ATTENTION_TYPE = #{attentionType}
<if test='null != name and "" != name'>
AND a.`NAME` LIKE CONCAT('%',#{name},'%')

Loading…
Cancel
Save