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

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

Zhaops 6 лет назад
Родитель
Сommit
216ce52294
23 измененных файлов с 771 добавлено и 197 удалено
  1. 40 0
      icss-service/src/main/java/com/diagbot/dto/LisConfigDTO.java
  2. 174 0
      icss-service/src/main/java/com/diagbot/entity/LisConfig.java
  3. 49 0
      icss-service/src/main/java/com/diagbot/enums/LisSourceEnum.java
  4. 63 0
      icss-service/src/main/java/com/diagbot/facade/LisConfigFacade.java
  5. 176 154
      icss-service/src/main/java/com/diagbot/facade/LisExcelResFacade.java
  6. 33 2
      icss-service/src/main/java/com/diagbot/facade/PushFacade.java
  7. 16 0
      icss-service/src/main/java/com/diagbot/mapper/LisConfigMapper.java
  8. 16 0
      icss-service/src/main/java/com/diagbot/service/LisConfigService.java
  9. 20 0
      icss-service/src/main/java/com/diagbot/service/impl/LisConfigServiceImpl.java
  10. 2 0
      icss-service/src/main/java/com/diagbot/vo/LisExcelWrapperVO.java
  11. 19 0
      icss-service/src/main/java/com/diagbot/vo/LisResultVO.java
  12. 1 1
      icss-service/src/main/java/com/diagbot/vo/PushVO.java
  13. 2 2
      icss-service/src/main/java/com/diagbot/web/LisExcelResController.java
  14. 29 0
      icss-service/src/main/java/com/diagbot/web/PushController.java
  15. 20 0
      icss-service/src/main/resources/mapper/LisConfigMapper.xml
  16. 0 20
      icssman-service/src/main/java/com/diagbot/dto/DictionaryInfoDTO.java
  17. 23 0
      icssman-service/src/main/java/com/diagbot/dto/ModuleInfoDTO.java
  18. 52 0
      icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java
  19. 3 17
      icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java
  20. 16 0
      icssman-service/src/main/java/com/diagbot/vo/GetModuleInfoVO.java
  21. 2 1
      icssman-service/src/main/java/com/diagbot/vo/QuestionIndexVO.java
  22. 12 0
      icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java
  23. 3 0
      icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

+ 40 - 0
icss-service/src/main/java/com/diagbot/dto/LisConfigDTO.java

@@ -0,0 +1,40 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: TODO
+ * @date 2018年12月25日 上午11:02:17
+ */
+@Setter
+@Getter
+public class LisConfigDTO {
+	 private Long id;
+	 /**
+     * 医院id
+     */
+    private String hospitalId;
+
+    /**
+     * 套餐名
+     */
+    private String mealName;
+
+    /**
+     * 项目名
+     */
+    private String itemName;
+
+    /**
+     * 公表id
+     */
+    private String uniqueId;
+
+    /**
+     * 公表明
+     */
+    private String uniqueName;
+}

+ 174 - 0
icss-service/src/main/java/com/diagbot/entity/LisConfig.java

@@ -0,0 +1,174 @@
+package com.diagbot.entity;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+/**
+ * <p>
+ * 套餐字段映射公表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-12-25
+ */
+@TableName("tran_lis_config")
+public class LisConfig 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;
+
+    /**
+     * 医院id
+     */
+    private String hospitalCode;
+
+    /**
+     * 套餐名
+     */
+    private String mealName;
+
+    /**
+     * 项目名
+     */
+    private String itemName;
+
+    /**
+     * 公表id
+     */
+    private String uniqueId;
+
+    /**
+     * 公表明
+     */
+    private String uniqueName;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+    public String getHospitalCode() {
+        return hospitalCode;
+    }
+
+    public void setHospitalCode(String hospitalCode) {
+        this.hospitalCode = hospitalCode;
+    }
+    public String getMealName() {
+        return mealName;
+    }
+
+    public void setMealName(String mealName) {
+        this.mealName = mealName;
+    }
+    public String getItemName() {
+        return itemName;
+    }
+
+    public void setItemName(String itemName) {
+        this.itemName = itemName;
+    }
+    public String getUniqueId() {
+        return uniqueId;
+    }
+
+    public void setUniqueId(String uniqueId) {
+        this.uniqueId = uniqueId;
+    }
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    @Override
+    public String toString() {
+        return "LisConfig{" +
+        "id=" + id +
+        ", isDeleted=" + isDeleted +
+        ", gmtCreate=" + gmtCreate +
+        ", gmtModified=" + gmtModified +
+        ", creator=" + creator +
+        ", modifier=" + modifier +
+        ", hospitalCode=" + hospitalCode +
+        ", mealName=" + mealName +
+        ", itemName=" + itemName +
+        ", uniqueId=" + uniqueId +
+        ", uniqueName=" + uniqueName +
+        "}";
+    }
+}

+ 49 - 0
icss-service/src/main/java/com/diagbot/enums/LisSourceEnum.java

