Selaa lähdekoodia

代码规范检查

ltt 2 vuotta sitten
vanhempi
commit
4350c01ad2

+ 1 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwpWantBuyController.java

@@ -99,7 +99,7 @@ public class KwpWantBuyController {
      * @Author: lt
      * @Date: 13:39 2023/7/25 0025
     **/
-    @PostMapping(value = "/dels", produces = MediaType.APPLICATION_JSON_VALUE)
+    @DeleteMapping(value = "/dels", produces = MediaType.APPLICATION_JSON_VALUE)
     public HttpResult dels(@RequestBody WantBuyDels ids) {
         kwpWantBuyService.dels(ids);
         return HttpResult.ok("批量删除成功");

+ 1 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/WantBuyDels.java

@@ -18,6 +18,7 @@ import java.util.List;
 @Setter
 @ToString
 public class WantBuyDels {
+
     @NotBlank(message = "ids不能为空")
     private String ids;
 }

+ 2 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/WantBuySelectParam.java

@@ -36,6 +36,7 @@ public class WantBuySelectParam extends PageRequest {
      * 支付集合字符串
      */
     private String trading;
+
     /**
      * 字符串转集合进行筛选
      */
@@ -51,7 +52,6 @@ public class WantBuySelectParam extends PageRequest {
      */
     private String areaLevel;
 
-
     /**
      * 商品类型
      */
@@ -67,9 +67,9 @@ public class WantBuySelectParam extends PageRequest {
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @NotNull(message = "生成开始时间不能为空")
     private LocalDateTime startCreateTime;
+
     @NotNull(message = "生成结束时间不能为空")
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime endCreateTime;
 
-
 }

+ 29 - 13
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java

@@ -44,17 +44,19 @@ import java.util.stream.Collectors;
 @Slf4j
 @RequiredArgsConstructor
 public class KwpWantBuyService {
-
     @DubboReference(version = "2.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
-
     private final KwpWantBuyMapper kwpWantBuyMapper;
-
     private final KwpWantBuyTradingMapper kwpWantBuyTradingMapper;
     private final KwpWantBuyAddressMapper kwpWantBuyAddressMapper;
     private final KwoWantBuyAddressService kwoWantBuyAddressService;
     private final KwoWantBuyTradingService kwoWantBuyTradingService;
 
+    /**
+     * @desc: 求购大厅列表查询
+     * @author lt
+     * @Date 11:50 2023/8/1 0001
+    **/
     public PageRes<WantBuySelectRes> buyHallList(WantBuySelectParam wantBuySelectParam){
         // 如果有求购方式的查询条件,需要先查询出求购方式的id
         if (StringUtils.isNotBlank(wantBuySelectParam.getTrading())) {
@@ -98,6 +100,11 @@ public class KwpWantBuyService {
         return new PageRes<>(new PageInfo<>(wantBuyDto));
     }
 
+    /**
+     * @desc 求购列表查询
+     * @author lt
+     * @Date 11:50 2023/8/1 0001
+    **/
     public PageRes<WantBuySelectRes> select(WantBuySelectParam wantBuySelectParam) {
 
         if (StringUtils.isNotBlank(wantBuySelectParam.getTrading())) {
@@ -141,8 +148,12 @@ public class KwpWantBuyService {
         return new PageRes<>(new PageInfo<>(wantBuyDto));
     }
 
-    private List<String> goodsTypeHandle(WantBuySelectParam wantBuySelectParam)
-    {
+    /**
+     * @Desc 求购列表查询
+     * @param wantBuySelectParam
+     * @return
+     */
+    private List<String> goodsTypeHandle(WantBuySelectParam wantBuySelectParam) {
         List<SysDictResDto> goodsTypeList = remoteSystemService.queryDictBottom(wantBuySelectParam.getGoodsType(), wantBuySelectParam.getGoodsTypeValue());
         if (CollectionUtils.isNotEmpty(goodsTypeList)) {
             return  goodsTypeList.stream().map(SysDictResDto::getValue).toList();
@@ -150,6 +161,10 @@ public class KwpWantBuyService {
         return null;
     }
 
+    /**
+     * @Desc 字符串转数组
+     * @return
+     */
     private List<String> stringToLongList(String str) {
         if (StringUtils.isBlank(str)) {
             return null;
@@ -157,10 +172,8 @@ public class KwpWantBuyService {
 // 使用逗号分隔字符串,并去除两端空格
         String[] stringArray = str.split(Global.COMMA);
         return Arrays.asList(stringArray);
-
     }
 
-
     /**
      * @Desc 求购草稿新增
      * @Author lt
@@ -175,7 +188,6 @@ public class KwpWantBuyService {
 
     }
 
-
     /**
      * @Desc 求购上架新增
      * @Author lt
@@ -189,6 +201,11 @@ public class KwpWantBuyService {
         addWantBuy(param, message, status);
     }
 
+    /**
+     * @desc 新增求购统一方法
+     * @author lt
+     * @Date 11:52 2023/8/1 0001
+    **/
     @Transactional(rollbackFor = Exception.class)
     public void addWantBuy(AddWantBuyParam param, String message, Integer status) {
         Date currentDate = new Date();
@@ -207,8 +224,6 @@ public class KwpWantBuyService {
                 .setRemark(param.getRemark()).setStatus(status).setCreateBy(userId)
                 .setCreateTime(currentDate).setUpdateBy(userId)
                 .setUpdateTime(currentDate).setDelFlag(Global.NO);
-
-
         kwpWantBuyMapper.insert(kwoWantBuy);
         if (Objects.isNull(kwoWantBuy.getId())) {
             throw new BusinessException(message + "失败");
@@ -281,8 +296,10 @@ public class KwpWantBuyService {
      * @Date 14:56 2023/7/25 0025
      **/
     public void batchTakeOffShelves(WantBuyDels param) {
-        if (BeanUtils.isEmpty(param)) throw new BusinessException("请提供需要下架的产品");
-        List<String> ids = List.of(param.getIds().split(","));
+        if (BeanUtils.isEmpty(param)) {
+            throw new BusinessException("请提供需要下架的产品");
+        }
+        List<String> ids = List.of(param.getIds().split(Global.COMMA));
         //1.查询ids所属产品只有status=1的才能下架,如果存在其它状态的则不能下架
         LambdaUpdateWrapper<KwoWantBuy> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(KwoWantBuy::getDelFlag, Global.NO).in(KwoWantBuy::getId, ids);
@@ -417,7 +434,6 @@ public class KwpWantBuyService {
 
     }
 
-
     /**
      * @Desc: 根据id查询求购信息
      * @param id