Kaynağa Gözat

用户信息采集

15376779826 1 hafta önce
ebeveyn
işleme
2ac7a8a3b1
18 değiştirilmiş dosya ile 242 ekleme ve 18 silme
  1. 47 0
      fs-doctor-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java
  2. 1 1
      fs-service/src/main/java/com/fs/his/domain/FsInquiryOrder.java
  3. 1 0
      fs-service/src/main/java/com/fs/his/domain/FsStoreOrder.java
  4. 6 0
      fs-service/src/main/java/com/fs/his/domain/FsUserInformationCollection.java
  5. 8 0
      fs-service/src/main/java/com/fs/his/dto/FsUserInformationCollectionDTO.java
  6. 3 0
      fs-service/src/main/java/com/fs/his/mapper/FsUserInformationCollectionMapper.java
  7. 2 0
      fs-service/src/main/java/com/fs/his/param/CollectionInfoConfirmParam.java
  8. 1 0
      fs-service/src/main/java/com/fs/his/param/FsInquiryOrderListPDParam.java
  9. 2 0
      fs-service/src/main/java/com/fs/his/param/FsPackageOrderCreateParam.java
  10. 2 0
      fs-service/src/main/java/com/fs/his/param/FsUserInformationCollectionParam.java
  11. 13 0
      fs-service/src/main/java/com/fs/his/param/UserInformationDoctorType2Param.java
  12. 8 0
      fs-service/src/main/java/com/fs/his/service/IFsUserInformationCollectionService.java
  13. 11 1
      fs-service/src/main/java/com/fs/his/service/impl/FsPackageOrderServiceImpl.java
  14. 85 14
      fs-service/src/main/java/com/fs/his/service/impl/FsUserInformationCollectionServiceImpl.java
  15. 2 0
      fs-service/src/main/java/com/fs/im/service/OpenIMService.java
  16. 15 0
      fs-service/src/main/java/com/fs/im/service/impl/OpenIMServiceImpl.java
  17. 28 2
      fs-service/src/main/resources/mapper/his/FsUserInformationCollectionMapper.xml
  18. 7 0
      fs-user-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java

+ 47 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java

@@ -0,0 +1,47 @@
+package com.fs.app.controller;
+
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsUserInformationCollection;
+import com.fs.his.dto.FsUserInformationCollectionDTO;
+import com.fs.his.param.CollectionInfoConfirmParam;
+import com.fs.his.param.UserInformationDoctorType2Param;
+import com.fs.his.service.IFsUserInformationCollectionService;
+import com.fs.his.vo.FsInquiryOrderListPDVO;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/user/collection")
+public class FsUserInformationCollectionController extends  AppBaseController {
+    @Autowired
+    private IFsUserInformationCollectionService fsUserInformationCollectionService;
+    @GetMapping("/getUserInformation")
+    public R getUserInformation(@RequestParam("id") Long id) {
+        FsUserInformationCollectionDTO fsUserInformationCollection = fsUserInformationCollectionService.selectFsUserInformationCollectionDTOById(id);
+
+
+        return R.ok().put("data", fsUserInformationCollection);
+    }
+    @PostMapping("/doctorConfirm")
+    public R doctorConfirm(@RequestBody FsUserInformationCollection collection){
+        return fsUserInformationCollectionService.doctorConfirm(collection);
+    }
+
+    @GetMapping("/getCollectionList")
+    private R getCollectionList(UserInformationDoctorType2Param userInformationDoctorType2Param) {
+        PageHelper.startPage(userInformationDoctorType2Param.getPageNum(), userInformationDoctorType2Param.getPageSize());
+        userInformationDoctorType2Param.setDoctorType2Id(Long.parseLong(getDoctorId()));
+        List<FsUserInformationCollection> fsUserInformationCollections = fsUserInformationCollectionService.selectFsUserInformationCollectionByDoctorType2(userInformationDoctorType2Param);
+        PageInfo<FsUserInformationCollection> listPageInfo=new PageInfo<>(fsUserInformationCollections);
+        return R.ok().put("data",listPageInfo);
+    }
+
+    @PostMapping("/doctorType2Confirm")
+    public R doctorType2Confirm(@RequestBody FsUserInformationCollection collection){
+        return fsUserInformationCollectionService.doctorType2Confirm(collection);
+    }
+}

