Browse Source

Merge remote-tracking branch 'origin/dev/icss' into dev/icss

wangyu 6 years ago
parent
commit
8963fec2ad

+ 5 - 1
icss-service/src/main/java/com/diagbot/dto/PushKYJDTO.java

@@ -14,6 +14,10 @@ import java.util.List;
 @Getter
 @Setter
 public class PushKYJDTO {
+    private List<FeatureRate> symptom;
+    private List<FeatureRate> vitals;
     private List<FeatureRate> dis;
     private List<FeatureRate> labs;
-}
+    private List<FeatureRate> pacs;
+    private List<FeatureRate> history;
+}

+ 20 - 4
icss-service/src/main/java/com/diagbot/facade/IntroduceInfoFacade.java

@@ -52,7 +52,7 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
         }
 
-        IntroduceDTO introduceDTO = this.getRecordById(introduceMap.getIntroduceId());
+        IntroduceDTO introduceDTO = this.getRecordByIdAndPosition(introduceMap.getIntroduceId(), introduceByQuestionVO.getPosition());
         return introduceDTO;
     }
 
@@ -84,17 +84,18 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "提示信息未维护");
         }
 
-        IntroduceDTO introduceDTO = this.getRecordById(introduceMap.getIntroduceId());
+        IntroduceDTO introduceDTO = this.getRecordByIdAndPosition(introduceMap.getIntroduceId(), introduceByQuestionVO.getPosition());
         return introduceDTO;
     }
 
     /**
-     * 根据id获取提示信息
+     * 获取指定位置提示信息
      *
      * @param id
+     * @param position
      * @return
      */
-    public IntroduceDTO getRecordById(Long id) {
+    public IntroduceDTO getRecordByIdAndPosition(Long id, Integer position) {
         IntroduceDTO introduceDTO = new IntroduceDTO();
         IntroduceInfo introduceInfo = this.getById(id);
         if (introduceInfo == null) {
@@ -104,7 +105,12 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         }
         BeanUtil.copyProperties(introduceInfo, introduceDTO);
 
+
         QueryWrapper<IntroduceDetail> introduceDetailQueryWrapper = new QueryWrapper<>();
+        //展示位置
+        if (position != null) {
+            introduceDetailQueryWrapper.apply("find_in_set({0},position)", position);
+        }
         introduceDetailQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey()).
                 eq("introduce_id", introduceInfo.getId()).
                 orderByAsc("order_no");
@@ -112,4 +118,14 @@ public class IntroduceInfoFacade extends IntroduceInfoServiceImpl {
         introduceDTO.setIntroduceDetailList(introduceDetailList);
         return introduceDTO;
     }
+
+    /**
+     * 根据id获取提示信息
+     *
+     * @param id
+     * @return
+     */
+    public IntroduceDTO getRecordById(Long id) {
+        return getRecordByIdAndPosition(id, null);
+    }
 }

+ 1 - 1
icss-service/src/main/java/com/diagbot/facade/PushFacade.java

@@ -15,7 +15,6 @@ import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DeptVital;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.VitalOrder;
-import com.diagbot.enums.InputModeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.QuantitativeTypeEnum;
 import com.diagbot.enums.QuestionTypeEnum;
