diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java index 7fdf3508..a498263a 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java @@ -4,6 +4,7 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; import com.elink.esua.epdc.dto.form.ArchiveFormDTO; import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; +import com.elink.esua.epdc.dto.form.ModuleCategoryFormDTO; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.service.CustomService; import org.springframework.beans.factory.annotation.Autowired; @@ -100,4 +101,16 @@ public class ApiCustomInfoController { public Result getArchiveDetail(@PathVariable("id") String id) { return customService.getArchiveDetail(id); } + + /** + * @Description 小程序获取模块分类 + * @Author songyunpeng + * @Date 2020/10/29 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @GetMapping("module/moduleCategory") + public Result> getModuleCategory(ModuleCategoryFormDTO dto){ + return customService.getModuleCategory(dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java index 2b546b7f..9bca7ff0 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java @@ -2,10 +2,7 @@ package com.elink.esua.epdc.feign; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.fallback.CustomFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -13,6 +10,7 @@ import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import java.util.List; @@ -75,4 +73,15 @@ public interface CustomFeignClient { @GetMapping(value = "custom/archive/detail/{id}", consumes = MediaType.APPLICATION_JSON_VALUE) Result getArchiveDetail(@PathVariable("id") String id); + + /** + * @Description 小程序获取模块类别 + * @Author songyunpeng + * @Date 2020/10/29 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @GetMapping("custom/modulecategory/moduleCategory") + Result> getModuleCategory(@RequestBody ModuleCategoryFormDTO dto); + } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java index 8874bf45..d1ff98a6 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java @@ -3,14 +3,10 @@ package com.elink.esua.epdc.feign.fallback; import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; import com.elink.esua.epdc.commons.tools.utils.Result; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.CustomFeignClient; import org.springframework.stereotype.Component; -import org.springframework.web.bind.annotation.PathVariable; import java.util.List; @@ -56,4 +52,9 @@ public class CustomFeignClientFallback implements CustomFeignClient { public Result getArchiveDetail(String id) { return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getArchiveDetail", id); } + + @Override + public Result> getModuleCategory(ModuleCategoryFormDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "ModuleCategoryFormDTO", dto); + } } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java index 6c3eaf53..9cdc342e 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java @@ -2,10 +2,7 @@ package com.elink.esua.epdc.service; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import java.util.List; @@ -90,4 +87,12 @@ public interface CustomService { * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getArchiveDetail(String id); + /** + * @Description 小程序获取模块分类 + * @Author songyunpeng + * @Date 2020/10/29 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> getModuleCategory(ModuleCategoryFormDTO dto); } diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java index 9b319702..0573d8ea 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java @@ -4,10 +4,7 @@ import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.DeptOption; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; -import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO; -import com.elink.esua.epdc.dto.form.ArchiveFormDTO; -import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO; -import com.elink.esua.epdc.dto.form.EpiDemicReportFormDTO; +import com.elink.esua.epdc.dto.form.*; import com.elink.esua.epdc.dto.result.*; import com.elink.esua.epdc.feign.AdminFeignClient; import com.elink.esua.epdc.feign.CustomFeignClient; @@ -113,4 +110,9 @@ public class CustomServiceImpl implements CustomService { public Result getArchiveDetail(String id) { return customFeignClient.getArchiveDetail(id); } + + @Override + public Result> getModuleCategory(ModuleCategoryFormDTO dto) { + return customFeignClient.getModuleCategory(dto); + } } diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ModuleCategoryFormDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ModuleCategoryFormDTO.java new file mode 100644 index 00000000..e0c0268e --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ModuleCategoryFormDTO.java @@ -0,0 +1,33 @@ +package com.elink.esua.epdc.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 模块分类接口参数 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class ModuleCategoryFormDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 页码 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageIndex; + + /** + * 页容量 + */ + @Min(value = 1, message = "页容量必须大于0") + private Integer pageSize; + + @NotBlank(message = "PID不能为空") + private String pid; +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ModuleCategoryResultDTO.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ModuleCategoryResultDTO.java new file mode 100644 index 00000000..73c8d9bc --- /dev/null +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ModuleCategoryResultDTO.java @@ -0,0 +1,67 @@ +package com.elink.esua.epdc.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 模块分类接口结果 + * + * @author songyunpeng + * @since v1.0.0 2020-05-20 + */ +@Data +public class ModuleCategoryResultDTO implements Serializable { + private static final long serialVersionUID = 2379520294973498819L; + + /** + * 主键 + */ + private String id; + + /** + * 上级ID + */ + private String pid; + + /** + * 模块类别编码 + */ + private String categoryCode; + + /** + * 模块类别名称 + */ + private String categoryName; + + /** + * 模块类别 + */ + private String categoryType; + + /** + * 模块类别图片 + */ + private String imgUrl; + + /** + * 模块样式 + */ + private String moduleStyle; + + /** + * 是否有BANNER 0-否,1-是 + */ + private String bannerFlag; + + /** + * 备注 + */ + private String remark; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/controller/ModuleCategoryController.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/controller/ModuleCategoryController.java index 1cd8f36f..be4b625e 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/controller/ModuleCategoryController.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/controller/ModuleCategoryController.java @@ -27,6 +27,8 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.dto.CategoryOption; import com.elink.esua.epdc.dto.ModuleCategoryDTO; +import com.elink.esua.epdc.dto.form.ModuleCategoryFormDTO; +import com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO; import com.elink.esua.epdc.modules.moduleCategory.excel.ModuleCategoryExcel; import com.elink.esua.epdc.modules.moduleCategory.service.ModuleCategoryService; import org.springframework.beans.factory.annotation.Autowired; @@ -117,4 +119,16 @@ public class ModuleCategoryController { public Result getCategoryTree() { return moduleCategoryService.getCategoryTree(); } + /** + * @Description 小程序获取模块分类 + * @Author songyunpeng + * @Date 2020/10/29 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + @GetMapping("moduleCategory") + public Result> getModuleCategory(@RequestBody ModuleCategoryFormDTO dto){ + return moduleCategoryService.getModuleCategory(dto); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/dao/ModuleCategoryDao.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/dao/ModuleCategoryDao.java index 15978a75..33928711 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/dao/ModuleCategoryDao.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/dao/ModuleCategoryDao.java @@ -19,6 +19,8 @@ package com.elink.esua.epdc.modules.moduleCategory.dao; import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; import com.elink.esua.epdc.dto.ModuleCategoryTreeDTO; +import com.elink.esua.epdc.dto.form.ModuleCategoryFormDTO; +import com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO; import com.elink.esua.epdc.modules.moduleCategory.entity.ModuleCategoryEntity; import org.apache.ibatis.annotations.Mapper; @@ -57,4 +59,12 @@ public interface ModuleCategoryDao extends BaseDao { * @return com.elink.esua.epdc.modules.moduleCategory.entity.ModuleCategoryEntity **/ ModuleCategoryEntity getById(String id); + /** + * @Description 小程序查询模块分类 + * @Author songyunpeng + * @Date 2020/10/29 + * @Param [dto] + * @return java.util.List + **/ + List selectListModuleCategory(ModuleCategoryFormDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/ModuleCategoryService.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/ModuleCategoryService.java index 89b75f73..d861a657 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/ModuleCategoryService.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/ModuleCategoryService.java @@ -22,6 +22,8 @@ import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CategoryOption; import com.elink.esua.epdc.dto.ModuleCategoryDTO; +import com.elink.esua.epdc.dto.form.ModuleCategoryFormDTO; +import com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO; import com.elink.esua.epdc.modules.moduleCategory.entity.ModuleCategoryEntity; import java.util.List; @@ -107,4 +109,12 @@ public interface ModuleCategoryService extends BaseService * @return com.elink.esua.epdc.commons.tools.utils.Result **/ Result getCategoryTree(); + /** + * @Description 小程序获取模块分类 + * @Author songyunpeng + * @Date 2020/10/29 + * @Param [dto] + * @return com.elink.esua.epdc.commons.tools.utils.Result> + **/ + Result> getModuleCategory(ModuleCategoryFormDTO dto); } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/impl/ModuleCategoryServiceImpl.java b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/impl/ModuleCategoryServiceImpl.java index e709a462..18d95bfd 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/impl/ModuleCategoryServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/impl/ModuleCategoryServiceImpl.java @@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.exception.ErrorCode; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; @@ -31,6 +32,8 @@ import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.CategoryOption; import com.elink.esua.epdc.dto.ModuleCategoryDTO; import com.elink.esua.epdc.dto.ModuleCategoryTreeDTO; +import com.elink.esua.epdc.dto.form.ModuleCategoryFormDTO; +import com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO; import com.elink.esua.epdc.modules.moduleCategory.dao.ModuleCategoryDao; import com.elink.esua.epdc.modules.moduleCategory.entity.ModuleCategoryEntity; import com.elink.esua.epdc.modules.moduleCategory.redis.ModuleCategoryRedis; @@ -212,6 +215,15 @@ public class ModuleCategoryServiceImpl extends BaseServiceImpl getCategoryTree() { return new Result().ok(this.packageCategoryOption()); } + + @Override + public Result> getModuleCategory(ModuleCategoryFormDTO dto) { + int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize(); + dto.setPageIndex(pageIndex); + + List actApplyRecordResultDTOS = this.baseDao.selectListModuleCategory(dto); + return new Result>().ok(actApplyRecordResultDTOS); } + /** * @Description 组装信息 * @Author songyunpeng diff --git a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/moduleCategory/ModuleCategoryDao.xml b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/moduleCategory/ModuleCategoryDao.xml index 8bc29a19..175cc62b 100644 --- a/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/moduleCategory/ModuleCategoryDao.xml +++ b/esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/moduleCategory/ModuleCategoryDao.xml @@ -46,6 +46,22 @@ select t1.*,(select t2.category_name from epdc_module_category t2 where t2.id=t1.pid)parentName from epdc_module_category t1 where t1.id = #{value} and t1.del_flag = 0 + \ No newline at end of file