Przeglądaj źródła

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

lengfaqiang 2 lat temu
rodzic
commit
3153a7f894
47 zmienionych plików z 1743 dodań i 69 usunięć
  1. 50 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/bannerDistrictEnum.java
  2. 1 0
      sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java
  3. 6 2
      sckw-common/sckw-common-redis/src/main/java/com/sckw/redis/constant/RedisConstant.java
  4. 15 0
      sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/constant/ChannelEnum.java
  5. 1 1
      sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/dto/WalletDto.java
  6. 25 0
      sckw-modules/sckw-operation/pom.xml
  7. 93 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/controller/KwoBannerController.java
  8. 20 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/dao/KwoBannerMapper.java
  9. 95 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/entity/KwoBanner.java
  10. 106 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/BannerAddReqVo.java
  11. 64 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/BannerQueryReqVo.java
  12. 34 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/IdsReqVo.java
  13. 95 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerDetailResVo.java
  14. 116 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerQueryResVo.java
  15. 218 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/service/BannerService.java
  16. 91 0
      sckw-modules/sckw-operation/src/main/java/com/sckw/operation/service/CommonBusinessService.java
  17. 24 0
      sckw-modules/sckw-operation/src/main/resources/bootstrap-sky.yml
  18. 1 1
      sckw-modules/sckw-operation/src/main/resources/bootstrap.yml
  19. 45 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java
  20. 11 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpLedgerLogistics.java
  21. 11 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpLedgerTrade.java
  22. 4 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/ILedger.java
  23. 5 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerCarrierDto.java
  24. 5 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerLogisticsDto.java
  25. 10 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerPurchaseDto.java
  26. 5 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerSellDto.java
  27. 9 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerShipperDto.java
  28. 2 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerTradeDto.java
  29. 4 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementPurchaseDto.java
  30. 4 4
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementSellDto.java
  31. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/AddWalletReq.java
  32. 23 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/CashPageReq.java
  33. 7 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/CashWalletReq.java
  34. 23 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/PrePayReq.java
  35. 38 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/RefundReq.java
  36. 8 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java
  37. 8 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerTradeService.java
  38. 27 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpWalletRelationService.java
  39. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayCenterService.java
  40. 324 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java
  41. 35 4
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerLogisticsMapper.xml
  42. 8 2
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerTradeMapper.xml
  43. 16 16
      sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementTradeMapper.xml
  44. 5 0
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java
  45. 6 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WayBillDetailDTO.java
  46. 11 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillTicketVO.java
  47. 32 14
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

+ 50 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/model/enums/bannerDistrictEnum.java

@@ -0,0 +1,50 @@
+package com.sckw.core.model.enums;
+
+import lombok.Getter;
+
+/**
+ * @author sky
+ * @desc 默认地址类型
+ * @date 2023/6/15
+ */
+@Getter
+public enum bannerDistrictEnum {
+
+    //首页
+    BANNER_ZERO(0, "首页"),
+    //建材市场
+    BANNER_ONE(1, "建材市场"),
+    //求购大厅
+    BANNER_TWO(2, "求购大厅"),
+    //运需广场
+    BANNER_THREE(3, "运需广场"),
+    //运力大厅
+    BANNER_FOUR(4, "运力大厅"),
+    //金融服务
+    BANNER_FIVE(5, "金融服务"),
+    //车后服务
+    BANNER_SIX(6,"车后服务"),
+    //绿智新能
+    BANNER_SEVEN(7,"绿智新能");
+
+
+
+    private final int code;
+
+    private final String name;
+
+    bannerDistrictEnum(int code, String name){
+        this.code = code;
+        this.name = name;
+    }
+
+    public static bannerDistrictEnum getName(int code){
+        for (bannerDistrictEnum addressDefaultTypeEnum : values()) {
+            if (addressDefaultTypeEnum.getCode() == code) {
+                return addressDefaultTypeEnum;
+            }
+        }
+        return null;
+    }
+
+}

+ 1 - 0
sckw-common/sckw-common-core/src/main/java/com/sckw/core/web/constant/HttpStatus.java

@@ -146,6 +146,7 @@ public class HttpStatus {
     public static final String COOPERATE_CANCEL_EXISTS = "未查询到可撤销的记录";
     public static final String ADDRESS_NOT_EXISTS = "未查询到地址记录或已失效";
     public static final String CONTRACT_NOT_EXISTS = "未查询到合同或已失效";
+    public static final String Data_NOT_EXISTS = "未查询到相关数据";
 
     /**自定义提示消息*/
     public static final String PASSWD_ERROR = "密码不正确";

+ 6 - 2
sckw-common/sckw-common-redis/src/main/java/com/sckw/redis/constant/RedisConstant.java

@@ -71,8 +71,12 @@ public class RedisConstant {
      */
     public static final String SETTLEMENT_KEY = "sckw:kst:%s";
     /**
-     * 钱包企业关联关系
+     * 企业关联钱包
      */
-    public static final String WALLET = "wallet:uid";
+    public static final String WALLET_ENT = "wallet:ent";
+    /**
+     * 钱包关联企业
+     */
+    public static final String WALLET_UID = "wallet:uid";
 
 }

+ 15 - 0
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/constant/ChannelEnum.java

@@ -31,6 +31,21 @@ public enum ChannelEnum {
         return null;
     }
 
+    /**
+     * 通过渠道获取
+     *
+     * @param channel 渠道
+     * @return
+     */
+    public static ChannelEnum getByChannel(String channel) {
+        for (ChannelEnum channelEnum : ChannelEnum.values()) {
+            if (channelEnum.getChannel().equals(channel)) {
+                return channelEnum;
+            }
+        }
+        return null;
+    }
+
     /**
      * 通过渠道获取描述
      *

+ 1 - 1
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/dto/WalletDto.java

@@ -24,7 +24,7 @@ public class WalletDto implements Serializable {
 
     private String uid;
     /**
-     * 渠道
+     * 渠道 huifu
      */
     private String channel;
 

+ 25 - 0
sckw-modules/sckw-operation/pom.xml

@@ -29,6 +29,11 @@
             <artifactId>sckw-common-core</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-remote</artifactId>
+        </dependency>
+
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-datasource</artifactId>
@@ -38,6 +43,26 @@
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-redis</artifactId>
         </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-stream</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-seata</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-common-sentinel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-system-api</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.sckw</groupId>
             <artifactId>sckw-common-log</artifactId>

+ 93 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/controller/KwoBannerController.java

@@ -0,0 +1,93 @@
+package com.sckw.operation.controller;
+
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.operation.model.vo.req.*;
+import com.sckw.operation.service.BannerService;
+import jakarta.validation.Valid;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author sky
+ * @desc 菜单管理
+ * @date 2023/8/28
+ */
+@RestController
+@RequestMapping("/bannerOperation")
+public class KwoBannerController {
+
+    @Autowired
+    private BannerService bannerService;
+
+    /**
+     * @param reqVo 分页入参
+     * @return HttpResult
+     * @desc: 分页查询
+     * @author: sky
+     * @date: 2023/8/28
+     */
+    @PostMapping("/queryByPage")
+    public HttpResult queryByPage(@RequestBody BannerQueryReqVo reqVo) throws SystemException {
+        return HttpResult.ok(bannerService.queryByPage(reqVo));
+    }
+
+    /**
+     * @param reqVo 新增入参
+     * @return HttpResult
+     * @desc: 新增入参
+     * @author: sky
+     * @date: 2023/8/28
+     */
+    @PostMapping("/add")
+    public HttpResult add(@Valid @RequestBody BannerAddReqVo reqVo) throws SystemException {
+        bannerService.addService(reqVo);
+        return HttpResult.ok(HttpStatus.MSG_003);
+    }
+
+    /**
+     * @param reqVo 更新
+     * @return HttpResult
+     * @desc: 更新入参
+     * @author: sky
+     * @date: 2023/8/28
+     */
+    @PostMapping("/update")
+    public HttpResult update(@Valid @RequestBody BannerAddReqVo reqVo) throws SystemException {
+        bannerService.udpateService(reqVo);
+        return HttpResult.ok(HttpStatus.MSG_005);
+    }
+
+    /**
+     * @param reqVo ids
+     * @return HttpResult
+     * @desc: 删除
+     * @author: sky
+     * @date: 2023/8/28
+     */
+    @PostMapping("/delete")
+    public HttpResult delete(@Valid @RequestBody IdsReqVo reqVo) throws SystemException {
+        bannerService.deleteServer(reqVo.getIds());
+        return HttpResult.ok(HttpStatus.MSG_008);
+    }
+
+    /**
+     * @param reqVo 主键
+     * @return HttpResult
+     * @desc: 查详情
+     * @author: sky
+     * @date: 2023/8/28
+     */
+    @PostMapping("detail")
+    public HttpResult detail(@RequestBody IdsReqVo reqVo) throws SystemException {
+        return HttpResult.ok(bannerService.detailServer(reqVo.getId()));
+    }
+
+
+
+
+}

+ 20 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/dao/KwoBannerMapper.java

@@ -0,0 +1,20 @@
+package com.sckw.operation.dao;
+
+import com.sckw.operation.model.entity.KwoBanner;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+* @author PC
+* @description 针对表【kwo_banner(地址信息)】的数据库操作Mapper
+* @createDate 2023-07-10 14:27:34
+* @Entity com.sckw.operation.model.entity.KwoBanner
+*/
+@Mapper
+public interface KwoBannerMapper extends BaseMapper<KwoBanner> {
+
+}
+
+
+
+

+ 95 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/entity/KwoBanner.java

@@ -0,0 +1,95 @@
+package com.sckw.operation.model.entity;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 地址信息
+ * @TableName kwo_banner
+ */
+@TableName(value ="kwo_banner")
+@Data
+public class KwoBanner implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 展示图片
+     */
+    private String url;
+
+    /**
+     * 跳转地址
+     */
+    private String jumpUrl;
+
+    /**
+     * 显示区域(0首页,1建材市场,2求购大厅,3运需广场,4运力大厅,5金融服务,6车后服务,7绿智新能)
+     */
+    private Integer district;
+
+    /**
+     * 开始日期
+     */
+    private Date startTime;
+
+    /**
+     * 结束日期
+     */
+    private Date entTime;
+
+    /**
+     * 顺序
+     */
+    private Integer sort;
+
+    /**
+     * 显示终端:苹果设备 ios、安卓设备 android、物流管家 pc、官网 pc-portal、管理系统 pc-background、移动端网页 mobile、全部终端 terminal
+     */
+    private String clientType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+
+    /**
+     * 状态(0 草稿 1已发布 2取消发布)
+     */
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private Long createBy;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    private Date updateTime;
+
+    /**
+     * 删除标识(0正常/1删除)
+     */
+    private Integer delFlag;
+
+}

