Просмотр исходного кода

1.信息采集疾病情况排序 2.信息采集信息过敏和备注信息

wjj 2 недель назад
Родитель
Сommit
570aeb49aa

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

@@ -65,4 +65,9 @@ public class FsUserInfoCollectionUVO {
 
     //处方审核状态 0待审核 1通过 2拒绝
     private Integer prescribeStatus;
+
+    //是否过敏
+    private String allergy;
+    //备注
+    private String remark;
 }

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

@@ -17,6 +17,9 @@ public class AnswerVO implements Serializable {
 
     //已选择数据(多选)
     private List<Integer> value;
+
+    //排序
+    private Integer sort;
     //private Integer value;
 
 

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/domain/FsUserInformationCollection.java

@@ -87,4 +87,9 @@ public class FsUserInformationCollection extends BaseEntity{
     //用户电话后四位
     private String userPhoneFour;
 
+    //是否过敏
+    private String allergy;
+    //备注
+    private String remark;
+
 }

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsUserInformationCollectionParam.java

@@ -39,4 +39,9 @@ public class FsUserInformationCollectionParam {
     private String userName;
     //用户电话后四位
     private String userPhoneFour;
+
+    //是否过敏
+    private String allergy;
+    //备注
+    private String remark;
 }

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

@@ -272,6 +272,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             vo.setSex(fsUserInformationCollection.getSex());
             vo.setUserPhoneFour(fsUserInformationCollection.getUserPhoneFour());
             vo.setUserName(fsUserInformationCollection.getUserName());
+            vo.setRemark(fsUserInformationCollection.getRemark());
+            vo.setAllergy(fsUserInformationCollection.getAllergy());
             if (map.getQuestionId() == null) {
                 FsQuestionAndAnswerVO questionAndAnswerVO = questionAndAnswerService.selectFsQuestionAndAnswerById(fsUserInformationCollection.getQuestionId());
                 List<AnswerVO> answerVOS = JSON.parseArray(fsUserInformationCollection.getJsonInfo(), AnswerVO.class);
@@ -300,6 +302,21 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         }
         if (ObjectUtil.isNotEmpty(vo.getAnswers())){
             vo.getAnswers().forEach(answerVO -> {
+                if (answerVO.getSort() == null) {
+                    if (answerVO.getTitle().contains("糖尿病")) {
+                        answerVO.setSort(1);
+                    } else if (answerVO.getTitle().contains("心脑血管")) {
+                        answerVO.setSort(2);
+                    } else if (answerVO.getTitle().contains("风湿骨病")) {
+                        answerVO.setSort(3);
+                    } else if (answerVO.getTitle().contains("肝胆")) {
+                        answerVO.setSort(4);
+                    } else if (answerVO.getTitle().contains("其他")) {
+                        answerVO.setSort(5);
+                    } else if (answerVO.getTitle().contains("特殊")) {
+                        answerVO.setSort(6);
+                    }
+                }
                 if(answerVO.getFlag() == null) {
                     answerVO.setFlag(false);
                 }
@@ -312,10 +329,13 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
 //                    .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(List::indexOf)).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(List::indexOf)).reversed()).collect(Collectors.toList())
-                    .stream()
-                    .sorted((a,b)-> Boolean.compare(b.getFlag(),a.getFlag())).collect(Collectors.toList());
+                    .sorted(Comparator.comparing(AnswerVO::getSort)).collect(Collectors.toList());
+
             vo.setAnswers(collect);
         }
         return vo;
@@ -331,6 +351,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         FsUserInformationCollectionVO vo = new FsUserInformationCollectionVO();
         FsUserInformationCollection collection = fsUserInformationCollectionMapper.selectFsUserInformationCollectionById(id);
         if (collection != null) {
+            vo.setAllergy(collection.getAllergy());
+            vo.setRemark(collection.getRemark());
             vo.setAnswers(JSON.parseArray(collection.getJsonInfo(), AnswerVO.class));
             List<AnswerVO> answers = vo.getAnswers();
             if (!CollectionUtils.isEmpty(answers)){
@@ -534,6 +556,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
             vo.setUserAdvice(collection.getUserAdvice());
             vo.setDoctorAdvice(collection.getDoctorAdvice());
             vo.setDoctor(doctorMapper.selectFsDoctorByDoctorId(collection.getDoctorId()));
+            vo.setAllergy(collection.getAllergy());
+            vo.setRemark(collection.getRemark());
         }
         return vo;
     }
@@ -829,6 +853,8 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
         fsUserInformationCollection.setUserName(param.getUserName());
         fsUserInformationCollection.setUserPhoneFour(param.getUserPhoneFour());
         fsUserInformationCollection.setSex(param.getSex());
+        fsUserInformationCollection.setAllergy(param.getAllergy());
+        fsUserInformationCollection.setRemark(param.getRemark());
         //获取医生信息
         CompanyUser companyUser = companyUserMapper.selectCompanyUserById(param.getCompanyUserId());
         if (companyUser == null) {
@@ -850,20 +876,21 @@ public class FsUserInformationCollectionServiceImpl extends ServiceImpl<FsUserIn
     }
 
     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 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}]";
-        List<AnswerVO> vo1 = null;
-        List<AnswerVO> vo2 = JSON.parseArray(str2, AnswerVO.class);
-        System.out.println(vo1);
-        System.out.println(vo2);
-        vo2.addAll(vo1);
-        Map<String, List<AnswerVO>> collect = vo2.stream()
-                .collect(Collectors.groupingBy(AnswerVO::getTitle));
-        List<AnswerVO> collect1 = vo2.stream()
-                .collect(Collectors.groupingBy(AnswerVO::getTitle))
-                .values().stream()
-                .map(group -> group.stream().reduce((a, b) -> a).orElse(null)).collect(Collectors.toList());
-        System.out.println(JSON.toJSONString(collect));
-        System.out.println(JSON.toJSONString(collect1));
+//        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}]";
+//        List<AnswerVO> vo1 = null;
+//        List<AnswerVO> vo2 = JSON.parseArray(str2, AnswerVO.class);
+//        System.out.println(vo1);
+//        System.out.println(vo2);
+//        vo2.addAll(vo1);
+//        Map<String, List<AnswerVO>> collect = vo2.stream()
+//                .collect(Collectors.groupingBy(AnswerVO::getTitle));
+//        List<AnswerVO> collect1 = vo2.stream()
+//                .collect(Collectors.groupingBy(AnswerVO::getTitle))
+//                .values().stream()
+//                .map(group -> group.stream().reduce((a, b) -> a).orElse(null)).collect(Collectors.toList());
+//        System.out.println(JSON.toJSONString(collect));
+//        System.out.println(JSON.toJSONString(collect1));
+        boolean contains = "是否有糖尿病相关疾病?".contains("糖尿病");
     }
 }

