Просмотр исходного кода

Merge remote-tracking branch 'origin/dev' into dev

lengfaqiang 2 лет назад
Родитель
Сommit
74fee537b9

+ 9 - 10
sckw-modules-api/sckw-order-api/src/main/java/com/sckw/order/api/dubbo/TradeOrderInfoService.java

@@ -28,16 +28,6 @@ public interface TradeOrderInfoService {
      */
     void updateOrderStatus(UpdateOrderStatusParam param);
 
-    /**
-     * @desc: 废弃
-     * @desc: 更新订单委托量、已履约量
-     * @author: yzc
-     * @date: 2023-07-18 18:34
-     * @Param param:
-     * @return: com.sckw.core.web.response.HttpResult
-     */
-    HttpResult updateOrderAmount(UpdateOrderAmountParam param);
-
     /**
      * @desc: 生成或撤销物流订单
      * @author: yzc
@@ -73,4 +63,13 @@ public interface TradeOrderInfoService {
      * @return: void
      */
     void updateAssociateStatement(UpdateAssociateStatementParam param);
+
+    /**
+     * @desc: 是否关联企业  true是,false否
+     * @author: yzc
+     * @date: 2023-08-16 16:20
+     * @Param entId:
+     * @return: java.lang.Boolean
+     */
+    Boolean associateEnt(Long entId);
 }

+ 1 - 1
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/dubbo/GoodsInfoService.java

@@ -53,7 +53,7 @@ public interface GoodsInfoService {
     HttpResult updateGoodsAmount(Long id, BigDecimal amount);
 
     /**
-     * @desc: 是否有关联客服经理
+     * @desc: 是否有关联客服经理 true是,false否
      * @author: yzc
      * @date: 2023-08-15 10:06
      * @Param userId:  用户id

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

@@ -1,14 +1,21 @@
 package com.sckw.order.controller;
 
 import com.sckw.core.annotation.Log;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.web.response.HttpResult;
+import com.sckw.excel.utils.ExcelUtil;
+import com.sckw.order.model.dto.WantBuyExport;
 import com.sckw.order.model.vo.req.*;
 import com.sckw.order.serivce.KwpWantBuyService;
+import jakarta.servlet.http.HttpServletResponse;
 import lombok.RequiredArgsConstructor;
 import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
+
 /**
  * @desc: 求购controller
  * @author: yzc
@@ -142,4 +149,21 @@ public class KwpWantBuyController {
     public HttpResult statistic(@RequestBody WantBuySelectParam params) {
         return HttpResult.ok(kwpWantBuyService.statistic(params));
     }
+
+    /**
+     * @desc: 求购导出
+     * @author: yzc
+     * @date: 2023-08-16 16:09
+     * @Param param:
+     * @Param response:
+     * @return: void
+     */
+    @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
+    public void export(@RequestBody WantBuySelectParam param, HttpServletResponse response) {
+        List<WantBuyExport> list = kwpWantBuyService.export(param);
+        if (CollectionUtils.isEmpty(list)) {
+            throw new BusinessException("导出数据为空!");
+        }
+        ExcelUtil.downData(response, WantBuyExport.class, list);
+    }
 }

+ 8 - 6
sckw-modules/sckw-order/src/main/java/com/sckw/order/dubbo/TradeOrderInfoServiceImpl.java

@@ -17,6 +17,7 @@ import com.sckw.order.model.KwoTradeOrderTrack;
 import com.sckw.order.serivce.KwoTradeOrderContractService;
 import com.sckw.order.serivce.KwoTradeOrderService;
 import com.sckw.order.serivce.KwoTradeOrderTrackService;
+import com.sckw.order.serivce.KwoTradeOrderUnitService;
 import com.sckw.redis.constant.RedisConstant;
 import com.sckw.redis.utils.RedissonUtils;
 import com.sckw.stream.model.SckwBusSum;
@@ -48,6 +49,8 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
     private KwoTradeOrderTrackService kwoTradeOrderTrackService;
     @Autowired
     private KwoTradeOrderContractService kwoTradeOrderContractService;
+    @Autowired
+    private KwoTradeOrderUnitService tradeOrderUnitService;
 
 
     @Override
@@ -93,12 +96,6 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
         saveMongoDb(updateParam);
     }
 
