Browse Source

新增:/heart/icresidemanddict/option-service

dev_shibei_match
yinzuomei 4 years ago
parent
commit
13d76dbd90
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  2. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/DemandOptionFormDTO.java
  3. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  4. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  5. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  6. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  7. 17
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

1
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<OptionResultDTO> children;
private Boolean usableFlag;
}

19
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;
}

13
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<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId()));
}
/**
* 服务措施管理界面
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("option-service")
public Result<List<OptionResultDTO>> getDemandOptionsV2(@LoginUser TokenDto tokenDto,@RequestBody DemandOptionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,DemandOptionFormDTO.AddUserInternalGroup.class);
return new Result<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptionsV2(formDTO));
}
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询

4
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<IcResiDemandDictEntity> {
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode);
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId,@Param("usableFlagFormValue") String usableFlagFormValue);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode,@Param("usableFlagFormValue") String usableFlagFormValue);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -86,6 +86,7 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
*/
List<OptionResultDTO> getDemandOptions(String customerId);
List<OptionResultDTO> getDemandOptionsV2(DemandOptionFormDTO formDTO);
/**
* 居民信息列表需要展示分类名称单独开出来这个接口供user查询
* @param formDTO

13
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<IcResiDemandDic
*/
@Override
public List<OptionResultDTO> getDemandOptions(String customerId) {
return baseDao.selectDemandOptions(customerId);
return baseDao.selectDemandOptions(customerId,null);
}
@Override
public List<OptionResultDTO> getDemandOptionsV2(DemandOptionFormDTO formDTO) {
if ("addorupdate".equals(formDTO.getPurpose())) {
//只查询可用的
return baseDao.selectDemandOptions(formDTO.getCustomerId(), "1");
}
//查询全部
return baseDao.selectDemandOptions(formDTO.getCustomerId(), null);
}
@Override

17
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -24,8 +24,9 @@
<result column="value" property="value"/>
<result column="label" property="label"/>
<result column="PARENT_CODE" property="pValue"/>
<result column="usableFlag" property="usableFlag"/>
<collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO"
select="selectChildDemands" column="customerId=customerId,parentCode=value">
select="selectChildDemands" column="customerId=customerId,parentCode=value,usableFlagFormValue=usable_flag_form_value">
</collection>
</resultMap>
<select id="selectDemandOptions" resultMap="DemandResult">
@ -33,13 +34,18 @@
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
DEL_FLAG = 0
AND LEVEL = 1
AND CUSTOMER_ID = #{customerId}
<if test="null !=usableFlagFormValue and usableFlagFormValue!='' ">
and USABLE_FLAG=#{usableFlagFormValue}
</if>
ORDER BY
SORT ASC
</select>
@ -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}
<if test="null !=usableFlagFormValue and usableFlagFormValue!='' ">
and USABLE_FLAG=#{usableFlagFormValue}
</if>
ORDER BY
SORT ASC
</select>

Loading…
Cancel
Save