@@ -269,6 +268,7 @@ public class PushFacade {
         PushVO pushVO = new PushVO();
         pushVO.setAge(pushKYJVO.getAge());
         pushVO.setSex(pushKYJVO.getSex());
+        pushVO.setFeatureType(pushKYJVO.getFeatureType());
 
         //参数预处理
         /*String lis = "";

+ 3 - 1
icss-service/src/main/java/com/diagbot/vo/IntroduceByQuestionVO.java

@@ -3,6 +3,7 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 
 /**
@@ -17,5 +18,6 @@ public class IntroduceByQuestionVO {
     private String tagName;
     @NotNull(message = "请输入标签类型")
     private Integer type;
-
+    @NotNull(message = "请输入展示位置")
+    private Integer position;
 }

+ 3 - 0
icss-service/src/main/java/com/diagbot/vo/PushKYJVO.java

@@ -3,6 +3,7 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 
@@ -18,5 +19,7 @@ public class PushKYJVO {
     private Integer age;
     @NotNull(message = "请输入性别")
     private Integer sex;
+    @NotBlank(message = "请输入推送类型")
+    private String featureType;
     private List<LisResult> lisResultList;
 }

+ 3 - 1
icss-service/src/main/java/com/diagbot/vo/PushVO.java

@@ -3,6 +3,7 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.util.List;
 
@@ -18,6 +19,8 @@ public class PushVO {
     private Integer age;
     @NotNull(message = "请输入性别")
     private Integer sex;
+    @NotBlank(message = "请输入推送类型")
+    private String featureType;
     private String symptom;
     private String diag;
     private String vital;
@@ -25,6 +28,5 @@ public class PushVO {
     private String pacs;
     private String past;
     private String other;
-    private String featureType;
     private Long diseaseId;
 }

+ 5 - 3
icss-service/src/main/java/com/diagbot/web/IntroduceInfoController.java

@@ -35,7 +35,8 @@ public class IntroduceInfoController {
 
     @ApiOperation(value = "根据标签id获取提示信息[by:zhaops]",
             notes = "questionId: 标签id,必填<br>" +
-                    "type:标签类型,必填")
+                    "type:标签类型,必填" +
+                    "position:展示位置(1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示),必填")
     @PostMapping("/getByQuestionId")
     public RespDTO<IntroduceDTO> getByQuestionId(@RequestBody @Valid IntroduceByQuestionVO introduceByQuestionVO) {
         IntroduceDTO introduceDTO = introduceInfoFacade.getByQuestionId(introduceByQuestionVO);
@@ -44,7 +45,8 @@ public class IntroduceInfoController {
 
     @ApiOperation(value = "根据标签名称获取提示信息[by:zhaops]",
             notes = "tagName: 标签名称,必填<br>" +
-                    "type:标签类型,必填")
+                    "type:标签类型,必填" +
+                    "position:展示位置(1-推送展示,2-更多展示,3-一般治疗展示,4-手术治疗展示),必填")
     @PostMapping("/getByQuestionName")
     public RespDTO<IntroduceDTO> getByQuestionName(@RequestBody @Valid IntroduceByQuestionVO introduceByQuestionVO) {
         IntroduceDTO introduceDTO = introduceInfoFacade.getByQuestionName(introduceByQuestionVO);
@@ -58,4 +60,4 @@ public class IntroduceInfoController {
         IntroduceDTO introduceDTO = introduceInfoFacade.getRecordById(id);
         return RespDTO.onSuc(introduceDTO);
     }
-}
+}

+ 6 - 5
icss-service/src/main/java/com/diagbot/web/PushController.java

@@ -42,8 +42,8 @@ public class PushController {
                     "lis:化验,Array<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>"+
-                    "diseaeId:取治疗方案的诊断,Long<br>" )
+                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>" +
+                    "diseaeId:取治疗方案的诊断,Long<br>")
     @PostMapping("/pushInner")
     @SysLogger("pushInner")
     public RespDTO<PushDTO> pushInner(@RequestBody @Valid PushVO pushVO) {
@@ -59,8 +59,8 @@ public class PushController {
                     "lis:化验,Array<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
-                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>"+
-                    "diseaeId:取治疗方案的诊断,Long<br>" )
+                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>" +
+                    "diseaeId:取治疗方案的诊断,Long<br>")
     @PostMapping("/pushText")
     @SysLogger("pushText")
     public RespDTO<PushDTO> pushText(@RequestBody @Valid PushVO pushVO) {
@@ -86,7 +86,8 @@ public class PushController {
     @ApiOperation(value = "推理接口(快易检)[by:zhaops]",
             notes = "age: 年龄(必填)<br>" +
                     "sex:性别,1:男,2:女(必填)<br>" +
-                    "lisKYJVOList:化验项列表(必填)<br>")
+                    "lisKYJVOList:化验项列表(必填)<br>" +
+                    "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>")
     @PostMapping("/pushKYJ")
     @SysLogger("pushKYJ")
     public RespDTO<PushKYJDTO> pushKYJ(@RequestBody @Valid PushKYJVO pushKYJVO) {

+ 20 - 0
icssman-service/src/main/java/com/diagbot/dto/DictionaryInfoDTO.java

@@ -0,0 +1,20 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.DictionaryInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description: 
+ * @Author: ztg
+ * @Date: 2018/12/25 15:25
+ */
+@Getter
+@Setter
+public class DictionaryInfoDTO {
+    private Long groupType;
+    private String reamrk;
+    private List<DictionaryInfo> detail;
+}

+ 88 - 0
icssman-service/src/main/java/com/diagbot/entity/DictionaryInfo.java

@@ -0,0 +1,88 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * icss字典表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@TableName("icss_dictionary_info")
+@Getter
+@Setter
+public class DictionaryInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 分组(值自定义)
+     */
+    private Long groupType;
+
+    /**
+     * 内容
+     */
+    private String name;
+
+    /**
+     * 值
+     */
+    private String val;
+
+    /**
+     * 返回类型(0: 都返回,1:后台维护返回 2:icss界面返回)
+     */
+    private Integer returnType;
+
+    /**
+     * 排序号
+     */
+    private Integer orderNo;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+}

