ソースを参照

新增types查询接口

xiewenjie 3 年 前
コミット
a638f1f419

+ 29 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/RenovationController.java

@@ -164,6 +164,35 @@ public class RenovationController extends BaseController {
         return Result.success(renovationPartsTypeService.findTypeByPartsId(parts.getId()));
     }
 
+
+    /**
+     * 根据细类类型获取装饰详情
+     *
+     * @return
+     */
+    @ApiOperation("根据细类类型获取装饰详情")
+    @RequestMapping(value = "/findPartsDetailByTypes", method = RequestMethod.POST)
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "types", value = "类型", dataType = "String[]")})
+    @NoAuthentication
+    @AroundLog(name = "根据细类类型获取装饰详情")
+    public Result findPartsDetailByTypes(@RequestBody RequestRenovationParts parts) {
+        if (parts.getId() == null) {
+            return Result.failure(CodeConstant.FAILURE_CODE_3001, CodeConstant.FAILURE_MSG_3001);
+        }
+
+        Page page = PageHelper.startPage(parts.getPageNum(), parts.getPageSize(), true);
+
+        List<RenovationPartsDetailEntity> list = renovationPartsDetailService.findPartsDetailByTypes(parts.getTypes());
+
+        Page<RenovationPartsDetailEntity> a = new Page<RenovationPartsDetailEntity>(parts.getPageNum(), parts.getPageSize());
+        a.setTotal(page.getTotal());
+        PageInfo<RenovationPartsDetailEntity> pageInfo = a.toPageInfo();
+        pageInfo.setList(list);
+        return Result.success(pageInfo);
+    }
+
+
     /**
      * 根据细类id获取装饰详情
      *

+ 3 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/IRenovationPartsDetailService.java

@@ -17,6 +17,9 @@ public interface IRenovationPartsDetailService extends IBaseService<RenovationPa
 
     List<ResponseRenovationPartsDetail> findDetailByTypeId(Long id, Long colorId, Long classifyId);
 
+    List<RenovationPartsDetailEntity> findPartsDetailByTypes(String[] types);
+
+
     ResponseRenovationPartsDetail findByName(String name);
 
     List<ResponseRenovationPartsDetail> findByKeyWord(String keyWord);

+ 6 - 0
sxz-core/src/main/java/com/fdkk/sxz/webApi/service/impl/RenovationPartsDetailServiceImpl.java

@@ -57,6 +57,12 @@ public class RenovationPartsDetailServiceImpl extends BaseServiceImpl<IRenovatio
     @Autowired
     private IModelUploadService modelUploadService;
 
+    @Override
+    public List<RenovationPartsDetailEntity> findPartsDetailByTypes(String[] types) {
+        LambdaQueryWrapper<RenovationPartsDetailEntity> wrapper = Wrappers.lambdaQuery();
+        wrapper.in(RenovationPartsDetailEntity::getType, types);
+        return list(wrapper);
+    }
 
     @Override
     public List<ResponseRenovationPartsDetail> findDetailByTypeId(Long id, Long colorId, Long classifyId) {

+ 2 - 1
sxz-modules/src/main/java/com/fdkk/sxz/vo/request/RequestRenovationParts.java

@@ -1,7 +1,6 @@
 package com.fdkk.sxz.vo.request;
 
 import com.fdkk.sxz.base.RequestBase;
-import io.swagger.models.auth.In;
 import lombok.Data;
 
 /**
@@ -32,5 +31,7 @@ public class RequestRenovationParts extends RequestBase {
 
     private Long classifyId;
 
+    private String[] types;
+
 
 }