+ 106 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/BannerAddReqVo.java

@@ -0,0 +1,106 @@
+package com.sckw.operation.model.vo.req;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.core.model.page.PageRequest;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author sky
+ * @desc 新增入参
+ * @date 2023/7/10
+ */
+@Data
+public class BannerAddReqVo extends PageRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5677297006062954377L;
+
+    private Long id;
+    /**
+     * 展示图片
+     */
+    @NotBlank(message = "图片地址不能为空")
+    @Size(max = 200, message = "图片地址超长")
+    private String url;
+    /**
+     * 跳转地址
+     */
+    @NotBlank(message = "跳转地址不能为空")
+    @Size(max = 100, message = "跳转地址超长")
+    private String jumpUrl;
+
+    /**
+     * 显示区域(0首页,1建材市场,2求购大厅,3运需广场,4运力大厅,5金融服务,6车后服务,7绿智新能)
+     */
+    @NotNull(message = "显示区域不能为空")
+    private Integer district;
+
+    /**
+     * 创建开始时间(时间戳)
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @NotNull(message = "开始时间不能为空")
+    private Date startTime;
+
+    /**
+     * 创建结束时间(时间戳)
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @NotNull(message = "结束时间不能为空")
+    private Date endTime;
+
+    /**
+     * 排序
+     */
+    @NotNull(message = "排序不能为空")
+    private Integer sort;
+
+    /**
+     * 显示终端:苹果设备 ios、安卓设备 android、物流管家 pc、官网 pc-portal、管理系统 pc-background、移动端网页 mobile、全部终端 terminal
+     */
+    @NotBlank(message = "显示终端不能为空")
+    @Size(max = 40, message = "显示终端超长")
+    private String clientType;
+
+    /**
+     * 备注
+     */
+
+    private String remark;
+
+    /**
+     * 状态(0 草稿 1已发布 2取消发布)
+     */
+    @NotNull(message = "状态不能为空")
+    private Integer status;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private String createTime;
+
+    /**
+     * 更新时间
+     */
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    private String updateTime;
+
+}

+ 64 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/BannerQueryReqVo.java

@@ -0,0 +1,64 @@
+package com.sckw.operation.model.vo.req;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.core.model.page.PageRequest;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author czh
+ * @desc 查询入参
+ * @date 2023/7/10
+ */
+@Data
+public class BannerQueryReqVo extends PageRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5677297006062954377L;
+
+    /**
+     * 状态(0 草稿 1已发布 2取消发布)
+     */
+    private Integer status;
+
+    /**
+     * 显示终端:苹果设备 ios、安卓设备 android、物流管家 pc、官网 pc-portal、管理系统 pc-background、移动端网页 mobile、全部终端 terminal
+     */
+    private String clientType;
+
+    /**
+     * 创建开始时间(时间戳)
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    /**
+     * 创建结束时间(时间戳)
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    /**
+     * 显示区域(0首页,1建材市场,2求购大厅,3运需广场,4运力大厅,5金融服务,6车后服务,7绿智新能)
+     */
+    private Long district;
+
+    /**
+     * 主键
+     */
+    private String ids;
+
+    /**
+     * 搜索
+     */
+    private String Keywords;
+
+}

+ 34 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/req/IdsReqVo.java

@@ -0,0 +1,34 @@
+package com.sckw.operation.model.vo.req;
+
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Size;
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author sky
+ * @desc 已多个主键为入参
+ * @date 2023/7/11
+ */
+@Data
+public class IdsReqVo implements Serializable {
+
+
+    @Serial
+    private static final long serialVersionUID = 1025798279287885824L;
+    /**
+     * 多个主键,用","隔开
+     */
+    @NotBlank(message = "id不能为空")
+    private String ids;
+
+    private Long id;
+
+    /**
+     * 备注
+     */
+    @Size(max = 400, message = "备注超长")
+    private String remark;
+}

+ 95 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerDetailResVo.java

@@ -0,0 +1,95 @@
+package com.sckw.operation.model.vo.res;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.core.model.page.PageRequest;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serial;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author sky
+ * @desc 详情返回
+ * @date 2023/7/10
+ */
+@Data
+public class BannerDetailResVo extends PageRequest implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 5677297006062954377L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 展示图片
+     */
+    private String url;
+    /**
+     * 跳转地址
+     */
+    private String jumpUrl;
+
+    /**
+     * 显示区域(0首页,1建材市场,2求购大厅,3运需广场,4运力大厅,5金融服务,6车后服务,7绿智新能)
+     */
+    private Integer district;
+
+    /**
+     * 创建开始时间(时间戳)
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date startTime;
+
+    /**
+     * 创建结束时间(时间戳)
+     */
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+
+    /**
+     * 显示终端:苹果设备 ios、安卓设备 android、物流管家 pc、官网 pc-portal、管理系统 pc-background、移动端网页 mobile、全部终端 terminal
+     */
+    private Integer sort;
+
+    /**
+     * 显示终端:苹果设备 ios、安卓设备 android、物流管家 pc、官网 pc-portal、管理系统 pc-background、移动端网页 mobile、全部终端 terminal
+     */
+    private String clientType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 状态(0 草稿 1已发布 2取消发布)
+     */
+    private String status;
+
+    /**
+     * 创建人
+     */
+    private String createBy;
+
+    /**
+     * 创建时间
+     */
+    private String createTime;
+
+    /**
+     * 更新时间
+     */
+    private String updateBy;
+    /**
+     * 更新时间
+     */
+    private String updateTime;
+
+}

+ 116 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/model/vo/res/BannerQueryResVo.java

@@ -0,0 +1,116 @@
+package com.sckw.operation.model.vo.res;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.sckw.core.utils.LongToStringUtils;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author sky
+ * @desc 查询返参
+ * @date 2023/7/12
+ */
+@Data
+public class BannerQueryResVo implements Serializable {
+    /**
+     * 主键
+     */
+    @JsonSerialize(using = LongToStringUtils.class)
+    private Long id;
+
+    /**
+     * 展示图片
+     */
+    private String url;
+
+    /**
+     * 跳转地址
+     */
+    private String jumpUrl;
+
+    /**
+     * 显示区域(0首页,1建材市场,2求购大厅,3运需广场,4运力大厅,5金融服务,6车后服务,7绿智新能)
+     */
+    private Integer district;
+
+    private String districtName;
+
+    /**
+     * 开始日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date startTime;
+
+    /**
+     * 结束日期
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date entTime;
+
+    /**
+     * 顺序
+     */
+    private Integer sort;
+
+    /**
+     * 显示终端:苹果设备 ios、安卓设备 android、物流管家 pc、官网 pc-portal、管理系统 pc-background、移动端网页 mobile、全部终端 terminal
+     */
+    private String clientType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+
+
+    /**
+     * 状态(0 草稿 1已发布 2取消发布)
+     */
+    private Integer status;
+
+    private String statusText;
+
+    /**
+     * 创建人ID
+     */
+    private Long createBy;
+
+    /**
+     * 创建人名字
+     */
+    private String createByName;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    /**
+     * 更新人
+     */
+    private Long updateBy;
+
+    /**
+     * 更新时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    /**
+     * 删除标识(0正常/1删除)
+     */
+    private Integer delFlag;
+
+}

