xucaiqin 2 өдөр өмнө
parent
commit
d343a6a25d
31 өөрчлөгдсөн 428 нэмэгдсэн , 527 устгасан
  1. 0 56
      sckw-modules-api/sckw-file-api/src/main/java/com/sckw/file/api/dubbo/FileApiDubboService.java
  2. 27 0
      sckw-modules-api/sckw-file-api/src/main/java/com/sckw/file/api/dubbo/RemoteFileService.java
  3. 20 0
      sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/TradeEntInfoResVo.java
  4. 6 22
      sckw-modules/sckw-file/src/main/java/com/sckw/file/controller/KwfFileController.java
  5. 0 83
      sckw-modules/sckw-file/src/main/java/com/sckw/file/dubbo/FileDubboApiServiceImpl.java
  6. 34 0
      sckw-modules/sckw-file/src/main/java/com/sckw/file/dubbo/RemoteFileServiceImpl.java
  7. 4 3
      sckw-modules/sckw-file/src/main/java/com/sckw/file/service/FileService.java
  8. 6 9
      sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java
  9. 4 0
      sckw-modules/sckw-payment/pom.xml
  10. 12 20
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/config/ApplicationProperties.java
  11. 7 44
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java
  12. 14 13
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletPayableController.java
  13. 7 6
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/entity/KwpWallet.java
  14. 3 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/entity/KwpWalletCash.java
  15. 1 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/enums/PayXwEnum.java
  16. 36 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/CashParaPage.java
  17. 1 2
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/dto/CashWalletReq.java
  18. 100 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/dto/UserDetailDto.java
  19. 27 0
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/dto/UserInfo.java
  20. 1 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPayableBalanceQuery.java
  21. 1 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPayablePayQuery.java
  22. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPayableQuery.java
  23. 3 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPrepaidBalanceQuery.java
  24. 1 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPrepaidQuery.java
  25. 1 5
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPrepaidRecordQuery.java
  26. 0 89
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/res/HttpResult.java
  27. 7 1
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/PayXwService.java
  28. 65 115
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java
  29. 0 39
      sckw-modules/sckw-payment/src/main/java/com/sckw/payment/utils/PageMoreRes.java
  30. 19 0
      sckw-modules/sckw-payment/src/main/resources/bootstrap-prod.yml
  31. 20 1
      sckw-modules/sckw-payment/src/main/resources/bootstrap-test.yml

+ 0 - 56
sckw-modules-api/sckw-file-api/src/main/java/com/sckw/file/api/dubbo/FileApiDubboService.java

@@ -1,56 +0,0 @@
-package com.sckw.file.api.dubbo;
-
-import com.sckw.core.model.file.FileInfo;
-import com.sckw.core.web.response.HttpResult;
-import com.sckw.file.api.dto.FileInfoDTO;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.InputStream;
-import java.text.ParseException;
-
-/**
- * @author lfdc
- * @version 1.0
- * @className FileApiDubboService
- * @description fileDubbo服务
- * @company sckw
- * @date 2023-06-06 10:06:27
- */
-public interface FileApiDubboService {
-
-    /**
-     * 文件上传
-     * @param str
-     * @param fileByte
-     * @return
-     */
-    HttpResult fileUpload(String str, byte[] fileByte);
-
-    /**
-     * dubbo方式上传
-     * @param file
-     * @return
-     */
-    HttpResult fileUploadTodubbo(MultipartFile file);
-
-    /**
-     * 查询数据
-     * @return
-     */
-    HttpResult selectAll();
-
-    /**
-     * dubbo 文件调用
-     * @param inputStream
-     * @param fileInfo
-     * @return
-     */
-    HttpResult fileDubboUpload(InputStream inputStream, FileInfoDTO fileInfo);
-
-    /**
-     * dubbo保存信息
-     * @param fileInfo
-     * @return
-     */
-    HttpResult fileInfoInsert(FileInfo fileInfo) throws ParseException;
-}

+ 27 - 0
sckw-modules-api/sckw-file-api/src/main/java/com/sckw/file/api/dubbo/RemoteFileService.java

@@ -0,0 +1,27 @@
+package com.sckw.file.api.dubbo;
+
+import com.sckw.core.model.vo.FileInfoVO;
+import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @author lfdc
+ * @version 1.0
+ * @className FileApiDubboService
+ * @description fileDubbo服务
+ * @company sckw
+ * @date 2023-06-06 10:06:27
+ */
+public interface RemoteFileService {
+
+
+    /**
+     * dubbo方式上传
+     * @param file
+     * @return
+     */
+    BaseResult<FileInfoVO> fileUpload(MultipartFile file);
+
+
+}

+ 20 - 0
sckw-modules-api/sckw-payment-api/src/main/java/com/sckw/payment/api/model/TradeEntInfoResVo.java

@@ -0,0 +1,20 @@
+package com.sckw.payment.api.model;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * 交易对方企业信息
+ *
+ * @author tangyishan
+ * @since 2026-02-03  10:39
+ */
+@Data
+public class TradeEntInfoResVo implements Serializable {
+    private static final long serialVersionUID = 1L;
+    @JsonFormat(shape = JsonFormat.Shape.STRING)
+    private Long entId;
+    private String entName;
+}

+ 6 - 22
sckw-modules/sckw-file/src/main/java/com/sckw/file/controller/KwfFileController.java

@@ -1,15 +1,15 @@
 package com.sckw.file.controller;
 
 import com.sckw.core.annotation.RepeatSubmit;
-import com.sckw.core.model.file.FileInfo;
+import com.sckw.core.model.vo.FileInfoVO;
 import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.response.BaseResult;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.result.Status;
 import com.sckw.file.api.dto.FileInfoDTO;
-import com.sckw.file.dubbo.FileDubboApiServiceImpl;
+import com.sckw.file.dubbo.RemoteFileServiceImpl;
 import com.sckw.file.model.param.FileImageParam;
 import com.sckw.file.service.FileService;
-import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
@@ -23,7 +23,6 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.text.ParseException;
 import java.util.Map;
 
 /**
@@ -44,7 +43,7 @@ public class KwfFileController {
     private FileService fileService;
 
     @Autowired
-    private FileDubboApiServiceImpl fileApiService;
+    private RemoteFileServiceImpl fileApiService;
 
     /**
      * 上传文件至OSS
@@ -126,12 +125,12 @@ public class KwfFileController {
      * @return
      */
     @RequestMapping(value = "/uploadFileInfo", method = RequestMethod.POST)
-    public HttpResult uploadFileInfo(@RequestParam("file") MultipartFile file) {
+    public BaseResult<FileInfoVO> uploadFileInfo(@RequestParam("file") MultipartFile file) {
         try {
             return fileService.uploadFileInfo(file);
         } catch (Exception e) {
             log.info("上传文件失败:{}",e.getMessage(),e);
-            return HttpResult.error("上传文件失败:" + e.getMessage());
+            return BaseResult.failed("上传文件失败:" + e.getMessage());
         }
     }
 
@@ -194,21 +193,6 @@ public class KwfFileController {
         }
     }
 
