Browse Source

完成销售端任务栏用户信息采集过程中的进度同步逻辑

cgp 2 weeks ago
parent
commit
3e2c399b61

+ 41 - 0
fs-company/src/main/java/com/fs/company/controller/qw/FsUserInformationCollectionScheduleController.java

@@ -1,8 +1,16 @@
 package com.fs.company.controller.qw;
 package com.fs.company.controller.qw;
 
 
+import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.security.LoginUser;
+import com.fs.framework.service.TokenService;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
+import com.fs.his.enums.PrescriptionTaskStepEnum;
 import com.fs.qw.service.IFsUserInformationCollectionScheduleService;
 import com.fs.qw.service.IFsUserInformationCollectionScheduleService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,6 +43,9 @@ public class FsUserInformationCollectionScheduleController extends BaseControlle
     @Autowired
     @Autowired
     private IFsUserInformationCollectionScheduleService fsUserInformationCollectionScheduleService;
     private IFsUserInformationCollectionScheduleService fsUserInformationCollectionScheduleService;
 
 
+    @Autowired
+    private TokenService tokenService;
+
     /**
     /**
      * 对于每条用户信息采集记录,只获取其最新的任务流程
      * 对于每条用户信息采集记录,只获取其最新的任务流程
      */
      */
@@ -92,6 +103,19 @@ public class FsUserInformationCollectionScheduleController extends BaseControlle
         return toAjax(fsUserInformationCollectionScheduleService.updateFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule));
         return toAjax(fsUserInformationCollectionScheduleService.updateFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule));
     }
     }
 
 
+    /**
+     * 终止用户信息采集进度
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:stop')")
+    @Log(title = "终止用户信息采集进度", businessType = BusinessType.INSERT)
+    @PutMapping("/endProcess")
+    public AjaxResult stopCollectionSchedule(@RequestBody FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsUserInformationCollectionSchedule.setTerminatedBy(loginUser.getCompany().getUserId());
+        return toAjax(fsUserInformationCollectionScheduleService.stopCollectionSchedule(fsUserInformationCollectionSchedule));
+    }
+
     /**
     /**
      * 删除用户信息采集进度
      * 删除用户信息采集进度
      */
      */
@@ -102,4 +126,21 @@ public class FsUserInformationCollectionScheduleController extends BaseControlle
     {
     {
         return toAjax(fsUserInformationCollectionScheduleService.deleteFsUserInformationCollectionScheduleByIds(ids));
         return toAjax(fsUserInformationCollectionScheduleService.deleteFsUserInformationCollectionScheduleByIds(ids));
     }
     }
+
+    /**
+     * 获取用户信息采集任务流程步骤枚举列表
+     */
+    @PreAuthorize("@ss.hasPermi('qw:collectionSchedule:list')")
+    @GetMapping("/steps")
+    public AjaxResult getTaskSteps() {
+        List<Map<String, Object>> steps = Arrays.stream(PrescriptionTaskStepEnum.values())
+                .map(enumItem -> {
+                    Map<String, Object> map = new HashMap<>();
+                    map.put("dictValue", enumItem.getCode());
+                    map.put("dictLabel", enumItem.getDesc());
+                    return map;
+                })
+                .collect(Collectors.toList());
+        return AjaxResult.success(steps);
+    }
 }
 }

+ 8 - 7
fs-service/src/main/java/com/fs/his/domain/FsUserInformationCollectionSchedule.java

@@ -28,31 +28,29 @@ public class FsUserInformationCollectionSchedule extends BaseEntity{
     private Long userId;
     private Long userId;
 
 
     /** 客户姓名 */
     /** 客户姓名 */
-    @Excel(name = "客户姓名")
     private String userName;
     private String userName;
 
 
     /** 医生id */
     /** 医生id */
     private Long doctorId;
     private Long doctorId;
 
 
     /** 约诊医生 */
     /** 约诊医生 */
-    @Excel(name = "约诊医生")
     private String doctorName;
     private String doctorName;
 
 
     /** 套餐包Id */
     /** 套餐包Id */
     private Long packageId;
     private Long packageId;
 
 
     /** 挂载商品名称 */
     /** 挂载商品名称 */
-    @Excel(name = "挂载商品名称")
     private String packageName;
     private String packageName;
 
 
-    /** 当前流程节点:(1:待用户第一次确认、2:待开方、3:待药师审核、4:待建议、5:待用户二次确认);其中带疗法模式有1,2,3,5;无疗法模式只有1,4,5 */
-    @Excel(name = "当前状态")
+    /** 当前流程节点:(1:待用户第一次确认、2:待开方、3:待药师审核、4:待建议、5:待用户二次确认、6:完成);其中带疗法模式有1,2,3,5,6;无疗法模式只有1,4,5,6 */
     private Integer currentStep;
     private Integer currentStep;
 
 
     /** 整体任务状态:1-进行中,2-已完成,3-已中止 */
     /** 整体任务状态:1-进行中,2-已完成,3-已中止 */
-    @Excel(name = "整体任务状态:1-进行中,2-已完成,3-已中止")
     private Integer status;
     private Integer status;
 
 
+    /** 创建时间 */
+    private Date createTime;
+
     /** 完成时间 */
     /** 完成时间 */
     @JsonFormat(pattern = "yyyy-MM-dd")
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
     @Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
@@ -64,7 +62,10 @@ public class FsUserInformationCollectionSchedule extends BaseEntity{
     private Date terminatedTime;
     private Date terminatedTime;
 
 
     /** 中止操作人id */
     /** 中止操作人id */
-    private String terminatedBy;
+    private Long terminatedBy;
+
+    /** 订单号 */
+    private String orderCode;
 
 
 
 
 }
 }

+ 79 - 0
fs-service/src/main/java/com/fs/his/enums/PrescriptionTaskStepEnum.java