-    @Override
-    public HttpResult updateOrderAmount(UpdateOrderAmountParam param) {
-        return HttpResult.ok();
-
-    }
-
     @Override
     @Transactional(rollbackFor = Exception.class)
     public HttpResult createOrCancelLogisticsOrder(CreateOrCancelLogisticsOrderParam param) {
@@ -271,6 +268,11 @@ public class TradeOrderInfoServiceImpl implements TradeOrderInfoService {
 
     }
 
+    @Override
+    public Boolean associateEnt(Long entId) {
+        return tradeOrderUnitService.associateEnt(entId);
+    }
+
     /**
      * @desc: mq保存mongodb
      * @author: yzc

+ 15 - 12
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/dto/TransportDemandExport.java

@@ -20,40 +20,43 @@ public class TransportDemandExport implements Serializable {
     @Serial
     private static final long serialVersionUID = -7951209824419422786L;
 
-    @ExcelProperty(value = "状态", index = 0)
+    @ExcelProperty(value = "序号" )
+    private String serialNumber;
+
+    @ExcelProperty(value = "状态")
     private String statusLabel;
 
-    @ExcelProperty(value = "商品名称", index = 1)
+    @ExcelProperty(value = "商品名称")
     private String name;
 
-    @ExcelProperty(value = "分类", index = 2)
+    @ExcelProperty(value = "分类")
     private String goodsTypeLabel;
 
-    @ExcelProperty(value = "运需单价", index = 3)
+    @ExcelProperty(value = "运需单价")
     private String price;
 
-    @ExcelProperty(value = "总计划量", index = 4)
+    @ExcelProperty(value = "总计划量")
     private String amount;
 
-    @ExcelProperty(value = "商品规格", index = 5)
+    @ExcelProperty(value = "商品规格")
     private String spec;
 
-    @ExcelProperty(value = "装货地址", index = 6)
+    @ExcelProperty(value = "装货地址")
     private String loadAddress;
 
-    @ExcelProperty(value = "卸货地址", index = 7)
+    @ExcelProperty(value = "卸货地址")
     private String unloadAddress;
 
-    @ExcelProperty(value = "截止时间", index = 8)
+    @ExcelProperty(value = "截止时间")
     private String deadline;
 
-    @ExcelProperty(value = "创建时间", index = 9)
+    @ExcelProperty(value = "创建时间")
     private String createTime;
 
-    @ExcelProperty(value = "更新时间", index = 10)
+    @ExcelProperty(value = "更新时间")
     private String updateTime;
 
-    @ExcelProperty(value = "备注", index = 11)
+    @ExcelProperty(value = "备注")
     private String remark;
 
 }

+ 56 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/dto/WantBuyExport.java

@@ -0,0 +1,56 @@
+package com.sckw.order.model.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.sckw.excel.annotation.ExcelContext;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @desc: 求购列表导出
+ * @author: yzc
+ * @date: 2023-08-16 15:36
+ */
+@Data
+@Accessors(chain = true)
+@ExcelContext(fileName = "求购列表信息", sheetName = "求购列表信息")
+public class WantBuyExport implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 7225805024416842861L;
+
+
+    @ExcelProperty(value = "序号" )
+    private String serialNumber;
+
+    @ExcelProperty(value = "状态")
+    private String statusLabel;
+
+    @ExcelProperty(value = "商品名称")
+    private String name;
+
+    @ExcelProperty(value = "分类")
+    private String goodsTypeLabel;
+
+    @ExcelProperty(value = "规格尺寸")
+    private String spec;
+
+    @ExcelProperty(value = "支付方式")
+    private String tradings;
+
+    @ExcelProperty(value = "求购单价")
+    private String price;
+
+    @ExcelProperty(value = "求购总量")
+    private String amount;
+
+    @ExcelProperty(value = "创建时间")
+    private String createTime;
+
+    @ExcelProperty(value = "更新时间")
+    private String updateTime;
+
+    @ExcelProperty(value = "备注")
+    private String remark;
+}

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

@@ -73,4 +73,11 @@ public class WantBuySelectParam extends PageRequest {
     private Long entId;
     private List<Long> entIds;
 
+    /**
+     * 指定求购id集合导出
+     */
+    private String ids;
+
+    private List<Long> wantBuyIds;
+
 }

+ 14 - 0
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderUnitService.java

@@ -126,4 +126,18 @@ public class KwoTradeOrderUnitService {
         List<KwoTradeOrderUnit> list = kwoTradeOrderUnitMapper.selectList(wrapper);
         return CollectionUtils.emptyIfNull(list);
     }
+
+    /**
+     * @desc: 否关联企业  true是,false否
+     * @author: yzc
+     * @date: 2023-08-16 16:22
+     * @Param entId:
+     * @return: java.lang.Boolean
+     */
+    public Boolean associateEnt(Long entId) {
+        LambdaQueryWrapper<KwoTradeOrderUnit> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(KwoTradeOrderUnit::getEntId, entId).eq(KwoTradeOrderUnit::getDelFlag, Global.NO);
+        Long count = kwoTradeOrderUnitMapper.selectCount(wrapper);
+        return Objects.nonNull(count) && count > 0L;
+    }
 }