-    /**
-     * dubbo接收文件信息保存至数据库
-     *
-     * @param fileInfo
-     * @return
-     */
-    @RequestMapping(value = "/fileInfoInsertByOSS", method = RequestMethod.POST)
-    @GlobalTransactional(rollbackFor = Exception.class)
-    public HttpResult fileInfoInsertByOSS(@RequestBody FileInfo fileInfo) {
-        try {
-            return fileApiService.fileInfoInsert(fileInfo);
-        } catch (ParseException e) {
-            throw new RuntimeException(e);
-        }
-    }
 
     /**
      * dubbo接收上传文件至OSS

+ 0 - 83
sckw-modules/sckw-file/src/main/java/com/sckw/file/dubbo/FileDubboApiServiceImpl.java

@@ -1,83 +0,0 @@
-package com.sckw.file.dubbo;
-
-import com.sckw.core.model.constant.NumberConstant;
-import com.sckw.core.common.enums.enums.FileEnum;
-import com.sckw.core.model.file.FileInfo;
-import com.sckw.core.utils.FileUtils;
-import com.sckw.core.utils.IdWorker;
-import com.sckw.core.utils.StringUtils;
-import com.sckw.core.web.response.HttpResult;
-import com.sckw.excel.utils.DateUtil;
-import com.sckw.file.api.dto.FileInfoDTO;
-import com.sckw.file.api.dubbo.FileApiDubboService;
-import com.sckw.file.dao.KwsFileInfoDao;
-import com.sckw.file.model.kwfFileInfo;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.io.FilenameUtils;
-import org.apache.dubbo.config.annotation.DubboService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.multipart.MultipartFile;
-
-import java.io.InputStream;
-import java.math.BigDecimal;
-import java.text.ParseException;
-import java.util.Map;
-
-/**
- * @author lfdc
- * @description fileDubbo调用
- * @date 2023/6/20 0020
- */
-
-@Slf4j
-@DubboService(group = "design", version = "1.0.0",timeout = 50000)
-public class FileDubboApiServiceImpl implements FileApiDubboService {
-
-    @Autowired
-    KwsFileInfoDao fileInfoDao;
-
-    @Override
-    public HttpResult fileUpload(String str, byte[] fileByte) {
-        return null;
-    }
-
-    @Override
-    public HttpResult fileUploadTodubbo(MultipartFile file) {
-        return null;
-    }
-
-    @Override
-    public HttpResult selectAll() {
-        BigDecimal bigDecimal = new BigDecimal(NumberConstant.ZERO);
-        BigDecimal bigDecimal1 = new BigDecimal(NumberConstant.SIX);
-        BigDecimal divide = bigDecimal1.divide(bigDecimal);
-        return null;
-    }
-
-    @Override
-    public HttpResult fileDubboUpload(InputStream inputStream, FileInfoDTO fileInfo) {
-        Map<String, String> map = FileUtils.uploadFileByInfo(inputStream, fileInfo.getOriginalName(), FileEnum.Local_Address);
-        return HttpResult.ok(map);
-    }
-
-    @Override
-    public HttpResult fileInfoInsert(FileInfo fileInfo) throws ParseException {
-        kwfFileInfo kwfFileInfo = new kwfFileInfo();
-        kwfFileInfo.setOriginalName(fileInfo.getFileOriginalName());
-        kwfFileInfo.setFileSuffix(FilenameUtils.getExtension(fileInfo.getFileOriginalName()));
-        kwfFileInfo.setFileSize(StringUtils.isBlank(fileInfo.getFileSize()) ? new BigDecimal(NumberConstant.ZERO) : fileInfo.getFileSize());
-        kwfFileInfo.setId(new IdWorker(1).nextId());
-        kwfFileInfo.setType(fileInfo.getType());
-        kwfFileInfo.setFileName(fileInfo.getFileName());
-        kwfFileInfo.setMd5(fileInfo.getFileMd5());
-        kwfFileInfo.setFilePath(fileInfo.getFilePath());
-        kwfFileInfo.setCreateTime(DateUtil.strToDate(fileInfo.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
-        kwfFileInfo.setUpdateTime(DateUtil.strToDate(fileInfo.getUpdateTime(),"yyyy-MM-dd HH:mm:ss"));
-        kwfFileInfo.setStatus(fileInfo.getStatus());
-        kwfFileInfo.setDelFlag(fileInfo.getDelFlag());
-        kwfFileInfo.setCreateBy(fileInfo.getCreateBy());
-        kwfFileInfo.setUpdateBy(fileInfo.getUpdateBy());
-        fileInfoDao.insert(kwfFileInfo);
-        return HttpResult.ok();
-    }
-}

+ 34 - 0
sckw-modules/sckw-file/src/main/java/com/sckw/file/dubbo/RemoteFileServiceImpl.java

@@ -0,0 +1,34 @@
+package com.sckw.file.dubbo;
+
+import com.sckw.core.model.vo.FileInfoVO;
+import com.sckw.core.web.response.BaseResult;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.file.api.dubbo.RemoteFileService;
+import com.sckw.file.service.FileService;
+import jakarta.annotation.Resource;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+/**
+ * @author lfdc
+ * @description fileDubbo调用
+ * @date 2023/6/20 0020
+ */
+
+@Slf4j
+@DubboService(group = "design", version = "1.0.0",timeout = 50000)
+public class RemoteFileServiceImpl implements RemoteFileService {
+
+    @Resource
+    private FileService fileService;
+
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public BaseResult<FileInfoVO> fileUpload(MultipartFile file) {
+        return fileService.uploadFileInfo(file);
+    }
+
+}

+ 4 - 3
sckw-modules/sckw-file/src/main/java/com/sckw/file/service/FileService.java

@@ -3,10 +3,10 @@ package com.sckw.file.service;
 
 import com.aliyun.oss.model.OSSObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.common.enums.StringConstant;
 import com.sckw.core.common.enums.enums.FileDisposeLayoutEnum;
 import com.sckw.core.common.enums.enums.FileEnum;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.file.FileInfo;
 import com.sckw.core.model.vo.FileInfoEncryptVO;
 import com.sckw.core.model.vo.FileInfoVO;
@@ -15,6 +15,7 @@ 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.core.web.response.BaseResult;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.core.web.response.result.Status;
 import com.sckw.file.api.dto.FileInfoDTO;
@@ -259,7 +260,7 @@ public class FileService {
         return null;
     }
 
-    public HttpResult uploadFileInfo(MultipartFile file) {
+    public BaseResult<FileInfoVO> uploadFileInfo(MultipartFile file) {
         boolean flag = checkFileFormat(file);
         if (!flag) {
             throw new RuntimeException("上传文件格式错误!");
@@ -271,7 +272,7 @@ public class FileService {
         BeanUtils.copyProperties(returnFileInfo, fileInfoVO);
         boolean isImage = FileUtils.isImage(file);
         insertFile(returnFileInfo, isImage);
-        return HttpResult.ok(fileInfoVO);
+        return BaseResult.success(fileInfoVO);
     }
 
     private void insertFile(FileInfo fileInfo, boolean isImage) {

+ 6 - 9
sckw-modules/sckw-fleet/src/main/java/com/sckw/fleet/service/KwfDriverService.java

@@ -25,7 +25,6 @@ import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.excel.easyexcel.ExcelImportListener;
 import com.sckw.excel.utils.ExcelUtil;
-import com.sckw.file.api.dubbo.FileApiDubboService;
 import com.sckw.fleet.dao.*;
 import com.sckw.fleet.model.*;
 import com.sckw.fleet.model.dto.*;
@@ -47,12 +46,10 @@ import com.sckw.transport.api.dubbo.TransportRemoteService;
 import com.sckw.transport.api.model.param.CapacityTruckParam;
 import com.sckw.transport.api.model.vo.RWaybillOrderVo;
 import com.sckw.transport.api.model.vo.WaybillOrderTaskVO;
-import io.seata.spring.annotation.GlobalTransactional;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -89,8 +86,7 @@ public class KwfDriverService {
     KwfFleetDriverMapper fleetDriverDao;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
-    @DubboReference(version = "1.0.0", group = "design", check = false)
-    private FileApiDubboService remoteFileService;
+
     @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
     private RemoteUserService remoteUserService;
     @Autowired
@@ -374,7 +370,7 @@ public class KwfDriverService {
     @Transactional(rollbackFor = Exception.class)
     public void saveTruckAndAssociate(DriverAssociatedTruckSaveRequest request) {
         log.info("开始新增车辆档案并关联司机,request={}", JSON.toJSONString(request));
-        
+
         String entId = request.getEntId();
         if (org.apache.commons.lang3.StringUtils.isBlank(entId)) {
             log.error("新增车辆档案失败:企业id不能为空");
@@ -396,6 +392,7 @@ public class KwfDriverService {
         truckSaveParam.setVin(request.getVin());
         truckSaveParam.setBrand(request.getBrand());
         truckSaveParam.setPositionDevice(request.getPositionDevice());
+
         truckSaveParam.setEntId(StringUtils.isNotBlank(entId) ? Long.valueOf(entId) : LoginUserHolder.getEntId());
         log.info("调用truckService.saveTruck保存车辆档案,truckNo={}", request.getTruckNo());
         try {
@@ -411,7 +408,7 @@ public class KwfDriverService {
         KwfTruck truck = truckRepository.getOne(Wrappers.<KwfTruck>lambdaQuery()
                 .eq(KwfTruck::getTruckNo, request.getTruckNo())
                 .last("limit 1"));
-        
+
         if (truck == null) {
             log.error("车辆档案保存后查询失败,truckNo={}", request.getTruckNo());
             throw new BusinessPlatfromException(ErrorCodeEnum.TRUCK_NOT_FOUND, "车辆档案保存失败");
@@ -424,7 +421,7 @@ public class KwfDriverService {
         associatedTrackAddRequest.setDriverId(request.getDriverId());
         associatedTrackAddRequest.setTruckNo(truck.getTruckNo());
         associatedTrackAddRequest.setTruckAxleId(request.getTruckAxleId());
-        
+
         log.info("开始关联司机与车辆,driverId={}, truckNo={}", request.getDriverId(), truck.getTruckNo());
         try {
             addAssociatedTrack(associatedTrackAddRequest);
@@ -433,7 +430,7 @@ public class KwfDriverService {
             log.error("司机与车辆关联异常,driverId={}, truckNo={}", request.getDriverId(), truck.getTruckNo(), e);
             throw new BusinessException( "司机与车辆关联异常");
         }
-        
+
         log.info("新增车辆档案并关联司机流程结束");
     }
 

+ 4 - 0
sckw-modules/sckw-payment/pom.xml

@@ -125,6 +125,10 @@
             <version>1.0.0</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>com.sckw</groupId>
+            <artifactId>sckw-file-api</artifactId>
+        </dependency>
 
 
     </dependencies>

+ 12 - 20
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/config/ApplicationProperties.java

@@ -6,25 +6,17 @@ import org.springframework.context.annotation.Configuration;
 
 @Data
 @Configuration
-@ConfigurationProperties(prefix = "sckw.payment")
+@ConfigurationProperties(prefix = "payment.xw")
 public class ApplicationProperties {
-    //报表导出根路径
-    private String bankCode;
-    //新网银行配置
-    private XWBankConfig xw;
-
-    @Data
-    public static class XWBankConfig{
-        private String url;
-        private String charge;
-        private String prefix;
-        private String appId;
-        private Integer platNo;
-        private String amtMaxOrder;
-        private String amtMaxDay;
-        private String account;
-        private String split;
-        private String cash;
-        private String refund;
-    }
+    private String url;
+    private String charge;
+    private String prefix;
+    private String appId;
+    private Integer platNo;
+    private String amtMaxOrder;
+    private String amtMaxDay;
+    private String account;
+    private String split;
+    private String cash;
+    private String refund;
 }

+ 7 - 44
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletController.java

@@ -2,10 +2,12 @@ package com.sckw.payment.controller;
 
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.model.page.PageRes;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginEntHolder;
 import com.sckw.core.web.response.BaseResult;
-import com.sckw.payment.api.model.dto.TradeEntInfoResVo;
+import com.sckw.payment.api.model.TradeEntInfoResVo;
 import com.sckw.payment.api.model.dto.common.R;
+import com.sckw.payment.pojo.CashParaPage;
 import com.sckw.payment.pojo.CashVo;
 import com.sckw.payment.pojo.UpdateCash;
 import com.sckw.payment.pojo.dto.CashWalletReq;
@@ -14,7 +16,6 @@ import com.sckw.payment.pojo.vo.WalletVo;
 import com.sckw.payment.pojo.vo.req.CreateUserReq;
 import com.sckw.payment.pojo.vo.req.WalletPayableQuery;
 import com.sckw.payment.pojo.vo.req.WalletPrepaidQuery;
-import com.sckw.payment.pojo.vo.res.HttpResult;
 import com.sckw.payment.pojo.vo.res.WalletPayableSummary;
 import com.sckw.payment.pojo.vo.res.WalletPrepaidSummary;
 import com.sckw.payment.pojo.vo.res.WalletSummary;
@@ -42,11 +43,7 @@ import java.util.List;
 @Tag(name = "钱包管理")
 @RestController
 @RequestMapping("/wallet")
-public class WalletController  {
-
-
-    //    @Autowired
-//    private IWalletService walletService;
+public class WalletController {
     @Resource
     private WalletService walletService;
 
@@ -63,8 +60,8 @@ public class WalletController  {
      */
     @Operation(summary = "开户", description = "为用户开通钱包账户")
     @PostMapping("createUser")
-    public HttpResult createUser(@RequestBody @Valid CreateUserReq createUserReq) {
-        return HttpResult.ok(walletService.createUser(createUserReq));
+    public BaseResult<Object> createUser(@RequestBody @Valid CreateUserReq createUserReq) {
+        return BaseResult.success(walletService.createUser(createUserReq));
     }
 
     /**
@@ -155,7 +152,7 @@ public class WalletController  {
         }
         R<WalletCashVo> walletCashVoR = walletService.cashInfo();
 
-        if (HttpStatus.SUCCESS == walletCashVoR.getCode()) {
+        if (HttpStatus.SUCCESS_CODE == walletCashVoR.getCode()) {
             WalletCashVo data = walletCashVoR.getData();
             summary.setAvailableBalance(data.getCashAmount());
             summary.setId(data.getId());
@@ -186,39 +183,5 @@ public class WalletController  {
         return BaseResult.success(summary);
     }
 
-    /**
-     * 新增钱包
-     */
-//    @Operation(summary =  "新增保存钱包表")
-//    @PostMapping("/add")
-//    public BaseResult addSave(@RequestBody WalletInfoVo walletInfoVo) {
-//        walletInfoVo.setEntId(LoginUserHolder.getEntId());
-//        return BaseResult.success(walletService.createWallet(walletInfoVo));
-//    }
-
-    /**
-     * 修改钱包表
-     *
-     * @return ModelAndView
-     */
-
-//    @Operation(summary =  "修改保存钱包表")
-//    @PostMapping(value = "/edit/{id}")
-//    public BaseResult editSave(@PathVariable Long id) {
-//        Wallet wallet = walletService.selectWalletById(id);
-//        return toAjax(walletService.updateWallet(wallet));
-//    }
 
-
-    //    @Operation(summary =  "删除钱包表",parameters =  {
-//            @Parameter(name = "ids", description = "id,多个用英文逗号分隔",required = true)
-//    })
-//    @PostMapping("/remove")
-//    public BaseResult remove(String ids) {
-//        if (StringUtils.isBlank(ids)) {
-//            return BaseResult.failed("请选择需要删除的数据!");
-//        }
-//        List<Long> idList = Stream.of(ids.split(",")).filter(StringUtils::isNotBlank).map(String::trim).map(Long::valueOf).distinct().collect(Collectors.toList());
-//        return toAjax(walletService.deleteWalletByIds(idList));
-//    }
 }

+ 14 - 13
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/controller/WalletPayableController.java

@@ -1,18 +1,19 @@
 package com.sckw.payment.controller;
 
 import com.github.pagehelper.PageInfo;
+import com.sckw.contract.api.RemoteContractService;
+import com.sckw.contract.api.model.dto.req.TradeEntListQueryFeignDto;
+import com.sckw.contract.api.model.dto.res.TradeEntInfoResVo;
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.web.context.LoginEntHolder;
 import com.sckw.core.web.response.BaseResult;
 import com.sckw.core.web.response.result.PageDataResult;
-import com.sckw.payment.api.ContractFeignService;
-import com.sckw.payment.api.domain.req.TradeEntListQueryFeignDto;
-import com.sckw.payment.api.domain.res.TradeEntInfoResVo;
 import com.sckw.payment.pojo.vo.req.*;
 import com.sckw.payment.pojo.vo.res.*;
 import com.sckw.payment.service.IWalletPayableService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -35,9 +36,9 @@ public class WalletPayableController  {
 
     @Autowired
     private IWalletPayableService walletPayableService;
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    private RemoteContractService remoteContractService;
 
-    @Autowired
-    private ContractFeignService contractFeignService;
 
 
     //查询待付或代收运费的汇总接口
@@ -90,14 +91,14 @@ public class WalletPayableController  {
         TradeEntListQueryFeignDto queryFeignDto = new TradeEntListQueryFeignDto();
         queryFeignDto.setCurEntId(LoginEntHolder.getEntId());
         String entTypes = LoginEntHolder.get().getEntTypes();
-        if(EntTypeEnum.consign(entTypes)){
-            queryFeignDto.setTradeEntType(4);
-        } else if (EntTypeEnum.carrier(entTypes)) {
-            queryFeignDto.setTradeEntType(3);
-        }else {
+        if (entTypes.contains(String.valueOf(EntTypeEnum.SUPPLIER.getCode()))) {
+            queryFeignDto.setTradeEntType(EntTypeEnum.PURCHASER.getCode());
+        } else if (entTypes.contains(String.valueOf(EntTypeEnum.PURCHASER.getCode()))) {
+            queryFeignDto.setTradeEntType(EntTypeEnum.SUPPLIER.getCode());
+        } else {
             return BaseResult.success(Collections.emptyList());
         }
-        return BaseResult.success(contractFeignService.queryPayableTradeEntIds(queryFeignDto).getData());
+        return remoteContractService.queryPrepaidTradeEntIds(queryFeignDto);
     }
 
 
@@ -114,7 +115,7 @@ public class WalletPayableController  {
         if(!entTypes.contains(String.valueOf(EntTypeEnum.LOGISTIC.getCode()))) {
             return BaseResult.failed("当前用户非物流商,无法进行此操作");
         }
-        return toAjax(walletPayableService.manualEntry(payableManualDto));
+        return BaseResult.success(walletPayableService.manualEntry(payableManualDto));
     }
 
 
@@ -148,7 +149,7 @@ public class WalletPayableController  {
     @Operation(summary = "申请付款")
     @PostMapping("/applyPay")
     public BaseResult<Object> applyPay(@RequestBody @Validated WalletPayableApplyPayDto applyPayDto) {
-        return toAjax(walletPayableService.applyPay(applyPayDto));
+        return BaseResult.success(walletPayableService.applyPay(applyPayDto));
     }
 
     /**

+ 7 - 6
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/entity/KwpWallet.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -52,42 +53,42 @@ public class KwpWallet {
      */
     @TableField(value = "cash_amount")
     @Schema(description = "提现金额")
-    private Long cashAmount;
+    private BigDecimal cashAmount;
 
     /**
      * 预付余额
      */
     @TableField(value = "prepay_amount")
     @Schema(description = "预付余额")
-    private Long prepayAmount;
+    private BigDecimal prepayAmount;
 
     /**
      * 交易中金额
      */
     @TableField(value = "dealing_amount")
     @Schema(description = "交易中金额")
-    private Long dealingAmount;
+    private BigDecimal dealingAmount;
 
     /**
      * 运费金额
      */
     @TableField(value = "freight_amount")
     @Schema(description = "运费金额")
-    private Long freightAmount;
+    private BigDecimal freightAmount;
 
     /**
      * 进行中金额
      */
     @TableField(value = "processing_amount")
     @Schema(description = "进行中金额")
-    private Long processingAmount;
+    private BigDecimal processingAmount;
 
     /**
      * 付款中金额
      */
     @TableField(value = "paying_amount")
     @Schema(description = "付款中金额")
-    private Long payingAmount;
+    private BigDecimal payingAmount;
 
     /**
      * 渠道

+ 3 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/entity/KwpWalletCash.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 
 /**
@@ -59,14 +60,14 @@ public class KwpWalletCash {
      */
     @TableField(value = "amount")
     @Schema(description = "交易金额")
-    private Long amount;
+    private BigDecimal amount;
 
     /**
      * 可提现金额
      */
     @TableField(value = "cash_amount")
     @Schema(description = "可提现金额")
-    private Long cashAmount;
+    private BigDecimal cashAmount;
 
     /**
      * 凭证

+ 1 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/enums/PayXwEnum.java

@@ -11,6 +11,7 @@ import lombok.Getter;
 @AllArgsConstructor
 public enum PayXwEnum {
     BEFORE_CREATE("/user/beforeCreate", "获取开户地址"),
+    ACCOUNT("/user/account", "账户信息"),
     PAY("/prePay/pay", "钱包清单"),
     SPLIT("/pay/settle", "清分"),
     WITHDRAW_TAKE("/pay/withdraw", "申请提现"),

+ 36 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/CashParaPage.java

@@ -0,0 +1,36 @@
+package com.sckw.payment.pojo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.sckw.core.model.vo.BasePara;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * 提现
+ *
+ * @author xucaiqin
+ * @date 2023-08-29 09:14:04
+ */
+@Getter
+@Setter
+public class CashParaPage extends BasePara  {
+    private Long entId;
+
+    private Integer action;
+
+    private String orderNo;
+    private Integer status;
+
+    private BigDecimal startAmount;
+    private BigDecimal endAmount;
+
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String startCreateTime;
+
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private String endCreateTime;
+
+}

+ 1 - 2
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/dto/CashWalletReq.java

@@ -1,6 +1,5 @@
 package com.sckw.payment.pojo.dto;
 
-import com.sckw.common.core.pojo.MoneyChange;
 import jakarta.validation.constraints.Digits;
 import jakarta.validation.constraints.Positive;
 import jakarta.validation.constraints.Size;
@@ -17,7 +16,7 @@ import java.math.BigDecimal;
  */
 @Getter
 @Setter
-public class CashWalletReq implements MoneyChange {
+public class CashWalletReq  {
 
     @Positive(message = "提现金额必须大于0")
     @Digits(message = "小数位数过长或金额过大", integer = 10, fraction = 2)

+ 100 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/dto/UserDetailDto.java

@@ -0,0 +1,100 @@
+package com.sckw.payment.pojo.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author xucaiqin
+ * @date 2023-12-29 17:18:42
+ */
+@Getter
+@Setter
+public class UserDetailDto {
+    /**
+     * id
+     */
+    private Long id;
+
+    /**
+     * 中台用户id
+     */
+    private String uid;
+
+    /**
+     * 流水号
+     */
+    private String tranNo;
+
+    /**
+     * 开户响应流水号
+     */
+    private String openacctNo;
+
+    /**
+     * 新网用户id
+     */
+    private String customerNo;
+
+    /**
+     * 认证id
+     */
+    private String authId;
+
+    /**
+     * 结算账户
+     */
+    private String settleAcct;
+
+    /**
+     * 余额账户
+     */
+    private String balanceAcct;
+
+    /**
+     * 免密账户
+     */
+    private String unPwdAcct;
+
+    /**
+     * 企业对公户开户行名
+     */
+    private String bankName;
+
+    /**
+     * 企业对公户开户行号
+     */
+    private String bankCode;
+
+    /**
+     * 企业对公账户号
+     */
+    private String bankCardNo;
+
+    /**
+     * 中台通知地址
+     */
+    private String noticeUrl;
+
+    /**
+     * 中台通知状态 1-未通知 2-通知成功 3-通知失败
+     */
+    private Integer noticeFlag;
+
+    /**
+     * 审核状态 1-提交信息 2-小额验证 3-人工审核 4-联系人认证 5-法人认证 6-开户成功 7-开户失败
+     */
+    private Integer auditFlag;
+
+    /**
+     * 结算授权状态 0-待提交 1-提交申请 2-审核通过 3-审核失败
+     */
+    private Integer settleFlag;
+
+
+    //userinfo表字段
+    private String contactPhone;
+    private String legalPhone;
+    private String fullName;
+
+
+}

+ 27 - 0
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/dto/UserInfo.java

@@ -0,0 +1,27 @@
+package com.sckw.payment.pojo.dto;
+
+
+import jakarta.validation.constraints.NotBlank;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @Author xucaiqin
+ * @date 2023-03-30 19:19:43
+ */
+@Getter
+@Setter
+@AllArgsConstructor
+@NoArgsConstructor
+public class UserInfo implements Serializable {
+    @Serial
+    private static final long serialVersionUID = 3652670959771172362L;
+    @NotBlank(message = "uid不能为空")
+    private String uid;
+
+}

+ 1 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPayableBalanceQuery.java

@@ -1,13 +1,11 @@
 package com.sckw.payment.pojo.vo.req;
 
-import com.sckw.common.core.web.page.BaseQuery;
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
-import jakarta.validation.constraints.Pattern;
 import lombok.Data;
 
 import java.math.BigDecimal;
 
-import static com.sckw.common.core.utils.DateUtils.dateTimeRegExp;
 
 /**
  *
@@ -37,11 +35,9 @@ public class WalletPayableBalanceQuery extends BaseQuery {
     @Schema(description = "执行状态,1-进行中 2-成功 3-失败")
     private Integer status;
     /** 开始时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询开始时间格式不正确")
     @Schema(description = "查询开始时间,yyyy-MM-dd HH:mm:ss")
     private String startTime; // 开始时间
     /** 结束时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询结束时间格式不正确")
     @Schema(description = "查询结束时间,yyyy-MM-dd HH:mm:ss")
     private String endTime; // 结束时间
     /** 当前企业id */

+ 1 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPayablePayQuery.java

@@ -1,12 +1,10 @@
 package com.sckw.payment.pojo.vo.req;
 
-import com.sckw.common.core.web.page.BaseQuery;
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
 import lombok.Data;
 
-import static com.sckw.common.core.utils.DateUtils.dateTimeRegExp;
 
 /**
  * 运费支付记录查询列表参数
@@ -24,11 +22,9 @@ public class WalletPayablePayQuery extends BaseQuery {
     @Schema(description = "付状态,0-等待支付 2-支付成功")
     private Integer status;
     /** 开始时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询开始时间格式不正确")
     @Schema(description = "查询开始时间,yyyy-MM-dd HH:mm:ss")
     private String startTime; // 开始时间
     /** 结束时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询结束时间格式不正确")
     @Schema(description = "查询结束时间,yyyy-MM-dd HH:mm:ss")
     private String endTime; // 结束时间
 }

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPayableQuery.java

@@ -1,6 +1,6 @@
 package com.sckw.payment.pojo.vo.req;
 
-import com.sckw.common.core.web.page.BaseQuery;
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 

+ 3 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPrepaidBalanceQuery.java

@@ -1,13 +1,12 @@
 package com.sckw.payment.pojo.vo.req;
 
-import com.sckw.common.core.web.page.BaseQuery;
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
-import jakarta.validation.constraints.Pattern;
 import lombok.Data;
+import lombok.EqualsAndHashCode;
 
 import java.math.BigDecimal;
 
-import static com.sckw.common.core.utils.DateUtils.dateTimeRegExp;
 
 /**
  * 待履约/预付余额明细查询参数
@@ -15,6 +14,7 @@ import static com.sckw.common.core.utils.DateUtils.dateTimeRegExp;
  * @author tangyishan
  * @since 2026-01-14  10:17
  */
+@EqualsAndHashCode(callSuper = true)
 @Data
 public class WalletPrepaidBalanceQuery extends BaseQuery {
     /** 关联订单编号 */
@@ -36,11 +36,9 @@ public class WalletPrepaidBalanceQuery extends BaseQuery {
     @Schema(description = "执行状态,1-进行中 2-成功 3-失败")
     private Integer status;
     /** 开始时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询开始时间格式不正确")
     @Schema(description = "查询开始时间,yyyy-MM-dd HH:mm:ss")
     private String startTime; // 开始时间
     /** 结束时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询结束时间格式不正确")
     @Schema(description = "查询结束时间,yyyy-MM-dd HH:mm:ss")
     private String endTime; // 结束时间
     /** 当前企业id */

+ 1 - 1
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPrepaidQuery.java

@@ -1,6 +1,6 @@
 package com.sckw.payment.pojo.vo.req;
 
-import com.sckw.common.core.web.page.BaseQuery;
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 

+ 1 - 5
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/req/WalletPrepaidRecordQuery.java

@@ -1,13 +1,11 @@
 package com.sckw.payment.pojo.vo.req;
 
-import com.sckw.common.core.web.page.BaseQuery;
+import com.sckw.core.web.page.BaseQuery;
 import io.swagger.v3.oas.annotations.media.Schema;
 import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Pattern;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import static com.sckw.common.core.utils.DateUtils.dateTimeRegExp;
 
 /**
  * 预付支付记录查询参数
@@ -26,11 +24,9 @@ public class WalletPrepaidRecordQuery extends BaseQuery {
     @Schema(description = "付状态,0-等待支付 1-支付成功")
     private Integer status;
     /** 开始时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询开始时间格式不正确")
     @Schema(description = "查询开始时间,yyyy-MM-dd HH:mm:ss")
     private String startTime; // 开始时间
     /** 结束时间 */
-    @Pattern(regexp = dateTimeRegExp, message = "查询结束时间格式不正确")
     @Schema(description = "查询结束时间,yyyy-MM-dd HH:mm:ss")
     private String endTime; // 结束时间
 }

+ 0 - 89
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/pojo/vo/res/HttpResult.java

@@ -1,89 +0,0 @@
-package com.sckw.payment.pojo.vo.res;
-
-import com.sckw.common.core.web.page.HttpStatus;
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * HTTP结果封装
- * @author zk
- * @date Oct 29, 2018
- */
-@Data
-public class HttpResult implements Serializable {
-
-	private int code = HttpStatus.SUCCESS_CODE;
-	private String msg = HttpStatus.SUCCESS_MESSAGE;
-	private Object data;
-
-	public static HttpResult error() {
-		return error(HttpStatus.GLOBAL_EXCEPTION_CODE, HttpStatus.GLOBAL_EXCEPTION_MESSAGE);
-	}
-
-	public static HttpResult error(String msg) {
-		return error(HttpStatus.GLOBAL_EXCEPTION_CODE, msg);
-	}
-
-	public static HttpResult error(int code, String msg) {
-		HttpResult r = new HttpResult();
-		r.setCode(code);
-		r.setMsg(msg);
-		return r;
-	}
-
-	public static HttpResult error(String msg, Object data) {
-		HttpResult r = new HttpResult();
-		r.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
-		r.setMsg(msg);
-		r.setData(data);
-		return r;
-	}
-
-	public static HttpResult error(int code, String msg, Object data) {
-		HttpResult r = new HttpResult();
-		r.setCode(code);
-		r.setMsg(msg);
-		r.setData(data);
-		return r;
-	}
-
-
-	public static HttpResult ok() {
-		return new HttpResult();
-	}
-
-	public static HttpResult ok(String msg) {
-		HttpResult r = new HttpResult();
-		r.setMsg(msg);
-		return r;
-	}
-
-	public static HttpResult ok(Object data) {
-		HttpResult r = new HttpResult();
-		r.setData(data);
-		return r;
-	}
-
-    public static HttpResult ok(int code, String msg) {
-        HttpResult r = new HttpResult();
-        r.setCode(code);
-        r.setMsg(msg);
-        return r;
-    }
-
-	public static HttpResult ok(String msg, Object data) {
-		HttpResult r = new HttpResult();
-		r.setMsg(msg);
-		r.setData(data);
-		return r;
-	}
-
-    public static HttpResult ok(int code,String msg, Object data) {
-        HttpResult r = new HttpResult();
-        r.setCode(code);
-        r.setMsg(msg);
-        r.setData(data);
-        return r;
-    }
-}

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

@@ -20,7 +20,7 @@ import org.springframework.stereotype.Service;
 @Service
 @Slf4j
 public class PayXwService {
-    @Value("${xw.address}")
+    @Value("${payment.xw.url}")
     private String xwAddress;
 
     private String jsonHttp(PayXwEnum payXwEnum, Object object) {
@@ -50,6 +50,12 @@ public class PayXwService {
         });
     }
 
+    public R<UserDetailDto> account(UserInfo userInfo) {
+        String sync = jsonHttp(PayXwEnum.ACCOUNT, userInfo);
+        return JSONObject.parseObject(sync, new TypeReference<>() {
+        });
+    }
+
     public R<PayRes> pay(PayDto payDto) {
         String sync = jsonHttp(PayXwEnum.PAY, payDto);
         return JSONObject.parseObject(sync, new TypeReference<>() {

+ 65 - 115
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/WalletService.java

@@ -3,18 +3,25 @@ package com.sckw.payment.service;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.IdUtil;
+import cn.hutool.core.util.NumberUtil;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson2.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.enums.EntTypeEnum;
 import com.sckw.core.model.page.PageRes;
+import com.sckw.core.model.vo.FileInfoVO;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginEntHolder;
 import com.sckw.core.web.context.LoginUserHolder;
-import com.sckw.payment.api.model.dto.TradeEntInfoResVo;
+import com.sckw.core.web.response.BaseResult;
+import com.sckw.file.api.dubbo.RemoteFileService;
+import com.sckw.payment.api.model.TradeEntInfoResVo;
 import com.sckw.payment.api.model.dto.common.R;
+import com.sckw.payment.config.ApplicationProperties;
 import com.sckw.payment.entity.KwpWallet;
 import com.sckw.payment.entity.KwpWalletCash;
 import com.sckw.payment.entity.KwpWalletSplit;
@@ -24,6 +31,7 @@ import com.sckw.payment.enums.WalletStatusEnum;
 import com.sckw.payment.mapper.KwpWalletCashMapper;
 import com.sckw.payment.mapper.KwpWalletMapper;
 import com.sckw.payment.mapper.KwpWalletSplitMapper;
+import com.sckw.payment.pojo.CashParaPage;
 import com.sckw.payment.pojo.CashVo;
 import com.sckw.payment.pojo.UpdateCash;
 import com.sckw.payment.pojo.dto.*;
@@ -35,7 +43,6 @@ import com.sckw.payment.pojo.vo.req.WalletPrepaidQuery;
 import com.sckw.payment.pojo.vo.res.WalletPayableSummary;
 import com.sckw.payment.pojo.vo.res.WalletPrepaidSummary;
 import com.sckw.payment.pojo.vo.res.WalletSummary;
-import com.sckw.payment.utils.MoneyUtil;
 import com.sckw.redis.config.RedisLockUtil;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
@@ -69,9 +76,8 @@ import java.util.stream.Collectors;
 public class WalletService {
     private final PayXwService payXwService;
     private final KwpWalletCashMapper kwpWalletCashMapper;
-    //    private final KwpWalletSubMapper kwpWalletSubMapper;
     private final KwpWalletMapper kwpWalletMapper;
-
+    private final ApplicationProperties applicationProperties;
     @DubboReference(version = "1.0.0", group = "design", check = false)
     private RemoteSystemService remoteSystemService;
     @Autowired
@@ -79,7 +85,8 @@ public class WalletService {
     @Autowired
     private IWalletPayableService walletPayableService;
     private final RedisLockUtil redisLockUtil;
-    private final FileService fileService;
+    @DubboReference(version = "1.0.0", group = "design", check = false)
+    private RemoteFileService remoteFileService;
     @Resource
     private KwpWalletSplitMapper kwpWalletSplitMapper;
 
@@ -147,18 +154,14 @@ public class WalletService {
 
             if (Objects.nonNull(kwpWalletCash)) {
                 MultipartFile file = cashDto.getFile();
-                R<FileDto> stringR = R.fail("");
-                try {
-                    stringR = fileService.fileUpload(file);
-                } catch (Exception e) {
-                    log.error("文件上传失败 {}", e.getMessage());
+                BaseResult<FileInfoVO> httpResult = remoteFileService.fileUpload(file);
+                if (HttpStatus.SUCCESS_CODE == httpResult.getCode()) {
+                    FileInfoVO data = httpResult.getData();
+                    kwpWalletCash.setImg(Objects.nonNull(data) ? data.getFileAbsolutePath() : "");
                 }
-                FileDto data = stringR.getData();
-
-                Long deal = MoneyUtil.bigMoney(new BigDecimal(amt));
-                kwpWalletCash.setImg(Objects.nonNull(data) ? data.getFileAbsolutePath() : "");
+                BigDecimal deal = new BigDecimal(amt);
                 kwpWalletCash.setAmount(deal);
-                kwpWalletCash.setCashAmount(kwpWalletCash.getCashAmount() - deal);
+                kwpWalletCash.setCashAmount(NumberUtil.sub(kwpWalletCash.getCashAmount(), deal));
                 kwpWalletCash.setStatus(1);
                 kwpWalletCashMapper.updateById(kwpWalletCash);
             } else {
@@ -178,17 +181,12 @@ public class WalletService {
                     .eq(KwpWalletSplit::getStatus, 1)
             );
             if (Objects.nonNull(kwpWalletSplit)) {
-                R<FileDto> stringR = R.fail("");
-                try {
-                    if (Objects.nonNull(file) && !file.isEmpty()) {
-                        stringR = fileService.fileUpload(file);
-                    }
-                } catch (Exception e) {
-                    log.error("清分凭证上传失败 {}", e.getMessage());
+                BaseResult<FileInfoVO> httpResult = remoteFileService.fileUpload(file);
+                if (HttpStatus.SUCCESS_CODE == httpResult.getCode()) {
+                    FileInfoVO data = httpResult.getData();
+                    kwpWalletSplit.setImg(Objects.nonNull(data) ? data.getFileAbsolutePath() : "");
                 }
-                FileDto data = stringR.getData();
 
-                kwpWalletSplit.setImg(Objects.nonNull(data) ? data.getFileAbsolutePath() : "");
                 kwpWalletSplit.setStatus(StrUtil.equals(splitDto.getStatus(), "true") ? 2 : 3);
                 kwpWalletSplitMapper.updateById(kwpWalletSplit);
                 //
@@ -198,9 +196,9 @@ public class WalletService {
 
                     if (Objects.nonNull(kwpWallet)) {
                         if (Objects.equals(kwpWallet.getCashFlag(), 2)) {
-                            Long amount = MoneyUtil.bigMoney(new BigDecimal(splitDto.getAmt()));
-                            long sub = kwpWallet.getCashAmount() - amount;
-                            if (sub < 0L) {
+                            BigDecimal amount = new BigDecimal(splitDto.getAmt());
+                            BigDecimal sub = NumberUtil.sub(kwpWallet.getCashAmount(), amount);
+                            if (sub.compareTo(new BigDecimal("0")) < 0) {
                                 log.error("提现余额不足 {} {}", kwpWallet.getCashAmount(), amount);
                             }
                             KwpWalletCash kwpWalletCash = new KwpWalletCash();
@@ -227,7 +225,7 @@ public class WalletService {
                                 withdrawDto.setUid(kwpWallet.getUid());
                                 withdrawDto.setOrderNo(kwpWalletCash.getOrderNo());
                                 withdrawDto.setAmt(splitDto.getAmt());
-                                withdrawDto.setNoticeUrl("/notice/cash");
+                                withdrawDto.setNoticeUrl(applicationProperties.getCash());
                                 withdrawDto.setSummary("");
                                 withdrawDto.setRemark("提现");
                                 withdrawDto.setCommission("0.00");
@@ -253,67 +251,6 @@ public class WalletService {
     }
 
 
-    /**
-     * 提现
-     * 重新提现:只针对汇付 3.20调整为只有新网渠道,其它渠道不接入
-     *
-     * @return
-     */
-//    @Transactional(rollbackFor = Exception.class)
-//    public Object cashOUt(CashWalletReq cashWalletReq) {
-//        log.info("提现:{}", JSONObject.toJSONString(cashWalletReq));
-//        Long entId = LoginUserHolder.getEntId();
-//
-//        KwpWallet kwpWallet = kwpWalletMapper.selectOne(Wrappers.lambdaQuery(KwpWallet.class).eq(KwpWallet::getEntId, entId));
-//        if (Objects.isNull(kwpWallet)) {
-//            throw new BusinessException("企业钱包不存在");
-//        }
-//        Long amount = cashWalletReq.bigMoney(cashWalletReq.getMoney());
-//        long sub = kwpWallet.getCashAmount() - amount;
-//        if (sub < 0L) {
-//            throw new BusinessException("提现余额不足");
-//        }
-//        String key = String.format(RedisConstant.CASH_LOCK, entId);
-//
-//        if (redisLockUtil.tryLock(key)) {
-//            try {
-//                KwpWalletCash kwpWalletCash = new KwpWalletCash();
-//                kwpWalletCash.setFromEnt(entId);
-//                kwpWalletCash.setToEnt(0L);
-//                kwpWalletCash.setOrderNo(IdUtil.getSnowflakeNextIdStr());
-//                kwpWalletCash.setAction(1);
-//                kwpWalletCash.setAmount(amount);
-//                kwpWalletCash.setCashAmount(sub);
-//                kwpWalletCash.setImg("");
-//                kwpWalletCash.setRemark(cashWalletReq.getRemark());
-//                kwpWalletCash.setStatus(3);
-//                kwpWalletCash.setCreateBy(0L);
-//                kwpWalletCash.setCreateTime(LocalDateTime.now());
-//                kwpWalletCash.setUpdateBy(0L);
-//                kwpWalletCash.setUpdateTime(LocalDateTime.now());
-//                kwpWalletCash.setDelFlag(0);
-//
-//
-//                WithdrawDto withdrawDto = new WithdrawDto();
-//                R<WithdrawRes> payIndexR = payXwService.withDraw(withdrawDto);
-//                if (!payIndexR.getStatus()) {
-//                    kwpWalletCash.setStatus(2);//提现失败
-//                } else {
-//                    //todo 提现成功在扣减,并更新主钱包
-////                    kwpWallet.setCashAmount(sub);
-////                    kwpWalletMapper.updateById(kwpWallet);
-//                }
-//                kwpWalletCashMapper.insert(kwpWalletCash);
-//                return kwpWalletCash.getId();
-//            } finally {
-//                redisLockUtil.unlock(key);
-//            }
-//        }
-//        throw new BusinessException("请稍后再试");
-//
-//    }
-
-
     /**
      * 渠道开通
      *
@@ -324,7 +261,7 @@ public class WalletService {
         Long entId = createUserReq.getEntId();
         EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(entId);
         if (Objects.isNull(entCacheResDto)) {
-            throw new ServiceException("未找到企业信息");
+            throw new BusinessException("未找到企业信息");
         }
         List<EntCertificateResDto> certificateInfo = entCacheResDto.getCertificateInfo();
         Map<Integer, String> certMap = new HashMap<>();
@@ -345,21 +282,21 @@ public class WalletService {
         userPara.setLegalIds(certMap.get(2));
         userPara.setLegalName(entCacheResDto.getLegalName());
         userPara.setLegalPhone(entCacheResDto.getLegalPhone());
-        userPara.setNoticeUrl("");//todo 填写当前服务地址,通知开户成功
+        userPara.setNoticeUrl(applicationProperties.getAccount());
         R<CreateUser> createUserR = payXwService.beforeCreateUser(userPara);
         if (createUserR.getCode() != 200) {
-            throw new ServiceException(createUserR.getMsg());
+            throw new BusinessException(createUserR.getMsg());
         }
         KwpWallet kwpWallet = new KwpWallet();
         kwpWallet.setEntId(entId);
         kwpWallet.setUid(userPara.getUid());
         kwpWallet.setEntType(Integer.valueOf(entCacheResDto.getEntTypes()));
-        kwpWallet.setCashAmount(0L);
-        kwpWallet.setPrepayAmount(0L);
-        kwpWallet.setDealingAmount(0L);
-        kwpWallet.setFreightAmount(0L);
-        kwpWallet.setProcessingAmount(0L);
-        kwpWallet.setPayingAmount(0L);
+        kwpWallet.setCashAmount(new BigDecimal("0"));
+        kwpWallet.setPrepayAmount(new BigDecimal("0"));
+        kwpWallet.setDealingAmount(new BigDecimal("0"));
+        kwpWallet.setFreightAmount(new BigDecimal("0"));
+        kwpWallet.setProcessingAmount(new BigDecimal("0"));
+        kwpWallet.setPayingAmount(new BigDecimal("0"));
         kwpWallet.setChannel("xinwang");
         kwpWallet.setStatus(1);
         kwpWallet.setRemark("");
@@ -421,9 +358,23 @@ public class WalletService {
                 summary.setTradingFreightTotal(walletPayableSummary.getTradingFreightTotal());
                 summary.setPayingFreightTotal(walletPayableSummary.getPayingFreightTotal());
             }
-
-            bean.setStatusLabel(WalletStatusEnum.getByCode(one.getStatus()));
-            bean.setCashAmount(MoneyUtil.smallMoney(one.getCashAmount()));
+            if (Objects.equals(one.getStatus(), 1)) {//开户中,兜底查询支付服务,判定用户是否开户成功
+                R<UserDetailDto> account = payXwService.account(new UserInfo(one.getUid()));
+                if (account.getCode() == 200) {
+                    UserDetailDto data = account.getData();
+                    if (Objects.nonNull(data)) {
+                        if (Objects.equals(data.getAuditFlag(), 6)) {//开户成功
+                            bean.setStatus(2);
+                            one.setStatus(2);
+                            kwpWalletMapper.updateById(one);
+                        }
+                    }
+                    bean.setStatusLabel(WalletStatusEnum.getByCode(bean.getStatus()));
+                }
+            } else {
+                bean.setStatusLabel(WalletStatusEnum.getByCode(one.getStatus()));
+            }
+            bean.setCashAmount(one.getCashAmount());
             bean.setPrepayAmount(summary.getPreBalanceTotal());
             bean.setDealingAmount(summary.getPreTradingAmountTotal());
             bean.setFreightAmount(summary.getFreightTotal());
@@ -432,7 +383,7 @@ public class WalletService {
 
             return R.ok(bean);
         }
-        return R.fail("暂未开通钱包");
+        return R.failed("暂未开通钱包");
     }
 
 
@@ -445,7 +396,7 @@ public class WalletService {
                 .eq(Objects.nonNull(cashParaPage.getAction()), KwpWalletCash::getAction, cashParaPage.getAction())
                 .eq(Objects.nonNull(cashParaPage.getStatus()), KwpWalletCash::getStatus, cashParaPage.getStatus())
                 .between(Objects.nonNull(cashParaPage.getStartAmount()) && Objects.nonNull(cashParaPage.getEndAmount()),
-                        KwpWalletCash::getAmount, cashParaPage.bigMoney(cashParaPage.getStartAmount()), cashParaPage.bigMoney(cashParaPage.getEndAmount()))
+                        KwpWalletCash::getAmount, cashParaPage.getStartAmount(), cashParaPage.getEndAmount())
                 .between(StrUtil.isNotBlank(cashParaPage.getStartCreateTime()) && StrUtil.isNotBlank(cashParaPage.getEndCreateTime()), KwpWalletCash::getCreateTime, cashParaPage.getStartCreateTime(), cashParaPage.getEndCreateTime())
                 .like(StrUtil.isNotBlank(cashParaPage.getOrderNo()), KwpWalletCash::getOrderNo, cashParaPage.getOrderNo())
                 .eq(KwpWalletCash::getDelFlag, 0)
@@ -455,8 +406,8 @@ public class WalletService {
             CashVo bean = BeanUtil.toBean(d, CashVo.class);
             bean.setActionLabel(CashActionEnum.getByCode(d.getAction()));
             bean.setStatusLabel(CashStatusEnum.getByCode(d.getStatus()));
-            bean.setCashAmount(MoneyUtil.smallMoney(d.getCashAmount()));
-            bean.setAmount(MoneyUtil.smallMoney(d.getAmount()));
+            bean.setCashAmount(d.getCashAmount());
+            bean.setAmount(d.getAmount());
             bean.setFromEntName(getFirmName(d.getFromEnt()));
             bean.setToEntName(getFirmName(d.getToEnt()));
             return bean;
@@ -470,12 +421,11 @@ public class WalletService {
 
         KwpWallet kwpWallet = kwpWalletMapper.selectOne(Wrappers.lambdaQuery(KwpWallet.class).eq(KwpWallet::getEntId, entId));
         if (Objects.isNull(kwpWallet)) {
-            throw new ServiceException("企业钱包不存在");
+            throw new BusinessException("企业钱包不存在");
         }
-        Long amount = cashWalletReq.bigMoney(cashWalletReq.getMoney());
-        long sub = kwpWallet.getCashAmount() - amount;
-        if (sub < 0L) {
-            throw new ServiceException("提现余额不足");
+        BigDecimal sub = NumberUtil.sub(kwpWallet.getCashAmount(), cashWalletReq.getMoney());
+        if (sub.compareTo(new BigDecimal("0")) < 0) {
+            throw new BusinessException("提现余额不足");
         }
         String key = String.format("sckw:cash:%s", entId);
 
@@ -487,7 +437,7 @@ public class WalletService {
                 kwpWalletCash.setToEnt(entId);
                 kwpWalletCash.setOrderNo(IdUtil.getSnowflakeNextIdStr());
                 kwpWalletCash.setAction(1);
-                kwpWalletCash.setAmount(amount);
+                kwpWalletCash.setAmount(cashWalletReq.getMoney());
                 kwpWalletCash.setCashAmount(sub);
                 kwpWalletCash.setImg("");
                 kwpWalletCash.setRemark(cashWalletReq.getRemark());
@@ -518,7 +468,7 @@ public class WalletService {
                 redisLockUtil.unlock(key);
             }
         }
-        throw new ServiceException("请稍后再试");
+        throw new BusinessException("请稍后再试");
     }
 
     public R<WalletCashVo> cashInfo() {
@@ -528,11 +478,11 @@ public class WalletService {
             WalletCashVo bean = BeanUtil.toBean(one, WalletCashVo.class);
 
             bean.setStatusLabel(WalletStatusEnum.getByCode(one.getStatus()));
-            bean.setCashAmount(MoneyUtil.smallMoney(one.getCashAmount()));
+            bean.setCashAmount(one.getCashAmount());
 
             return R.ok(bean);
         }
-        return R.fail("暂未开通钱包");
+        return R.failed("暂未开通钱包");
     }
 
     public List<TradeEntInfoResVo> queryEntList() {
@@ -542,7 +492,7 @@ public class WalletService {
                 .select(KwpWalletCash::getFromEnt));
         if (CollUtil.isNotEmpty(kwpWalletCashes)) {
             List<Long> collect = kwpWalletCashes.stream().map(KwpWalletCash::getFromEnt).toList();
-            List<EntInfo> entInfos = remoteSystemService.queryEntInfos(collect);
+            List<EntCacheResDto> entInfos = remoteSystemService.queryEntCacheByIds(collect);
             return entInfos.stream().map(d -> BeanUtil.toBean(d, TradeEntInfoResVo.class)).collect(Collectors.toList());
         }
         return CollUtil.newArrayList();

+ 0 - 39
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/utils/PageMoreRes.java

@@ -1,39 +0,0 @@
-//package com.sckw.payment.utils;
-//
-//import com.github.pagehelper.PageInfo;
-//import com.sckw.core.model.page.PageRes;
-//import com.sckw.payment.model.vo.res.SettlementLogisticsSumVo;
-//
-//import java.util.List;
-//
-///**
-// * 返回的分页数据中,有额外需要返回的参数
-// *
-// * @author Aick Spt
-// * @date 2023-07-25 17:31
-// */
-//public class PageMoreRes<T> extends PageRes<T> {
-//
-//    /**
-//     * 更多其余数据
-//     */
-//    public SettlementLogisticsSumVo otherList;
-//
-//
-//    public void setOtherList(SettlementLogisticsSumVo otherList) {
-//        this.otherList = otherList;
-//    }
-//
-//
-//    public SettlementLogisticsSumVo getOtherList() {
-//        return otherList;
-//    }
-//
-//    public PageMoreRes(PageInfo<T> pageInfo, SettlementLogisticsSumVo otherList) {
-//        super(pageInfo);
-//        this.otherList = otherList;
-//    }
-//
-//
-//
-//}

+ 19 - 0
sckw-modules/sckw-payment/src/main/resources/bootstrap-prod.yml

@@ -26,3 +26,22 @@ spring:
           - dataId: sckw-common.yml
             group: sckw-ng-service-platform
             refresh: true
+payment:
+  xw:
+    url: https://payment.sckaiwu.cn/4NiTskifAmjssbCE
+    #  中台充值回调地址
+    charge: https://payment.sckaiwu.cn/asdfasdf/notice/xinwang/direct_payment/%s/%s
+    prefix: D:\Desk\Project\Pay-xw\src\main\resources\test\
+    appId: UATG9357f354f8854b02b596228910a7ae08
+    platNo: 7022
+    # 申请和授权 金额限定
+    amtMaxOrder: 50000
+    amtMaxDay: 500000
+    #  开户回调地址
+    account: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/user
+    # 清分回调地址
+    split: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/split
+    #  提现回调地址
+    cash: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/cash
+    #  退款回调地址
+    refund: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/refund

+ 20 - 1
sckw-modules/sckw-payment/src/main/resources/bootstrap-test.yml

@@ -26,4 +26,23 @@ spring:
         extension-configs:
           - dataId: sckw-common.yml
             group: sckw-ng-service-platform
-            refresh: true
+            refresh: true
+payment:
+  xw:
+    url: https://payment.sckaiwu.cn/4NiTskifAmjssbCE
+    #  中台充值回调地址
+    charge: https://payment.sckaiwu.cn/asdfasdf/notice/xinwang/direct_payment/%s/%s
+    prefix: D:\Desk\Project\Pay-xw\src\main\resources\test\
+    appId: UATG9357f354f8854b02b596228910a7ae08
+    platNo: 7022
+    # 申请和授权 金额限定
+    amtMaxOrder: 50000
+    amtMaxDay: 500000
+    #  开户回调地址
+    account: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/user
+    # 清分回调地址
+    split: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/split
+    #  提现回调地址
+    cash: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/cash
+    #  退款回调地址
+    refund: https://test.sckaiwu.cn/4NiTskifAmjssbCEXWBank/notice/refund