+ 1 - 1
fs-service/src/main/java/com/fs/his/domain/FsInquiryOrder.java

@@ -144,7 +144,7 @@ public class FsInquiryOrder extends BaseEntity
     private Integer source;//订单来源
 
     private Long triageUserId;
-    //是否信息采集生成的问诊订单1是0否
+
     private Integer isUserInformation;
 
     public Integer getIsUserInformation() {

+ 1 - 0
fs-service/src/main/java/com/fs/his/domain/FsStoreOrder.java

@@ -265,5 +265,6 @@ public class FsStoreOrder extends BaseEntity
     private Integer source;
     private BigDecimal billPrice;
     private String erpPhone;
+    private Integer doctorType2Confirm;
 
 }

+ 6 - 0
fs-service/src/main/java/com/fs/his/domain/FsUserInformationCollection.java

@@ -95,5 +95,11 @@ public class FsUserInformationCollection extends BaseEntity{
     private String remark;
 
     private Long patientId;
+    private String patientName;
+
+    private Long companyId;
+    private Long doctorType2Id;
+    private Integer doctorType2Confirm;
+    private String doctorType2Sign;
 
 }

+ 8 - 0
fs-service/src/main/java/com/fs/his/dto/FsUserInformationCollectionDTO.java

@@ -92,4 +92,12 @@ public class FsUserInformationCollectionDTO {
     private String packageName;
 
     private String questionJson;
+
+    private String doctorSign;
+
+    private String doctorType2Name;
+    private Long doctorType2Id;
+    private Integer doctorType2Confirm;
+    private String doctorType2Sign;
+
 }

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.his.domain.FsUserInformationCollection;
 import com.fs.his.dto.FsUserInformationCollectionDTO;
 import com.fs.his.param.FsUserInformationCollectionListDParam;
+import com.fs.his.param.UserInformationDoctorType2Param;
 import com.fs.his.vo.FsUserInformationCollectionListDVO;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -95,4 +96,6 @@ public interface FsUserInformationCollectionMapper extends BaseMapper<FsUserInfo
     List<FsUserInformationCollection> selectAutoConfirm();
 
     FsUserInformationCollectionDTO selectFsUserInformationCollectionDTOById(Long id);
+
+    List<FsUserInformationCollection>selectFsUserInformationCollectionByDoctorType2(@Param("maps") UserInformationDoctorType2Param userInformationDoctorType2Param);
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/CollectionInfoConfirmParam.java

@@ -13,4 +13,6 @@ public class CollectionInfoConfirmParam {
 
     //用户建议
     private String userAdvice;
+
+    private Long patientId;
 }

+ 1 - 0
fs-service/src/main/java/com/fs/his/param/FsInquiryOrderListPDParam.java

@@ -22,5 +22,6 @@ public class FsInquiryOrderListPDParam  extends BaseParam implements Serializabl
     Long userId;
     private String eTime;
     private String sTime;
+    private Integer isUserInformation = 0;
 
 }

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/FsPackageOrderCreateParam.java

