Explorar o código

根据用户id查询用户采集信息

cgp hai 1 día
pai
achega
2bc8275357

+ 5 - 3
fs-doctor-app/src/main/java/com/fs/app/controller/FsPrescribeController.java

@@ -17,6 +17,8 @@ import com.fs.his.service.IFsExportTaskService;
 import com.fs.his.service.IFsPrescribeService;
 import com.fs.his.vo.FsPrescribeListVO;
 import com.fs.his.vo.FsPrescribeVO;
+import com.fs.hisStore.domain.FsUserInformationCollection;
+import com.fs.hisStore.service.IFsUserInformationCollectionService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.transaction.annotation.Transactional;
@@ -43,6 +45,9 @@ public class FsPrescribeController extends BaseController
     @Autowired
     private FsPatientMapper fsPatientMapper;
 
+    @Autowired
+    private IFsUserInformationCollectionService fsUserInformationCollectionService;
+
     /**
      * 确认处方
      * @param param 处方
@@ -196,7 +201,4 @@ public class FsPrescribeController extends BaseController
         return toAjax(fsPrescribeService.deleteFsPrescribeByPrescribeIds(prescribeIds));
     }
 
-
-
-
 }

+ 7 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/UserInfoCollectionController.java

@@ -44,4 +44,11 @@ public class UserInfoCollectionController extends AppBaseController{
     public R doctorConfirm(@RequestBody FsUserInformationCollection collection){
         return userInfoCollectionService.doctorConfirm(collection);
     }
+
+    //用户采集信息详情
+    @GetMapping("/getCollectionByUserId/{userId}")
+    public R getCollectionByUserId(@PathVariable("userId") Long userId){
+        FsUserInformationCollectionVO detail = userInfoCollectionService.getCollectionByUserId(userId);
+        return R.ok().put("data", detail);
+    }
 }

+ 1 - 1
fs-service/src/main/java/com/fs/his/mapper/FsPatientMapper.java

@@ -95,7 +95,7 @@ public interface FsPatientMapper
     @Select("SELECT * FROM fs_patient WHERE user_id=#{userId}")
     List<FsPatientVO> selectFsPatientListByUserId(Long userId);
     @Select({"<script> " +
-            "select DISTINCT p.patient_id, p.patient_name,p.id_card,p.birthday,p.sex,p.weight,p.mobile,o.create_time  from fs_inquiry_order o inner join fs_patient p  on o.patient_id=p.patient_id     " +
+            "select DISTINCT p.patient_id,p.user_id, p.patient_name,p.id_card,p.birthday,p.sex,p.weight,p.mobile,o.create_time  from fs_inquiry_order o inner join fs_patient p  on o.patient_id=p.patient_id     " +
             "where  p.status=1 and  o.doctor_id=#{maps.doctorId}  " +
             "<if test = 'maps.patientName != null     '> " +
             "and p.patient_name like CONCAT('%',#{maps.patientName},'%')" +

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

@@ -88,4 +88,6 @@ public interface IFsUserInformationCollectionService extends IService<FsUserInfo
 
     //自动退款
     void autoRefund(FsUserInformationCollection collection);
+
+    FsUserInformationCollectionVO getCollectionByUserId(Long userId);
 }

+ 10 - 0
fs-service/src/main/java/com/fs/hisStore/service/impl/FsUserInformationCollectionServiceImpl.java

@@ -743,6 +743,16 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
 
     }
 
+    @Override
+    public FsUserInformationCollectionVO getCollectionByUserId(Long userId) {
+        FsUserInformationCollectionVO vo = new FsUserInformationCollectionVO();
+        FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionByUserId(userId);
+        if (collection != null) {
+            vo.setAnswers(JSON.parseArray(collection.getJsonInfo(), AnswerVO.class));
+        }
+        return vo;
+    }
+
     private List<AnswerVO> getAnswerVOs(List<AnswerVO> target,List<AnswerVO> source) {
         target.addAll(source);
         return target.stream()

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

@@ -2058,17 +2058,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
         FROM fs_store_order
         WHERE is_del = 0 AND status > 1
-        <if test="startTime != null">
+        <if test="startTime != null and startTime !=''">
             AND create_time &gt;= #{startTime}
         </if>
-        <if test="endTime != null">
+        <if test="endTime != null and endTime != ''">
             AND create_time &lt;= #{endTime}
         </if>
-
-        <if test="companyId != null">
+        <if test="companyId != null and companyId !=''">
             AND company_id = #{companyId}
         </if>
-        <if test="companyUserId != null">
+        <if test="companyUserId != null and companyUserId !=''">
             AND company_user_id = #{companyUserId}
         </if>
     </select>

+ 4 - 4
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -987,16 +987,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SUM(CASE WHEN pay_type IN ('2', '3') THEN COALESCE(pay_money, 0) ELSE 0 END) AS codAmount
         FROM fs_store_order_scrm
         WHERE is_del = 0 AND status > 0
-        <if test="startTime != null">
+        <if test="startTime != null and startTime !=''">
             AND create_time &gt;= #{startTime}
         </if>
-        <if test="endTime != null">
+        <if test="endTime != null and endTime != ''">
             AND create_time &lt;= #{endTime}
         </if>
-        <if test="companyId != null">
+        <if test="companyId != null and companyId !=''">
             AND company_id = #{companyId}
         </if>
-        <if test="companyUserId != null">
+        <if test="companyUserId != null and companyUserId !=''">
             AND company_user_id = #{companyUserId}
         </if>
     </select>