+ 5 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsUserInformationCollectionVO.java

@@ -35,4 +35,9 @@ public class FsUserInformationCollectionVO {
     //用户电话后四位
     private String userPhoneFour;
 
+    //是否过敏
+    private String allergy;
+    //备注
+    private String remark;
+
 }

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

@@ -28,13 +28,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="sex"    column="sex"    />
         <result property="userName"    column="user_name"    />
         <result property="userPhoneFour"    column="user_phone_four"    />
+        <result property="allergy"    column="allergy"    />
+        <result property="remark"    column="remark"    />
     </resultMap>
 
     <sql id="selectFsUserInformationCollectionVo">
         select id, question_id, user_id, json_info, user_confirm
              , 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_confirm_time,sex,user_name,user_phone_four from fs_user_information_collection
+             ,status,user_advice,doctor_advice,doctor_confirm_time,sex,user_name,user_phone_four
+             ,allergy,remark  from fs_user_information_collection
     </sql>
 
     <select id="selectFsUserInformationCollectionList" parameterType="FsUserInformationCollection" resultMap="FsUserInformationCollectionResult">
@@ -93,6 +96,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="userPhoneFour != null">user_phone_four,</if>
             <if test="userName != null">user_name,</if>
             <if test="sex != null">sex,</if>
+            <if test="allergy != null">allergy,</if>
+            <if test="remark != null">remark,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="questionId != null">#{questionId},</if>
@@ -117,6 +122,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sex != null">#{sex},</if>
             <if test="userName != null">#{userName},</if>
             <if test="userPhoneFour != null">#{userPhoneFour},</if>
+            <if test="allergy != null">#{allergy},</if>
+            <if test="remark != null">#{remark},</if>
          </trim>
     </insert>
 
@@ -145,6 +152,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="sex != null">sex = #{sex},</if>
             <if test="userName != null">user_name = #{userName},</if>
             <if test="userPhoneFour != null">user_phone_four = #{userPhoneFour},</if>
+            <if test="allergy != null">allergy = #{allergy},</if>
+            <if test="remark != null">remark = #{remark},</if>
         </trim>
         where id = #{id}
     </update>