+ 218 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/service/BannerService.java

@@ -0,0 +1,218 @@
+package com.sckw.operation.service;
+
+import java.io.IOException;
+import java.util.*;
+
+import cn.hutool.core.date.DateUtil;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import com.sckw.core.exception.SystemException;
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.AddressDefaultTypeEnum;
+import com.sckw.core.model.page.PageHelperUtil;
+import com.sckw.core.model.page.PageResult;
+import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.IdWorker;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.operation.model.vo.req.BannerAddReqVo;
+import com.sckw.operation.model.vo.res.*;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import com.sckw.operation.dao.KwoBannerMapper;
+import com.sckw.operation.model.vo.req.BannerQueryReqVo;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import com.sckw.operation.model.entity.KwoBanner;
+import com.sckw.core.model.enums.bannerDistrictEnum;
+
+/**
+ * @author sky
+ * @desc banner service
+ * @date 2023/8/28
+ */
+@Slf4j
+@Service
+public class BannerService {
+
+    @Autowired
+    private KwoBannerMapper kwoBannerMapper;
+
+    @Autowired
+    private CommonBusinessService commonBusinessService;
+
+
+
+
+    /**
+     * @param reqVo 分页入参
+     * @return HttpResult
+     * @desc: 分页查询
+     * @author: sky
+     * @date: 2023/7/12
+     */
+    public PageResult queryByPage(BannerQueryReqVo reqVo) {
+        PageHelper.startPage(reqVo.getPage(), reqVo.getPageSize());
+        List<KwoBanner> kwoBannerList = findList(reqVo);
+        if (CollectionUtils.isEmpty(kwoBannerList)) {
+            return PageHelperUtil.getPageResult(new PageInfo<>());
+        }
+        List<BannerQueryResVo> list = getAddressQueryResVo(kwoBannerList);
+        return PageHelperUtil.getPageResult(new PageInfo<>(list), kwoBannerList, reqVo.getPageSize());
+    }
+
+    /**
+     * @param reqVo 分页入参
+     * @return KwoBanner
+     * @desc: 全量查询
+     * @author: sky
+     * @date: 2023/7/12
+     */
+    private List<KwoBanner> findList(BannerQueryReqVo reqVo) {
+        LambdaQueryWrapper<KwoBanner> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(Objects.nonNull(reqVo.getStatus()), KwoBanner::getStatus, reqVo.getStatus()).
+                eq(KwoBanner::getDelFlag, Global.NO).
+                and(StringUtils.isNotBlank(reqVo.getKeywords()),
+                        wq -> wq.like(KwoBanner::getUrl, reqVo.getKeywords()).or().
+                                like(KwoBanner::getClientType, reqVo.getKeywords())).
+                orderByDesc(KwoBanner::getUpdateTime);
+
+        if (Objects.nonNull(reqVo.getStartTime())) {
+            wrapper.ge(KwoBanner::getCreateTime, reqVo.getStartTime());
+        }
+
+        if (Objects.nonNull(reqVo.getEndTime())) {
+            wrapper.lt(KwoBanner::getCreateTime, DateUtil.offsetDay(reqVo.getEndTime(), 1));
+        }
+
+        if (StringUtils.isNotBlank(reqVo.getIds())) {
+            wrapper.in(KwoBanner::getId, Arrays.stream(reqVo.getIds().split(Global.COMMA)).map(Long::parseLong).toList());
+        }
+        return kwoBannerMapper.selectList(wrapper);
+    }
+
+
+    /**
+     * @return BannerQueryResVo
+     * @desc: 转换成vo
+     * @param: KwoBanner 实体
+     * @author: sky
+     * @date 2023/7/18
+     */
+    private List<BannerQueryResVo> getAddressQueryResVo(List<KwoBanner> kwoBanner) {
+        List<BannerQueryResVo> list = new ArrayList<>();
+        List<Long> userIds = kwoBanner.stream().map(KwoBanner::getCreateBy).distinct().toList();
+        List<Integer> types = kwoBanner.stream().map(KwoBanner::getDistrict).distinct().toList();
+        Map<Long, UserCacheResDto> userCacheResDtoMap = commonBusinessService.queryUserCacheMapByIds(userIds);
+
+        kwoBanner.forEach(item -> {
+            BannerQueryResVo bannerQueryResVo = new BannerQueryResVo();
+            BeanUtils.copyProperties(item, bannerQueryResVo);
+            UserCacheResDto userCacheResDto = userCacheResDtoMap.get(item.getCreateBy());
+
+            if (Objects.nonNull(userCacheResDto)) {
+                bannerQueryResVo.setCreateByName(userCacheResDto.getName());
+            }
+
+            if (Objects.nonNull(item.getDistrict())) {
+                bannerQueryResVo.setDistrictName(bannerDistrictEnum.getName(item.getDistrict()).getName());
+            }
+
+            //bannerQueryResVo.statusText(StringUtils.isNotBlank(item.getStatus()) ? "已设置" : "未设置");
+            list.add(bannerQueryResVo);
+        });
+        return list;
+    }
+
+    /**
+     * @param reqVo 新增入参
+     * @desc: 新增banner
+     * @author: sky
+     * @date: 2023/8/29
+     */
+    @Transactional(rollbackFor = {})
+    public void addService(BannerAddReqVo reqVo) {
+        KwoBanner kwoBanner = new KwoBanner();
+        BeanUtils.copyProperties(reqVo, kwoBanner);
+        Long userId = LoginUserHolder.getUserId();
+        Date date = new Date();
+        kwoBanner.setDelFlag(Global.NO);
+        kwoBanner.setStatus(Global.NO);
+        kwoBanner.setCreateBy(userId);
+        kwoBanner.setUpdateBy(userId);
+        kwoBanner.setCreateTime(date);
+        kwoBanner.setUpdateTime(date);
+        kwoBanner.setId(new IdWorker(1L).nextId());
+        if (kwoBannerMapper.insert(kwoBanner) <= 0) {
+            throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
+        }
+    }
+
+    /**
+     * @param reqVo 更新入参
+     * @desc: 更新banner
+     * @author: sky
+     * @date: 2023/8/29
+     */
+    @Transactional(rollbackFor = {})
+    public void udpateService(BannerAddReqVo reqVo) {
+        KwoBanner kwobanner = kwoBannerMapper.selectById(reqVo.getId());
+        if (Objects.isNull(kwobanner)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.Data_NOT_EXISTS);
+        }
+        BeanUtils.copyProperties(reqVo, kwobanner);
+        if (kwoBannerMapper.updateById(kwobanner) <= 0) {
+            throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.UPDATE_FAIL);
+        }
+    }
+
+    /**
+     * @param ids 主键
+     * @desc: 删除
+     * @author: sky
+     * @date: 2023/8/29
+     */
+    @Transactional(rollbackFor = {})
+    public void deleteServer(String ids) {
+        List<Long> idList = Arrays.stream(ids.split(Global.COMMA)).map(Long::parseLong).toList();
+        List<KwoBanner> kwoBanner = kwoBannerMapper.selectBatchIds(idList);
+        if (CollectionUtils.isEmpty(kwoBanner)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ADDRESS_NOT_EXISTS);
+        }
+
+        Long userId = LoginUserHolder.getUserId();
+        Date date = new Date();
+        kwoBanner.forEach(item -> {
+            item.setUpdateTime(date);
+            item.setUpdateBy(userId);
+            item.setDelFlag(Global.YES);
+
+            if (kwoBannerMapper.updateById(item) <= 0) {
+                throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.DELETE_FAIL);
+            }
+        });
+    }
+
+    /**
+     * @param id 主键
+     * @return AddressDetailResVo
+     * @desc: 查详情
+     * @author: czh
+     * @date: 2023/7/25
+     */
+    public BannerDetailResVo detailServer(Long id) {
+        KwoBanner kwoBanner = kwoBannerMapper.selectById(id);
+        if (Objects.isNull(kwoBanner) || kwoBanner.getDelFlag().equals(Global.YES)) {
+            return null;
+        }
+
+        BannerDetailResVo bannerDetailResVo = new BannerDetailResVo();
+        BeanUtils.copyProperties(kwoBanner, bannerDetailResVo);
+        return bannerDetailResVo;
+    }
+
+}

+ 91 - 0
sckw-modules/sckw-operation/src/main/java/com/sckw/operation/service/CommonBusinessService.java

