Procházet zdrojové kódy

修改用信息采集确认业务

wjj před 2 dny
rodič
revize
5b353a2ce4

+ 28 - 19
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -158,10 +158,16 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (collection == null) {
             throw new CustomException("没有用户采集信息");
         }
-        if (collection.getUserConfirm() == 1 || collection.getDoctorConfirm() == 1) {
+        if (collection.getUserConfirm() == 1 && collection.getUserConfirm2() == 0) {
             throw new CustomException("确认中,暂无法修改");
         }
+        //清空订单号
+        fsUserInformationCollectionMapper.collectionOderCodeNULL(param.getId());
         FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
+        fsUserInformationCollection.setUserConfirm2(0);
+        fsUserInformationCollection.setUserConfirm(0);
+        fsUserInformationCollection.setDoctorConfirm(0);
+        fsUserInformationCollection.setStatus(1);
         fsUserInformationCollection.setUpdateTime(DateUtils.getNowDate());
         return baseMapper.updateFsUserInformationCollection(fsUserInformationCollection);
     }
@@ -364,8 +370,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             }
         } else {
             //没有关联套餐包医生确认清空所有状态
-            map.setDoctorConfirm(0);
-            map.setUserConfirm(0);
+            map.setUserConfirm2(1);
+//            map.setDoctorConfirm(0);
+//            map.setUserConfirm(0);
         }
 
         if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
@@ -476,22 +483,24 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             //第一次确认
             if (collection.getStatus() == 1) {
                 map.setStatus(2);
-            }
-            else if (collection.getStatus() == 2) {
-                //清空订单号
-                fsUserInformationCollectionMapper.collectionOderCodeNULL(collection.getId());
-                map.setStatus(1);
-                map.setDoctorConfirm(0);
-                map.setUserConfirm(0);
-                map.setUserConfirm2(0);
-                FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderCode(collection.getPackageOrderCode());
-                if (fsStoreOrder != null) {
-                    FsStoreOrder editOrder   = new FsStoreOrder();
-                    editOrder.setOrderId(fsStoreOrder.getOrderId());
-                    editOrder.setIsConfirm(1);
-                    storeOrderService.updateFsStoreOrder(editOrder);
-                } else {
-                    return R.error("没有找到订单");
+            } else if (collection.getStatus() == 2) {
+                map.setUserConfirm2(1);
+//                //清空订单号
+//                fsUserInformationCollectionMapper.collectionOderCodeNULL(collection.getId());
+//                map.setStatus(1);
+//                map.setDoctorConfirm(0);
+//                map.setUserConfirm(0);
+//                map.setUserConfirm2(0);
+                if (collection.getUserConfirm2() == 0) {
+                    FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderCode(collection.getPackageOrderCode());
+                    if (fsStoreOrder != null) {
+                        FsStoreOrder editOrder   = new FsStoreOrder();
+                        editOrder.setOrderId(fsStoreOrder.getOrderId());
+                        editOrder.setIsConfirm(1);
+                        storeOrderService.updateFsStoreOrder(editOrder);
+                    } else {
+                        return R.error("没有找到订单");
+                    }
                 }
             }
         }