@@ -0,0 +1,49 @@
+package com.diagbot.enums;
+
+import com.diagbot.core.KeyedNamed;
+import lombok.Setter;
+
+/**
+ * @Description:化验数据来源
+ * @Author:zhaops
+ * @time: 2018/12/26 16:37
+ */
+public enum LisSourceEnum  implements KeyedNamed {
+    Inner(0, "ICSS-内部"),
+    Outer(1, "外部");
+
+    @Setter
+    private Integer key;
+
+    @Setter
+    private String name;
+
+    LisSourceEnum(Integer key, String name) {
+        this.key = key;
+        this.name = name;
+    }
+
+    public static LisSourceEnum getEnum(Integer key) {
+        for (LisSourceEnum item : LisSourceEnum.values()) {
+            if (item.key == key) {
+                return item;
+            }
+        }
+        return null;
+    }
+
+    public static String getName(Integer key) {
+        LisSourceEnum item = getEnum(key);
+        return item != null ? item.name : null;
+    }
+
+    @Override
+    public int getKey() {
+        return key;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+}

+ 63 - 0
icss-service/src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -0,0 +1,63 @@
+package com.diagbot.facade;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.diagbot.util.EntityUtil;
+import org.springframework.stereotype.Component;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.diagbot.dto.LisConfigDTO;
+import com.diagbot.entity.LisConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.impl.LisConfigServiceImpl;
+import com.diagbot.util.BeanUtil;
+
+/**
+ * 
+ * @author wangfeng
+ * @Description: 化验公表配置
+ * @date 2018年12月25日 上午10:57:34
+ */
+@Component
+public class LisConfigFacade extends LisConfigServiceImpl {
+
+	/**
+	 * 根据医院编码查询公表映射配置
+	 *
+	 * @param hospitalCode
+	 * @return
+	 */
+	public List<LisConfigDTO> getLisConfigByhospitalId(String hospitalCode) {
+
+		QueryWrapper<LisConfig> lisConfig = new QueryWrapper<>();
+		lisConfig.eq("is_deleted", IsDeleteEnum.N.getKey()).eq("hospital_code", hospitalCode);
+		List<LisConfig> data = list(lisConfig);
+		List<LisConfigDTO> datas = BeanUtil.listCopyTo(data, LisConfigDTO.class);
+		return datas;
+	}
+
+	/**
+	 * 根据医院编码获取化验项映射关系
+	 *
+	 * @param hospitalCode
+	 * @return
+	 */
+	public Map<String, Map<String, String>> getLisConfigMapByHospitalCode(String hospitalCode) {
+		Map<String, Map<String, String>> retMap = new LinkedHashMap<>();
+		QueryWrapper<LisConfig> lisConfigQueryWrapper = new QueryWrapper<>();
+		lisConfigQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+				.eq("hospital_code", hospitalCode);
+		List<LisConfig> lisConfigList = this.list(lisConfigQueryWrapper);
+		Map<String, List<LisConfig>> lisConfigMap = EntityUtil.makeEntityListMap(lisConfigList, "mealName");
+		for (Map.Entry<String, List<LisConfig>> entry : lisConfigMap.entrySet()) {
+			if (entry.getValue().size() > 0) {
+				retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "itemName", "uniqueName"));
+			} else {
+				retMap.put(entry.getKey(), null);
+			}
+		}
+		return retMap;
+	}
+}

+ 176 - 154
icss-service/src/main/java/com/diagbot/facade/LisExcelResFacade.java

@@ -1,5 +1,6 @@
 package com.diagbot.facade;
 
