diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java index 9ffd3efccb..8c42570bc3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java @@ -18,4 +18,5 @@ public class OptionResultDTO implements Serializable { private String pValue; private String sysDictDataId; private List children; + private Boolean usableFlag; } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java new file mode 100644 index 0000000000..64d77d5788 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.form.demand; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +@Data +public class DemandOptionFormDTO implements Serializable { + private static final long serialVersionUID = -5335277881919236426L; + + public interface AddUserInternalGroup { + } + + @NotBlank(message = "token获取客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + @NotBlank(message = "查询条件和查看居民详情:query;新增或修改居民信息:addorupdate", groups = AddUserInternalGroup.class) + private String purpose; +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java index 2b225c73dc..565a7a8423 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java @@ -132,6 +132,19 @@ public class IcResiDemandDictController { return new Result>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId())); } + /** + * 服务措施管理界面, + * + * @param tokenDto + * @param formDTO + * @return + */ + @PostMapping("option-service") + public Result> getDemandOptionsV2(@LoginUser TokenDto tokenDto,@RequestBody DemandOptionFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO,DemandOptionFormDTO.AddUserInternalGroup.class); + return new Result>().ok(icResiDemandDictService.getDemandOptionsV2(formDTO)); + } /** * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java index ed09bfd858..211ab20e8d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java @@ -36,8 +36,8 @@ import java.util.Set; */ @Mapper public interface IcResiDemandDictDao extends BaseDao { - List selectDemandOptions(@Param("customerId") String customerId); - List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode); + List selectDemandOptions(@Param("customerId") String customerId,@Param("usableFlagFormValue") String usableFlagFormValue); + List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode,@Param("usableFlagFormValue") String usableFlagFormValue); String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set codeSet); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index ce9c4741a7..12cbaf7dad 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -86,6 +86,7 @@ public interface IcResiDemandDictService extends BaseService getDemandOptions(String customerId); + List getDemandOptionsV2(DemandOptionFormDTO formDTO); /** * 居民信息列表需要展示分类名称,单独开出来这个接口,供user查询 * @param formDTO diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index 520e367177..5fe0df4eff 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java @@ -182,7 +182,18 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl getDemandOptions(String customerId) { - return baseDao.selectDemandOptions(customerId); + return baseDao.selectDemandOptions(customerId,null); + } + + + @Override + public List getDemandOptionsV2(DemandOptionFormDTO formDTO) { + if ("addorupdate".equals(formDTO.getPurpose())) { + //只查询可用的 + return baseDao.selectDemandOptions(formDTO.getCustomerId(), "1"); + } + //查询全部 + return baseDao.selectDemandOptions(formDTO.getCustomerId(), null); } @Override diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml index 0e6293002d..be50e98601 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -24,8 +24,9 @@ + + select="selectChildDemands" column="customerId=customerId,parentCode=value,usableFlagFormValue=usable_flag_form_value"> @@ -48,7 +54,9 @@ CUSTOMER_ID AS customerId, CATEGORY_CODE AS "value", CATEGORY_NAME AS "label", - PARENT_CODE as pValue + PARENT_CODE as pValue, + #{usableFlagFormValue} as usable_flag_form_value, + USABLE_FLAG as usableFlag FROM ic_resi_demand_dict WHERE @@ -56,6 +64,9 @@ AND LEVEL = 2 AND CUSTOMER_ID = #{customerId} AND PARENT_CODE = #{parentCode} + + and USABLE_FLAG=#{usableFlagFormValue} + ORDER BY SORT ASC