Browse Source

模块类小程序接口

feature/syp_points
songyunpeng 5 years ago
parent
commit
cbacf4c783
  1. 13
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/controller/ApiCustomInfoController.java
  2. 17
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/CustomFeignClient.java
  3. 11
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/feign/fallback/CustomFeignClientFallback.java
  4. 13
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/CustomService.java
  5. 10
      esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/CustomServiceImpl.java
  6. 33
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ModuleCategoryFormDTO.java
  7. 67
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/result/ModuleCategoryResultDTO.java
  8. 14
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/controller/ModuleCategoryController.java
  9. 10
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/dao/ModuleCategoryDao.java
  10. 10
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/ModuleCategoryService.java
  11. 12
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/moduleCategory/service/impl/ModuleCategoryServiceImpl.java
  12. 16
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/moduleCategory/ModuleCategoryDao.xml

13
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<ArchiveDetailResultDTO> 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<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
@GetMapping("module/moduleCategory")
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto){
return customService.getModuleCategory(dto);
}
}

17
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<ArchiveDetailResultDTO> getArchiveDetail(@PathVariable("id") String id);
/**
* @Description 小程序获取模块类别
* @Author songyunpeng
* @Date 2020/10/29
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
@GetMapping("custom/modulecategory/moduleCategory")
Result<List<ModuleCategoryResultDTO>> getModuleCategory(@RequestBody ModuleCategoryFormDTO dto);
}

11
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<ArchiveDetailResultDTO> getArchiveDetail(String id) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "getArchiveDetail", id);
}
@Override
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_CUSTOM_SERVER, "ModuleCategoryFormDTO", dto);
}
}

13
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<com.elink.esua.epdc.dto.result.ArchiveDetailResultDTO>
**/
Result<ArchiveDetailResultDTO> getArchiveDetail(String id);
/**
* @Description 小程序获取模块分类
* @Author songyunpeng
* @Date 2020/10/29
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto);
}

10
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<ArchiveDetailResultDTO> getArchiveDetail(String id) {
return customFeignClient.getArchiveDetail(id);
}
@Override
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto) {
return customFeignClient.getModuleCategory(dto);
}
}

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

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

14
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<CategoryOption> getCategoryTree() {
return moduleCategoryService.getCategoryTree();
}
/**
* @Description 小程序获取模块分类
* @Author songyunpeng
* @Date 2020/10/29
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
@GetMapping("moduleCategory")
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(@RequestBody ModuleCategoryFormDTO dto){
return moduleCategoryService.getModuleCategory(dto);
}
}

10
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<ModuleCategoryEntity> {
* @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<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>
**/
List<ModuleCategoryResultDTO> selectListModuleCategory(ModuleCategoryFormDTO dto);
}

10
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<ModuleCategoryEntity>
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.CategoryOption>
**/
Result<CategoryOption> getCategoryTree();
/**
* @Description 小程序获取模块分类
* @Author songyunpeng
* @Date 2020/10/29
* @Param [dto]
* @return com.elink.esua.epdc.commons.tools.utils.Result<java.util.List<com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO>>
**/
Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto);
}

12
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<ModuleCategoryDao
public Result<CategoryOption> getCategoryTree() {
return new Result<CategoryOption>().ok(this.packageCategoryOption());
}
@Override
public Result<List<ModuleCategoryResultDTO>> getModuleCategory(ModuleCategoryFormDTO dto) {
int pageIndex = (dto.getPageIndex() - NumConstant.ONE) * dto.getPageSize();
dto.setPageIndex(pageIndex);
List<ModuleCategoryResultDTO> actApplyRecordResultDTOS = this.baseDao.selectListModuleCategory(dto);
return new Result<List<ModuleCategoryResultDTO>>().ok(actApplyRecordResultDTOS); }
/**
* @Description 组装信息
* @Author songyunpeng

16
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
</select>
<select id="selectListModuleCategory" resultType="com.elink.esua.epdc.dto.result.ModuleCategoryResultDTO">
select ID,
PID,
CATEGORY_CODE,
CATEGORY_NAME,
CATEGORY_TYPE,
IMG_URL,
MODULE_STYLE,
BANNER_FLAG,
REMARK,
SORT
from epdc_module_category
where DEL_FLAG='0' and ENABLE_FLAG ='1' and PID = #{pid}
order by sort
LIMIT #{pageIndex},#{pageSize}
</select>
</mapper>
Loading…
Cancel
Save