Browse Source

支付状态同步

ct 4 ngày trước cách đây
mục cha
commit
3ac0e05758

+ 4 - 10
fs-admin/src/main/java/com/fs/his/controller/FsStorePaymentController.java

@@ -14,14 +14,7 @@ import com.fs.his.vo.FsStorePaymentVO;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
@@ -128,10 +121,11 @@ public class FsStorePaymentController extends BaseController
 
 
     @GetMapping(value = "getStatus/{paymentId}")
-    public AjaxResult getStatus(@PathVariable("paymentId") Long paymentId)
+    public AjaxResult getStatus(@PathVariable("paymentId") Long paymentId,
+                                @RequestParam(value = "refundDate",required = false ) Date refundDate)
     {
 
-        return AjaxResult.success( fsStorePaymentService.updateFsStorePaymentByDecryptForm(paymentId));
+        return AjaxResult.success( fsStorePaymentService.updateFsStorePaymentByDecryptForm(paymentId,refundDate));
     }
     @PreAuthorize("@ss.hasPermi('his:storePayment:refund')")
     @GetMapping(value = "refund/{paymentId}")

+ 1 - 1
fs-admin/src/main/java/com/fs/his/task/Task.java

@@ -599,7 +599,7 @@ public class Task {
         List<FsStorePayment> fsStorePayments = fsStorePaymentService.selectAllPayment();
         for (FsStorePayment fsStorePayment : fsStorePayments) {
             try{
-                fsStorePaymentService.updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId());
+                fsStorePaymentService.updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId(),null);
             }catch (Exception e){
                 logger.error("同步支付失败:"+fsStorePayment.getPaymentId());
             }

+ 2 - 1
fs-service/src/main/java/com/fs/his/service/IFsStorePaymentService.java

@@ -1,5 +1,6 @@
 package com.fs.his.service;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -89,7 +90,7 @@ public interface IFsStorePaymentService
 
     List<FsStorePaymentExcelVO> selectFsStorePaymentExcelVO(FsStorePaymentParam fsStorePayment);
 
-    String updateFsStorePaymentByDecryptForm(Long paymentId);
+    String updateFsStorePaymentByDecryptForm(Long paymentId, Date refundDate);
 
     R refundFsStorePayment(Long paymentId);
 

+ 2 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1014,7 +1014,8 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
                 if (company != null) {
                     String followDoctorIdsJson = company.getFollowDoctorIds();
                     if (followDoctorIdsJson != null && followDoctorIdsJson != "") {
-                        long[] ids = JSON.parseObject(followDoctorIdsJson, long[].class);
+                        String jsonStr = JSON.parseObject(followDoctorIdsJson, String.class);
+                        long[] ids = JSON.parseObject(jsonStr, long[].class);
                         if (ids.length > 0) {
                             Random random = new Random();
                             // 从数组中随机选择一个数字

+ 3 - 3
fs-service/src/main/java/com/fs/his/service/impl/FsStorePaymentServiceImpl.java

@@ -358,14 +358,14 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
 
     @Override
     @Transactional
-    public String updateFsStorePaymentByDecryptForm(Long paymentId) {
+    public String updateFsStorePaymentByDecryptForm(Long paymentId,Date refundDate) {
         FsStorePayment fsStorePayment = fsStorePaymentMapper.selectFsStorePaymentByPaymentId(paymentId);
         if (fsStorePayment != null && fsStorePayment.getStatus() == 1) {
             //退款同步
             if (fsStorePayment.getPayMode().equals("hf")) {
                 V2TradePaymentScanpayRefundqueryRequest refundQueryRequest = new V2TradePaymentScanpayRefundqueryRequest();
                 // 退款请求日期
-                refundQueryRequest.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(DateUtils.getNowDate()));
+                refundQueryRequest.setOrgReqDate(new SimpleDateFormat("yyyyMMdd").format(refundDate));
 //                refundQueryRequest.setOrgReqDate("20260128");
                 //自己传的
                 refundQueryRequest.setOrgReqSeqId("refund-"+fsStorePayment.getPayCode());
@@ -1774,7 +1774,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
             for (FsStorePayment fsStorePayment : list) {
                 CompletableFuture<Void> future = CompletableFuture.runAsync(() -> {
                     try {
-                        updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId());
+                        updateFsStorePaymentByDecryptForm(fsStorePayment.getPaymentId(),null);
                         //查询是否改为已支付
                         FsStorePayment finalPayment = fsStorePaymentMapper.selectFsStorePaymentByPaymentId(fsStorePayment.getPaymentId());
                         try {