Ver código fonte

修改用户信息采集问答数据结构

wjj 3 dias atrás
pai
commit
5c0a993958

+ 3 - 0
fs-service/src/main/java/com/fs/course/vo/FsUserInfoCollectionUVO.java

@@ -56,4 +56,7 @@ public class FsUserInfoCollectionUVO {
 
 
     private String patientJson;
+
+    //处方图片
+    private String prescribeImgUrl;
 }

+ 4 - 2
fs-service/src/main/java/com/fs/his/vo/AnswerVO.java

@@ -15,8 +15,10 @@ public class AnswerVO implements Serializable {
 
     private List<Options> options;
 
-    //已选择数据
-    private Integer value;
+    //已选择数据(多选)
+    private List<Integer> value;
+    //private Integer value;
+
 
     //是否医生已确认
     private Boolean flag;

+ 45 - 9
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -25,17 +25,13 @@ import com.fs.course.mapper.FsUserCompanyUserMapper;
 import com.fs.course.param.CollectionInfoConfirmParam;
 import com.fs.course.vo.FsUserInfoCollectionUVO;
 import com.fs.his.config.FsSysConfig;
-import com.fs.his.domain.FsDoctor;
-import com.fs.his.domain.FsPackage;
-import com.fs.his.domain.FsPackageOrder;
-import com.fs.his.domain.FsStoreOrder;
+import com.fs.his.domain.*;
 import com.fs.his.mapper.FsDoctorMapper;
 import com.fs.his.mapper.FsPackageMapper;
 import com.fs.his.mapper.FsPackageOrderMapper;
-import com.fs.his.service.IFsDoctorService;
-import com.fs.his.service.IFsPackageOrderService;
-import com.fs.his.service.IFsQuestionAndAnswerService;
-import com.fs.his.service.IFsStoreOrderService;
+import com.fs.his.mapper.FsPrescribeMapper;
+import com.fs.his.param.FsPrescribeParam;
+import com.fs.his.service.*;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.AnswerVO;
 import com.fs.his.vo.FsQuestionAndAnswerVO;
@@ -100,6 +96,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     @Autowired
     private FsPackageOrderMapper packageOrderMapper;
 
+    @Autowired
+    private FsPrescribeMapper fsPrescribeMapper;
+
+    @Autowired
+    private IFsPrescribeService prescribeService;
+
     /**
      * 查询用户信息采集
      * 
@@ -232,10 +234,17 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
                 if(answerVO.getFlag() == null) {
                     answerVO.setFlag(false);
                 }
+                if (answerVO.getValue() == null) {
+                    answerVO.setValue(new ArrayList<>());
+                }
             });
             //有值且为true排前面
+//            List<AnswerVO> collect = vo.getAnswers().stream()
+//                    .sorted(Comparator.comparing(AnswerVO::getValue, Comparator.nullsFirst(Integer::compareTo)).reversed()).collect(Collectors.toList())
+//                    .stream()
+//                    .sorted((a,b)-> Boolean.compare(b.getFlag(),a.getFlag())).collect(Collectors.toList());
             List<AnswerVO> collect = vo.getAnswers().stream()
-                    .sorted(Comparator.comparing(AnswerVO::getValue, Comparator.nullsFirst(Integer::compareTo)).reversed()).collect(Collectors.toList())
+                    .sorted(Comparator.comparing(AnswerVO::getValue, Comparator.nullsFirst(List::indexOf)).reversed()).collect(Collectors.toList())
                     .stream()
                     .sorted((a,b)-> Boolean.compare(b.getFlag(),a.getFlag())).collect(Collectors.toList());
             vo.setAnswers(collect);
@@ -329,6 +338,18 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         }
         if (fsUserInformationCollection.getIsPackage() == 1) {
             map.setDoctorConfirm(1);
+            //插入生成处方签定时任务数据
+            if(fsUserInformationCollection.getPackageOrderCode() != null) {
+                FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderCode(fsUserInformationCollection.getPackageOrderCode());
+                if (fsStoreOrder != null && fsStoreOrder.getIsPay() == 1) {
+                    if (fsStoreOrder.getPrescribeId() != null) {
+                        FsPrescribeParam fsPrescribeParam = new FsPrescribeParam();
+                        fsPrescribeParam.setPrescribeId(fsStoreOrder.getPrescribeId());
+                        prescribeService.confirmPrescribe(fsPrescribeParam);
+                    }
+                }
+
+            }
         } else {
             //没有关联套餐包医生确认清空所有状态
             map.setDoctorConfirm(0);
@@ -347,6 +368,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             doctorConfirm.setConfirmSecond(seconds);
             doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
             redisCache.deleteObject("doctorConfirm:" + collection.getId());
+
+
             return R.ok();
         }
         return R.error("医生确认失败");
@@ -384,6 +407,19 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
                     vo.setOrderStatus(fsPackageOrder.getIsPay());
                     vo.setOrderId(fsPackageOrder.getOrderId());
                     vo.setPatientJson(fsPackageOrder.getPatientJson());
+                    if((fsPackage.getProductType() == 1 || fsPackage.getProductType() == 2) && fsPackageOrder.getIsPay() == 1) {
+                        //套餐包为药品且已支付的查询处方订单拿到处方签
+                        FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderCode(collection.getPackageOrderCode());
+                        if (fsStoreOrder != null) {
+                            Long prescribeId = fsStoreOrder.getPrescribeId();
+                            FsPrescribe fsPrescribe = fsPrescribeMapper.selectFsPrescribeByPrescribeId(prescribeId);
+                            if (fsPrescribe != null) {
+                                vo.setPrescribeImgUrl(fsPrescribe.getPrescribeImgUrl());
+                            }
+                        } else {
+                            throw new CustomException("没有处方订单");
+                        }
+                    }
                 }
             }
             vo.setIsPackage(collection.getIsPackage());

+ 1 - 2
fs-service/src/main/resources/mapper/hisStore/FsUserInformationCollectionMapper.xml

@@ -104,7 +104,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userConfirm2 != null">#{userConfirm2},</if>
             <if test="packageOrderCode != null">#{packageOrderCode},</if>
             <if test="status != null">#{status},</if>
-            <if test="status != null">#{status},</if>
             <if test="doctorConfirmTime != null">#{doctorConfirmTime},</if>
          </trim>
     </insert>
@@ -130,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isPackage != null">is_package = #{isPackage},</if>
             <if test="packageOrderCode != null">package_order_code = #{packageOrderCode},</if>
             <if test="status != null">status = #{status},</if>
-            <if test="doctorConfirmTime != null">doctorConfirmTime = #{doctor_confirm_time},</if>
+            <if test="doctorConfirmTime != null">doctor_confirm_time = #{doctorConfirmTime},</if>
         </trim>
         where id = #{id}
     </update>