@@ -0,0 +1,91 @@
+package com.sckw.operation.service;
+
+import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.CooperateTypeEnum;
+import com.sckw.system.api.RemoteSystemService;
+
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author sky
+ * @desc 公共
+ * @date 2023/7/12
+ */
+@Service
+public class CommonBusinessService {
+
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+
+
+
+    /**
+     * @param userIds 用户id
+     * @return UserCacheResDto
+     * @desc: 查用户信息
+     * @author: czh
+     * @date: 2023/7/12
+     */
+    public Map<Long, UserCacheResDto> queryUserCacheMapByIds(List<Long> userIds){
+        return remoteSystemService.queryUserCacheMapByIds(userIds);
+    }
+
+
+    /**
+     * @param entIds 企业id
+     * @return EntCacheResDto
+     * @desc: 查企业信息
+     * @author: czh
+     * @date: 2023/7/12
+     */
+    public Map<Long, EntCacheResDto> queryEntCacheMapByIds(List<Long> entIds) {
+        return remoteSystemService.queryEntCacheMapByIds(entIds);
+    }
+
+    /**
+     * @param keys type#value,type#value
+     * @return Map
+     * @desc: 根据id查字典
+     * @author: czh
+     * @date: 2023/7/12
+     */
+    public Map<String, SysDictResDto> queryDictMapByTypeValues(String keys) {
+        return remoteSystemService.queryDictMapByTypeValues(keys);
+    }
+
+    /**
+     * @param type 当前企业的属性
+     * @return Integer
+     * @desc: 转换成相对的属性
+     * @author: czh
+     * @date: 2023/7/11
+     */
+    public Integer changeAttribute(Integer type) {
+        if (type == CooperateTypeEnum.SUPPLIER.getCode()) {
+            return CooperateTypeEnum.PURCHASER.getCode();
+        }
+
+        if (type == CooperateTypeEnum.PURCHASER.getCode()) {
+            return CooperateTypeEnum.SUPPLIER.getCode();
+        }
+
+        if (type == CooperateTypeEnum.CONSIGN.getCode()) {
+            return CooperateTypeEnum.CARRIAGE.getCode();
+        }
+
+        if (type == CooperateTypeEnum.CARRIAGE.getCode()) {
+            return CooperateTypeEnum.CONSIGN.getCode();
+        }
+
+        return Global.NO;
+    }
+}

+ 24 - 0
sckw-modules/sckw-operation/src/main/resources/bootstrap-sky.yml

@@ -0,0 +1,24 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 10.10.10.230:8848
+        # 命名空间
+        namespace: sckw-sky
+        # 共享配置
+        group: sckw-service-platform
+      config:
+        # 配置中心地址
+        server-addr: 10.10.10.230:8848
+        # 配置文件格式
+        file-extension: yaml
+        # 命名空间
+        namespace: sckw-sky
+        # 共享配置
+        group: sckw-service-platform
+        #可以读多个配置文件  需要在同一个命名空间下面可以是不同的组
+        extension-configs:
+          - dataId: sckw-common.yml
+            group: sckw-service-platform
+            refresh: true

+ 1 - 1
sckw-modules/sckw-operation/src/main/resources/bootstrap.yml

@@ -5,7 +5,7 @@ spring:
   application:
     name: sckw-operation
   profiles:
-    active: ${DEPLOY_MODE:dev}
+    active: sky
   main:
     allow-bean-definition-overriding: true
     allow-circular-references: true

+ 45 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java

@@ -0,0 +1,45 @@
+package com.sckw.payment.controller;
+
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.payment.model.vo.req.WalletDetailReq;
+import com.sckw.payment.service.WalletService;
+import jakarta.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * 钱包
+ *
+ * @author xucaiqin
+ * @date 2023-08-28 15:36:48
+ */
+@Validated
+@RestController
+@RequestMapping("/wallet")
+public class WalletController {
+    @Resource
+    private WalletService walletService;
+
+    /**
+     * 钱包总览信息
+     *
+     * @return
+     */
+    @GetMapping("overview")
+    public HttpResult overview() {
+        return HttpResult.ok(walletService.walletOverview());
+    }
+
+    /**
+     * 查询资金明细
+     *
+     * @return
+     */
+    @GetMapping("detail")
+    public HttpResult detail(WalletDetailReq walletDetailReq) {
+        return HttpResult.ok(walletService.walletDetail(walletDetailReq));
+    }
+
+}

+ 11 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpLedgerLogistics.java

