Browse Source

Merge branch 'dev_policy_service' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_policy_service

master
jianjun 3 years ago
parent
commit
f6d9a82204
  1. 6
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java
  2. 39
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java
  3. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java
  4. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  5. 11
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  6. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  7. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  8. 30
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java
  9. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml
  10. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java
  11. 24
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java
  12. 14
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java
  13. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java
  14. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java
  15. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java
  16. 23
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java
  17. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java
  18. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java
  19. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java
  20. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml
  21. 2
      epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql
  22. 2
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

6
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ResisByPolicyRulesFormDTO.java

@ -32,9 +32,9 @@ public class ResisByPolicyRulesFormDTO {
@AllArgsConstructor
public static class RuleList {
private String ruleName;
private List<ResiRule> resiRule;
private List<HouseRule> houseRule;
private List<StatRule> statRule;
private List<ResiRule> resiRuleList;
private List<HouseRule> houseRuleList;
private List<StatRule> statRuleList;
}
@Data

39
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/IcUserController.java

@ -2,10 +2,13 @@ package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.epmetuser.form.IcUserCategoryFormDTO;
@ -14,7 +17,9 @@ import com.epmet.dataaggre.dto.epmetuser.result.IcUserCategoryResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.ResiByPolicyInfoResultDTO;
import com.epmet.dataaggre.service.ResiService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@ -30,7 +35,7 @@ import java.util.Set;
@RestController
@RequestMapping("icuser")
public class IcUserController {
public class IcUserController implements ResultDataResolver {
@Autowired
private EpmetUserService epmetUserService;
@ -38,6 +43,9 @@ public class IcUserController {
@Autowired
private ResiService icResiService;
@Autowired
private EpmetHeartOpenFeignClient heartOpenFeignClient;
/**
* 人员类别分析-各类别人数
*
@ -59,13 +67,14 @@ public class IcUserController {
*/
@PostMapping("listByPolicyRules")
public Result<PageData<ResiByPolicyInfoResultDTO>> listByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) {
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule = input.getRuleList().getResiRuleList();
List<ResisByPolicyRulesFormDTO.HouseRule> houseRule = input.getRuleList().getHouseRuleList();
List<ResisByPolicyRulesFormDTO.StatRule> statRule = input.getRuleList().getStatRuleList();
Integer pageNo = input.getPageNo();
Integer pageSize = input.getPageSize();
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule = input.getRuleList().getResiRule();
List<ResisByPolicyRulesFormDTO.HouseRule> houseRule = input.getRuleList().getHouseRule();
List<ResisByPolicyRulesFormDTO.StatRule> statRule = input.getRuleList().getStatRule();
String orgId = input.getOrgId();
String orgType = input.getOrgType();
String neighborHoodId = input.getNeighborHoodId();
@ -74,12 +83,26 @@ public class IcUserController {
String houseId = input.getHouseId();
String idCard = input.getIdCard();
String name = input.getName();
String ruleId = input.getRuleId();
if (StringUtils.isNotBlank(ruleId)) {
// 从heart取,覆盖形参
com.epmet.dto.form.resi.ResisByPolicyRulesFormDTO.RuleList ruleList = getResultDataOrThrowsException(
heartOpenFeignClient.listPolicyRules4QueryAndExport(ruleId),
ServiceConstant.EPMET_HEART_SERVER,
EpmetErrorCode.SERVER_ERROR.getCode(),
null, null);
resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRuleList(), ResisByPolicyRulesFormDTO.ResiRule.class);
houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRuleList(), ResisByPolicyRulesFormDTO.HouseRule.class);
statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class);
}
// 全都为空,则返回空
// 全都为空,则返回空ç
if (CollectionUtils.isEmpty(resiRule)
&& CollectionUtils.isEmpty(houseRule)
&& CollectionUtils.isEmpty(statRule)) {
return new Result().ok(new ArrayList<>());
return new Result().ok(new PageData<>(new ArrayList<>(), 0));
}
PageData<ResiByPolicyInfoResultDTO> page = icResiService.listByPolicyRules(orgId, orgType, neighborHoodId, buildingId, unitId,
@ -97,7 +120,7 @@ public class IcUserController {
icResiService.exportResisByPolicy(
input.getOrgId(), input.getOrgType(), input.getNeighborHoodId(), input.getBuildingId(), input.getUnitId(),
input.getHouseId(), input.getIdCard(), input.getName(), input.getPageNo(), input.getPageSize(),
input.getRuleId(), input.getRuleList().getResiRule(), input.getRuleList().getHouseRule(), input.getRuleList().getStatRule(), response);
input.getRuleId(), input.getRuleList().getResiRuleList(), input.getRuleList().getHouseRuleList(), input.getRuleList().getStatRuleList(), response);
} catch (IOException e) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "导出Excel文件失败", "导出Excel文件失败");
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/IcResiUserDao.java

@ -69,6 +69,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @return
*/
List<ResiByPolicyInfoResultDTO> listByPolicyRules(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("neighborHoodId") String neighborHoodId,
@ -86,6 +87,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
* @return
*/
Integer getTotalByPolicyRules(@Param("customerId") String customerId,
@Param("orgIdPath") String orgIdPath,
@Param("orgId") String orgId,
@Param("orgType") String orgType,
@Param("neighborHoodId") String neighborHoodId,

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -201,11 +201,11 @@ public interface EpmetUserService {
*/
List<StaffSelectResDTO> staffSelectList(List<String> staffIds);
List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name, Integer pageNo, Integer pageSize,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds);
Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
Integer getTotalByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds);
}

11
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -45,6 +45,7 @@ import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.UserBaseInfoDTO;
import com.epmet.dto.result.StaffRoleResultDTO;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.MapUtils;
@ -845,15 +846,15 @@ public class EpmetUserServiceImpl implements EpmetUserService {
}
@Override
public List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
public List<ResiByPolicyInfoResultDTO> listByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name, Integer pageNo, Integer pageSize,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds) {
return icResiUserDao.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
PageHelper.startPage(pageNo, pageSize);
return icResiUserDao.listByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
}
@Override
public Integer getTotalByPolicyRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds) {
return icResiUserDao.getTotalByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
public Integer getTotalByPolicyRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId, String unitId, String houseId, String idCard, String name, List<ResisByPolicyRulesFormDTO.ResiRule> resiRule, List<String> houseIds) {
return icResiUserDao.getTotalByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId, houseId, idCard, name, resiRule, houseIds);
}
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -218,7 +218,7 @@ public interface GovOrgService {
*/
CustomerAgencyEntity getRootAgencyByCustomerId(String customerId);
List<IcHouseEntity> listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId,
List<IcHouseEntity> listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId,
String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize);

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1110,7 +1110,7 @@ public class GovOrgServiceImpl implements GovOrgService {
}
@Override
public List<IcHouseEntity> listHousesByRules(String customerId, String orgId, String orgType, String neighborHoodId, String buildingId,
public List<IcHouseEntity> listHousesByRules(String customerId, String orgIdPath, String orgId, String orgType, String neighborHoodId, String buildingId,
String unitId, String houseId, List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule, Integer pageNo, Integer pageSize) {
@ -1120,11 +1120,13 @@ public class GovOrgServiceImpl implements GovOrgService {
QueryWrapper<IcHouseEntity> query = new QueryWrapper<>();
// 如果参数里面选了,就用参数选择的来查询,没有选择的话,就查询当前工作人员所属组织的本级及下级
if (StringUtils.isNotBlank(orgId) && StringUtils.isNotBlank(orgType)) {
String orgIdPath = getOrgIdPath(orgId, orgType);
query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath);
orgIdPath = getOrgIdPath(orgId, orgType);
}
query.likeRight(StringUtils.isNotBlank(orgIdPath), "ORG_ID_PATH", orgIdPath);
if (StringUtils.isNotBlank(customerId)) {
query.eq("CUSTOMER_ID", customerId);
}

30
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/ResiServiceImpl.java

@ -22,7 +22,10 @@ import com.epmet.dataaggre.service.ResiService;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -48,21 +51,34 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
@Autowired
private EpmetHeartOpenFeignClient heartOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Override
public PageData<ResiByPolicyInfoResultDTO> listByPolicyRules(String orgId, String orgType, String neighborHoodId, String buildingId, String unitId,
String houseId, String idCard, String name, Integer pageNo, Integer pageSize,
List<ResisByPolicyRulesFormDTO.ResiRule> resiRule,
List<ResisByPolicyRulesFormDTO.HouseRule> houseRule,
List<ResisByPolicyRulesFormDTO.StatRule> statRule) {
String userId = EpmetRequestHolder.getLoginUserId();
String app = EpmetRequestHolder.getLoginUserApp();
String client = EpmetRequestHolder.getLoginUserClient();
String customerId = EpmetRequestHolder.getLoginUserCustomerId();
// 查询当前组织及下级id路径
LoginUserDetailsResultDTO userDetail = getResultDataOrThrowsException(userOpenFeignClient.getLoginUserDetails(new LoginUserDetailsFormDTO(app, client, userId)),
ServiceConstant.EPMET_USER_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), null, null);
String orgIdPath = userDetail.getOrgIdPath();
// 结果集
List<ResiByPolicyInfoResultDTO> resultResis = new ArrayList<>();
// 1.用户没配置house和stat规则,直接按照居民规则查询
if (CollectionUtils.isEmpty(houseRule) && CollectionUtils.isEmpty(statRule)) {
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, null);
fillResisExtraInfoForPolicy(resis);
return new PageData<>(resis, new PageInfo(resis).getTotal());
}
@ -71,7 +87,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
int total = 0;
do {
// 拿到房屋id列表,去查询居民列表
List<IcHouseEntity> houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
List<IcHouseEntity> houseEntities = govOrgService.listHousesByRules(customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, houseRule, statRule, housePageNo, 50);
List<String> houseIds = houseEntities.stream().map(icHouseEntity -> icHouseEntity.getId()).collect(Collectors.toList());
@ -83,7 +99,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
// 查询居民,满了20个,不再查询数据,只查询数量
if (resultResis.size() < pageSize) {
List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, pageNo, pageSize, resiRule, houseIds);
resultResis.addAll(resis);
@ -91,7 +107,7 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
// 查询数量
Integer count = epmetUserService.getTotalByPolicyRules(
customerId, orgId, orgType, neighborHoodId, buildingId, unitId,
customerId, orgIdPath, orgId, orgType, neighborHoodId, buildingId, unitId,
houseId, idCard, name, resiRule, houseIds);
total += count;
@ -167,9 +183,9 @@ public class ResiServiceImpl implements ResiService, ResultDataResolver {
EpmetErrorCode.SERVER_ERROR.getCode(),
null, null);
resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRule(), ResisByPolicyRulesFormDTO.ResiRule.class);
houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRule(), ResisByPolicyRulesFormDTO.HouseRule.class);
statRule = ConvertUtils.sourceToTarget(ruleList.getStatRule(), ResisByPolicyRulesFormDTO.StatRule.class);
resiRule = ConvertUtils.sourceToTarget(ruleList.getResiRuleList(), ResisByPolicyRulesFormDTO.ResiRule.class);
houseRule = ConvertUtils.sourceToTarget(ruleList.getHouseRuleList(), ResisByPolicyRulesFormDTO.HouseRule.class);
statRule = ConvertUtils.sourceToTarget(ruleList.getStatRuleList(), ResisByPolicyRulesFormDTO.StatRule.class);
}
ServletOutputStream ostream = response.getOutputStream();

