Browse Source

Merge remote-tracking branch 'origin/dev_ic_platform' into dev_ic_platform

dev_shibei_match
jianjun 4 years ago
parent
commit
be6df4157a
  1. 24
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java
  2. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  3. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  4. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java
  5. 13
      epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java
  6. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  7. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  8. 39
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml

24
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java

@ -44,29 +44,9 @@ public class IcResiDemandDTO implements Serializable {
private String customerId;
/**
* 主表Id
* 需求code对应ic_resi_demand_dict
*/
private String icResiUser;
/**
* 大类Id
*/
private Date bigClass;
/**
* 大类名称
*/
private Date bigClassName;
/**
* 小类Id
*/
private String smallClass;
/**
* 小类名称
*/
private String smallClassName;
private String categoryCode;
/**
* 描述

9
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -17,7 +17,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
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.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
@ -29,6 +32,7 @@ import com.epmet.service.IcResiDemandDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@ -81,4 +85,9 @@ public class IcResiDemandDictController {
return new Result();
}
@PostMapping("demandoption")
public Result<List<OptionResultDTO>> getDemandOptions(@LoginUser TokenDto tokenDto) {
return new Result<List<OptionResultDTO>>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId()));
}
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@ -32,6 +33,6 @@ import java.util.List;
*/
@Mapper
public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<OptionResultDTO> selectDemandOptions(String customerId);
List<OptionResultDTO> selectChildDemands(String parentCode);
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode);
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java

@ -49,24 +49,9 @@ public class IcResiDemandEntity extends BaseEpmetEntity {
private String icResiUser;
/**
* 大类Id
* 需求code对应ic_resi_demand_dict
*/
private Date bigClass;
/**
* 大类名称
*/
private Date bigClassName;
/**
* 小类Id
*/
private String smallClass;
/**
* 小类名称
*/
private String smallClassName;
private String categoryCode;
/**
* 描述

13
epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java

@ -40,17 +40,8 @@ public class IcResiDemandExcel {
@Excel(name = "主表Id")
private String icResiUser;
@Excel(name = "大类Id")
private Date bigClass;
@Excel(name = "大类名称")
private Date bigClassName;
@Excel(name = "小类Id")
private String smallClass;
@Excel(name = "小类名称")
private String smallClassName;
@Excel(name = "需求code")
private String categoryCode;
@Excel(name = "描述")
private String remakes;

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -18,6 +18,7 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcResiDemandDictDTO;
import com.epmet.entity.IcResiDemandDictEntity;
@ -93,4 +94,13 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
*/
void delete(String[] ids);
/**
* @Description 获取居民需求
* @Param customerId
* @Return {@link List< OptionResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/27 17:57
*/
List<OptionResultDTO> getDemandOptions(String customerId);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -21,6 +21,7 @@ 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.OptionResultDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcResiDemandDictDao;
@ -96,4 +97,17 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @param customerId
* @Description 获取居民需求
* @Param customerId
* @Return {@link List< OptionResultDTO >}
* @Author zhaoqifeng
* @Date 2021/10/27 17:57
*/
@Override
public List<OptionResultDTO> getDemandOptions(String customerId) {
return baseDao.selectDemandOptions(customerId);
}
}

39
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -19,8 +19,43 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectDemandOptions" resultType="com.epmet.commons.tools.dto.result.OptionResultDTO"> </select>
<select id="selectChildDemands" resultType="com.epmet.commons.tools.dto.result.OptionResultDTO"> </select>
<resultMap id="DemandResult" type="com.epmet.commons.tools.dto.result.OptionResultDTO">
<result column="customerId"/>
<result column="value" property="value"/>
<result column="label" property="label"/>
<collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO"
select="selectChildDemands" column="customerId=customerId,parentCode=value">
</collection>
</resultMap>
<select id="selectDemandOptions" resultMap="DemandResult">
SELECT
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label"
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 1
AND CUSTOMER_ID = #{customerId}
ORDER BY
SORT ASC
</select>
<select id="selectChildDemands" resultMap="DemandResult">
SELECT
CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label"
FROM
ic_resi_demand_dict
WHERE
DEL_FLAG = 0
AND LEVEL = 2
AND CUSTOMER_ID = #{customerId}
AND PARENT_CODE = #{parentCode}
ORDER BY
SORT ASC
</select>
</mapper>
Loading…
Cancel
Save