+import com.diagbot.dto.LisConfigDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
@@ -15,6 +16,7 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -35,167 +37,187 @@ import java.util.stream.Collectors;
 @Component
 public class LisExcelResFacade {
 
-    public RespDTO<LitAssayVO> lisExcelAnalysis(MultipartFile file, HttpServletRequest request) {
+	@Autowired
+	LisConfigFacade lisConfigFacade;
 
-        List<String> messages = new ArrayList<>();
-        List<LisExcelWrapperVO> lisExcelWrapperList = new ArrayList<>();
-        InputStream inputStream = null;
-        Workbook wb = null;
-        try {
-            if (!file.isEmpty()) {
-                inputStream = file.getInputStream();
-                if (inputStream.available() > 512000) {
-                    messages.add("化验文件最大支持500KB!");
-                } else {
-                    String fileName = file.getOriginalFilename();
-                    if (fileName.lastIndexOf(".") != -1) {
-                        String type = fileName.substring(fileName.lastIndexOf("."));
-                        if (type.equals(".xls")) {
-                            wb = new HSSFWorkbook(inputStream);
-                        } else if (type.equals(".xlsx")) {
-                            wb = new XSSFWorkbook(inputStream);
-                        }
-                        if (wb != null) {
-                            Sheet sheet = wb.getSheetAt(0);
-                            int count = 0;
-                            String mealName, itemName, unit, value, max, min, time;
-                            for (Row row : sheet) {
-                                count++;
-                                try {
-                                    if (row != null) {
-                                        mealName = getValue(row.getCell(0)).trim().replace(" ", "");
-                                        itemName = getValue(row.getCell(1)).trim().replace(" ", "");
-                                        unit = getValue(row.getCell(2)).trim();
-                                        value = getValue(row.getCell(3)).trim();
-                                        min = getValue(row.getCell(4)).trim();
-                                        max = getValue(row.getCell(5)).trim();
-                                        time = getValue(row.getCell(6)).trim();
-                                        type = getValue(row.getCell(7)).trim();
-                                    } else {
-                                        mealName = null;
-                                        itemName = null;
-                                        unit = null;
-                                        value = null;
-                                        min = null;
-                                        max = null;
-                                        time = null;
-                                        type = null;
-                                    }
+	public RespDTO<LitAssayVO> lisExcelAnalysis(MultipartFile file, String hospitalCode, HttpServletRequest request) {
+		System.out.println("hospitalId======" + hospitalCode);
+		List<String> messages = new ArrayList<>();
+		List<LisExcelWrapperVO> lisExcelWrapperList = new ArrayList<>();
+		InputStream inputStream = null;
+		Workbook wb = null;
+		try {
+			if (!file.isEmpty()) {
+				inputStream = file.getInputStream();
+				if (inputStream.available() > 512000) {
+					messages.add("化验文件最大支持500KB!");
+				} else {
+					String fileName = file.getOriginalFilename();
+					if (fileName.lastIndexOf(".") != -1) {
+						String type = fileName.substring(fileName.lastIndexOf("."));
+						if (type.equals(".xls")) {
+							wb = new HSSFWorkbook(inputStream);
+						} else if (type.equals(".xlsx")) {
+							wb = new XSSFWorkbook(inputStream);
+						}
+						if (wb != null) {
+							Sheet sheet = wb.getSheetAt(0);
+							int count = 0;
+							String mealName, itemName, unit, value, max, min, time;
+							for (Row row : sheet) {
+								count++;
+								try {
+									if (row != null) {
+										mealName = getValue(row.getCell(0)).trim().replace(" ", "");
+										itemName = getValue(row.getCell(1)).trim().replace(" ", "");
+										unit = getValue(row.getCell(2)).trim();
+										value = getValue(row.getCell(3)).trim();
+										min = getValue(row.getCell(4)).trim();
+										max = getValue(row.getCell(5)).trim();
+										time = getValue(row.getCell(6)).trim();
+										type = getValue(row.getCell(7)).trim();
+									} else {
+										mealName = null;
+										itemName = null;
+										unit = null;
+										value = null;
+										min = null;
+										max = null;
+										time = null;
+										type = null;
+									}
 
-                                    if (StringUtil.isEmpty(mealName) && StringUtil.isEmpty(itemName)
-                                            && StringUtil.isEmpty(value) && StringUtil.isEmpty(type)) {
-                                        continue;
-                                    }
+									if (StringUtil.isEmpty(mealName) && StringUtil.isEmpty(itemName)
+											&& StringUtil.isEmpty(value) && StringUtil.isEmpty(type)) {
+										continue;
+									}
 
-                                    if (count == 1 && mealName.equals("套餐名")) {
-                                        continue;
-                                    }
+									if (count == 1 && mealName.equals("套餐名")) {
+										continue;
+									}
 
-                                    if (StringUtil.isEmpty(mealName) || StringUtil.isEmpty(itemName)
-                                            || StringUtil.isEmpty(value) || StringUtil.isEmpty(type)) {
-                                        // throw new
-                                        // CommonException(CommonErrorCode.NOT_EXISTS,
-                                        // "第"+count+"行数据不规范,套餐名、项目名、结果三项必填;");
-                                        messages.add("第" + count + "行数据不规范,套餐名、项目名、结果、是否异常四项必填;");
-                                        continue;
-                                    }
-                                    LisExcelWrapperVO lisExcelWrapper = new LisExcelWrapperVO();
+									if (StringUtil.isEmpty(mealName) || StringUtil.isEmpty(itemName)
+											|| StringUtil.isEmpty(value) || StringUtil.isEmpty(type)) {
+										messages.add("第" + count + "行数据不规范,套餐名、项目名、结果、是否异常四项必填;");
+										continue;
+									}
+									LisExcelWrapperVO lisExcelWrapper = new LisExcelWrapperVO();
 
-                                    lisExcelWrapper.setMealName(mealName);
-                                    lisExcelWrapper.setItemName(itemName);
-                                    lisExcelWrapper.setUnit(unit);
-                                    lisExcelWrapper.setValue(value);
-                                    lisExcelWrapper.setMax(max);
-                                    lisExcelWrapper.setMin(min);
-                                    lisExcelWrapper.setTime(time);
-                                    lisExcelWrapper.setType(type);
-                                    lisExcelWrapperList.add(lisExcelWrapper);
-                                } catch (Exception e) {
-                                    e.printStackTrace();
-                                    throw new CommonException(CommonErrorCode.NOT_EXISTS, e.toString());
-                                    // logger.error("",e);
-                                }
-                            }
-                        } else {
-                            // throw new
-                            // CommonException(CommonErrorCode.NOT_EXISTS,
-                            // "非excel文件无法解析!");
-                            messages.add("非excel文件无法解析!");
-                        }
-                    } else {
-                        // throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                        // "未知文件无法解析!");
-                        messages.add("未知文件无法解析!");
-                    }
-                }
-            } else {
-                // throw new CommonException(CommonErrorCode.NOT_EXISTS,
-                // "无文件上传!");
-                messages.add("无文件上传!");
-            }
-            Map<String, List<LisExcelWrapperVO>> lixExMap = lisExcelWrapperList.stream()
-                    .collect(Collectors.groupingBy(LisExcelWrapperVO::getMealName));
-            List<LisExcelResVO> LisExcelReslist = new ArrayList<LisExcelResVO>();
-            for (String str : lixExMap.keySet()) {
-                LisExcelResVO lisExcelResVO = new LisExcelResVO();
-                lisExcelResVO.setMenus(str);
-                lisExcelResVO.setLisExcelItem(lixExMap.get(str));
-                LisExcelReslist.add(lisExcelResVO);
-            }
+									lisExcelWrapper.setMealName(mealName);
+									lisExcelWrapper.setItemName(itemName);
+									// lisExcelWrapper.setUniqueName(uniqueName);
+									lisExcelWrapper.setUnit(unit);
+									lisExcelWrapper.setValue(value);
+									lisExcelWrapper.setMax(max);
+									lisExcelWrapper.setMin(min);
+									lisExcelWrapper.setTime(time);
+									lisExcelWrapper.setType(type);
+									lisExcelWrapperList.add(lisExcelWrapper);
+								} catch (Exception e) {
+									e.printStackTrace();
+									throw new CommonException(CommonErrorCode.NOT_EXISTS, e.toString());
+									// logger.error("",e);
+								}
+							}
+						} else {
+							// throw new
+							// CommonException(CommonErrorCode.NOT_EXISTS,
+							// "非excel文件无法解析!");
+							messages.add("非excel文件无法解析!");
+						}
+					} else {
+						// throw new CommonException(CommonErrorCode.NOT_EXISTS,
+						// "未知文件无法解析!");
+						messages.add("未知文件无法解析!");
+					}
+				}
+			} else {
+				// throw new CommonException(CommonErrorCode.NOT_EXISTS,
+				// "无文件上传!");
+				messages.add("无文件上传!");
+			}
+			//匹配公表名
+			List<LisConfigDTO> litData = lisConfigFacade.getLisConfigByhospitalId(hospitalCode);
+			if(litData.size()>0){
+				List<LisExcelWrapperVO> lisExcelWrapperListNew = new ArrayList<>();
+				for (LisExcelWrapperVO lisExcelWrapperNew : lisExcelWrapperList) {
+					
+					for (LisConfigDTO LisNew : litData) {
+						if (LisNew.getMealName().equals(lisExcelWrapperNew.getMealName())
+								&& LisNew.getItemName().equals(lisExcelWrapperNew.getItemName())) {
+							lisExcelWrapperNew.setUniqueName(LisNew.getUniqueName());
+						}
 
-            LitAssayVO litAssay = new LitAssayVO();
-            litAssay.setMessages(messages);
-            litAssay.setLisExcelRes(LisExcelReslist);
-            return RespDTO.onSuc(litAssay);
-        } catch (Exception e) {
-            e.printStackTrace();
-            throw new CommonException(CommonErrorCode.NOT_EXISTS, "化验excel文件解析出错!");
-            // return response.failure("化验excel文件解析出错!");
-        } finally {
-            try {
-                if (inputStream != null) {
-                    inputStream.close();
-                }
-                if (wb != null) {
-                    wb.close();
-                }
-            } catch (Exception e) {
-            }
-        }
-    }
+					}
+					lisExcelWrapperListNew.add(lisExcelWrapperNew);
+				}
+				lisExcelWrapperList = lisExcelWrapperListNew;
+			}
+			
 
-    private String getValue(Cell cell) {
-        try {
-            Object obj = null;
-            switch (cell.getCellTypeEnum()) {
-                case BOOLEAN:
-                    obj = cell.getBooleanCellValue();
-                    break;
-                case ERROR:
-                    obj = cell.getErrorCellValue();
-                    break;
-                case NUMERIC:
-                    if (HSSFDateUtil.isCellDateFormatted(cell)) {
-                        Date date = cell.getDateCellValue();
-                        obj = DateFormatUtils.format(date, "yyyy-MM-dd");
-                    } else {
-                        obj = cell.getNumericCellValue();
-                        DecimalFormat df = new DecimalFormat("0");
-                        obj = df.format(obj);
-                    }
+			Map<String, List<LisExcelWrapperVO>> lixExMap = lisExcelWrapperList.stream()
+					.collect(Collectors.groupingBy(LisExcelWrapperVO::getMealName));
+			List<LisExcelResVO> LisExcelReslist = new ArrayList<LisExcelResVO>();
+			for (String str : lixExMap.keySet()) {
+				LisExcelResVO lisExcelResVO = new LisExcelResVO();
+				lisExcelResVO.setMenus(str);
+				lisExcelResVO.setLisExcelItem(lixExMap.get(str));
+				LisExcelReslist.add(lisExcelResVO);
+			}
 
-                    // obj = cell.getNumericCellValue();
-                    break;
-                case STRING:
-                    obj = cell.getStringCellValue();
-                    break;
-                default:
-                    break;
-            }
-            return obj.toString();
-        } catch (Exception e) {
-            return "";
-        }
-    }
+			LitAssayVO litAssay = new LitAssayVO();
+			litAssay.setMessages(messages);
+			litAssay.setLisExcelRes(LisExcelReslist);
+			return RespDTO.onSuc(litAssay);
+		} catch (Exception e) {
+			e.printStackTrace();
+			throw new CommonException(CommonErrorCode.NOT_EXISTS, "化验excel文件解析出错!");
+			// return response.failure("化验excel文件解析出错!");
+		} finally {
+			try {
+				if (inputStream != null) {
+					inputStream.close();
+				}
+				if (wb != null) {
+					wb.close();
+				}
+			} catch (Exception e) {
+			}
+		}
+	}
+
+	private String getValue(Cell cell) {
+		try {
+			Object obj = null;
+			switch (cell.getCellTypeEnum()) {
+			case BOOLEAN:
+				obj = cell.getBooleanCellValue();
+				break;
+			case ERROR:
+				obj = cell.getErrorCellValue();
+				break;
+			case NUMERIC:
+				if (HSSFDateUtil.isCellDateFormatted(cell)) {
+					Date date = cell.getDateCellValue();
+					obj = DateFormatUtils.format(date, "yyyy-MM-dd");
+				} else {
+					obj = cell.getNumericCellValue();
+					DecimalFormat df = new DecimalFormat("0");
+					obj = df.format(obj);
+				}
+
+				// obj = cell.getNumericCellValue();
+				break;
+			case STRING:
+				obj = cell.getStringCellValue();
+				break;
+			default:
+				break;
+			}
+			return obj.toString();
+		} catch (Exception e) {
+			return "";
+		}
+	}
 
 }

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