21
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/IcResiUserDao.xml

@ -71,7 +71,10 @@
<sql id="segmentForPolicyRules">
<where>
ic_resi_user.CUSTOMER_ID=#{customerId}
ic_resi_user.status='0'
and ic_resi_user.CUSTOMER_ID=#{customerId}
and ic_resi_user.PIDS LIKE CONCAT(#{orgIdPath},'%')
and ic_resi_user.del_flag='0'
<!--组织过滤-->
<if test="orgId != null and orgId != '' and orgType != null and orgType != ''">
<choose>
@ -84,23 +87,23 @@
</choose>
</if>
<!-- 小区等条件 -->
<if test="neighborHoodId != null">
<if test="neighborHoodId != null and neighborHoodId!=''">
and ic_resi_user.VILLAGE_ID=#{neighborHoodId}
</if>
<if test="buildingId != null">
<if test="buildingId != null and buildingId!=''">
and ic_resi_user.BUILD_ID=#{buildingId}
</if>
<if test="unitId != null">
<if test="unitId != null and unitId!=''">
and ic_resi_user.UNIT_ID=#{unitId}
</if>
<if test="houseId != null">
<if test="houseId != null and houseId!=''">
and ic_resi_user.HOME_ID=#{houseId}
</if>
<if test="idCard != null">
and ic_resi_user.ID_CARD like CONCAT('%'#{idCard}, '%')
<if test="idCard != null and idCard!=''">
and ic_resi_user.ID_CARD like CONCAT('%',#{idCard}, '%')
</if>
<if test="name != null">
and ic_resi_user.NAME like CONCAT('%'#{name}, '%')
<if test="name != null and name!=''">
and ic_resi_user.NAME like CONCAT('%',#{name}, '%')
</if>
<!-- 房屋id列表 -->
<if test="houseIds != null and houseIds.size() > 0">

1
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyPageFormDTO.java

@ -32,6 +32,7 @@ public class IcPolicyPageFormDTO extends PageFormDTO implements Serializable {
* 是否过期1已过期0未过期
*/
private String expiredFlag;
private String agencyId;
}

24
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/policy/IcPolicyRuleDetailDTO.java

@ -66,5 +66,29 @@ public class IcPolicyRuleDetailDTO {
*/
@NotBlank(message = "参数值不能为空", groups = {ResiRulerShowGroup.class,HouseRulerShowGroup.class,StatRulerShowGroup.class})
private String colVal;
/**
* 用于前端展示基础信息教育信息房屋类型.....
*/
private String itemGroupName;
/**
* 用于前端展示姓名手机号......
*/
private String itemLabel;
/**
* 用于前端展示等于不等于大于小于....
*/
private String queryTypeName;
/**
* 用于前端展示参数值显示值eg:男女
*/
private String colValLabel;
/**
* 用于前端展示逻辑并且或者
*/
private String nextLogicalRelName;
}

14
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/HeartResisByPolicyRulesFormDTO.java

@ -28,14 +28,18 @@ public class HeartResisByPolicyRulesFormDTO {
private Integer pageSize;
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class RuleList {
private String ruleName;
private List<ResisByPolicyRulesFormDTO.ResiRule> resiRule;
private List<ResisByPolicyRulesFormDTO.HouseRule> houseRule;
private List<ResisByPolicyRulesFormDTO.StatRule> statRule;
private List<ResisByPolicyRulesFormDTO.ResiRule> resiRuleList;
private List<ResisByPolicyRulesFormDTO.HouseRule> houseRuleList;
private List<ResisByPolicyRulesFormDTO.StatRule> statRuleList;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class ResiRule {
private String ruleDesc;
private String nextLogicalRel;
@ -48,6 +52,8 @@ public class HeartResisByPolicyRulesFormDTO {
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class HouseRule {
private String colTable;
private String colKey;
@ -58,6 +64,8 @@ public class HeartResisByPolicyRulesFormDTO {
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class StatRule {
private String colKey;
private String colVal;

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResisByPolicyRulesFormDTO.java

@ -28,9 +28,9 @@ public class ResisByPolicyRulesFormDTO {
@NoArgsConstructor
@AllArgsConstructor
public static class RuleList {
private List<ResiRule> resiRule;
private List<HouseRule> houseRule;
private List<StatRule> statRule;
private List<ResiRule> resiRuleList;
private List<HouseRule> houseRuleList;
private List<StatRule> statRuleList;
}
@Data

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServiceRecordV2DetailResultDTO.java

@ -5,7 +5,6 @@ import com.epmet.dto.IcServiceScopeV2DTO;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -21,6 +20,7 @@ public class ServiceRecordV2DetailResultDTO implements Serializable {
private String serviceRecordId;
private String serviceName;
private String policyId;
/**
* 服务组织类型

22
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPolicyController.java

@ -1,16 +1,14 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcPolicyDTO;
import com.epmet.dto.IcPolicyItemResultDTO;
import com.epmet.dto.form.resi.HeartResisByPolicyRulesFormDTO;
import com.epmet.dto.IcPolicyRuleDTO;
import com.epmet.dto.form.policy.IcPolicyFormDTO;
import com.epmet.dto.form.policy.IcPolicyPageFormDTO;
@ -57,6 +55,7 @@ public class IcPolicyController {
* @param input
* @return
*/
@Deprecated
@PostMapping("resiuserlist")
public Result listResiUserByPolicyRules(@RequestBody ResisByPolicyRulesFormDTO input) {
// 调整错位的逻辑符号位置
@ -145,6 +144,17 @@ public class IcPolicyController {
return new Result<PageData<IcPolicyDTO>>().ok(page);
}
/**
* Desc: 政策列表下拉选
* @param tokenDto
* @author zxc
* @date 2022/7/21 09:48
*/
@PostMapping("policyListSelect")
public Result<List<IcPolicyDTO>> policyListSelect(@LoginUser TokenDto tokenDto){
return new Result<List<IcPolicyDTO>>().ok(icPolicyService.policyListSelect(tokenDto.getUserId(),tokenDto.getCustomerId()));
}
/**
* 细则列表
* @param customerId
@ -189,7 +199,7 @@ public class IcPolicyController {
r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal()))
.collect(Collectors.toList());
data.setResiRule(resiRules);
data.setResiRuleList(resiRules);
}
// house规则
@ -200,7 +210,7 @@ public class IcPolicyController {
.map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(),
r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType()))
.collect(Collectors.toList());
data.setHouseRule(houseRules);
data.setHouseRuleList(houseRules);
}
// stat规则
@ -212,7 +222,7 @@ public class IcPolicyController {
r.getRuleDesc(), r.getQueryType(), r.getColTable()))
.collect(Collectors.toList());
data.setStatRule(statRules);
data.setStatRuleList(statRules);
}
return new Result<ResisByPolicyRulesFormDTO.RuleList>().ok(data);

23
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPolicyRuleDetailEntity.java

@ -84,4 +84,27 @@ public class IcPolicyRuleDetailEntity extends BaseEpmetEntity {
*/
private Integer sort;
/**
* 用于前端展示基础信息教育信息房屋类型.....
*/
private String itemGroupName;
/**
* 用于前端展示姓名手机号......
*/
private String itemLabel;
/**
* 用于前端展示等于不等于大于小于....
*/
private String queryTypeName;
/**
* 用于前端展示参数值显示值eg:男女
*/
private String colValLabel;
/**
* 用于前端展示逻辑并且或者
*/
private String nextLogicalRelName;
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPolicyService.java

@ -45,6 +45,14 @@ public interface IcPolicyService extends BaseService<IcPolicyEntity> {
*/
PageData<IcPolicyDTO> policyList(IcPolicyPageFormDTO formDTO);
/**
* Desc: 政策列表下拉选
* @param formDTO
* @author zxc
* @date 2022/7/21 09:48
*/
List<IcPolicyDTO> policyListSelect(String userId,String customerId);
List<IcPolicyRuleDTO> ruleList(String customerId,String policyId);
IcPolicyDTO policyDetail(String customerId,String policyId);

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPolicyServiceImpl.java

@ -246,6 +246,15 @@ public class IcPolicyServiceImpl extends BaseServiceImpl<IcPolicyDao, IcPolicyEn
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public List<IcPolicyDTO> policyListSelect(String userId,String customerId) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null == staffInfo || StringUtils.isBlank(staffInfo.getAgencyId())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "工作人员缓存信息异常", "工作人员信息异常");
}
return baseDao.policyList(customerId, staffInfo.getAgencyId(), null,null,null);
}
@Override
public List<IcPolicyRuleDTO> ruleList(String customerId, String policyId) {
LambdaQueryWrapper<IcPolicyRuleEntity> wrapper = new LambdaQueryWrapper<>();
@ -331,7 +340,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl<IcPolicyDao, IcPolicyEn
r.getItemId(), r.getQueryType(), r.getColTable(), r.getColKey(), r.getColVal()))
.collect(Collectors.toList());
aggForm.getRuleList().setResiRule(resiRules);
aggForm.getRuleList().setResiRuleList(resiRules);
}
// house规则
@ -342,7 +351,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl<IcPolicyDao, IcPolicyEn
.map((r) -> new ResisByPolicyRulesFormDTO.HouseRule(r.getColTable(), r.getColKey(), r.getColVal(),
r.getRuleDesc(), r.getNextLogicalRel(), r.getQueryType()))
.collect(Collectors.toList());
aggForm.getRuleList().setHouseRule(houseRules);
aggForm.getRuleList().setHouseRuleList(houseRules);
}
// stat规则
@ -354,7 +363,7 @@ public class IcPolicyServiceImpl extends BaseServiceImpl<IcPolicyDao, IcPolicyEn
r.getRuleDesc(), r.getQueryType(), r.getColTable()))
.collect(Collectors.toList());
aggForm.getRuleList().setStatRule(statRules);
aggForm.getRuleList().setStatRuleList(statRules);
}
}

17
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceRecordV2ServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@ -16,6 +17,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dao.IcServiceFeedbackV2Dao;
import com.epmet.dao.IcServiceRecordV2Dao;
import com.epmet.dao.IcServiceScopeDao;
import com.epmet.dao.IcServiceScopeV2Dao;
import com.epmet.dto.IcServiceFeedbackV2DTO;
import com.epmet.dto.IcServiceRecordV2DTO;
import com.epmet.dto.IcServiceScopeV2DTO;
@ -67,11 +69,12 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor
private IcServiceFeedbackV2Service icServiceFeedbackV2Service;
@Autowired
private HeartAttachmentService heartAttachmentService;
@Autowired
private IcServiceScopeDao serviceScopeDao;
@Autowired
private IcServiceFeedbackV2Dao serviceFeedbackV2Dao;
@Autowired
private IcServiceScopeV2Dao icServiceScopeV2Dao;
@Override
public PageData<IcServiceRecordV2DTO> page(Map<String, Object> params) {
@ -177,8 +180,16 @@ public class IcServiceRecordV2ServiceImpl extends BaseServiceImpl<IcServiceRecor
log.error(String.format("取消服务记录失败,未查询到服务记录,服务记录Id->%s", formDTO.getServiceRecordId()));
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "取消服务记录失败,未查询到服务记录");
}
entity.setServiceStatus("cancel");
baseDao.updateById(entity);
if (!"in_service".equals(entity.getServiceStatus())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), String.format("服务状态:%s", entity.getServiceStatus()), "只有服务中的记录可以取消");
}
//2.删除主表、字表数据【进行中数据不存在反馈记录】
baseDao.deleteById(entity);
LambdaQueryWrapper<IcServiceScopeV2Entity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(IcServiceScopeV2Entity::getServiceRecordId, formDTO.getServiceRecordId());
icServiceScopeV2Dao.delete(tWrapper);
}
@Override

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcServiceRecordV2Dao.xml

@ -6,17 +6,17 @@
<!-- 【服务管理】列表 -->
<select id="serviceRecordV2List" resultType="com.epmet.dto.result.ServiceRecordV2ListResultDTO">
SELECT
sr.ID AS serviceRecordId,
DISTINCT sr.ID AS serviceRecordId,
sr.POLICY_ID,
sr.SERVICE_NAME,
sr.SERVICE_ORG_TYPE,
sr.SERVICE_ORG_ID,
sr.SERVICE_TIME_START,
sr.SERVICE_TIME_END,
date_format(sr.SERVICE_TIME_START,'%Y-%m-%d') AS serviceTimeStart,
date_format(sr.SERVICE_TIME_END,'%Y-%m-%d') AS serviceTimeEnd,
sr.SERVICE_STATUS,
IFNULL(sf.SERVICE_PEOPLE_NUMBER,0) AS servicePeopleNumber
FROM ic_service_record_v2 sr
INNER JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0
left JOIN ic_service_feedback_v2 sf ON sf.SERVICE_RECORD_ID = sr.ID AND sf.DEL_FLAG = 0
INNER JOIN ic_service_scope_v2 ss ON ss.SERVICE_RECORD_ID = sr.ID AND ss.DEL_FLAG = '0'
WHERE sr.DEL_FLAG = '0'
AND ss.OBJECT_ID_PATH LIKE concat('%',#{orgId},'%')

2
epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.32__policy_flag.sql

@ -14,4 +14,4 @@ where i.DEL_FLAG='0'
and i.COLUMN_NAME is not null
and i.COLUMN_NAME !=''
and i.ITEM_TYPE not in('cascader')
and i.label not in ('分割线','出生日期');
and i.label not in ('分割线','出生日期','参战时间');

2
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

@ -167,7 +167,7 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
if (null == gridInfoCache || (null != gridInfoCache.getAbandonFlag() && NumConstant.ONE == gridInfoCache.getAbandonFlag())) {
result.setGridId(StrConstant.EPMETY_STR);
result.setCustomerId(StrConstant.EPMETY_STR);
logger.error(String.format("获取用户最近访问网格异常,网格可能被删除或者被弃用,参数%s",JSON.toJSONString(formDTO)));
logger.warn(String.format("获取用户最近访问网格异常,网格可能被删除或者被弃用,参数%s",JSON.toJSONString(formDTO)));
return result;
}
result.setGridId(userResult.getData().getGridId());

Loading…
Cancel
Save