소스 검색

完善新版信息采集表流程执行代码

cgp 3 일 전
부모
커밋
1162957dd0
1개의 변경된 파일19개의 추가작업 그리고 9개의 파일을 삭제
  1. 19 9
      fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

+ 19 - 9
fs-service/src/main/java/com/fs/his/service/impl/FsStoreOrderServiceImpl.java

@@ -1191,23 +1191,33 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService {
             order.setFollowEndTime(calendar2.getTime());
             order.setFollowStatus(0);
         }
-        if (fsStoreOrderMapper.insertFsStoreOrder(order) > 0) {
 
+        //创建支付回调订单后 对于个微的信息采集表订单需要特殊处理  这个流程是先开方后付款,需要在支付回调更新处方、信息采集状态
+        FsPrescribe prescribeResult = prescribeService.selectNewestAuditedPrescribeByCollectionId(collection.getId());
+        if (!isPre) {
+            //个微信息采集表支付回调,订单绑定处方id
+            if (prescribeResult == null) {
+                logger.error("个微信息采集未找到匹配的开方数据,订单绑定处方id失败,信息采集信息id:{}", collection.getId());
+            } else {
+                //回调订单绑定处方id
+                order.setPrescribeId(prescribeResult.getPrescribeId());
+            }
+        }
+
+        if (fsStoreOrderMapper.insertFsStoreOrder(order) > 0) {
             if(!isPre){
-                //创建支付回调订单后 个微用户的订单需要特殊处理  这个是先开方后付款
-                FsPrescribe fsPrescribe = prescribeService.selectNewestAuditedPrescribeByCollectionId(collection.getId());
-                if (fsPrescribe == null){
+                //个微信息采集表支付回调,信息采集表更新采集状态,处方表绑定订单id
+                if (prescribeResult == null){
                     logger.error("个微信息采集未找到匹配的开方数据,采集信息id:{}",collection.getId());
                 }else {
-                    //处方绑定订单id
-                    fsPrescribe.setStoreOrderId(order.getOrderId());
-                    prescribeService.updateFsPrescribe(fsPrescribe);
+                    //处方绑定回调订单信息
+                    prescribeResult.setStoreId(order.getStoreId());//店铺id
+                    prescribeResult.setStoreOrderId(order.getOrderId());//订单主键id
+                    prescribeService.updateFsPrescribe(prescribeResult);
                     FsUserInformationCollection willUpdate = new FsUserInformationCollection();
                     willUpdate.setId(collection.getId());
                     willUpdate.setPersonalCollectStatus(PostPayPrescStatusEnum.PAID_BY_USER.getCode());//用户已付款状态
                     userInformationCollectionMapper.updateFsUserInformationCollection(willUpdate);
-                    //回调订单绑定处方id
-                    order.setPrescribeId(fsPrescribe.getPrescribeId());
                 }
             }
             //插入生成订单档期日志