Explorar el Código

信息采集终止业务

wjj hace 2 semanas
padre
commit
16884fb741

+ 9 - 0
fs-company/src/main/java/com/fs/hisStore/controller/FsUserInformationCollectionController.java

@@ -119,4 +119,13 @@ public class FsUserInformationCollectionController extends BaseController
         return fsUserInformationCollectionService.getWxaCodePackageOrderUnLimit(orderId);
 
     }
+
+    /**
+     * 信息采集终止
+     */
+    @PutMapping("/stop")
+    public R stop(@RequestBody FsUserInformationCollectionParam param){
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        return fsUserInformationCollectionService.stopCollection(param.getId(),loginUser.getUser().getUserId());
+    }
 }

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/service/IFsUserInformationCollectionService.java

@@ -90,4 +90,6 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     void autoRefund(FsUserInformationCollection collection);
 
     FsUserInformationCollectionVO getCollectionByUserId(Long userId);
+
+    R stopCollection(Long collectionId,Long operateId);
 }

+ 23 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -845,6 +845,29 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         return vo;
     }
 
+    @Override
+    public R stopCollection(Long collectionId,Long operateId) {
+        FsUserInformationCollection collection = this.fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(collectionId);
+        if (collection == null) {
+            return R.error("未找到采集信息");
+        }
+        if (collection.getStatus() == 2 && collection.getUserConfirm2() == 1) {
+            return R.error("用户信息采集已完成,无法终止");
+        }
+        //清空订单号
+        fsUserInformationCollectionMapper.collectionOderCodeNULL(collectionId);
+        //清空信息采集状态
+        FsUserInformationCollection map = new FsUserInformationCollection();
+        map.setId(collectionId);
+        map.setUserConfirm(0);
+        map.setDoctorConfirm(0);
+        map.setStatus(1);
+        if(fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
+            return R.ok();
+        }
+        return R.error("终止失败");
+    }
+
     private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
         target.addAll(source);
         return target.stream()