+ 3 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTransportDemandService.java

@@ -34,6 +34,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.stereotype.Service;
 
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 /**
@@ -286,11 +287,12 @@ public class KwoTransportDemandService {
             return Collections.emptyList();
         }
         List<TransportDemandExport> result = Lists.newArrayList();
+        AtomicInteger i = new AtomicInteger(1);
         demands.forEach(e -> {
             TransportDemandExport export = BeanUtils.copyProperties(e, TransportDemandExport.class);
             export.setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
                     .setStatusLabel(DictEnum.getLabel(DictTypeEnum.TRANSPORT_DEMAND_STATUS.getType(), String.valueOf(e.getStatus())))
-                    .setLoadAddress(e.getLoadAreaName() + e.getLoadDetailAddress())
+                    .setLoadAddress(e.getLoadAreaName() + e.getLoadDetailAddress()).setSerialNumber(String.valueOf(i.getAndIncrement()))
                     .setUnloadAddress(e.getUnloadAreaName() + e.getUnloadDetailAddress())
                     .setDeadline(Objects.isNull(e.getDeadline()) ? null : DateUtil.dateToStr(e.getDeadline()))
                     .setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))

+ 45 - 3
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwpWantBuyService.java

@@ -16,12 +16,14 @@ import com.sckw.core.utils.BeanUtils;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.excel.utils.DateUtil;
 import com.sckw.order.dao.KwpWantBuyAddressMapper;
 import com.sckw.order.dao.KwpWantBuyMapper;
 import com.sckw.order.dao.KwpWantBuyTradingMapper;
 import com.sckw.order.model.KwoWantBuy;
 import com.sckw.order.model.KwoWantBuyAddress;
 import com.sckw.order.model.KwoWantBuyTrading;
+import com.sckw.order.model.dto.WantBuyExport;
 import com.sckw.order.model.vo.req.*;
 import com.sckw.order.model.vo.res.WantBuyAddressDetailRes;
 import com.sckw.order.model.vo.res.WantBuyDetailRes;
@@ -36,6 +38,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
 
 /**
@@ -446,9 +449,7 @@ public class KwpWantBuyService {
             List<String> longList = stringToLongList(params.getTrading());
             params.setTradings(longList);
         }
-        if (StringUtils.isNotBlank(params.getStatus())) {
-            params.setStatus(params.getStatus());
-        }
+        params.setStatus(null);
         //商品分类筛选处理
         if (StringUtils.isNotBlank(params.getGoodsType()) && StringUtils.isNotBlank(params.getGoodsTypeValue())) {
             List<String> goodsTypes = goodsTypeHandle(params);
@@ -475,4 +476,45 @@ public class KwpWantBuyService {
         res.setTableTops(tableTops).setTableBottom(tableBottom);
         return res;
     }
+
+    public List<WantBuyExport> export(WantBuySelectParam param) {
+        WantBuySelectParam selectParam = new WantBuySelectParam();
+        if (StringUtils.isNotBlank(param.getIds())) {
+            List<Long> ids = StringUtils.splitStrToList(param.getIds(), Long.class);
+            selectParam.setWantBuyIds(ids);
+        } else {
+            BeanUtils.copyProperties(param, selectParam);
+            if (StringUtils.isNotBlank(selectParam.getTrading())) {
+                List<String> longList = stringToLongList(selectParam.getTrading());
+                selectParam.setTradings(longList);
+            }
+            if (StringUtils.isNotBlank(selectParam.getStatus())) {
+                selectParam.setStatus(selectParam.getStatus());
+            }
+            //商品分类筛选处理
+            if (StringUtils.isNotBlank(selectParam.getGoodsType()) && StringUtils.isNotBlank(selectParam.getGoodsTypeValue())) {
+                List<String> goodsTypes = goodsTypeHandle(selectParam);
+                selectParam.setGoodsTypeValueSearch(goodsTypes);
+            }
+        }
+        selectParam.setEntId(LoginUserHolder.getEntId());
+        List<WantBuySelectRes> wantBuyDto = kwpWantBuyMapper.pageSelect(selectParam);
+        if (CollectionUtils.isEmpty(wantBuyDto)) {
+            return Collections.emptyList();
+        }
+        List<WantBuyExport> result = new ArrayList<>();
+        AtomicInteger i = new AtomicInteger(1);
+        wantBuyDto.forEach(e -> {
+            WantBuyExport export = BeanUtils.copyProperties(e, WantBuyExport.class);
+            List<String> tradings = e.getWantBuyTradings().stream()
+                    .map(wantBuyTradingRes -> DictEnum.getLabel(DictTypeEnum.TRADE_TYPE.getType(), wantBuyTradingRes.getTrading()))
+                    .collect(Collectors.toList());
+            export.setSerialNumber(String.valueOf(i.getAndIncrement())).setTradings(String.join(Global.COMMA, tradings))
+                    .setGoodsTypeLabel(DictEnum.getLabel(DictTypeEnum.PRODUCT_NAME_TYPE.getType(), e.getGoodsType()))
+                    .setCreateTime(Objects.isNull(e.getCreateTime()) ? null : DateUtil.getDateTime(e.getCreateTime()))
+                    .setUpdateTime(Objects.isNull(e.getUpdateTime()) ? null : DateUtil.getDateTime(e.getUpdateTime()));
+            result.add(export);
+        });
+        return result;
+    }
 }

+ 6 - 0
sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml

@@ -55,6 +55,12 @@
                 #{item,jdbcType=VARCHAR}
             </foreach>
         </if>
+        <if test="wantBuyReq.wantBuyIds != null and wantBuyReq.wantBuyIds.size() > 0">
+            and kb.id in
+            <foreach collection="wantBuyReq.wantBuyIds" item="item" open="(" close=")" separator=",">
+                #{item,jdbcType=BIGINT}
+            </foreach>
+        </if>
         <if test="wantBuyReq.status != null and wantBuyReq.status != ''">
             and kb.status = #{wantBuyReq.status}
         </if>

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementLogisticsService.java

@@ -202,7 +202,7 @@ public class KwpSettlementLogisticsService {
         List<TableTop> tableTops = new ArrayList<>();
         TableTop tableTop = new TableTop();
         //总
-        settlementReq.setStatus(null);
+        settlementReq.setStatus(0);
         settlementLogisticsStatusCountVos.setAllCount(settlementLogisticsMapper.getCountList(settlementReq));
         tableTop.setName("全部").setValue(settlementReq.getStatus()).setTotal(Math.toIntExact(settlementLogisticsStatusCountVos.getAllCount()));
         tableTops.add(tableTop);

+ 27 - 13
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpSettlementWalletService.java

@@ -513,19 +513,33 @@ public class KwpSettlementWalletService {
 
     }
 
-    public BigDecimal getConfirmLogisticsPayment(Long id) {
-        SettlementLogisticsDto byId = kwpSettlementLogisticsService.detail(id, LogisticsUnitType.CARRIER, LogisticsUnitType.SHIPPER);
-        if (Objects.isNull(byId)) {
-            throw new BusinessException("结算单不存在");
-        }
-        if (StringUtils.isNotBlank(byId.getTrading()) && !byId.getTrading().startsWith(TradingEnum.RECEIVE_PAY.getValue())) {
-            throw new BusinessException("只支持货货到付款方式订单进行当前操作");
-        }
-        List<LedgerUnitDto> listById = kwpSettlementLogisticsService.getListById(id);
-        if (CollectionUtils.isEmpty(listById) || listById.size() != NumberConstant.TWO) {
-            throw new BusinessException("对账单交易企业双方不存在或缺少");
-        }
-        return getWalletBalance(listById, byId.getTrading());
+    public WalletDto getConfirmLogisticsPayment(Long id) {
+        //todo
+        WalletDto walletDto = new WalletDto();
+        walletDto.setName("测试钱宝");
+        walletDto.setMemberName("");
+        walletDto.setUid("kll_0001");
+        walletDto.setChannel("1");
+        walletDto.setCreateTime(LocalDateTime.now());
+        walletDto.setFilter("kll_0002");
+        walletDto.setFreeze(0L);
+        walletDto.setApMoney(0L);
+        walletDto.setTotalMoney(12000L);
+        walletDto.setMoney(1L);
+
+        return walletDto;
+//        SettlementLogisticsDto byId = kwpSettlementLogisticsService.detail(id, LogisticsUnitType.CARRIER, LogisticsUnitType.SHIPPER);
+//        if (Objects.isNull(byId)) {
+//            throw new BusinessException("结算单不存在");
+//        }
+//        if (StringUtils.isNotBlank(byId.getTrading()) && !byId.getTrading().startsWith(TradingEnum.RECEIVE_PAY.getValue())) {
+//            throw new BusinessException("只支持货货到付款方式订单进行当前操作");
+//        }
+//        List<LedgerUnitDto> listById = kwpSettlementLogisticsService.getListById(id);
+//        if (CollectionUtils.isEmpty(listById) || listById.size() != NumberConstant.TWO) {
+//            throw new BusinessException("对账单交易企业双方不存在或缺少");
+//        }
+//        return getWalletBalance(listById, byId.getTrading());
     }