Quellcode durchsuchen

益寿缘医生端-增加处方来源显示

cgp vor 6 Stunden
Ursprung
Commit
2e8a8171d7

+ 19 - 1
fs-service/src/main/java/com/fs/his/service/impl/FsPrescribeServiceImpl.java

@@ -208,7 +208,25 @@ public class FsPrescribeServiceImpl implements IFsPrescribeService
 
     @Override
     public List<FsPrescribeListVO> selectFsPrescribeListVOWithConfirm(FsPrescribeParam fsPrescribe) {
-        return  fsPrescribeMapper.selectFsPrescribeListVOWithConfirm(fsPrescribe);
+        List<FsPrescribeListVO> fsPrescribeListVOS = fsPrescribeMapper.selectFsPrescribeListVOWithConfirm(fsPrescribe);
+        if (CollectionUtils.isEmpty(fsPrescribeListVOS)){
+            return Collections.emptyList();
+        }
+        //设置处方来源标识 医生在开方时要求区分处方的来源 哪些是信息采集表产生的
+        List<String> orderCodes=fsPrescribeListVOS.stream().map(FsPrescribeListVO::getOrderCode).collect(Collectors.toList());
+        //通过订单号批量查询信息采集进度表
+        List<FsUserInformationCollectionSchedule> schedules = scheduleMapper.selectCollectionScheduleListByOrderCodeList(orderCodes);
+        if (CollectionUtils.isEmpty(schedules)){
+            return fsPrescribeListVOS;
+        }
+        Set<String> existingOrderCodes = schedules.stream().map(FsUserInformationCollectionSchedule::getOrderCode).filter(Objects::nonNull).collect(Collectors.toSet());
+        //从信息采集进度表查询匹配的数据,对于匹配的,将处方来源标识设置为1
+        for(FsPrescribeListVO vo:fsPrescribeListVOS){
+            if (existingOrderCodes.contains(vo.getOrderCode())){
+                vo.setPrescribeSource(1);
+            }
+        }
+        return  fsPrescribeListVOS;
     }
 
     @Override

+ 3 - 0
fs-service/src/main/java/com/fs/his/vo/FsPrescribeListVO.java

@@ -181,4 +181,7 @@ public class FsPrescribeListVO {
     /** 组别 */
     private String groupCode;
 
+    //处方来源 暂定 1:信息采集表
+    private Integer prescribeSource;
+
 }

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

@@ -2,6 +2,7 @@ package com.fs.qw.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.fs.his.domain.FsUserInformationCollectionSchedule;
+import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 
 import java.util.List;
@@ -94,4 +95,9 @@ public interface FsUserInformationCollectionScheduleMapper extends BaseMapper<Fs
 
     @Select("SELECT * FROM fs_user_information_collection_schedule WHERE collection_id = #{collectionId} AND current_step = 5 AND `status` = 1")
     FsUserInformationCollectionSchedule selectSecondConfirmScheduleByCollectionId(Long collectionId);
+
+    /**
+     * 根据订单编号列表查询用户信息采集进度列表
+     * */
+    List<FsUserInformationCollectionSchedule> selectCollectionScheduleListByOrderCodeList(@Param("orderCodes") List<String> orderCodes);
 }

+ 24 - 0
fs-service/src/main/resources/mapper/qw/FsUserInformationCollectionScheduleMapper.xml

@@ -169,6 +169,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ORDER BY id DESC
         LIMIT 1
     </select>
+    <select id="selectCollectionScheduleListByOrderCodeList" 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,
+        company_id,
+        company_user_id
+        FROM fs_user_information_collection_schedule
+        WHERE order_code IN
+        <foreach collection="orderCodes" item="code" open="(" separator="," close=")">
+            #{code}
+        </foreach>
+    </select>
 
 
     <insert id="insertFsUserInformationCollectionSchedule" parameterType="FsUserInformationCollectionSchedule" useGeneratedKeys="true" keyProperty="id">