@@ -21,6 +21,8 @@ public class FsPackageOrderCreateParam implements Serializable {
     private Integer source;//订单来源 1:小程序 2:app  3:H5
     private String createPackageOrderKey;
     private Integer payType;
+    private Integer isUserInformation = 0;
+    private Long userInformationId;
 
 
 

+ 2 - 0
fs-service/src/main/java/com/fs/his/param/FsUserInformationCollectionParam.java

@@ -47,4 +47,6 @@ public class FsUserInformationCollectionParam {
     private Long patientId;
 
     private String doctorSign;
+
+    private String packageOrderCode;
 }

+ 13 - 0
fs-service/src/main/java/com/fs/his/param/UserInformationDoctorType2Param.java

@@ -0,0 +1,13 @@
+package com.fs.his.param;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class UserInformationDoctorType2Param extends BaseParam implements Serializable {
+    private Integer doctorType2Confirm;
+    private String patientName;
+    private String packageOrderCode;
+    private Long doctorType2Id;
+}

+ 8 - 0
fs-service/src/main/java/com/fs/his/service/IFsUserInformationCollectionService.java

@@ -7,6 +7,7 @@ import com.fs.his.dto.FsUserInformationCollectionDTO;
 import com.fs.his.param.CollectionInfoConfirmParam;
 import com.fs.his.param.FsUserInformationCollectionListDParam;
 import com.fs.his.param.FsUserInformationCollectionParam;
+import com.fs.his.param.UserInformationDoctorType2Param;
 import com.fs.his.vo.FsUserInfoCollectionUVO;
 import com.fs.his.vo.FsUserInformationCollectionAndPatientVO;
 import com.fs.his.vo.FsUserInformationCollectionListDVO;
@@ -29,6 +30,8 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
      */
     FsUserInformationCollection selectFsUserInformationCollectionById(Long id);
 
+
+
     /**
      * 查询用户信息采集列表
      *
@@ -37,6 +40,8 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
      */
     List<FsUserInformationCollection> selectFsUserInformationCollectionList(FsUserInformationCollection fsUserInformationCollection);
 
+    List<FsUserInformationCollection> selectFsUserInformationCollectionByDoctorType2(UserInformationDoctorType2Param userInformationDoctorType2Param);
+
     /**
      * 新增用户信息采集
      *
@@ -92,6 +97,7 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     R getWxaCodePackageOrderUnLimit(Long collectionId);
 
     R doctorConfirm(FsUserInformationCollection collection);
+    R doctorType2Confirm(FsUserInformationCollection collection);
 
     FsUserInfoCollectionUVO info(Long id, Long userId);
 
@@ -103,4 +109,6 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
     FsUserInformationCollectionVO getCollectionByUserId(Long userId);
 
     FsUserInformationCollectionDTO selectFsUserInformationCollectionDTOById(Long id);
+
+    int updatePackageOrderCode(FsUserInformationCollection fsUserInformationCollection);
 }

+ 11 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsPackageOrderServiceImpl.java

@@ -168,6 +168,9 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
     @Autowired
     private CloudHostProper cloudHostProper;
 
+    @Autowired
+    private IFsUserInformationCollectionService fsUserInformationCollectionService;
+
     /**
      * 查询套餐订单
      *
@@ -606,7 +609,9 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
         c.setTime(order.getStartTime());
         c.add(Calendar.DAY_OF_MONTH, fsPackage.getCycle());
         order.setFinishTime(c.getTime());
-        order.setFormJson(param.getFormJson());
+        if (param.getIsUserInformation() != 1){
+            order.setFormJson(param.getFormJson());
+        }
         order.setPackageJson(JSONUtil.toJsonStr(fsPackage));
         order.setCreateTime(new Date());
         if(patient!=null){
@@ -618,6 +623,11 @@ public class FsPackageOrderServiceImpl implements IFsPackageOrderService
         order.setCycle(fsPackage.getCycle());
         order.setCostDiscountMoney(fsPackage.getTotalCostPrice().subtract(fsPackage.getTotalPrice()));
         if(fsPackageOrderMapper.insertFsPackageOrder(order)>0){
+            FsUserInformationCollection fsUserInformationCollection = fsUserInformationCollectionService.selectFsUserInformationCollectionById(param.getUserInformationId());
+            if (fsUserInformationCollection != null) {
+                fsUserInformationCollection.setPackageOrderCode(order.getOrderSn());
+                fsUserInformationCollectionService.updatePackageOrderCode(fsUserInformationCollection);
+            }
             String redisKey = String.valueOf(StrUtil.format("{}{}", FsConstants.REDIS_PACKAGE_ORDER_UNPAY, order.getOrderId()));
             redisCache.setCacheObject(redisKey,order.getOrderId(),30, TimeUnit.MINUTES);
             return R.ok().put("order",order);

+ 85 - 14
fs-service/src/main/java/com/fs/his/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -24,10 +24,7 @@ import com.fs.his.domain.*;
 import com.fs.his.dto.FsUserInformationCollectionDTO;
 import com.fs.his.enums.FsStoreOrderStatusEnum;
 import com.fs.his.mapper.*;
-import com.fs.his.param.CollectionInfoConfirmParam;
-import com.fs.his.param.FsInquiryOrderCreateParam;
-import com.fs.his.param.FsUserInformationCollectionListDParam;
-import com.fs.his.param.FsUserInformationCollectionParam;
+import com.fs.his.param.*;
 import com.fs.his.service.*;
 import com.fs.his.utils.ConfigUtil;
 import com.fs.his.vo.*;
@@ -176,6 +173,12 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         return baseMapper.selectFsUserInformationCollectionList(fsUserInformationCollection);
     }
 
+    @Override
+    public List<FsUserInformationCollection> selectFsUserInformationCollectionByDoctorType2(UserInformationDoctorType2Param userInformationDoctorType2Param) {
+        return fsUserInformationCollectionMapper.selectFsUserInformationCollectionByDoctorType2(userInformationDoctorType2Param);
+
+    }
+
     /**
      * 新增用户信息采集
      *
@@ -467,6 +470,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         map.setDoctorConfirm(1);
         //医生确认时间
         map.setDoctorConfirmTime(DateUtils.getNowDate());
+        //写入医生签名
+        FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(fsUserInformationCollection.getDoctorId());
+        map.setDoctorSign(fsDoctor.getSignUrl());
+        map.setDoctorAdvice(collection.getDoctorAdvice());
         if (answerVOS != null && !answerVOS.isEmpty()) {
             map.setJsonInfo(JSON.toJSONString(answerVOS));
         }
@@ -503,22 +510,76 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
 
             //更新医生确认信息
-            FsDoctorConfirm doctorConfirm = redisCache.getCacheObject("doctorConfirm:" + collection.getId());
-            if(doctorConfirm == null) {
-                return R.error("没有医生确认信息");
-            }
-            doctorConfirm.setDoctorEndTime(DateUtils.getNowDate());
-            Long seconds = DateUtil.between(doctorConfirm.getStartTime(), doctorConfirm.getDoctorEndTime(), DateUnit.SECOND);
-            doctorConfirm.setConfirmSecond(seconds);
-            doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
-            redisCache.deleteObject("doctorConfirm:" + collection.getId());
-
+//            FsDoctorConfirm doctorConfirm = redisCache.getCacheObject("doctorConfirm:" + collection.getId());
+//            if(doctorConfirm == null) {
+//                return R.error("没有医生确认信息");
+//            }
+//            doctorConfirm.setDoctorEndTime(DateUtils.getNowDate());
+//            Long seconds = DateUtil.between(doctorConfirm.getStartTime(), doctorConfirm.getDoctorEndTime(), DateUnit.SECOND);
+//            doctorConfirm.setConfirmSecond(seconds);
+//            doctorConfirmService.updateFsDoctorConfirm(doctorConfirm);
+//            redisCache.deleteObject("doctorConfirm:" + collection.getId());
 
+            openIMService.doctorSendMsgToUser(collection.getUserId(),collection.getDoctorId());
             return R.ok();
         }
         return R.error("医生确认失败");
     }
 
+    @Override
+    @Transactional
+    public R doctorType2Confirm(FsUserInformationCollection collection) {
+        FsUserInformationCollection fsUserInformationCollection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(collection.getId());
+        if (fsUserInformationCollection == null) {
+            return R.error("没有用户采集信息");
+        }
+        if (fsUserInformationCollection.getUserConfirm() == 0){
+            return R.error("用户未确认");
+        }
+        if (fsUserInformationCollection.getDoctorType2Confirm() == 1){
+            return R.error("药师已确认");
+        }
+        if (fsUserInformationCollection.getDoctorConfirm() != 1) {
+            return R.error("医生未签字无法确认");
+        }
+        if(StringUtils.isEmpty(fsUserInformationCollection.getPackageOrderCode())){
+            return R.error("用户未下单,无需确认");
+        }
+        List<AnswerVO> answerVOS = null;
+        //医生确认确认状态为true(用于封档)
+        if (StringUtils.isNotEmpty(fsUserInformationCollection.getJsonInfo()) ){
+            answerVOS = JSONArray.parseArray(fsUserInformationCollection.getJsonInfo(), AnswerVO.class);
+            answerVOS.forEach(answerVO -> {
+                answerVO.setFlag(true);
+            });
+        }
+        FsUserInformationCollection map = new FsUserInformationCollection();
+        map.setId(collection.getId());
+        map.setDoctorType2Confirm(1);
+        //医生确认时间
+        map.setDoctorConfirmTime(DateUtils.getNowDate());
+        //写入药师签名
+        FsDoctor fsDoctor = doctorMapper.selectFsDoctorByDoctorId(fsUserInformationCollection.getDoctorType2Id());
+        map.setDoctorType2Sign(fsDoctor.getSignUrl());
+        map.setDoctorAdvice(collection.getDoctorAdvice());
+        if (answerVOS != null && !answerVOS.isEmpty()) {
+            map.setJsonInfo(JSON.toJSONString(answerVOS));
+        }
+//
+
+        if (fsUserInformationCollectionMapper.updateFsUserInformationCollection(map) > 0) {
+            FsPackageOrder fsPackageOrder = packageOrderMapper.selectFsPackageOrderByOrderSn(collection.getPackageOrderCode());
+            if(fsPackageOrder.getStoreOrderId()==null||fsPackageOrder.getStoreOrderId()==0){
+                return R.error("用户未支付,无需确认");
+            }
+            FsStoreOrder fsStoreOrder = storeOrderService.selectFsStoreOrderByOrderId(fsPackageOrder.getStoreOrderId());
+            fsStoreOrder.setDoctorType2Confirm(1);
+            storeOrderService.updateFsStoreOrder(fsStoreOrder);
+            return R.ok();
+        }
+        return R.error("药师确认失败");
+    }
+
     @Override
     public FsUserInfoCollectionUVO info(Long id, Long userId) {
         FsUserInfoCollectionUVO vo = new FsUserInfoCollectionUVO();
@@ -609,6 +670,10 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         map.setId(param.getId());
         map.setUserConfirm(1);
         map.setUserAdvice(param.getUserAdvice());
+        if (param.getPatientId() == null|| param.getPatientId() == 0) {
+            return R.error("请提交就诊人信息");
+        }
+        map.setPatientId(param.getPatientId());
         if (collection.getStatus() == 1) {
 
             openIMService.sendUserInformation(collection.getUserId(),collection.getDoctorId(),collection.getId());
@@ -865,6 +930,11 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         return fsUserInformationCollectionMapper.selectFsUserInformationCollectionDTOById(id);
     }
 
+    @Override
+    public int updatePackageOrderCode(FsUserInformationCollection fsUserInformationCollection) {
+        return fsUserInformationCollectionMapper.updateFsUserInformationCollection(fsUserInformationCollection);
+    }
+
     private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
         target.addAll(source);
         return target.stream()
@@ -914,6 +984,7 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             //随机获取医生id
             doctorId = iFsDoctorService.selectFsDoctorDoctorByPackage();
         }
+        doctorId = 324l;
         fsUserInformationCollection.setDoctorId(doctorId);
 
         return fsUserInformationCollection;

+ 2 - 0
fs-service/src/main/java/com/fs/im/service/OpenIMService.java

@@ -87,4 +87,6 @@ public interface OpenIMService {
 
     OpenImResponseDTO sendUserInformation(Long userId,Long doctorId,Long userInformationId);
 
+    OpenImResponseDTO doctorSendMsgToUser(Long userId,Long doctorId);
+
 }

+ 15 - 0
fs-service/src/main/java/com/fs/im/service/impl/OpenIMServiceImpl.java

@@ -1612,4 +1612,19 @@ public class OpenIMServiceImpl implements OpenIMService {
             return null;
         }
     }
+
+    @Override
+    public OpenImResponseDTO doctorSendMsgToUser(Long userId, Long doctorId) {
+        OpenImMsgDTO openImMsgDTO = new OpenImMsgDTO();
+        ObjectMapper objectMapper = new ObjectMapper();
+        openImMsgDTO.setRecvID("U"+userId);
+        openImMsgDTO.setSendID("D"+doctorId);
+        openImMsgDTO.setContentType(101);
+        openImMsgDTO.setSenderPlatformID(5);
+        openImMsgDTO.setSessionType(1);
+        OpenImMsgDTO.Content content = new OpenImMsgDTO.Content();
+        content.setContent("您的用户信息已确认");
+        openImMsgDTO.setContent(content);
+        return openIMSendMsg(openImMsgDTO);
+    }
 }

+ 28 - 2
fs-service/src/main/resources/mapper/his/FsUserInformationCollectionMapper.xml

@@ -32,6 +32,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="allergy"    column="allergy"    />
         <result property="remark"    column="remark"    />
         <result property="patientId"    column="patient_id"    />
+        <result property="doctorType2Id"    column="doctor_type2_id"    />
+        <result property="doctorType2Confirm"    column="doctor_type2_confirm"    />
+        <result property="doctorType2Sign"    column="doctor_type2_sign"    />
     </resultMap>
 
     <sql id="selectFsUserInformationCollectionVo">
@@ -39,7 +42,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
              , doctor_confirm, create_time, update_time,doctor_id,company_user_id
              ,package_id,pay_type,amount,is_package,user_confirm2,package_order_code
              ,status,user_advice,doctor_advice,doctor_sign,doctor_confirm_time,sex,user_name,user_phone_four
-             ,allergy,remark,patient_id  from fs_user_information_collection
+             ,allergy,remark,patient_id,doctor_type2_id,doctor_type2_confirm,doctor_type2_sign  from fs_user_information_collection
     </sql>
 
     <select id="selectFsUserInformationCollectionList" parameterType="FsUserInformationCollection" resultMap="FsUserInformationCollectionResult">
@@ -74,15 +77,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectFsUserInformationCollectionDTOById"
             resultType="com.fs.his.dto.FsUserInformationCollectionDTO">
-        SELECT fui.*,fu.nick_name as userName,fp.patient_name,cu.nick_name as companyUserName,fd.doctor_name,fpkg.package_name,fqa.json_info as questionJson FROM fs_user_information_collection fui
+        SELECT fui.*,fu.nick_name as userName,fp.patient_name,cu.nick_name as companyUserName,fd.doctor_name,fd1.doctor_name as doctorType2Name,fpkg.package_name,fqa.json_info as questionJson FROM fs_user_information_collection fui
           LEFT JOIN fs_user fu ON fui.user_id = fu.user_id
           LEFT JOIN fs_patient fp ON fui.patient_id = fp. patient_id
           LEFT JOIN company_user cu ON fui.company_user_id = cu.user_id
           LEFT JOIN fs_doctor fd ON fui.doctor_id = fd.doctor_id
+          LEFT JOIN fs_doctor fd1 ON fui.doctor_type2_id = fd1.doctor_id
           LEFT JOIN fs_package fpkg ON fui.package_id = fpkg.package_id
           LEFT JOIN fs_question_and_answer fqa ON fui.question_id = fqa.id
         WHERE fui.id = #{id}
     </select>
+    <select id="selectFsUserInformationCollectionByDoctorType2"
+            resultType="com.fs.his.domain.FsUserInformationCollection">
+        select fui.*,fp.patient_name as patientName from fs_user_information_collection fui left join fs_patient fp on fui.patient_id = fp.patient_id
+            <where>
+                <if test="maps.doctorType2Id != null and maps.doctorType2Id != ''"> and fui.doctor_type2_id = #{maps.doctorType2Id}</if>
+                <if test="maps.doctorType2Confirm != null and maps.doctorType2Confirm != ''"> and fui.doctor_type2_confirm = #{maps.doctorType2Confirm}</if>
+                <if test="maps.packageOrderCode != null  and maps.packageOrderCode != ''"> and fui.package_order_code = #{maps.packageOrderCode}</if>
+            </where>
+
+    </select>
 
     <insert id="insertFsUserInformationCollection" parameterType="FsUserInformationCollection" useGeneratedKeys="true" keyProperty="id">
         insert into fs_user_information_collection
@@ -113,6 +127,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="allergy != null">allergy,</if>
             <if test="remark != null">remark,</if>
             <if test="patientId != null">patient_id,</if>
+            <if test="doctorType2Id != null">doctor_type2_id,</if>
+            <if test="doctorType2Confirm != null">doctor_type2_confirm,</if>
+            <if test="doctorType2Sign != null">doctor_type2_sign,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="questionId != null">#{questionId},</if>
@@ -141,6 +158,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="allergy != null">#{allergy},</if>
             <if test="remark != null">#{remark},</if>
             <if test="patientId != null">#{patientId},</if>
+            <if test="patientId != null">#{patientId},</if>
+            <if test="patientId != null">#{patientId},</if>
+            <if test="patientId != null">#{patientId},</if>
+            <if test="doctorType2Id != null">doctorType2Id,</if>
+            <if test="doctorType2Confirm != null">doctorType2Confirm,</if>
+            <if test="doctorType2Sign != null">doctorType2Sign,</if>
          </trim>
     </insert>
 
@@ -173,6 +196,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="allergy != null">allergy = #{allergy},</if>
             <if test="remark != null">remark = #{remark},</if>
             <if test="patientId != null">patient_id = #{patientId},</if>
+            <if test="doctorType2Id != null">doctor_type2_id = #{doctorType2Id},</if>
+            <if test="doctorType2Confirm != null">doctor_type2_confirm = #{doctorType2Confirm},</if>
+            <if test="doctorType2Sign != null">doctor_type2_sign = #{doctorType2Sign},</if>
         </trim>
         where id = #{id}
     </update>

+ 7 - 0
fs-user-app/src/main/java/com/fs/app/controller/FsUserInformationCollectionController.java

@@ -2,6 +2,9 @@ package com.fs.app.controller;
 
 import com.fs.app.annotation.Login;
 import com.fs.common.core.domain.R;
+import com.fs.company.domain.CompanyUser;
+import com.fs.company.domain.CompanyUserUser;
+import com.fs.company.service.ICompanyUserService;
 import com.fs.company.service.ICompanyUserUserService;
 import com.fs.his.domain.FsPatient;
 import com.fs.his.domain.FsUserInformationCollection;
@@ -29,6 +32,8 @@ public class FsUserInformationCollectionController extends AppBaseController
     private IFsUserInformationCollectionService fsUserInformationCollectionService;
     @Autowired
     private IFsPatientService fsPatientService;
+    @Autowired
+    private ICompanyUserService companyUserService;
 
 
 
@@ -52,6 +57,8 @@ public class FsUserInformationCollectionController extends AppBaseController
         if (info.getDoctorConfirm() == 0){
             info.setPackageId(null);
         }
+        CompanyUser companyUser = companyUserService.selectCompanyUserById(info.getCompanyUserId());
+        info.setCompanyId(companyUser.getCompanyId());
         Long patientId = info.getPatientId();
         if(patientId != null){
             FsPatient fsPatient = fsPatientService.selectFsPatientByPatientId(patientId);