Sfoglia il codice sorgente

优化益寿缘用户信息采集进度逻辑

cgp 1 settimana fa
parent
commit
e4735a73e1

+ 4 - 2
fs-company/src/main/java/com/fs/hisStore/controller/FsUserInformationCollectionController.java

@@ -5,6 +5,7 @@ import java.util.List;
 import com.fs.common.core.domain.R;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
+import com.fs.his.domain.FsUserInformationCollectionSchedule;
 import com.fs.hisStore.param.FsUserInformationCollectionParam;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -123,9 +124,10 @@ public class FsUserInformationCollectionController extends BaseController
     /**
      * 信息采集终止
      */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:stop')")
     @PutMapping("/stop")
-    public R stop(@RequestBody FsUserInformationCollectionParam param){
+    public R stop(@RequestBody FsUserInformationCollectionSchedule param){
         LoginUser loginUser = SecurityUtils.getLoginUser();
-        return fsUserInformationCollectionService.stopCollection(param.getId(),loginUser.getUser().getUserId());
+        return fsUserInformationCollectionService.stopCollection(param,loginUser.getUser().getUserId());
     }
 }

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.fs.common.core.domain.R;
 import com.fs.course.param.CollectionInfoConfirmParam;
 import com.fs.course.vo.FsUserInfoCollectionUVO;
+import com.fs.his.domain.FsUserInformationCollectionSchedule;
 import com.fs.hisStore.domain.FsUserInformationCollection;
 import com.fs.hisStore.param.FsUserInformationCollectionListDParam;
 import com.fs.hisStore.param.FsUserInformationCollectionParam;
@@ -91,5 +92,5 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
 
     FsUserInformationCollectionVO getCollectionByUserId(Long userId);
 
-    R stopCollection(Long collectionId,Long operateId);
+    R stopCollection(FsUserInformationCollectionSchedule param, Long operateId);
 }

+ 17 - 4
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -918,8 +918,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     }
 
     @Override
-    public R stopCollection(Long collectionId,Long operateId) {
-        FsUserInformationCollection collection = this.fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(collectionId);
+    public R stopCollection(FsUserInformationCollectionSchedule param, Long operateId) {
+        FsUserInformationCollection collection = this.fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(param.getCollectionId());
         if (collection == null) {
             return R.error("未找到采集信息");
         }
@@ -927,14 +927,27 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             return R.error("用户信息采集已完成,无法终止");
         }
         //清空订单号
-        fsUserInformationCollectionMapper.collectionOderCodeNULL(collectionId);
+        fsUserInformationCollectionMapper.collectionOderCodeNULL(param.getCollectionId());
         //清空信息采集状态
         FsUserInformationCollection map = new FsUserInformationCollection();
-        map.setId(collectionId);
+        map.setId(param.getCollectionId());
         map.setUserConfirm(0);
         map.setDoctorConfirm(0);
         map.setStatus(1);
         if(fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
+            //同步采集进度
+            FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule= new FsUserInformationCollectionSchedule();
+            fsUserInformationCollectionSchedule.setId(param.getId());
+            // "用户采集进度"中止时间
+            fsUserInformationCollectionSchedule.setTerminatedTime(DateUtils.getNowDate());
+            // "用户采集进度"中止标识
+            fsUserInformationCollectionSchedule.setStatus(CollectionTaskStatusEnum.TERMINATED.getCode());
+            // "用户采集进度"中止原因
+            fsUserInformationCollectionSchedule.setRemark(param.getRemark());
+            // "用户采集进度"中止操作人员
+            fsUserInformationCollectionSchedule.setTerminatedBy(operateId);
+            scheduleMapper.updateFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule);
+            
             return R.ok();
         }
         return R.error("终止失败");

+ 1 - 1
fs-service/src/main/java/com/fs/qw/service/impl/FsUserInformationCollectionScheduleServiceImpl.java

@@ -114,7 +114,7 @@ public class FsUserInformationCollectionScheduleServiceImpl extends ServiceImpl<
     @Transactional(rollbackFor = Exception.class)
     public int stopCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule) {
         // "用户信息采集表"状态清空
-        fsUserInformationCollectionService.stopCollection(fsUserInformationCollectionSchedule.getCollectionId(),fsUserInformationCollectionSchedule.getTerminatedBy());
+        //fsUserInformationCollectionService.stopCollection(fsUserInformationCollectionSchedule.getCollectionId(),fsUserInformationCollectionSchedule.getTerminatedBy());
         // "用户采集进度"中止时间
         fsUserInformationCollectionSchedule.setTerminatedTime(DateUtils.getNowDate());
         // "用户采集进度"中止标识