diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java index c0d6370588..a04efa1096 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/IcResiDemandDTO.java +++ b/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; /** * 描述 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java index 4d87ffc779..c83b41aa4f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java +++ b/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> getDemandOptions(@LoginUser TokenDto tokenDto) { + return new Result>().ok(icResiDemandDictService.getDemandOptions(tokenDto.getCustomerId())); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java index a618f7c71e..390e190f3c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java +++ b/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 { - List selectDemandOptions(String customerId); - List selectChildDemands(String parentCode); + List selectDemandOptions(@Param("customerId") String customerId); + List selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java index 6e2b9ac670..fa4da89b59 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiDemandEntity.java +++ b/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; /** * 描述 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java index 8f257a3264..4cf0f37a71 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/excel/IcResiDemandExcel.java +++ b/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; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index 80519d996c..034d4fc166 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/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} + * @Author zhaoqifeng + * @Date 2021/10/27 17:57 + */ + List getDemandOptions(String customerId); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java index 0cf9fba9d1..1910a360af 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java +++ b/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} + * @Author zhaoqifeng + * @Date 2021/10/27 17:57 + */ + @Override + public List getDemandOptions(String customerId) { + return baseDao.selectDemandOptions(customerId); + } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml index d2a96e6e66..d33235f4bf 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiDemandDictDao.xml @@ -19,8 +19,43 @@ - - + + + + + + + + + \ No newline at end of file