@@ -107,6 +107,17 @@ public class KwpLedgerLogistics {
      */
     @TableField(value = "audit_phone")
     private String auditPhone;
+    /**
+     * 财务联系人(承运方)
+     */
+    @TableField(value = "success_user")
+    private String successUser;
+
+    /**
+     * 财务联系人电话(承运方)
+     */
+    @TableField(value = "success_phone")
+    private String successPhone;
 
     /**
      * 对账清单凭证

+ 11 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/KwpLedgerTrade.java

@@ -107,6 +107,17 @@ public class KwpLedgerTrade {
      */
     @TableField(value = "audit_phone")
     private String auditPhone;
+    /**
+     * 财务联系人(销售方)
+     */
+    @TableField(value = "success_user")
+    private String successUser;
+
+    /**
+     * 财务联系人电话(销售方)
+     */
+    @TableField(value = "success_phone")
+    private String successPhone;
 
     /**
      * 生成时间

+ 4 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/ILedger.java

@@ -27,4 +27,8 @@ public interface ILedger {
 
 
     void setStatusLabel(String statusLabel);
+
+    Long getCreateBy();
+
+    void setCreateByName(String createByName);
 }

+ 5 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerCarrierDto.java

@@ -137,6 +137,11 @@ public class LedgerCarrierDto implements ILedger {
      */
     private String phone;
     private String firmName;
+    /**
+     * 创建人
+     */
+    private Long createBy;
+    private String createByName;
 
     /**
      * 订单数量

+ 5 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerLogisticsDto.java

@@ -116,7 +116,11 @@ public class LedgerLogisticsDto implements ILedger {
      */
     private Integer status;
     private String statusLabel;
-
+    /**
+     * 创建人
+     */
+    private Long createBy;
+    private String createByName;
     /**
      * 客户联系人
      */

+ 10 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerPurchaseDto.java

@@ -78,14 +78,14 @@ public class LedgerPurchaseDto implements ILedger {
     private BigDecimal actualPrice;
 
     /**
-     * 对账审核人电话
+     * 对账完成人电话(销售方)
      */
-    private String auditPhone;
+    private String successPhone;
 
     /**
-     * 对账审核人名称
+     * 对账完成人名称(销售方)
      */
-    private String auditUser;
+    private String successUser;
 
     /**
      * 对账清单凭证
@@ -116,6 +116,12 @@ public class LedgerPurchaseDto implements ILedger {
     private String phone;
     private String firmName;
 
+    /**
+     * 创建人
+     */
+    private Long createBy;
+    private String createByName;
+
     /**
      * 订单数量
      */

+ 5 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerSellDto.java

@@ -115,6 +115,11 @@ public class LedgerSellDto implements ILedger {
     private String contacts;
     private String phone;
     private String firmName;
+    /**
+     * 创建人
+     */
+    private Long createBy;
+    private String createByName;
 
     /**
      * 订单数量

+ 9 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerShipperDto.java

@@ -76,14 +76,14 @@ public class LedgerShipperDto implements ILedger {
      */
     private BigDecimal actualPrice;
     /**
-     * 对账审核人电话
+     * 对账审核人电话(承运方)
      */
-    private String auditPhone;
+    private String successPhone;
 
     /**
-     * 对账审核人名称
+     * 对账审核人名称(承运方)
      */
-    private String auditUser;
+    private String successUser;
     /**
      * 对账清单凭证
      */
@@ -119,6 +119,11 @@ public class LedgerShipperDto implements ILedger {
      */
     private String phone;
     private String firmName;
+    /**
+     * 创建人
+     */
+    private Long createBy;
+    private String createByName;
 
     /**
      * 订单数量

+ 2 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/LedgerTradeDto.java

@@ -114,7 +114,8 @@ public class LedgerTradeDto implements ILedger {
     private String contacts;
     private String phone;
     private String firmName;
-
+    private Long createBy;
+    private String createByName;
     /**
      * 订单数量
      */

+ 4 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementPurchaseDto.java

@@ -58,14 +58,14 @@ public class SettlementPurchaseDto implements ISettlement {
     private Date receiptTime;
 
     /**
-     * 对账销售财务联系人名称
+     * 对账采购财务联系人名称
      */
-    private String successUser;
+    private String auditUser;
 
     /**
-     * 对账销售财务联系人电话
+     * 对账采购财务联系人电话
      */
-    private String successPhone;
+    private String auditPhone;
     /**
      * 交易方式
      */

+ 4 - 4
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/dto/SettlementSellDto.java

@@ -57,14 +57,14 @@ public class SettlementSellDto implements ISettlement {
     private Date receiptTime;
 
     /**
-     * 对账采购财务联系人名称
+     * 对账销售财务联系人名称
      */
-    private String auditUser;
+    private String successUser;
 
     /**
-     * 对账采购财务联系人电话
+     * 对账销售财务联系人电话
      */
-    private String auditPhone;
+    private String successPhone;
 
     /**
      * 交易方式(预付款、货到付款)

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/AddWalletReq.java

@@ -18,7 +18,7 @@ import java.math.BigDecimal;
 @Setter
 public class AddWalletReq extends BasePara implements MoneyChange {
     /**
-     * 支付通道字典值
+     * 支付通道 huifu
      */
     @NotBlank(message = "支付通道不能为空")
     private String channel;

+ 23 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/CashPageReq.java

@@ -0,0 +1,23 @@
+package com.sckw.payment.model.vo.req;
+
+import com.sckw.core.model.vo.BasePara;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 提现记录
+ *
+ * @author xucaiqin
+ * @date 2023-08-29 09:14:04
+ */
+@Getter
+@Setter
+public class CashPageReq extends BasePara {
+    /**
+     * 支付通道 huifu
+     */
+    private String channel;
+
+    private String entName;
+
+}

+ 7 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/CashWalletReq.java

@@ -1,6 +1,5 @@
 package com.sckw.payment.model.vo.req;
 
-import com.sckw.core.model.vo.BasePara;
 import com.sckw.payment.model.vo.res.MoneyChange;
 import jakarta.validation.constraints.Digits;
 import jakarta.validation.constraints.NotBlank;
@@ -19,15 +18,18 @@ import java.math.BigDecimal;
  */
 @Getter
 @Setter
-public class CashWalletReq extends BasePara implements MoneyChange {
+public class CashWalletReq implements MoneyChange {
     /**
-     * 支付通道字典值
+     * 支付通道 huifu
      */
     @NotBlank(message = "支付通道不能为空")
     private String channel;
 
-    @NotBlank(message = "合作企业不能为空")
-    private String entId;
+    @NotBlank(message = "uid不能为空")
+    private String uid;
+
+    @NotBlank(message = "filter不能为空")
+    private String filter;
 
     @Positive(message = "提现金额必须大于0")
     @Digits(message = "小数位数过长或金额过大", integer = 10, fraction = 2)

+ 23 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/PrePayReq.java

@@ -0,0 +1,23 @@
+package com.sckw.payment.model.vo.req;
+
+import com.sckw.core.model.vo.BasePara;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 预付请求参数
+ *
+ * @author xucaiqin
+ * @date 2023-08-29 09:14:04
+ */
+@Getter
+@Setter
+public class PrePayReq extends BasePara {
+    /**
+     * 支付通道 1
+     */
+    private String channel;
+
+    private String entName;
+
+}

+ 38 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/model/vo/req/RefundReq.java

@@ -0,0 +1,38 @@
+package com.sckw.payment.model.vo.req;
+
+import com.sckw.payment.model.vo.res.MoneyChange;
+import jakarta.validation.constraints.Digits;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Positive;
+import jakarta.validation.constraints.Size;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * 退款
+ *
+ * @author xucaiqin
+ * @date 2023-08-29 09:14:04
+ */
+@Getter
+@Setter
+public class RefundReq  implements MoneyChange {
+    /**
+     * 支付通道字典值
+     */
+    @NotBlank(message = "支付通道不能为空")
+    private String channel;
+
+    @NotBlank(message = "合作企业不能为空")
+    private String entId;
+
+    @Positive(message = "提现金额必须大于0")
+    @Digits(message = "小数位数过长或金额过大", integer = 10, fraction = 2)
+    private BigDecimal money;
+
+    @Size(message = "备注不能超过200字")
+    private String remark;
+
+}

+ 8 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java

@@ -31,6 +31,7 @@ import com.sckw.payment.model.vo.res.LedgerLogisticsDetailVo;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import com.sckw.transport.api.dubbo.TransportDubboService;
 import com.sckw.transport.api.model.dto.AccountCheckingBindDTO;
 import com.sckw.transport.api.model.dto.LogisticsOrderDTO;
@@ -89,6 +90,11 @@ public class KwpLedgerLogisticsService extends AbsLedger {
             logisticsDto.setTaxRateLabel(taxRateMap.get(String.valueOf(taxRate)));
 
             logisticsDto.setStatusLabel(LedgerEnum.getDesc(logisticsDto.getStatus()));
+
+            UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(logisticsDto.getCreateBy());
+            if (Objects.nonNull(userCacheResDto)) {
+                logisticsDto.setCreateByName(userCacheResDto.getName());
+            }
         }
     }
 
@@ -491,6 +497,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
             receiptTime = LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN);
             kwpLedgerLogistics.setReceiptTime(receiptTime);
         }
+        kwpLedgerLogistics.setSuccessPhone(ledgerReq.getSuccessPhone());
+        kwpLedgerLogistics.setSuccessUser(ledgerReq.getSuccessUser());
         kwpLedgerLogistics.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerLogistics.setUpdateBy(LoginUserHolder.getUserId());
         kwpLedgerLogistics.setUpdateTime(LocalDateTime.now());

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

@@ -27,6 +27,7 @@ import com.sckw.payment.model.vo.res.LedgerTradeDetailVo;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.annotation.Resource;
 import lombok.RequiredArgsConstructor;
@@ -86,6 +87,10 @@ public class KwpLedgerTradeService extends AbsLedger {
             tradeDto.setTaxRateLabel(taxRateMap.get(String.valueOf(taxRate)));
 
             tradeDto.setStatusLabel(LedgerEnum.getDesc(tradeDto.getStatus()));
+            UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(tradeDto.getCreateBy());
+            if (Objects.nonNull(userCacheResDto)) {
+                tradeDto.setCreateByName(userCacheResDto.getName());
+            }
         }
     }
 
@@ -500,6 +505,8 @@ public class KwpLedgerTradeService extends AbsLedger {
             receiptTime = LocalDateTime.of(ledgerReq.getReceiptTime(), LocalTime.MIN);
             kwpLedgerTrade.setReceiptTime(receiptTime);
         }
+        kwpLedgerTrade.setSuccessPhone(ledgerReq.getSuccessPhone());
+        kwpLedgerTrade.setSuccessUser(ledgerReq.getSuccessUser());
         kwpLedgerTrade.setStatus(LedgerEnum.SUCCESS.getStatus());
         kwpLedgerTrade.setUpdateTime(LocalDateTime.now());
         tradeMapper.updateById(kwpLedgerTrade);
@@ -757,7 +764,7 @@ public class KwpLedgerTradeService extends AbsLedger {
      * @return
      */
     public List<String> checkOrder(Long entId, Long entTarget) {
-        return tradeMapper.selectJoin(entId,entTarget);
+        return tradeMapper.selectJoin(entId, entTarget);
     }
 
     /**

+ 27 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpWalletRelationService.java

@@ -38,7 +38,7 @@ public class KwpWalletRelationService {
         if (Objects.isNull(entId)) {
             return null;
         }
-        String uid = (String) redisTemplate.opsForHash().get(RedisConstant.WALLET, String.valueOf(entId));
+        String uid = (String) redisTemplate.opsForHash().get(RedisConstant.WALLET_ENT, String.valueOf(entId));
         if (StringUtils.isNotBlank(uid)) {
             return uid;
         }
@@ -49,10 +49,35 @@ public class KwpWalletRelationService {
             return null;
         }
         uid = kwpWalletRelation.getUid();
-        redisTemplate.opsForHash().put(RedisConstant.WALLET, String.valueOf(entId), uid);
+        redisTemplate.opsForHash().put(RedisConstant.WALLET_ENT, String.valueOf(entId), uid);
         return uid;
     }
 
+    /**
+     * 通过中台uid反查关联的企业
+     *
+     * @param uid 中台uid
+     * @return
+     */
+    public Long getEnt(String uid) {
+        if (StringUtils.isBlank(uid)) {
+            return null;
+        }
+        Long entId = (Long) redisTemplate.opsForHash().get(RedisConstant.WALLET_UID, uid);
+        if (Objects.nonNull(entId)) {
+            return entId;
+        }
+        KwpWalletRelation kwpWalletRelation = relationMapper.selectOne(new LambdaQueryWrapper<KwpWalletRelation>()
+                .eq(KwpWalletRelation::getUid, uid)
+                .eq(KwpWalletRelation::getDelFlag, 0).last("limit 1"));
+        if (Objects.isNull(kwpWalletRelation)) {
+            return null;
+        }
+        entId = kwpWalletRelation.getEntId();
+        redisTemplate.opsForHash().put(RedisConstant.WALLET_UID, uid, entId);
+        return entId;
+    }
+
     /**
      * 保存关联信息
      *

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

@@ -452,7 +452,7 @@ public class PayCenterService {
      * @param filter
      * @return
      */
-    public R<Object> transfer(String uid, ChannelEnum channel, Long money, String filter) {
+    public R<Object> transfer(String uid, String filter, ChannelEnum channel, Long money) {
         String sync = postHttp(PayCenterEnum.TRANSFER, new HashMap<>() {{
             put("uid", uid);
             put("channel", channel);

+ 324 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -0,0 +1,324 @@
+package com.sckw.payment.service;
+
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.page.PageRes;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.payment.api.model.constant.ChannelEnum;
+import com.sckw.payment.api.model.dto.Order;
+import com.sckw.payment.api.model.dto.WalletDto;
+import com.sckw.payment.api.model.dto.common.R;
+import com.sckw.payment.api.model.dto.page.CashPage;
+import com.sckw.payment.api.model.dto.page.PrePayIndexPage;
+import com.sckw.payment.model.vo.req.*;
+import com.sckw.payment.model.vo.res.FundVo;
+import com.sckw.payment.model.vo.res.WalletDetail;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * 钱包
+ *
+ * @author xucaiqin
+ * @date 2023-08-28 15:38:53
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class WalletService {
+    private final PayCenterService payCenterService;
+    private final KwpWalletRelationService walletRelationService;
+    private final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1, 2, TimeUnit.MINUTES, new LinkedBlockingQueue<>(12));
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteSystemService remoteSystemService;
+
+    /**
+     * 查询企业钱包总览信息
+     *
+     * @return
+     */
+    public WalletDetail walletOverview() {
+        Long entId = LoginUserHolder.getEntId();
+        String relation = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(relation)) {
+            throw new BusinessException("暂未开通电子钱包");
+        }
+        R<List<WalletDto>> wallet = payCenterService.wallet(relation, null, "");
+        long sum = 0;
+        if (wallet.getStatus()) {
+            List<WalletDto> data = CollectionUtils.isEmpty(wallet.getData()) ? new ArrayList<>() : wallet.getData();
+            for (WalletDto datum : data) {
+                sum += datum.getMoney();
+            }
+        }
+        return new WalletDetail(LoginUserHolder.getEntName(), String.valueOf(sum), String.valueOf(sum / 100.0D), 0);
+    }
+
+    /**
+     * 查询资金明细
+     *
+     * @return
+     */
+    public Object walletDetail(WalletDetailReq walletDetailReq) {
+        Long entId = LoginUserHolder.getEntId();
+        String entName = walletDetailReq.getEntName();
+        //todo-xcq 确认下拉选规则参数
+        ChannelEnum channelEnum = null;
+        if (StringUtils.isNotBlank(walletDetailReq.getChannel())) {
+            channelEnum = ChannelEnum.getByValue(walletDetailReq.getChannel());
+            if (Objects.isNull(channelEnum)) {
+                throw new BusinessException("支付通道不存在");
+            }
+        }
+        //查询我方企业开通的渠道
+        String relation = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(relation)) {
+            throw new BusinessException("暂未开通电子钱包");
+        }
+        List<WalletDto> res = new ArrayList<>();
+        List<Long> list = new ArrayList<>();
+        //筛选企业名称
+        if (StringUtils.isNotBlank(entName)) {
+            List<EntCacheResDto> entCacheResDto = remoteSystemService.queryEntCacheByName(entName);
+            //未筛选出数据
+            if (CollectionUtils.isEmpty(entCacheResDto)) {
+                return PageRes.handPage(walletDetailReq.getPage(), walletDetailReq.getPageSize(), new ArrayList<>());
+            }
+            list = entCacheResDto.stream().map(EntCacheResDto::getId).toList();
+        }
+
+        //搜索指定往来单位
+        if (!CollectionUtils.isEmpty(list)) {
+            for (Long aLong : list) {
+                R<List<WalletDto>> wallet = payCenterService.wallet(relation, channelEnum, String.valueOf(aLong));
+                if (wallet.getStatus()) {
+                    List<WalletDto> data = wallet.getData();
+                    res.addAll(data);
+                }
+            }
+        } else {
+            //不搜索往来单位
+            R<List<WalletDto>> wallet = payCenterService.wallet(relation, channelEnum, "");
+            if (wallet.getStatus()) {
+                List<WalletDto> data = wallet.getData();
+                res.addAll(data);
+            }
+        }
+        List<FundVo> vo = new ArrayList<>();
+        FundVo fundVo;
+
+        //组装res数据
+        for (WalletDto re : res) {
+            fundVo = new FundVo();
+            BeanUtils.copyProperties(re, fundVo);
+            fundVo.setChannelLabel(ChannelEnum.getDesc(re.getChannel()));
+            vo.add(fundVo);
+        }
+        return PageRes.handPage(walletDetailReq.getPage(), walletDetailReq.getPageSize(), vo);
+    }
+
+
+    /**
+     * 新增账目
+     *
+     * @return
+     */
+    public Object addWallet(AddWalletReq addWalletReq) {
+        Long entId1 = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId1);
+        if (StringUtils.isBlank(uid)) {
+            throw new BusinessException("您暂未开通电子钱包");
+        }
+        String entId = addWalletReq.getEntId();
+        String filter = walletRelationService.getRelation(Long.parseLong(entId));
+        if (StringUtils.isBlank(filter)) {
+            throw new BusinessException("合作单位暂未开通电子钱包");
+        }
+        ChannelEnum channelEnum = ChannelEnum.getByValue(addWalletReq.getChannel());
+        if (Objects.isNull(channelEnum)) {
+            throw new BusinessException("支付通道不能为空");
+        }
+
+        //1.开通钱包
+        R<Object> objectR = payCenterService.walletIndex(uid, channelEnum, filter, "");
+        if (!objectR.getStatus()) {
+            throw new BusinessException(StringUtils.isBlank(objectR.getMsg()) ? "钱包开通失败" : objectR.getMsg());
+        }
+        //2.发起预支付
+        R<Order> orderR = payCenterService.advancePayApply("", channelEnum, filter, addWalletReq.bigMoney(addWalletReq.getMoney()));
+        if (!orderR.getStatus()) {
+            throw new BusinessException(StringUtils.isBlank(orderR.getMsg()) ? "预支付失败" : orderR.getMsg());
+        }
+        return orderR.getData();
+    }
+
+    /**
+     * 账目充值
+     *
+     * @return
+     */
+    public Object addWalletMoney(AddWalletReq addWalletReq) {
+        Long entId1 = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId1);
+        if (StringUtils.isBlank(uid)) {
+            throw new BusinessException("您暂未开通电子钱包");
+        }
+        String entId = addWalletReq.getEntId();
+        String filter = walletRelationService.getRelation(Long.parseLong(entId));
+        if (StringUtils.isBlank(filter)) {
+            throw new BusinessException("合作单位暂未开通电子钱包");
+        }
+        ChannelEnum channelEnum = ChannelEnum.getByValue(addWalletReq.getChannel());
+        if (Objects.isNull(channelEnum)) {
+            throw new BusinessException("支付通道不能为空");
+        }
+        //发起预支付
+        R<Order> orderR = payCenterService.advancePayApply(uid, channelEnum, filter, addWalletReq.bigMoney(addWalletReq.getMoney()));
+        if (!orderR.getStatus()) {
+            throw new BusinessException(StringUtils.isBlank(orderR.getMsg()) ? "预支付失败" : orderR.getMsg());
+        }
+        return orderR.getData();
+    }
+
+    /**
+     * 提现
+     * 1.余额转出
+     * 2.申请提现
+     *
+     * @return
+     */
+    public Object cashOUt(CashWalletReq cashWalletReq) {
+        ChannelEnum byChannel = ChannelEnum.getByChannel(cashWalletReq.getChannel());
+        //余额转出
+        R<Object> transfer = payCenterService.transfer(cashWalletReq.getUid(), cashWalletReq.getFilter(), byChannel, cashWalletReq.bigMoney(cashWalletReq.getMoney()));
+        if (!transfer.getStatus()) {
+            throw new BusinessException(StringUtils.isNotBlank(transfer.getMsg()) ? transfer.getMsg() : "提现异常");
+        }
+        R<Order> orderR = payCenterService.withdrawTake(cashWalletReq.getUid(), byChannel, cashWalletReq.bigMoney(cashWalletReq.getMoney()), cashWalletReq.getRemark());
+        if (!orderR.getStatus()) {
+            throw new BusinessException(StringUtils.isNotBlank(orderR.getMsg()) ? orderR.getMsg() : "申请提现异常");
+        }
+        return orderR.getData();
+    }
+
+    /**
+     * 转账
+     *
+     * @return
+     */
+    public Object transfer() {
+        return null;
+    }
+
+
+    /**
+     * 提现记录
+     *
+     * @return
+     */
+    public Object cashList(CashPageReq cashPageReq) {
+        Long entId = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
+            return null;
+        }
+        ChannelEnum channelEnum = null;
+        if (StringUtils.isNotBlank(cashPageReq.getChannel())) {
+            channelEnum = ChannelEnum.getByValue(cashPageReq.getChannel());
+            if (Objects.isNull(channelEnum)) {
+                throw new BusinessException("选择渠道异常");
+            }
+        }
+        String entName = cashPageReq.getEntName();
+        if (StringUtils.isNotBlank(entName)) {
+            //todo 转换企业名称为filter
+
+        }
+        //查询中台接口
+        R<CashPage> cashPageR = payCenterService.withdrawIndex(uid, channelEnum, cashPageReq.getPage(), cashPageReq.getPageSize());
+        if (!cashPageR.getStatus()) {
+            return null;
+        }
+        //组装数据
+        return cashPageR.getData();
+    }
+
+    /**
+     * 预付记录
+     *
+     * @return
+     */
+    public Object prePayList(PrePayReq prePayReq) {
+        Long entId = LoginUserHolder.getEntId();
+        String uid = walletRelationService.getRelation(entId);
+        if (StringUtils.isBlank(uid)) {
+            return null;
+        }
+        ChannelEnum channelEnum = null;
+        if (StringUtils.isNotBlank(prePayReq.getChannel())) {
+            channelEnum = ChannelEnum.getByValue(prePayReq.getChannel());
+            if (Objects.isNull(channelEnum)) {
+                throw new BusinessException("选择渠道异常");
+            }
+        }
+        String entName = prePayReq.getEntName();
+        if (StringUtils.isNotBlank(entName)) {
+            //todo 转换企业名称为 filter
+
+        }
+        //
+        R<PrePayIndexPage> prePayIndexPageR = payCenterService.advancePayIndex(uid, channelEnum, "", prePayReq.getPage(), prePayReq.getPageSize());
+
+        return null;
+    }
+
+    /**
+     * 新增预付
+     *
+     * @return
+     */
+    public Object addPrePay() {
+        return null;
+    }
+
+    /**
+     * 预付追加
+     *
+     * @return
+     */
+    public Object prePayAppend() {
+        return null;
+    }
+
+    /**
+     * 申请退款
+     *
+     * @return
+     */
+    public Object applyRefund(RefundReq refundReq) {
+        return null;
+    }
+
+    /**
+     * 发起退款
+     *
+     * @return
+     */
+    public Object launchRefund() {
+        return null;
+    }
+
+}

+ 35 - 4
sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerLogisticsMapper.xml

@@ -18,6 +18,8 @@
         <result column="actual_price" jdbcType="DECIMAL" property="actualPrice"/>
         <result column="audit_user" jdbcType="VARCHAR" property="auditUser"/>
         <result column="audit_phone" jdbcType="VARCHAR" property="auditPhone"/>
+        <result column="success_user" jdbcType="VARCHAR" property="successUser"/>
+        <result column="success_phone" jdbcType="VARCHAR" property="successPhone"/>
         <result column="url" jdbcType="VARCHAR" property="url"/>
         <result column="generate_time" jdbcType="TIMESTAMP" property="generateTime"/>
         <result column="receipt_time" jdbcType="TIMESTAMP" property="receiptTime"/>
@@ -46,6 +48,8 @@
         actual_price,
         audit_user,
         audit_phone,
+        success_user,
+        success_phone,
         url,
         generate_time,
         receipt_time,
@@ -72,11 +76,14 @@
         kll.actual_price  actualPrice,
         kll.audit_phone   auditPhone,
         kll.audit_user    auditUser,
+        kll.success_phone successPhone,
+        kll.success_user  successUser,
         kll.url,
         kll.generate_time generateTime,
         kll.receipt_time  receiptTime,
         kll.remark,
         kll.status,
+        kll.create_by createBy,
         kllu.top_ent_id   checkEntId,
         kllu.contacts,
         kllu.phone,
@@ -84,13 +91,37 @@
         kll.order_count   orderCount
     </sql>
     <select id="shipperSelect" resultType="com.sckw.payment.model.dto.LedgerShipperDto">
-        select
-        <include refid="list_col"/>
+        select kll.id,
+               kll.l_ledger_no   lLedgerNo,
+               kll.name,
+               kll.start_time    startTime,
+               kll.end_time      endTime,
+               kll.tax_rate      taxRate,
+               kll.trading,
+               kll.total_price   totalPrice,
+               kll.ex_tax_price  exTaxPrice,
+               kll.settle_price  settlePrice,
+               kll.actual_price  actualPrice,
+               kll.success_phone successPhone,
+               kll.success_user  successUser,
+               kll.url,
+               kll.generate_time generateTime,
+               kll.receipt_time  receiptTime,
+               kll.remark,
+               kll.status,
+               kll.create_by     createBy,
+               kllu.top_ent_id   checkEntId,
+               kllu.contacts,
+               kllu.phone,
+               kllu.firm_name    firmName,
+               kll.order_count   orderCount
         from kwp_ledger_logistics kll
                  inner join kwp_ledger_logistics_unit kllu
-                            on kll.id = kllu.l_ledger_id and kllu.del_flag = 0 and kllu.unit_type = #{logisticsReq.unitType,jdbcType=INTEGER}
+                            on kll.id = kllu.l_ledger_id and kllu.del_flag = 0 and
+                               kllu.unit_type = #{logisticsReq.unitType,jdbcType=INTEGER}
                  inner join kwp_ledger_logistics_unit kllu2
-                            on kll.id = kllu2.l_ledger_id and kllu2.del_flag = 0 and kllu2.unit_type = #{logisticsReq.unitTypeTwo,jdbcType=INTEGER}
+                            on kll.id = kllu2.l_ledger_id and kllu2.del_flag = 0 and
+                               kllu2.unit_type = #{logisticsReq.unitTypeTwo,jdbcType=INTEGER}
         <where>
             kll.del_flag = 0
               and kllu2.top_ent_id = #{logisticsReq.entId,jdbcType=BIGINT}

+ 8 - 2
sckw-modules/sckw-payment/src/main/resources/mapper/KwpLedgerTradeMapper.xml

@@ -18,6 +18,8 @@
         <result column="actual_price" jdbcType="DECIMAL" property="actualPrice"/>
         <result column="audit_user" jdbcType="VARCHAR" property="auditUser"/>
         <result column="audit_phone" jdbcType="VARCHAR" property="auditPhone"/>
+        <result column="success_user" jdbcType="VARCHAR" property="successUser"/>
+        <result column="success_phone" jdbcType="VARCHAR" property="successPhone"/>
         <result column="generate_time" jdbcType="TIMESTAMP" property="generateTime"/>
         <result column="receipt_time" jdbcType="TIMESTAMP" property="receiptTime"/>
         <result column="url" jdbcType="VARCHAR" property="url"/>
@@ -46,6 +48,8 @@
         actual_price,
         audit_user,
         audit_phone,
+        success_user,
+        success_phone,
         generate_time,
         receipt_time,
         url,
@@ -77,6 +81,7 @@
         klt.receipt_time  receiptTime,
         klt.remark,
         klt.status,
+        klt.create_by     createBy,
         kltu.contacts,
         kltu.phone,
         kltu.firm_name    firmName,
@@ -94,12 +99,13 @@
         klt.ex_tax_price  exTaxPrice,
         klt.settle_price  settlePrice,
         klt.actual_price  actualPrice,
-        klt.audit_phone   auditPhone,
-        klt.audit_user    auditUser,
+        klt.success_phone   successPhone,
+        klt.success_user    successUser,
         klt.url,
         klt.generate_time generateTime,
         klt.receipt_time  receiptTime,
         klt.remark,
+        klt.create_by     createBy,
         klt.status,
         kltu.contacts,
         kltu.phone,

+ 16 - 16
sckw-modules/sckw-payment/src/main/resources/mapper/KwpSettlementTradeMapper.xml

@@ -78,10 +78,10 @@
                cast(kst.actual_price as char)                     actualPrice,
                cast(kst.total_price as char)                      totalPrice,
                cast((kst.total_price - kst.actual_price) as char) waitPrice,
-               kst.audit_user,
-               kst.audit_phone,
-               kst.success_user,
-               kst.success_phone,
+               kst.audit_user                                     auditUser,
+               kst.audit_phone                                    auditPhone,
+               kst.success_user                                   successUser,
+               kst.success_phone                                  successPhone,
                kst.create_time,
                kst.t_ledger_id,
                klt.id                                             ledgerId,
@@ -204,10 +204,10 @@
                cast(kst.actual_price as char)                     actualPrice,
                cast(kst.total_price as char)                      totalPrice,
                cast((kst.total_price - kst.actual_price) as char) waitPrice,
-               kst.audit_user,
-               kst.audit_phone,
-               kst.success_user,
-               kst.success_phone,
+               kst.audit_user                                     auditUser,
+               kst.audit_phone                                    auditPhone,
+               kst.success_user                                   successUser,
+               kst.success_phone                                  successPhone,
                kst.create_time,
                kst.t_ledger_id,
                klt.id                                             ledgerId,
@@ -234,10 +234,10 @@
                cast(kst.actual_price as char)                     actualPrice,
                cast(kst.total_price as char)                      totalPrice,
                cast((kst.total_price - kst.actual_price) as char) waitPrice,
-               kst.audit_user,
-               kst.audit_phone,
-               kst.success_user,
-               kst.success_phone,
+               kst.audit_user                                     auditUser,
+               kst.audit_phone                                    auditPhone,
+               kst.success_user                                   successUser,
+               kst.success_phone                                  successPhone,
                kst.create_time,
                kst.t_ledger_id,
                klt.id                                             ledgerId,
@@ -278,10 +278,10 @@
                cast(kst.actual_price as char)                     actualPrice,
                cast(kst.total_price as char)                      totalPrice,
                cast((kst.total_price - kst.actual_price) as char) waitPrice,
-               kst.audit_user,
-               kst.audit_phone,
-               kst.success_user,
-               kst.success_phone,
+               kst.audit_user                                     auditUser,
+               kst.audit_phone                                    auditPhone,
+               kst.success_user                                   successUser,
+               kst.success_phone                                  successPhone,
                kst.create_time,
                kst.t_ledger_id,
                klt.id                                             ledgerId,

+ 5 - 0
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java

@@ -202,6 +202,11 @@ public class KwTransportService {
                 statuses.add(CarWaybillEnum.REVOKED.getCode().longValue());
                 statuses.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode().longValue());
                 criteria.and("status").in(statuses);
+            } else if (query.getStatus().equals(String.valueOf(CarWaybillEnum.COMPLETION_UNLOADING.getCode()))) {
+                List<Long> statuses = new ArrayList<>();
+                statuses.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode().longValue());
+                statuses.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode().longValue());
+                criteria.and("status").in(statuses);
             } else if (!query.getStatus().equals("all")) {
                 criteria.and("status").is(Integer.valueOf(query.getStatus()));
             }

+ 6 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WayBillDetailDTO.java

@@ -146,10 +146,15 @@ public class WayBillDetailDTO{
     private String unloadDetailAddress;
 
     /**
-     * 承运企业
+     * 托运企业名称
      */
     private String checkFirmName;
 
+    /**
+     * 承运企业
+     */
+    private String carrierFirmName;
+
     /**
      * 运单状态
      */

+ 11 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillTicketVO.java

@@ -38,4 +38,15 @@ public class WaybillTicketVO {
      * 卸货重量
      */
     private String unloadWeight;
+
+    /**
+     * 亏吨重量
+     */
+    private String deficitAmount;
+
+    /**
+     * 扣亏量(合理损耗-(实装-实卸))-单位
+     */
+    private String deficitRealAmount;
+
 }

+ 32 - 14
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

@@ -38,6 +38,7 @@ import org.springframework.data.mongodb.core.query.Query;
 import org.springframework.stereotype.Service;
 import org.springframework.util.ObjectUtils;
 
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.regex.Pattern;
 
@@ -116,6 +117,8 @@ public class WaybillManagementService {
             wayBillDetailDTO.setUnloadDetailAddress(info.getUnloadCityName().concat(info.getUnloadDetailAddress()));
             wayBillDetailDTO.setLoadName(info.getLoadName());
             wayBillDetailDTO.setUnloadName(info.getUnloadName());
+            wayBillDetailDTO.setCarrierFirmName(info.getCarrierFirmName());
+            wayBillDetailDTO.setCheckFirmName(info.getCheckFirmName());
             // 计费方式
             KwtLogisticsOrder kwtLogisticsOrder = kwtLogisticsOrderMapper.selectById(info.getLOrderId());
             if(!ObjectUtils.isEmpty(kwtLogisticsOrder)) {
@@ -150,9 +153,16 @@ public class WaybillManagementService {
             waybillTicketVO.setUnloadTime(DateUtil.getDateTime(info.getUnloadTime()));
             waybillTicketVO.setUnloadWeight(String.valueOf(info.getUnloadAmount()));
             waybillTicketVO.setUnloadUrl(String.valueOf(info.getUnloadUrls()));
+            waybillTicketVO.setDeficitAmount(String.valueOf(info.getDeficitAmount()));
+            BigDecimal deficitLoss = info.getLoss() == null ? BigDecimal.valueOf(0) : info.getLoss();
+            BigDecimal deficitAmount = info.getDeficitAmount() == null ? BigDecimal.valueOf(0) : info.getDeficitAmount();
+            BigDecimal deficitRealAmount = BigDecimal.valueOf(0);
+            if(deficitAmount.compareTo(BigDecimal.valueOf(0)) > 0) {
+                deficitRealAmount = deficitLoss.subtract(deficitAmount);
+            }
+            waybillTicketVO.setDeficitRealAmount(deficitRealAmount.toString());
 //            waybillBoardListVO.setLoadUrls(sckwWaybillOrder.getLoadUrls() != null ? FileUtils.getOSSAddressPrefix() + sckwWaybillOrder.getLoadUrls() : null);
 //            waybillBoardListVO.setUnloadUrls(sckwWaybillOrder.getUnloadUrls() != null ? FileUtils.getOSSAddressPrefix() + sckwWaybillOrder.getUnloadUrls() : null);
-
         }
         List<Integer> statuses = initWaybillIndexStatus();
         // 初始化各状态
@@ -293,7 +303,7 @@ public class WaybillManagementService {
             statusVOS.add(waybillStatusVO);
         });
 
-        Criteria criteria = buildWaybillIndexQuery(query, statuses);
+        Criteria criteria = buildWaybillIndexQuery(query);
         Query queryFormat = new Query(criteria);
         long total = mongoTemplate.count(queryFormat, SckwWaybillOrder.class);
         queryFormat.with(PageRequest.of(query.getPage() - 1, query.getPageSize(),
@@ -391,10 +401,9 @@ public class WaybillManagementService {
     /**
      * 运单看板 查询条件构造
      * @param query
-     * @param statuses
      * @return
      */
-    public Criteria buildWaybillIndexQuery(WaybillOrderDTO query,List<Integer> statuses) {
+    public Criteria buildWaybillIndexQuery(WaybillOrderDTO query) {
         Criteria criteria = new Criteria();
         criteria.and("entId").is(LoginUserHolder.getEntId());
         criteria.and("delFlag").is(NumberConstant.ZERO);
@@ -403,12 +412,18 @@ public class WaybillManagementService {
         if (CollectionUtils.isNotEmpty(wOrderIds)) {
             Criteria.where("wOrderId").in(wOrderIds);
         }
-
-        if (StringUtils.isNotBlank(query.getStatus()) && !query.getStatus().equals("all")) {
-            criteria.and("status").is(Integer.valueOf(query.getStatus()));
-        } else {
-            criteria.and("status").in(statuses);
+        if (StringUtils.isNotBlank(query.getStatus())){
+            if (query.getStatus().equals(String.valueOf(CarWaybillEnum.COMPLETION_UNLOADING.getCode()))) {
+                List<Integer> _statuses = new ArrayList<>();
+                _statuses.add(CarWaybillEnum.COMPLETION_UNLOADING.getCode());
+                _statuses.add(CarWaybillEnum.APPROVAL_NO_PASS.getCode());
+                criteria.and("status").in(_statuses);
+            }
+            if (!query.getStatus().equals("all")) {
+                criteria.and("status").is(Integer.valueOf(query.getStatus()));
+            }
         }
+
         // 装载时间
         if (Objects.nonNull(query.getStartLoadTime()) && Objects.nonNull(query.getEndLoadTime())) {
             criteria.and("loadTime").gte(query.getStartLoadTime()).lte(DateUtil.offsetDay(query.getEndLoadTime(), 1));
@@ -475,7 +490,7 @@ public class WaybillManagementService {
      */
     public HttpResult waybillIndexStatistics(WaybillOrderDTO query){
         List<Integer> statuses = initWaybillIndexStatus();
-        Criteria criteria = buildWaybillIndexQuery(query, statuses);
+        Criteria criteria = buildWaybillIndexQuery(query);
         Aggregation aggregation = Aggregation.newAggregation(
                 Aggregation.match(criteria),
                 Aggregation.group("status").count().as("total"),
@@ -483,12 +498,12 @@ public class WaybillManagementService {
         );
         AggregationResults<TableTops> outputTypeCount = mongoTemplate.aggregate(aggregation, SckwWaybillOrder.class, TableTops.class);
         List<TableTops> results = outputTypeCount.getMappedResults();
-
+        Integer allTotal = 0;
         Map<String, TableTops> listMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         TableTops topTotal = new TableTops();
         topTotal.setName("全部");
         topTotal.setValue("all");
-        topTotal.setTotal(0);
+        topTotal.setTotal(allTotal);
         listMap.put("all", topTotal);
         statuses.forEach(e -> {
             TableTops top = new TableTops();
@@ -499,10 +514,13 @@ public class WaybillManagementService {
         });
         if(CollectionUtils.isNotEmpty(results)) {
             for(TableTops result: results) {
-                listMap.get(result.getValue()).setTotal(result.getTotal());
+                if(listMap.containsKey(result.getValue())) {
+                    listMap.get(result.getValue()).setTotal(result.getTotal());
+                }
+                allTotal += result.getTotal();
             }
         }
-        listMap.get("all").setTotal(listMap.values().parallelStream().mapToInt(e -> e.getTotal()).sum());
+        listMap.get("all").setTotal(allTotal);
         return HttpResult.ok(listMap.values());
     }