+ 35 - 0
icssman-service/src/main/java/com/diagbot/facade/DictionaryFacade.java

@@ -0,0 +1,35 @@
+package com.diagbot.facade;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.entity.DictionaryInfo;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.DictionaryInfoServiceImpl;
+import com.diagbot.util.EntityUtil;
+import org.springframework.stereotype.Component;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @Description:
+ * @Author:zhoutg
+ * @time: 2018/11/23 11:37
+ */
+@Component
+public class DictionaryFacade extends DictionaryInfoServiceImpl {
+
+    /**
+     * 返回字典信息
+     *
+     * @return
+     */
+    public Map<Long, List<DictionaryInfo>> getList() {
+        Map<Long, List<DictionaryInfo>> data = new LinkedHashMap<>();
+        List<DictionaryInfo> list = this.list(new QueryWrapper<DictionaryInfo>()
+                .in("return_type", new Long[]{0L, 1L})
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .orderByAsc("group_type", "order_no"));
+        return EntityUtil.makeEntityListMap(list, "groupType");
+    }
+}

+ 7 - 4
icssman-service/src/main/java/com/diagbot/facade/VitalOrderFacade.java

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -52,15 +53,17 @@ public class VitalOrderFacade extends VitalOrderServiceImpl {
                 set("gmt_modified", DateUtil.now());
         this.update(new VitalOrder(), vitalOrderUpdateWrapper);
         //插入新排序
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
         List<VitalOrder> vitalOrderList = Lists.newArrayList();
         for (VitalOrderVO vitalOrderVO : vitalOrderVOList) {
             VitalOrder vitalOrder = new VitalOrder();
             vitalOrder.setQuestionId(vitalOrderVO.getVitalId());
             vitalOrder.setOrderNo(vitalOrderVO.getOrderNo());
-            vitalOrder.setCreator(UserUtils.getCurrentPrincipleID());
-            vitalOrder.setGmtCreate(DateUtil.now());
-            vitalOrder.setModifier(UserUtils.getCurrentPrincipleID());
-            vitalOrder.setGmtModified(DateUtil.now());
+            vitalOrder.setCreator(userId);
+            vitalOrder.setGmtCreate(now);
+            vitalOrder.setModifier(userId);
+            vitalOrder.setGmtModified(now);
             vitalOrderList.add(vitalOrder);
         }
         vitalOrderService.saveBatch(vitalOrderList);

+ 16 - 0
icssman-service/src/main/java/com/diagbot/mapper/DictionaryInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.DictionaryInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * icss字典表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+public interface DictionaryInfoMapper extends BaseMapper<DictionaryInfo> {
+
+}

+ 16 - 0
icssman-service/src/main/java/com/diagbot/service/DictionaryInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.DictionaryInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * icss字典表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+public interface DictionaryInfoService extends IService<DictionaryInfo> {
+
+}

+ 20 - 0
icssman-service/src/main/java/com/diagbot/service/impl/DictionaryInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.DictionaryInfo;
+import com.diagbot.mapper.DictionaryInfoMapper;
+import com.diagbot.service.DictionaryInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * icss字典表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@Service
+public class DictionaryInfoServiceImpl extends ServiceImpl<DictionaryInfoMapper, DictionaryInfo> implements DictionaryInfoService {
+
+}

+ 45 - 0
icssman-service/src/main/java/com/diagbot/web/DictionaryInfoController.java

@@ -0,0 +1,45 @@
+package com.diagbot.web;
+
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.DictionaryInfo;
+import com.diagbot.facade.DictionaryFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * icss字典表 前端控制器
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2018-12-25
+ */
+@RequestMapping("/dictionaryInfo")
+@RestController
+@Api(value = "字典信息", tags = { "字典信息" })
+public class DictionaryInfoController {
+
+
+    @Autowired
+    DictionaryFacade dictionaryFacade;
+
+    @ApiOperation(value = "返回字典信息[by:zhoutg]",
+            notes = "")
+    @PostMapping("/getList")
+    @SysLogger("getList")
+    @Transactional
+    public RespDTO<Map<Long, List<DictionaryInfo>>> getList() {
+        Map<Long, List<DictionaryInfo>> data = dictionaryFacade.getList();
+        return RespDTO.onSuc(data);
+    }
+}

+ 21 - 0
icssman-service/src/main/resources/mapper/DictionaryInfoMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.DictionaryInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.DictionaryInfo">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="group_type" property="groupType" />
+        <result column="name" property="name" />
+        <result column="val" property="val" />
+        <result column="return_type" property="returnType" />
+        <result column="order_no" property="orderNo" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>