@@ -0,0 +1,79 @@
+package com.fs.his.enums;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonValue;
+import lombok.Getter;
+
+/**
+ * 用户信息采集任务流程步骤枚举
+ *
+ * 1 - 待用户第一次确认
+ * 2 - 待开方
+ * 3 - 待药师审核
+ * 4 - 待建议
+ * 5 - 待用户二次确认
+ */
+@Getter
+public enum PrescriptionTaskStepEnum {
+
+    WAITING_FIRST_CONFIRM(1, "待用户第一次确认"),
+    WAITING_PRESCRIBE(2, "待开方"),
+    WAITING_PHARMACIST_REVIEW(3, "待药师审核"),
+    WAITING_SUGGESTION(4, "待建议"),
+    WAITING_SECOND_CONFIRM(5, "待用户二次确认"),
+    WAITING_COMPLETED(6, "完成");
+
+    /** 步骤码(存入数据库的值) */
+    private final Integer code;
+
+    /** 步骤描述 */
+    private final String desc;
+
+    PrescriptionTaskStepEnum(Integer code, String desc) {
+        this.code = code;
+        this.desc = desc;
+    }
+
+    /**
+     * 根据 code 获取枚举(用于从数据库值转为枚举)
+     *
+     * @param code 步骤码
+     * @return 对应的枚举,若无匹配则返回 null
+     */
+    public static PrescriptionTaskStepEnum fromCode(Integer code) {
+        if (code == null) {
+            return null;
+        }
+        for (PrescriptionTaskStepEnum step : values()) {
+            if (step.code.equals(code)) {
+                return step;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Jackson 反序列化时使用(支持 JSON 中直接传数字如 1 -> WAITING_FIRST_CONFIRM)
+     */
+    @JsonCreator
+    public static PrescriptionTaskStepEnum fromJsonValue(Object value) {
+        if (value instanceof Number) {
+            return fromCode(((Number) value).intValue());
+        } else if (value instanceof String) {
+            try {
+                return fromCode(Integer.parseInt((String) value));
+            } catch (NumberFormatException ignored) {
+                // ignore
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Jackson 序列化时输出 code 而不是 name(如输出 1 而不是 "WAITING_FIRST_CONFIRM")
+     */
+    @JsonValue
+    public Integer getCode() {
+        return this.code;
+    }
+}

+ 3 - 0
fs-service/src/main/java/com/fs/his/mapper/FsStoreOrderMapper.java

@@ -1207,4 +1207,7 @@ public interface FsStoreOrderMapper
 
 
     //订单档期统计数量
     //订单档期统计数量
     Long selectScheduleStatisticsVOListCount(@Param("map") FsStoreOrderScheduleStatisticsParam param);
     Long selectScheduleStatisticsVOListCount(@Param("map") FsStoreOrderScheduleStatisticsParam param);
+
+    //根据处方id查询订单信息
+    FsStoreOrder selectByPrescriptionId(@Param("prescriptionId") Long prescriptionId);
 }
 }

+ 34 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeServiceImpl.java

@@ -19,6 +19,7 @@ import com.fs.his.domain.*;
 import com.fs.his.dto.FsPackagePatientDTO;
 import com.fs.his.dto.FsPackagePatientDTO;
 import com.fs.his.dto.FsPackagePruductDTO;
 import com.fs.his.dto.FsPackagePruductDTO;
 import com.fs.his.dto.FsPrescribeUsageDTO;
 import com.fs.his.dto.FsPrescribeUsageDTO;
+import com.fs.his.enums.PrescriptionTaskStepEnum;
 import com.fs.his.mapper.*;
 import com.fs.his.mapper.*;
 import com.fs.his.param.*;
 import com.fs.his.param.*;
 import com.fs.his.service.*;
 import com.fs.his.service.*;
@@ -32,6 +33,7 @@ import com.fs.im.dto.MsgDTO;
 import com.fs.im.dto.MsgDataDTO;
 import com.fs.im.dto.MsgDataDTO;
 import com.fs.im.dto.MsgDataFormatDTO;
 import com.fs.im.dto.MsgDataFormatDTO;
 import com.fs.im.service.IImService;
 import com.fs.im.service.IImService;
+import com.fs.qw.mapper.FsUserInformationCollectionScheduleMapper;
 import com.fs.system.oss.CloudStorageService;
 import com.fs.system.oss.CloudStorageService;
 import com.fs.system.oss.OSSFactory;
 import com.fs.system.oss.OSSFactory;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageHelper;
@@ -118,6 +120,12 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
     @Autowired
     @Autowired
     private FsStoreProductMapper fsStoreProductMapper;
     private FsStoreProductMapper fsStoreProductMapper;
 
 
+    @Autowired
+    private FsUserInformationCollectionScheduleMapper scheduleMapper;
+
+    @Autowired
+    private FsStoreOrderMapper storeOrderMapper;
+
     /**
     /**
      * 查询处方
      * 查询处方
      *
      *
@@ -1128,6 +1136,18 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
             msg.setCreateTime(DateUtils.getNowDate());
             msg.setCreateTime(DateUtils.getNowDate());
             doctorMsgMapper.insertDoctorMsg(msg);
             doctorMsgMapper.insertDoctorMsg(msg);
         }
         }
+        //同步用户信息采集进度
+        FsStoreOrder order = storeOrderMapper.selectByPrescriptionId(prescribe.getPrescribeId());
+        if (order != null){
+            FsUserInformationCollectionSchedule schedule = scheduleMapper.selectFsUserInformationCollectionByOrderCode(order.getOrderCode());
+            if (schedule != null){
+                //"待用户二次确认"节点
+                schedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_SECOND_CONFIRM.getCode());
+                scheduleMapper.updateFsUserInformationCollectionSchedule(schedule);
+                log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_SECOND_CONFIRM.getDesc(),schedule.getCollectionId());
+            }
+        }
+
         delUrl(param.getPrescribeId());
         delUrl(param.getPrescribeId());
         if (this.updateFsPrescribe(map) > 0){
         if (this.updateFsPrescribe(map) > 0){
             return R.ok("审核成功");
             return R.ok("审核成功");
@@ -1217,6 +1237,20 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
             collectionMapper.updateFsUserInformationCollection(map);
             collectionMapper.updateFsUserInformationCollection(map);
             //确认完成后删除缓存
             //确认完成后删除缓存
             redisCache.deleteObject("collectionPrescribeId:" + fsPrescribe.getPrescribeId());
             redisCache.deleteObject("collectionPrescribeId:" + fsPrescribe.getPrescribeId());
+            //同步用户信息采集进度
+            FsUserInformationCollectionSchedule schedule = scheduleMapper.selectFsUserInformationCollectionScheduleByCollectionId(collection.getId());
+            if (schedule != null){
+                //"待药师审核“节点
+                schedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_PHARMACIST_REVIEW.getCode());
+                //根据处方id查询处方订单号
+                FsStoreOrder fsStoreOrder=storeOrderMapper.selectByPrescriptionId(fsPrescribe.getPrescribeId());
+                if (fsStoreOrder != null){
+                    schedule.setOrderCode(fsStoreOrder.getOrderCode());
+                    scheduleMapper.updateFsUserInformationCollectionSchedule(schedule);
+                    log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_PHARMACIST_REVIEW.getDesc(),schedule.getCollectionId());
+                }
+
+            }
         }
         }
 
 
         // 医生确认后生成处方单
         // 医生确认后生成处方单

+ 75 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -35,7 +35,9 @@ import com.fs.doctor.domain.DoctorMsg;
 import com.fs.doctor.mapper.DoctorMsgMapper;
 import com.fs.doctor.mapper.DoctorMsgMapper;
 import com.fs.his.config.FsSysConfig;
 import com.fs.his.config.FsSysConfig;
 import com.fs.his.domain.*;
 import com.fs.his.domain.*;
+import com.fs.his.enums.CollectionTaskStatusEnum;
 import com.fs.his.enums.FsStoreOrderStatusEnum;
 import com.fs.his.enums.FsStoreOrderStatusEnum;
+import com.fs.his.enums.PrescriptionTaskStepEnum;
 import com.fs.his.mapper.*;
 import com.fs.his.mapper.*;
 import com.fs.his.param.FsPrescribeParam;
 import com.fs.his.param.FsPrescribeParam;
 import com.fs.his.service.*;
 import com.fs.his.service.*;
@@ -51,6 +53,7 @@ import com.fs.huifuPay.domain.HuifuConfirmrefundResult;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentDelaytransConfirmrefundRequest;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentDelaytransConfirmrefundRequest;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
 import com.fs.huifuPay.sdk.opps.core.request.V2TradePaymentScanpayRefundRequest;
 import com.fs.huifuPay.service.HuiFuService;
 import com.fs.huifuPay.service.HuiFuService;
+import com.fs.qw.mapper.FsUserInformationCollectionScheduleMapper;
 import com.fs.store.domain.FsDoctorConfirm;
 import com.fs.store.domain.FsDoctorConfirm;
 import com.fs.store.service.IFsDoctorConfirmService;
 import com.fs.store.service.IFsDoctorConfirmService;
 import com.fs.system.domain.SysConfig;
 import com.fs.system.domain.SysConfig;
@@ -73,6 +76,7 @@ import com.github.binarywang.wxpay.exception.WxPayException;
 import com.github.binarywang.wxpay.service.WxPayService;
 import com.github.binarywang.wxpay.service.WxPayService;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.google.gson.Gson;
 import com.google.gson.Gson;
+import lombok.extern.slf4j.Slf4j;
 import me.chanjar.weixin.common.error.WxErrorException;
 import me.chanjar.weixin.common.error.WxErrorException;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.NotNull;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
@@ -91,6 +95,7 @@ import org.springframework.util.CollectionUtils;
  * @author fs
  * @author fs
  * @date 2025-10-14
  * @date 2025-10-14
  */
  */
+@Slf4j
 @Service
 @Service
 public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserInformationCollectionMapper, FsUserInformationCollection> implements IFsUserInformationCollectionService {
 public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserInformationCollectionMapper, FsUserInformationCollection> implements IFsUserInformationCollectionService {
     Logger logger= LoggerFactory.getLogger(getClass());
     Logger logger= LoggerFactory.getLogger(getClass());
@@ -165,6 +170,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     private FsStoreOrderLogsMapper fsStoreOrderLogsMapper;
     private FsStoreOrderLogsMapper fsStoreOrderLogsMapper;
     @Autowired
     @Autowired
     private DoctorMsgMapper doctorMsgMapper;
     private DoctorMsgMapper doctorMsgMapper;
+
+    @Autowired
+    private IFsPackageService packageService;
+
+    @Autowired
+    private FsUserInformationCollectionScheduleMapper scheduleMapper;
     /**
     /**
      * 查询用户信息采集
      * 查询用户信息采集
      *
      *
@@ -198,10 +209,18 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     @Override
     @Override
     public Long insertFsUserInformationCollection(FsUserInformationCollectionParam param)
     public Long insertFsUserInformationCollection(FsUserInformationCollectionParam param)
     {
     {
-
         FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
         FsUserInformationCollection fsUserInformationCollection = getFsUserInformationCollection(param);
         fsUserInformationCollection.setCreateTime(DateUtils.getNowDate());
         fsUserInformationCollection.setCreateTime(DateUtils.getNowDate());
         baseMapper.insertFsUserInformationCollection(fsUserInformationCollection);
         baseMapper.insertFsUserInformationCollection(fsUserInformationCollection);
+        //新增用户信息采集表的同时记录用户信息采集进度
+        try {
+            fsUserInformationCollection.setPackageId(param.getPackageId());
+            FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule = assembleCreateSchedule(fsUserInformationCollection);
+            scheduleMapper.insertFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule);
+            log.info("新增用户信息采集进度数据,信息采集数据id:{}",fsUserInformationCollectionSchedule.getCollectionId());
+        }catch (Exception e){
+            logger.error("新增用户信息采集进度数据失败",e);
+        }
         return fsUserInformationCollection.getId();
         return fsUserInformationCollection.getId();
     }
     }
 
 
@@ -497,7 +516,14 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
             doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
             redisCache.deleteObject("doctorConfirm:" + collection.getId());
             redisCache.deleteObject("doctorConfirm:" + collection.getId());
 
 
-
+            //同步用户信息采集进度
+            FsUserInformationCollectionSchedule schedule = scheduleMapper.selectFsUserInformationCollectionScheduleByCollectionId(collection.getId());
+            if (schedule != null){
+                //"待用户二次确认"节点
+                schedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_SECOND_CONFIRM.getCode());
+                scheduleMapper.updateFsUserInformationCollectionSchedule(schedule);
+                log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_SECOND_CONFIRM.getDesc(),schedule.getCollectionId());
+            }
             return R.ok();
             return R.ok();
         }
         }
         return R.error("医生确认失败");
         return R.error("医生确认失败");
@@ -593,6 +619,9 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         map.setId(param.getId());
         map.setId(param.getId());
         map.setUserConfirm(1);
         map.setUserConfirm(1);
         map.setUserAdvice(param.getUserAdvice());
         map.setUserAdvice(param.getUserAdvice());
+        //用户信息采集表id
+        Long collectionId = collection.getId();
+        FsUserInformationCollectionSchedule schedule = scheduleMapper.selectFsUserInformationCollectionScheduleByCollectionId(collectionId);
         if (collection.getStatus() == 1) {
         if (collection.getStatus() == 1) {
             //用户第一次确认添加医生消息
             //用户第一次确认添加医生消息
             DoctorMsg msg = new DoctorMsg();
             DoctorMsg msg = new DoctorMsg();
@@ -607,6 +636,18 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             doctorMsgMapper.insertDoctorMsg(msg);
             doctorMsgMapper.insertDoctorMsg(msg);
             //第一次确认
             //第一次确认
             map.setStatus(2);
             map.setStatus(2);
+            //设置用户信息采集进度节点
+            if (schedule != null) {
+                if (schedule.getPackageId() != null) {
+                    //带套餐包的 "待开方"节点
+                    schedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_PRESCRIBE.getCode());
+                    log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_PRESCRIBE.getDesc(),schedule.getCollectionId());
+                } else {
+                    //没套餐包的 "待建议"节点
+                    schedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_SUGGESTION.getCode());
+                    log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_SUGGESTION.getDesc(),schedule.getCollectionId());
+                }
+            }
         } else if (collection.getStatus() == 2) {
         } else if (collection.getStatus() == 2) {
             //第二次确认
             //第二次确认
             map.setUserConfirm2(1);
             map.setUserConfirm2(1);
@@ -621,6 +662,15 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
                     return R.error("没有找到订单");
                     return R.error("没有找到订单");
                 }
                 }
             }
             }
+            //----------同步修改用户信息采集进度----------
+            if (schedule != null) {
+                //"已完成"任务节点
+                schedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_COMPLETED.getCode());
+                //"完成"任务状态
+                schedule.setStatus(CollectionTaskStatusEnum.COMPLETED.getCode());
+                schedule.setCompletedTime(DateUtils.getNowDate());
+                log.info("同步用户信息采集进度节点为:{},信息采集表id:{}",PrescriptionTaskStepEnum.WAITING_COMPLETED.getDesc(),schedule.getCollectionId());
+            }
         }
         }
         if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
         if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
             //存入医生确认统计时间数据
             //存入医生确认统计时间数据
@@ -631,6 +681,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             doctorConfirmService.insertFsDoctorConfirm(doctorConfirm);
             doctorConfirmService.insertFsDoctorConfirm(doctorConfirm);
             //医生确认时间存入缓存 医生确认后删除
             //医生确认时间存入缓存 医生确认后删除
             redisCache.setCacheObject("doctorConfirm:" + collection.getId(), doctorConfirm);
             redisCache.setCacheObject("doctorConfirm:" + collection.getId(), doctorConfirm);
+            //----------同步用户信息采集进度----------
+            if (schedule != null) {
+                scheduleMapper.updateFsUserInformationCollectionSchedule(schedule);
+            }
             return R.ok();
             return R.ok();
         }
         }
         return R.error("用户确认失败");
         return R.error("用户确认失败");
@@ -920,6 +974,25 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         return fsUserInformationCollection;
         return fsUserInformationCollection;
     }
     }
 
 
+    //辅助方法:组装用户信息采集进度对象
+    private FsUserInformationCollectionSchedule assembleCreateSchedule(FsUserInformationCollection fsUserInformationCollection){
+        FsUserInformationCollectionSchedule shedule = new FsUserInformationCollectionSchedule();
+        shedule.setCollectionId(fsUserInformationCollection.getId());
+        shedule.setUserId(fsUserInformationCollection.getUserId());
+        shedule.setDoctorId(fsUserInformationCollection.getDoctorId());
+        shedule.setPackageId(fsUserInformationCollection.getPackageId());
+        shedule.setCreateTime(DateUtils.getNowDate());
+        //任务状态:"进行中"
+        shedule.setStatus(CollectionTaskStatusEnum.PROCESSING.getCode());
+        //当前流程节点:"待用户第一次确认"
+        shedule.setCurrentStep(PrescriptionTaskStepEnum.WAITING_FIRST_CONFIRM.getCode());
+        FsPackage fsPackage = packageService.selectFsPackageByPackageId(fsUserInformationCollection.getPackageId());
+        if (fsPackage != null){
+            shedule.setPackageName(fsPackage.getPackageName());
+        }
+        return shedule;
+    }
+
     public static void main(String[] args) {
     public static void main(String[] args) {
 //        String str1 = "[{\"options\":[{\"flag\":false,\"name\":\"通天\",\"value\":0},{\"flag\":false,\"name\":\"哈哈\",\"value\":1}],\"title\":\"测试标题1\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"呼呼\",\"value\":0},{\"flag\":false,\"name\":\"嘻嘻\",\"value\":1}],\"title\":\"测试标题2\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"胸痛\",\"value\":0},{\"flag\":false,\"name\":\"胸闷\",\"value\":1},{\"flag\":false,\"name\":\"头晕\",\"value\":2},{\"flag\":false,\"name\":\"肢体麻木\",\"value\":3},{\"flag\":false,\"name\":\"无\",\"value\":4}],\"title\":\"您目前是否有心脑血管相关症状,如胸痛、胸闷、头晕、肢体麻木等?\",\"value\":1}]";
 //        String str1 = "[{\"options\":[{\"flag\":false,\"name\":\"通天\",\"value\":0},{\"flag\":false,\"name\":\"哈哈\",\"value\":1}],\"title\":\"测试标题1\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"呼呼\",\"value\":0},{\"flag\":false,\"name\":\"嘻嘻\",\"value\":1}],\"title\":\"测试标题2\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"胸痛\",\"value\":0},{\"flag\":false,\"name\":\"胸闷\",\"value\":1},{\"flag\":false,\"name\":\"头晕\",\"value\":2},{\"flag\":false,\"name\":\"肢体麻木\",\"value\":3},{\"flag\":false,\"name\":\"无\",\"value\":4}],\"title\":\"您目前是否有心脑血管相关症状,如胸痛、胸闷、头晕、肢体麻木等?\",\"value\":1}]";
 //        String str2 = "[{\"options\":[{\"flag\":true,\"name\":\"胸痛\",\"value\":0},{\"flag\":true,\"name\":\"胸闷\",\"value\":1},{\"flag\":true,\"name\":\"头晕\",\"value\":2},{\"flag\":true,\"name\":\"肢体麻木\",\"value\":3},{\"flag\":true,\"name\":\"无\",\"value\":4}],\"title\":\"您目前是否有心脑血管相关症状,如胸痛、胸闷、头晕、肢体麻木等?\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"胃疼\",\"value\":0},{\"flag\":false,\"name\":\"反酸\",\"value\":1},{\"flag\":false,\"name\":\"恶心\",\"value\":2},{\"flag\":false,\"name\":\"呕吐\",\"value\":3},{\"flag\":false,\"name\":\"黑便\",\"value\":4},{\"flag\":false,\"name\":\"无\",\"value\":5}],\"title\":\"您近期是否出现胃部不适症状,如胃痛、反酸、恶心、呕吐或黑便?\",\"value\":1}]";
 //        String str2 = "[{\"options\":[{\"flag\":true,\"name\":\"胸痛\",\"value\":0},{\"flag\":true,\"name\":\"胸闷\",\"value\":1},{\"flag\":true,\"name\":\"头晕\",\"value\":2},{\"flag\":true,\"name\":\"肢体麻木\",\"value\":3},{\"flag\":true,\"name\":\"无\",\"value\":4}],\"title\":\"您目前是否有心脑血管相关症状,如胸痛、胸闷、头晕、肢体麻木等?\",\"value\":1},{\"options\":[{\"flag\":false,\"name\":\"胃疼\",\"value\":0},{\"flag\":false,\"name\":\"反酸\",\"value\":1},{\"flag\":false,\"name\":\"恶心\",\"value\":2},{\"flag\":false,\"name\":\"呕吐\",\"value\":3},{\"flag\":false,\"name\":\"黑便\",\"value\":4},{\"flag\":false,\"name\":\"无\",\"value\":5}],\"title\":\"您近期是否出现胃部不适症状,如胃痛、反酸、恶心、呕吐或黑便?\",\"value\":1}]";

+ 16 - 0
fs-service/src/main/java/com/fs/qw/mapper/FsUserInformationCollectionScheduleMapper.java

@@ -20,6 +20,22 @@ public interface FsUserInformationCollectionScheduleMapper extends BaseMapper<Fs
      */
      */
     FsUserInformationCollectionSchedule selectFsUserInformationCollectionScheduleById(Long id);
     FsUserInformationCollectionSchedule selectFsUserInformationCollectionScheduleById(Long id);
 
 
+    /**
+     * 查询用户信息采集进度
+     *
+     * @param collectionId 用户信息采集表主键
+     * @return 用户信息采集进度
+     */
+    FsUserInformationCollectionSchedule selectFsUserInformationCollectionScheduleByCollectionId(Long collectionId);
+
+    /**
+     * 查询用户信息采集进度
+     *
+     * @param orderCode 订单编号
+     * @return 用户信息采集进度
+     */
+    FsUserInformationCollectionSchedule selectFsUserInformationCollectionByOrderCode(String orderCode);
+
     /**
     /**
      * 查询用户信息采集进度列表
      * 查询用户信息采集进度列表
      * 
      * 

+ 8 - 0
fs-service/src/main/java/com/fs/qw/service/IFsUserInformationCollectionScheduleService.java

@@ -66,4 +66,12 @@ public interface IFsUserInformationCollectionScheduleService extends IService<Fs
      * @return 结果
      * @return 结果
      */
      */
     int deleteFsUserInformationCollectionScheduleById(Long id);
     int deleteFsUserInformationCollectionScheduleById(Long id);
+
+    /**
+     * 终止用户信息采集进度
+     *
+     * @param fsUserInformationCollectionSchedule 用户信息采集进度
+     * @return 结果
+     */
+    int stopCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule);
 }
 }

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

@@ -4,9 +4,14 @@ import java.util.List;
 import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.DateUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
+import com.fs.his.enums.CollectionTaskStatusEnum;
+import com.fs.hisStore.service.IFsUserInformationCollectionService;
 import com.fs.qw.mapper.FsUserInformationCollectionScheduleMapper;
 import com.fs.qw.mapper.FsUserInformationCollectionScheduleMapper;
 import com.fs.qw.service.IFsUserInformationCollectionScheduleService;
 import com.fs.qw.service.IFsUserInformationCollectionScheduleService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 
 /**
 /**
  * 用户信息采集进度Service业务层处理
  * 用户信息采集进度Service业务层处理
@@ -15,8 +20,11 @@ import org.springframework.stereotype.Service;
  * @date 2025-11-18
  * @date 2025-11-18
  */
  */
 @Service
 @Service
+@Slf4j
 public class FsUserInformationCollectionScheduleServiceImpl extends ServiceImpl<FsUserInformationCollectionScheduleMapper, FsUserInformationCollectionSchedule> implements IFsUserInformationCollectionScheduleService {
 public class FsUserInformationCollectionScheduleServiceImpl extends ServiceImpl<FsUserInformationCollectionScheduleMapper, FsUserInformationCollectionSchedule> implements IFsUserInformationCollectionScheduleService {
 
 
+    @Autowired
+    private IFsUserInformationCollectionService fsUserInformationCollectionService;
     /**
     /**
      * 查询用户信息采集进度
      * 查询用户信息采集进度
      *
      *
@@ -101,4 +109,16 @@ public class FsUserInformationCollectionScheduleServiceImpl extends ServiceImpl<
     {
     {
         return baseMapper.deleteFsUserInformationCollectionScheduleById(id);
         return baseMapper.deleteFsUserInformationCollectionScheduleById(id);
     }
     }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int stopCollectionSchedule(FsUserInformationCollectionSchedule fsUserInformationCollectionSchedule) {
+        // "用户信息采集表"状态清空
+        fsUserInformationCollectionService.stopCollection(fsUserInformationCollectionSchedule.getCollectionId(),fsUserInformationCollectionSchedule.getTerminatedBy());
+        // "用户采集进度"中止时间
+        fsUserInformationCollectionSchedule.setTerminatedTime(DateUtils.getNowDate());
+        // "用户采集进度"中止标识
+        fsUserInformationCollectionSchedule.setStatus(CollectionTaskStatusEnum.TERMINATED.getCode());
+        return baseMapper.updateFsUserInformationCollectionSchedule(fsUserInformationCollectionSchedule);
+    }
 }
 }

+ 5 - 0
fs-service/src/main/resources/mapper/his/FsStoreOrderMapper.xml

@@ -2388,4 +2388,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </if>
         </if>
     </select>
     </select>
 
 
+    <select id="selectByPrescriptionId" resultType="com.fs.his.domain.FsStoreOrder">
+        <include refid="selectFsStoreOrderVo"/>
+        where prescription_id = #{prescriptionId}
+    </select>
+
 </mapper>
 </mapper>

+ 80 - 32
fs-service/src/main/resources/mapper/qw/FsUserInformationCollectionScheduleMapper.xml

@@ -8,9 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="id"    column="id"    />
         <result property="id"    column="id"    />
         <result property="collectionId"    column="collection_id"    />
         <result property="collectionId"    column="collection_id"    />
         <result property="userId"    column="user_id"    />
         <result property="userId"    column="user_id"    />
-        <result property="userName"    column="user_name"    />
         <result property="doctorId"    column="doctor_id"    />
         <result property="doctorId"    column="doctor_id"    />
-        <result property="doctorName"    column="doctor_name"    />
         <result property="packageId"    column="package_id"    />
         <result property="packageId"    column="package_id"    />
         <result property="packageName"    column="package_name"    />
         <result property="packageName"    column="package_name"    />
         <result property="currentStep"    column="current_step"    />
         <result property="currentStep"    column="current_step"    />
@@ -20,45 +18,82 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="terminatedTime"    column="terminated_time"    />
         <result property="terminatedTime"    column="terminated_time"    />
         <result property="terminatedBy"    column="terminated_by"    />
         <result property="terminatedBy"    column="terminated_by"    />
         <result property="remark"    column="remark"    />
         <result property="remark"    column="remark"    />
+        <result property="orderCode"    column="order_code"    />
     </resultMap>
     </resultMap>
 
 
     <sql id="selectFsUserInformationCollectionScheduleVo">
     <sql id="selectFsUserInformationCollectionScheduleVo">
-        select id, collection_id, user_id, user_name, doctor_id, doctor_name, package_id, package_name, current_step, status, create_time, completed_time, terminated_time, terminated_by, remark from fs_user_information_collection_schedule
+        select id, collection_id, user_id, doctor_id, package_id, package_name, current_step, status, create_time, completed_time, terminated_time, terminated_by, remark,order_code from fs_user_information_collection_schedule
     </sql>
     </sql>
 
 
     <select id="selectFsUserInformationCollectionScheduleList" parameterType="FsUserInformationCollectionSchedule" resultMap="FsUserInformationCollectionScheduleResult">
     <select id="selectFsUserInformationCollectionScheduleList" parameterType="FsUserInformationCollectionSchedule" resultMap="FsUserInformationCollectionScheduleResult">
-        <include refid="selectFsUserInformationCollectionScheduleVo"/>
+        SELECT
+        s.id,
+        s.collection_id,
+        s.user_id,
+        c.user_name,
+        s.doctor_id,
+        d.doctor_name,
+        s.package_id,
+        s.package_name,
+        s.current_step,
+        s.status,
+        s.create_time,
+        s.completed_time,
+        s.terminated_time,
+        s.terminated_by,
+        s.remark,
+        s.order_code
+        FROM
+        fs_user_information_collection_schedule s
+        LEFT JOIN fs_user_information_collection c ON s.collection_id = c.id
+        LEFT JOIN fs_doctor d ON s.doctor_id = d.doctor_id
         <where>
         <where>
-            <if test="collectionId != null "> and collection_id = #{collectionId}</if>
-            <if test="userId != null "> and user_id = #{userId}</if>
-            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
-            <if test="doctorId != null "> and doctor_id = #{doctorId}</if>
-            <if test="doctorName != null  and doctorName != ''"> and doctor_name like concat('%', #{doctorName}, '%')</if>
-            <if test="packageId != null "> and package_id = #{packageId}</if>
-            <if test="packageName != null  and packageName != ''"> and package_name like concat('%', #{packageName}, '%')</if>
-            <if test="currentStep != null "> and current_step = #{currentStep}</if>
-            <if test="status != null "> and status = #{status}</if>
-            <if test="completedTime != null "> and completed_time = #{completedTime}</if>
-            <if test="terminatedTime != null "> and terminated_time = #{terminatedTime}</if>
-            <if test="terminatedBy != null  and terminatedBy != ''"> and terminated_by = #{terminatedBy}</if>
+            <if test="collectionId != null "> and s.collection_id = #{collectionId}</if>
+            <if test="userId != null "> and s.user_id = #{userId}</if>
+            <if test="userName != null and userName != ''"> AND c.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="doctorId != null"> AND s.doctor_id = #{doctorId}</if>
+            <if test="doctorName != null and doctorName != ''"> AND d.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
+            <if test="packageId != null "> and s.package_id = #{packageId}</if>
+            <if test="packageName != null  and packageName != ''"> and s.package_name like concat('%', #{packageName}, '%')</if>
+            <if test="currentStep != null "> and s.current_step = #{currentStep}</if>
+            <if test="status != null "> and s.status = #{status}</if>
+            <if test="completedTime != null "> and s.completed_time = #{completedTime}</if>
+            <if test="terminatedTime != null "> and s.terminated_time = #{terminatedTime}</if>
+            <if test="terminatedBy != null  and terminatedBy != ''"> and s.terminated_by = #{terminatedBy}</if>
         </where>
         </where>
     </select>
     </select>
 
 
     <select id="getUserRecordLatestTaskProcess"
     <select id="getUserRecordLatestTaskProcess"
             parameterType="FsUserInformationCollectionSchedule"
             parameterType="FsUserInformationCollectionSchedule"
             resultMap="FsUserInformationCollectionScheduleResult">
             resultMap="FsUserInformationCollectionScheduleResult">
-
-        SELECT s.id, s.collection_id, s.user_id, s.user_name, s.doctor_id, s.doctor_name,
-        s.package_id, s.package_name, s.current_step, s.status, s.create_time,
-        s.completed_time, s.terminated_time, s.terminated_by, s.remark
-        FROM fs_user_information_collection_schedule s
+        SELECT
+        s.id,
+        s.collection_id,
+        s.user_id,
+        c.user_name,
+        s.doctor_id,
+        d.doctor_name,
+        s.package_id,
+        s.package_name,
+        s.current_step,
+        s.status,
+        s.create_time,
+        s.completed_time,
+        s.terminated_time,
+        s.terminated_by,
+        s.remark,
+        s.order_code
+        FROM
+        fs_user_information_collection_schedule s
+        LEFT JOIN fs_user_information_collection c ON s.collection_id = c.id
+        LEFT JOIN fs_doctor d ON s.doctor_id = d.doctor_id
         <where>
         <where>
             <!-- 动态过滤条件 -->
             <!-- 动态过滤条件 -->
             <if test="collectionId != null"> AND s.collection_id = #{collectionId}</if>
             <if test="collectionId != null"> AND s.collection_id = #{collectionId}</if>
             <if test="userId != null"> AND s.user_id = #{userId}</if>
             <if test="userId != null"> AND s.user_id = #{userId}</if>
-            <if test="userName != null and userName != ''"> AND s.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="userName != null and userName != ''"> AND c.user_name LIKE CONCAT('%', #{userName}, '%')</if>
             <if test="doctorId != null"> AND s.doctor_id = #{doctorId}</if>
             <if test="doctorId != null"> AND s.doctor_id = #{doctorId}</if>
-            <if test="doctorName != null and doctorName != ''"> AND s.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
+            <if test="doctorName != null and doctorName != ''"> AND d.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
             <if test="packageId != null"> AND s.package_id = #{packageId}</if>
             <if test="packageId != null"> AND s.package_id = #{packageId}</if>
             <if test="packageName != null and packageName != ''"> AND s.package_name LIKE CONCAT('%', #{packageName}, '%')</if>
             <if test="packageName != null and packageName != ''"> AND s.package_name LIKE CONCAT('%', #{packageName}, '%')</if>
             <if test="currentStep != null"> AND s.current_step = #{currentStep}</if>
             <if test="currentStep != null"> AND s.current_step = #{currentStep}</if>
@@ -72,9 +107,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             WHERE s2.collection_id = s.collection_id
             WHERE s2.collection_id = s.collection_id
             <if test="collectionId != null"> AND s2.collection_id = #{collectionId}</if>
             <if test="collectionId != null"> AND s2.collection_id = #{collectionId}</if>
             <if test="userId != null"> AND s2.user_id = #{userId}</if>
             <if test="userId != null"> AND s2.user_id = #{userId}</if>
-            <if test="userName != null and userName != ''"> AND s2.user_name LIKE CONCAT('%', #{userName}, '%')</if>
+            <if test="userName != null and userName != ''"> AND c.user_name LIKE CONCAT('%', #{userName}, '%')</if>
             <if test="doctorId != null"> AND s2.doctor_id = #{doctorId}</if>
             <if test="doctorId != null"> AND s2.doctor_id = #{doctorId}</if>
-            <if test="doctorName != null and doctorName != ''"> AND s2.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
+            <if test="doctorName != null and doctorName != ''"> AND d.doctor_name LIKE CONCAT('%', #{doctorName}, '%')</if>
             <if test="packageId != null"> AND s2.package_id = #{packageId}</if>
             <if test="packageId != null"> AND s2.package_id = #{packageId}</if>
             <if test="packageName != null and packageName != ''"> AND s2.package_name LIKE CONCAT('%', #{packageName}, '%')</if>
             <if test="packageName != null and packageName != ''"> AND s2.package_name LIKE CONCAT('%', #{packageName}, '%')</if>
             <if test="currentStep != null"> AND s2.current_step = #{currentStep}</if>
             <if test="currentStep != null"> AND s2.current_step = #{currentStep}</if>
@@ -90,15 +125,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectFsUserInformationCollectionScheduleVo"/>
         <include refid="selectFsUserInformationCollectionScheduleVo"/>
         where id = #{id}
         where id = #{id}
     </select>
     </select>
-        
+
+    <select id="selectFsUserInformationCollectionScheduleByCollectionId" parameterType="Long" resultMap="FsUserInformationCollectionScheduleResult">
+        SELECT
+            id, collection_id, user_id, doctor_id,
+            package_id, package_name, current_step, status, create_time,
+            completed_time, terminated_time, terminated_by, remark,order_code
+        FROM fs_user_information_collection_schedule
+        WHERE collection_id = #{collectionId}
+        ORDER BY id DESC
+        LIMIT 1
+    </select>
+    <select id="selectFsUserInformationCollectionByOrderCode" parameterType="String" resultMap="FsUserInformationCollectionScheduleResult">
+        <include refid="selectFsUserInformationCollectionScheduleVo"/>
+        where order_code = #{orderCode}
+    </select>
+
+
     <insert id="insertFsUserInformationCollectionSchedule" parameterType="FsUserInformationCollectionSchedule" useGeneratedKeys="true" keyProperty="id">
     <insert id="insertFsUserInformationCollectionSchedule" parameterType="FsUserInformationCollectionSchedule" useGeneratedKeys="true" keyProperty="id">
         insert into fs_user_information_collection_schedule
         insert into fs_user_information_collection_schedule
         <trim prefix="(" suffix=")" suffixOverrides=",">
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="collectionId != null">collection_id,</if>
             <if test="collectionId != null">collection_id,</if>
             <if test="userId != null">user_id,</if>
             <if test="userId != null">user_id,</if>
-            <if test="userName != null">user_name,</if>
             <if test="doctorId != null">doctor_id,</if>
             <if test="doctorId != null">doctor_id,</if>
-            <if test="doctorName != null">doctor_name,</if>
             <if test="packageId != null">package_id,</if>
             <if test="packageId != null">package_id,</if>
             <if test="packageName != null">package_name,</if>
             <if test="packageName != null">package_name,</if>
             <if test="currentStep != null">current_step,</if>
             <if test="currentStep != null">current_step,</if>
@@ -108,13 +157,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="terminatedTime != null">terminated_time,</if>
             <if test="terminatedTime != null">terminated_time,</if>
             <if test="terminatedBy != null">terminated_by,</if>
             <if test="terminatedBy != null">terminated_by,</if>
             <if test="remark != null">remark,</if>
             <if test="remark != null">remark,</if>
+            <if test="orderCode != null">order_code,</if>
          </trim>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="collectionId != null">#{collectionId},</if>
             <if test="collectionId != null">#{collectionId},</if>
             <if test="userId != null">#{userId},</if>
             <if test="userId != null">#{userId},</if>
-            <if test="userName != null">#{userName},</if>
             <if test="doctorId != null">#{doctorId},</if>
             <if test="doctorId != null">#{doctorId},</if>
-            <if test="doctorName != null">#{doctorName},</if>
             <if test="packageId != null">#{packageId},</if>
             <if test="packageId != null">#{packageId},</if>
             <if test="packageName != null">#{packageName},</if>
             <if test="packageName != null">#{packageName},</if>
             <if test="currentStep != null">#{currentStep},</if>
             <if test="currentStep != null">#{currentStep},</if>
@@ -124,6 +172,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="terminatedTime != null">#{terminatedTime},</if>
             <if test="terminatedTime != null">#{terminatedTime},</if>
             <if test="terminatedBy != null">#{terminatedBy},</if>
             <if test="terminatedBy != null">#{terminatedBy},</if>
             <if test="remark != null">#{remark},</if>
             <if test="remark != null">#{remark},</if>
+            <if test="orderCode != null">#{orderCode},</if>
          </trim>
          </trim>
     </insert>
     </insert>
 
 
@@ -132,9 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
         <trim prefix="SET" suffixOverrides=",">
             <if test="collectionId != null">collection_id = #{collectionId},</if>
             <if test="collectionId != null">collection_id = #{collectionId},</if>
             <if test="userId != null">user_id = #{userId},</if>
             <if test="userId != null">user_id = #{userId},</if>
-            <if test="userName != null">user_name = #{userName},</if>
             <if test="doctorId != null">doctor_id = #{doctorId},</if>
             <if test="doctorId != null">doctor_id = #{doctorId},</if>
-            <if test="doctorName != null">doctor_name = #{doctorName},</if>
             <if test="packageId != null">package_id = #{packageId},</if>
             <if test="packageId != null">package_id = #{packageId},</if>
             <if test="packageName != null">package_name = #{packageName},</if>
             <if test="packageName != null">package_name = #{packageName},</if>
             <if test="currentStep != null">current_step = #{currentStep},</if>
             <if test="currentStep != null">current_step = #{currentStep},</if>
@@ -144,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="terminatedTime != null">terminated_time = #{terminatedTime},</if>
             <if test="terminatedTime != null">terminated_time = #{terminatedTime},</if>
             <if test="terminatedBy != null">terminated_by = #{terminatedBy},</if>
             <if test="terminatedBy != null">terminated_by = #{terminatedBy},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="remark != null">remark = #{remark},</if>
+            <if test="orderCode != null">order_code = #{orderCode},</if>
         </trim>
         </trim>
         where id = #{id}
         where id = #{id}
     </update>
     </update>