@@ -13,17 +13,22 @@ import com.diagbot.dto.PushKYJDTO;
 import com.diagbot.dto.QuestionDTO;
 import com.diagbot.entity.DeptInfo;
 import com.diagbot.entity.DeptVital;
+import com.diagbot.entity.LisConfig;
 import com.diagbot.entity.QuestionInfo;
 import com.diagbot.entity.VitalOrder;
 import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.enums.LisSourceEnum;
 import com.diagbot.enums.QuantitativeTypeEnum;
 import com.diagbot.enums.QuestionTypeEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
+import com.diagbot.util.BeanUtil;
 import com.diagbot.util.EntityUtil;
 import com.diagbot.util.FastJsonUtils;
 import com.diagbot.util.StringUtil;
 import com.diagbot.vo.LisKYJVO;
+import com.diagbot.vo.LisResult;
+import com.diagbot.vo.LisResultVO;
 import com.diagbot.vo.PushKYJVO;
 import com.diagbot.vo.PushVO;
 import com.diagbot.vo.QuestionVO;
@@ -31,6 +36,7 @@ import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import javax.swing.*;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -61,6 +67,8 @@ public class PushFacade {
     private TreatmentFacade treatmentFacade;
     @Autowired
     private HighRiskServiceClient highRiskServiceClient;
+    @Autowired
+    private LisConfigFacade lisConfigFacade;
 
     /**
      * 推理接口
@@ -73,7 +81,7 @@ public class PushFacade {
         searchData.setAge(pushVO.getAge());
         searchData.setSymptom(pushVO.getSymptom());
         searchData.setVital(pushVO.getVital());
-        searchData.setLisArr(pushVO.getLis());
+
 
         searchData.setPacs(pushVO.getPacs());
         searchData.setPast(pushVO.getPast());
@@ -91,6 +99,25 @@ public class PushFacade {
                 break;
         }
 
+        //化验项映射,转公表
+        if (pushVO.getLis().size() > 0) {
+            Map<String, Map<String, String>> lisConfigMap = lisConfigFacade.getLisConfigMapByHospitalCode("A000");
+            for (LisResultVO lisResultVO : pushVO.getLis()) {
+                //source=0 icss页面数据,source=1 外部导入数据
+                if (!lisResultVO.getSource().equals(LisSourceEnum.Inner.getKey())) {
+                    continue;
+                }
+                if (StringUtil.isNotBlank(lisResultVO.getName()) && lisConfigMap.get(lisResultVO.getName()) != null) {
+                    Map<String, String> detailMap = lisConfigMap.get(lisResultVO.getName());
+                    if (StringUtil.isNotBlank(lisResultVO.getDetailName()) && StringUtil.isNotBlank(detailMap.get(lisResultVO.getDetailName()))) {
+                        lisResultVO.setUniqueName(detailMap.get(lisResultVO.getDetailName()));
+                    }
+                }
+            }
+        }
+
+        List<LisResult> lisResultList = BeanUtil.listCopyTo(pushVO.getLis(), LisResult.class);
+        searchData.setLisArr(lisResultList);
         searchData.setFeatureType(pushVO.getFeatureType());
         searchData.setSysCode("1");
         searchData.setLength(10);
@@ -281,7 +308,11 @@ public class PushFacade {
         pushVO.setLis(lis);*/
 
         //化验结果
-        pushVO.setLis(pushKYJVO.getLisResultList());
+        List<LisResultVO> lisResultVOList = BeanUtil.listCopyTo(pushKYJVO.getLisResultList(), LisResultVO.class);
+        for (LisResultVO lisResultVO : lisResultVOList) {
+            lisResultVO.setSource(LisSourceEnum.Outer.getKey());
+        }
+        pushVO.setLis(lisResultVOList);
 
         ResponseData responseData = pushAI(pushVO);
         PushKYJDTO pushKYJDTO = new PushKYJDTO();

+ 16 - 0
icss-service/src/main/java/com/diagbot/mapper/LisConfigMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.LisConfig;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 套餐字段映射公表 Mapper 接口
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-12-25
+ */
+public interface LisConfigMapper extends BaseMapper<LisConfig> {
+
+}

+ 16 - 0
icss-service/src/main/java/com/diagbot/service/LisConfigService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.LisConfig;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 套餐字段映射公表 服务类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-12-25
+ */
+public interface LisConfigService extends IService<LisConfig> {
+
+}

+ 20 - 0
icss-service/src/main/java/com/diagbot/service/impl/LisConfigServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.LisConfig;
+import com.diagbot.mapper.LisConfigMapper;
+import com.diagbot.service.LisConfigService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 套餐字段映射公表 服务实现类
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2018-12-25
+ */
+@Service
+public class LisConfigServiceImpl extends ServiceImpl<LisConfigMapper, LisConfig> implements LisConfigService {
+
+}

+ 2 - 0
icss-service/src/main/java/com/diagbot/vo/LisExcelWrapperVO.java

@@ -12,6 +12,8 @@ public class LisExcelWrapperVO {
 	
 	private String itemName;
 	
+	private String uniqueName;
+	
 	private String unit;
 	
 	private String value;

+ 19 - 0
icss-service/src/main/java/com/diagbot/vo/LisResultVO.java

@@ -0,0 +1,19 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2018/12/26 16:29
+ */
+@Getter
+@Setter
+public class LisResultVO extends LisResult {
+    //数据来源
+    @NotNull(message = "请输入数据来源")
+    private Integer source;
+}

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

@@ -24,7 +24,7 @@ public class PushVO {
     private String symptom;
     private String diag;
     private String vital;
-    private List<LisResult> lis;
+    private List<LisResultVO> lis;
     private String pacs;
     private String past;
     private String other;

+ 2 - 2
icss-service/src/main/java/com/diagbot/web/LisExcelResController.java

@@ -30,8 +30,8 @@ public class LisExcelResController {
 
     @ApiOperation(value = "导入化验数据:[by:wangfeng]", notes = "导入化验数据")
     @PostMapping("/lisExcelAnalysis")
-    public RespDTO<LitAssayVO> lisExcelAnalysis(@RequestParam("uploadfile") MultipartFile file,
+    public RespDTO<LitAssayVO> lisExcelAnalysis(@RequestParam("uploadfile") MultipartFile file,String hospitalCode,
                                                 HttpServletRequest request) {
-        return lisExcelResFacade.lisExcelAnalysis(file, request);
+        return lisExcelResFacade.lisExcelAnalysis(file,hospitalCode, request);
     }
 }

+ 29 - 0
icss-service/src/main/java/com/diagbot/web/PushController.java

@@ -40,6 +40,15 @@ public class PushController {
                     "other:其它史,String<br>" +
                     "vital:查体,String<br>" +
                     "lis:化验,Array<br>" +
+                    "lis:name:套餐名称(必填),String<br>" +
+                    "lis:detailName:化验项名称(必填),String<br>" +
+                    "lis:uniqueName:公表名称,String<br>" +
+                    "lis:value:值,Double<br>" +
+                    "lis:maxValue:最大值,Double<br>" +
+                    "lis:minValue:最小值,Double<br>" +
+                    "lis:units:单位,String<br>" +
+                    "lis:otherValue:其他结果,包括阴性阳性,文字描述等,String<br>" +
+                    "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
                     "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>" +
@@ -57,6 +66,16 @@ public class PushController {
                     "other:其它史,String<br>" +
                     "vital:查体,String<br>" +
                     "lis:化验,Array<br>" +
+                    "lis:化验,Array<br>" +
+                    "lis:name:套餐名称(必填),String<br>" +
+                    "lis:detailName:化验项名称(必填),String<br>" +
+                    "lis:uniqueName:公表名称,String<br>" +
+                    "lis:value:值,Double<br>" +
+                    "lis:maxValue:最大值,Double<br>" +
+                    "lis:minValue:最小值,Double<br>" +
+                    "lis:units:单位,String<br>" +
+                    "lis:otherValue:其他结果,包括阴性阳性,文字描述等,String<br>" +
+                    "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "diag:诊断,String<br>" +
                     "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填),String<br>" +
@@ -74,6 +93,16 @@ public class PushController {
                     "other:其它史,String<br>" +
                     "vital:查体<br>" +
                     "lis:化验,Array<br>" +
+                    "lis:化验,Array<br>" +
+                    "lis:name:套餐名称(必填),String<br>" +
+                    "lis:detailName:化验项名称(必填),String<br>" +
+                    "lis:uniqueName:公表名称,String<br>" +
+                    "lis:value:值,Double<br>" +
+                    "lis:maxValue:最大值,Double<br>" +
+                    "lis:minValue:最小值,Double<br>" +
+                    "lis:units:单位,String<br>" +
+                    "lis:otherValue:其他结果,包括阴性阳性,文字描述等,String<br>" +
+                    "lis:source:数据来源(必填),Integer<br>" +
                     "pacs:辅检,String<br>" +
                     "dis:诊断<br>" +
                     "featureType:类型,1:症状,3:其他史,4:查体,5:化验,6:辅检,7:诊断,8:治疗方案(必填)<br>")

+ 20 - 0
icss-service/src/main/resources/mapper/LisConfigMapper.xml

@@ -0,0 +1,20 @@
+<?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.LisConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.LisConfig">
+        <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="hospital_code" property="hospitalCode" />
+        <result column="meal_name" property="mealName" />
+        <result column="item_name" property="itemName" />
+        <result column="unique_id" property="uniqueId" />
+        <result column="unique_name" property="uniqueName" />
+    </resultMap>
+
+</mapper>

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

@@ -1,20 +0,0 @@
-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;
-}

+ 23 - 0
icssman-service/src/main/java/com/diagbot/dto/ModuleInfoDTO.java

@@ -0,0 +1,23 @@
+package com.diagbot.dto;
+
+import com.diagbot.entity.ModuleDetail;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/12/26 15:44
+ */
+@Getter
+@Setter
+public class ModuleInfoDTO {
+    //模板id
+    private Long id;
+    //模板名称
+    private String name;
+    //模板明细
+    private List<ModuleDetail> moduleDetails;
+}

+ 52 - 0
icssman-service/src/main/java/com/diagbot/facade/ModuleInfoFacade.java

@@ -3,6 +3,8 @@ package com.diagbot.facade;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.diagbot.dto.GetQuestionInfoDTO;
+import com.diagbot.dto.ModuleInfoDTO;
+import com.diagbot.entity.ModuleDetail;
 import com.diagbot.entity.ModuleInfo;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
@@ -13,11 +15,13 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.AddModuleInfoVO;
+import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
@@ -121,4 +125,52 @@ public class ModuleInfoFacade extends ModuleInfoServiceImpl {
         List<GetQuestionInfoDTO> getQuestionInfoDTOS = questionInfoFacade.moduleGetQuestiongInfoByName(moduleGetQuestionInfoVO);
         return getQuestionInfoDTOS;
     }
+
+    /**
+     * 获取子模板
+     *
+     * @param getModuleInfoVO
+     * @return
+     */
+    public List<ModuleInfoDTO> getModuleInfo(GetModuleInfoVO getModuleInfoVO){
+        //获取模板信息
+        QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
+        moduleInfoQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey());
+        if(getModuleInfoVO.getType() != null){
+            moduleInfoQueryWrapper.eq("type",getModuleInfoVO.getType());
+        }
+        List<ModuleInfo> moduleInfoList = this.list(moduleInfoQueryWrapper);
+        List<Long> moduleIdList = new ArrayList<>();
+        for (ModuleInfo moduleInfo:moduleInfoList) {
+            moduleIdList.add(moduleInfo.getId());
+        }
+        //获取模板明细信息
+        QueryWrapper<ModuleDetail> moduleDetailQueryWrapper = new QueryWrapper<>();
+        moduleDetailQueryWrapper.eq("is_deleted",IsDeleteEnum.N.getKey())
+            .in("module_id",moduleIdList);
+        List<ModuleDetail> moduleDetailList = moduleDetailFacade.list(moduleDetailQueryWrapper);
+        //将模板明细根据模板id放入map
+        Map<Long,List<ModuleDetail>> moduleDetailMap = new HashMap<>();
+        List<ModuleDetail> allModuleDetials = null;
+        for (ModuleInfo moduleInfo:moduleInfoList) {
+            allModuleDetials = new ArrayList<>();
+            for (ModuleDetail moduleDetail:moduleDetailList) {
+               if(moduleInfo.getId().longValue() == moduleDetail.getModuleId().longValue()){
+                   allModuleDetials.add(moduleDetail);
+               }
+            }
+            moduleDetailMap.put(moduleInfo.getId(),allModuleDetials);
+        }
+        //给ModuleInfoDTO设值
+        List<ModuleInfoDTO> moduleInfoDTOList = new ArrayList<>();
+        ModuleInfoDTO moduleInfoDTO = null;
+            for (ModuleInfo moduleInfo:moduleInfoList) {
+                moduleInfoDTO = new ModuleInfoDTO();
+                moduleInfoDTO.setId(moduleInfo.getId());
+                moduleInfoDTO.setName(moduleInfo.getName());
+                moduleInfoDTO.setModuleDetails(moduleDetailMap.get(moduleInfoDTO.getId()));
+                moduleInfoDTOList.add(moduleInfoDTO);
+            }
+        return moduleInfoDTOList;
+    }
 }

+ 3 - 17
icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java

@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
 
 /**
  * @Description:
- * @Author:zhaops
+ * @Author:zhoutg
  * @time: 2018/11/23 11:37
  */
 @Component
@@ -342,7 +342,7 @@ public class QuestionInfoFacade extends QuestionInfoServiceImpl {
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("type", questionInfo.getType())
                 .ne("id", questionInfo.getId() == null ? -1 : questionInfo.getId()));
-        if (questionInfoList.size() > 0) { //标签type、tagName唯一
+        if (ListUtil.isNotEmpty(questionInfoList)) { //标签type、tagName唯一
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "标签名称已重复,无法建立");
         }
         if ("save".equals(param.getSaveOrUpdate())) {
@@ -451,6 +451,7 @@ public class QuestionInfoFacade extends QuestionInfoServiceImpl {
         paramMap.put("type", questionIndexVO.getType());
         paramMap.put("controlType", questionIndexVO.getControlType());
         paramMap.put("notIds", questionIndexVO.getNotIds());
+        paramMap.put("tagType", questionIndexVO.getTagType());
         return this.index(paramMap);
     }
 
@@ -471,21 +472,6 @@ public class QuestionInfoFacade extends QuestionInfoServiceImpl {
     }
 
 
-    /**
-     * 根据标签名获取标签信息
-     *
-     * @param questionInfo
-     * @return
-     */
-    public QuestionInfo getQuestionInfos(QuestionInfo questionInfo) {
-        QueryWrapper<QuestionInfo> queryWrapper = new QueryWrapper<QuestionInfo>();
-        queryWrapper.eq("is_deleted", "N");
-        queryWrapper.eq("type", 1);
-        queryWrapper.eq("name", questionInfo.getName());
-        return this.getOne(queryWrapper);
-    }
-
-
     /**
      * 根据标签名获取标签信息
      *

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

@@ -0,0 +1,16 @@
+package com.diagbot.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @author: wangyu
+ * @time: 2018/12/26 15:27
+ */
+@Getter
+@Setter
+public class GetModuleInfoVO {
+    //模板类型
+    private Integer type;
+}

+ 2 - 1
icssman-service/src/main/java/com/diagbot/vo/QuestionIndexVO.java

@@ -7,7 +7,7 @@ import java.util.List;
 
 /**
  * @Description:
- * @Author:zhaops
+ * @Author:zhoutg
  * @time: 2018/11/29 15:09
  */
 @Getter
@@ -18,5 +18,6 @@ public class QuestionIndexVO {
     private Integer age;
     private Integer type;
     private Integer controlType;
+    private String tagType;
     private List<Long> notIds;
 }

+ 12 - 0
icssman-service/src/main/java/com/diagbot/web/ModuleInfoController.java

@@ -3,9 +3,11 @@ package com.diagbot.web;
 
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.GetQuestionInfoDTO;
+import com.diagbot.dto.ModuleInfoDTO;
 import com.diagbot.dto.RespDTO;
 import com.diagbot.facade.ModuleInfoFacade;
 import com.diagbot.vo.AddModuleInfoVO;
+import com.diagbot.vo.GetModuleInfoVO;
 import com.diagbot.vo.ModuleGetQuestionInfoVO;
 import com.diagbot.vo.UpdateModuleInfoVO;
 import io.swagger.annotations.Api;
@@ -84,4 +86,14 @@ public class ModuleInfoController {
         List<GetQuestionInfoDTO> date = moduleInfoFacade.getQuestionInfos(moduleGetQuestionInfoVO);
         return RespDTO.onSuc(date);
     }
+
+    @ApiOperation(value = "获取子模板信息[by:wangyu]",
+            notes = "type: 模板类型,1:主诉模板 2:现病史模板 3:现病史空模板 4 : 其他史模板 5:嵌套模板 6:慢病模板<br>" +
+                    "<br>")
+    @PostMapping("/getModuleInfo")
+    @SysLogger("getModuleInfo")
+    public RespDTO<List<ModuleInfoDTO>> getModuleInfo(@Valid @RequestBody GetModuleInfoVO getModuleInfoVO) {
+        List<ModuleInfoDTO> date = moduleInfoFacade.getModuleInfo(getModuleInfoVO);
+        return RespDTO.onSuc(date);
+    }
 }

+ 3 - 0
icssman-service/src/main/resources/mapper/QuestionInfoMapper.xml

@@ -63,6 +63,9 @@
         <if test="controlType != null and controlType != ''">
             and control_type = #{controlType}
         </if>
+        <if test="tagType != null and tagType != ''">
+            and tag_type = #{tagType}
+        </if>
         <if test="notIds != null and notIds.size() > 0 ">
             and id not in
             <foreach  collection="notIds" item="id" open="("  separator=","  close=")">