Commit 774a99120eaf9c7695597a1077e19a4cc3f6ad21

Authored by zhangchao
1 parent e7bdff9804
Exists in luanping

#fix:增加威县his工作站一键跳转相关接口逻辑

Showing 13 changed files with 726 additions and 49 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/AppointmentMapper.java View file @ 774a991
  1 +package com.lyms.platform.permission.dao.master;
  2 +
  3 +import com.lyms.platform.permission.model.AppointmentQuery;
  4 +import com.lyms.platform.pojo.AppointmentModel;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface AppointmentMapper {
  9 + List<AppointmentModel> queryAppointment(AppointmentQuery appointmentQuery);
  10 + int queryAppointmentCount(AppointmentQuery appointmentQuery);
  11 +}
platform-biz-service/src/main/java/com/lyms/platform/permission/model/AppointmentQuery.java View file @ 774a991
  1 +package com.lyms.platform.permission.model;
  2 +
  3 +import com.lyms.platform.common.dao.BaseQuery;
  4 +
  5 +public class AppointmentQuery extends BaseQuery {
  6 + private String doctor;
  7 + private String startTime;
  8 + private String endTime;
  9 + private String name;
  10 + private String dept;
  11 + private String idCard;
  12 + private String deptName;
  13 +
  14 + public String getIdCard() {
  15 + return idCard;
  16 + }
  17 +
  18 + public void setIdCard(String idCard) {
  19 + this.idCard = idCard;
  20 + }
  21 +
  22 + public String getDoctor() {
  23 + return doctor;
  24 + }
  25 +
  26 + public void setDoctor(String doctor) {
  27 + this.doctor = doctor;
  28 + }
  29 +
  30 + public String getStartTime() {
  31 + return startTime;
  32 + }
  33 +
  34 + public void setStartTime(String startTime) {
  35 + this.startTime = startTime;
  36 + }
  37 +
  38 + public String getEndTime() {
  39 + return endTime;
  40 + }
  41 +
  42 + public void setEndTime(String endTime) {
  43 + this.endTime = endTime;
  44 + }
  45 +
  46 + public String getName() {
  47 + return name;
  48 + }
  49 +
  50 + public void setName(String name) {
  51 + this.name = name;
  52 + }
  53 +
  54 + public String getDept() {
  55 + return dept;
  56 + }
  57 +
  58 + public void setDept(String dept) {
  59 + this.dept = dept;
  60 + }
  61 +
  62 + public String getDeptName() {
  63 + return deptName;
  64 + }
  65 +
  66 + public void setDeptName(String deptName) {
  67 + this.deptName = deptName;
  68 + }
  69 +}
platform-biz-service/src/main/java/com/lyms/platform/permission/service/AppointmentService.java View file @ 774a991
  1 +package com.lyms.platform.permission.service;
  2 +
  3 +import com.lyms.platform.permission.model.AppointmentQuery;
  4 +import com.lyms.platform.pojo.AppointmentModel;
  5 +
  6 +import java.util.List;
  7 +
  8 +public interface AppointmentService {
  9 + List<AppointmentModel> queryAppointment(AppointmentQuery appointmentQuery);
  10 + int queryAppointmentCount(AppointmentQuery appointmentQuery);
  11 +}
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/AppointmentServiceImpl.java View file @ 774a991
  1 +package com.lyms.platform.permission.service.impl;
  2 +
  3 +import com.lyms.platform.common.utils.StringUtils;
  4 +import com.lyms.platform.permission.dao.master.AppointmentMapper;
  5 +import com.lyms.platform.permission.model.AppointmentQuery;
  6 +import com.lyms.platform.permission.service.AppointmentService;
  7 +import com.lyms.platform.pojo.AppointmentModel;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Service;
  10 +
  11 +import java.util.List;
  12 +
  13 +@Service("appointmentService")
  14 +public class AppointmentServiceImpl implements AppointmentService {
  15 + @Autowired
  16 + private AppointmentMapper appointmentMapper;
  17 +
  18 + @Override
  19 + public List<AppointmentModel> queryAppointment(AppointmentQuery appointmentQuery) {
  20 + if (StringUtils.isNotEmpty(appointmentQuery.getNeed())){
  21 + appointmentQuery.mysqlBuild( appointmentMapper.queryAppointmentCount(appointmentQuery));
  22 + }
  23 + return appointmentMapper.queryAppointment(appointmentQuery);
  24 + }
  25 +
  26 + @Override
  27 + public int queryAppointmentCount(AppointmentQuery appointmentQuery) {
  28 + return appointmentMapper.queryAppointmentCount(appointmentQuery);
  29 + }
  30 +}
platform-biz-service/src/main/resources/mainOrm/master/AppointmentMapper.xml View file @ 774a991
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  3 +<mapper namespace="com.lyms.platform.permission.dao.master.AppointmentMapper">
  4 +
  5 + <resultMap id="BaseResultMap" type="com.lyms.platform.pojo.AppointmentModel">
  6 + <id property="id" column="id" jdbcType="INTEGER"/>
  7 + <result property="vccardNo" column="vccardNo" jdbcType="VARCHAR"/>
  8 + <result property="name" column="name" jdbcType="VARCHAR"/>
  9 + <result property="sex" column="sex" jdbcType="VARCHAR"/>
  10 + <result property="age" column="age" jdbcType="VARCHAR"/>
  11 + <result property="phone" column="phone" jdbcType="VARCHAR"/>
  12 + <result property="idCard" column="idCard" jdbcType="VARCHAR"/>
  13 + <result property="dept" column="dept" jdbcType="VARCHAR"/>
  14 + <result property="bhNum" column="bhNum" jdbcType="VARCHAR"/>
  15 + <result property="doctor" column="doctor" jdbcType="VARCHAR"/>
  16 + <result property="pinyin" column="pinyin" jdbcType="VARCHAR"/>
  17 + <result property="created" column="created" jdbcType="TIMESTAMP"/>
  18 + <result property="checkTime" column="checkTime" jdbcType="TIMESTAMP"/>
  19 + </resultMap>
  20 + <sql id="orderAndLimit">
  21 + <if test="need != null">
  22 + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER}
  23 + </if>
  24 + </sql>
  25 +
  26 + <select id="queryAppointment" resultMap="BaseResultMap" parameterType="com.lyms.platform.permission.model.AppointmentQuery">
  27 + select * from appointment
  28 + where
  29 + 1=1
  30 + <if test="doctor!=null">
  31 + and doctor=#{doctor}
  32 + </if>
  33 + <if test="idCard!=null">
  34 + and idCard=#{idCard}
  35 + </if>
  36 + <if test="name!=null">
  37 + and (name like concat('%',#{name},'%') or pinyin like concat('%',#{name},'%'))
  38 + </if>
  39 + <if test="dept!=null">
  40 + and (dept like concat(#{dept},'%') or (dept like concat("产后",'%') and dept !='产后服务部'))
  41 + </if>
  42 + <if test="deptName!=null">
  43 + and dept =#{deptName}
  44 + </if>
  45 + and <![CDATA[checkTime>=#{startTime}]]>
  46 + and <![CDATA[checkTime<=#{endTime}]]>
  47 + <include refid="orderAndLimit"/>
  48 + </select>
  49 +
  50 + <select id="queryAppointmentCount" resultType="int" parameterType="com.lyms.platform.permission.model.AppointmentQuery">
  51 + select count(id) from appointment
  52 + where
  53 + 1=1
  54 + <if test="doctor!=null">
  55 + and doctor=#{doctor}
  56 + </if>
  57 + <if test="idCard!=null">
  58 + and idCard=#{idCard}
  59 + </if>
  60 + <if test="name!=null">
  61 + and (name like concat('%',#{name},'%') or pinyin like concat('%',#{name},'%'))
  62 + </if>
  63 + <if test="dept!=null">
  64 + and (dept like concat(#{dept},'%') or (dept like concat("产后",'%') and dept !='产后服务部'))
  65 + </if>
  66 + and <![CDATA[checkTime>=#{startTime}]]>
  67 + and <![CDATA[checkTime<=#{endTime}]]>
  68 + </select>
  69 +</mapper>
platform-common/src/main/java/com/lyms/platform/common/utils/ExcelUtil.java View file @ 774a991
1 1 package com.lyms.platform.common.utils;
2 2  
3 3 import java.io.*;
  4 +import java.math.BigDecimal;
4 5 import java.util.*;
5 6  
6 7  
... ... @@ -13,6 +14,7 @@
13 14 import jxl.write.*;
14 15 import jxl.write.Number;
15 16 import jxl.write.biff.RowsExceededException;
  17 +import org.apache.commons.collections.CollectionUtils;
16 18  
17 19 /**
18 20 * Excel 工具类
... ... @@ -150,6 +152,110 @@
150 152 }
151 153  
152 154  
  155 + wwb.write();
  156 + wwb.close();
  157 + } catch (IOException e) {
  158 + e.printStackTrace();
  159 + } catch (RowsExceededException e) {
  160 + e.printStackTrace();
  161 + } catch (WriteException e) {
  162 + e.printStackTrace();
  163 + }
  164 + return out;
  165 + }
  166 +
  167 + /**
  168 + * 合并单元格导出
  169 + * @param out
  170 + * @param data
  171 + * @param columName
  172 + * @return
  173 + */
  174 + public static OutputStream toExcelRegion(OutputStream out,Map<String,Map<String,Object>> params ,Map<String,List<Map<String,Object>>> data, Map<String, String> columName) {
  175 + WritableWorkbook wwb;
  176 + try {
  177 + wwb = Workbook.createWorkbook(out);
  178 + // 创建一个新的工作表
  179 + WritableSheet ws = wwb.createSheet("sheet", 0); // 创建一个工作表
  180 + /**
  181 + * 设置单元格样式
  182 + */
  183 + WritableFont wf = new WritableFont(WritableFont.ARIAL, 12, WritableFont.BOLD, false, UnderlineStyle.NO_UNDERLINE, Colour.BLACK);
  184 +
  185 + WritableCellFormat wcf = new WritableCellFormat(wf);
  186 + ws.setRowView(0, 300); // 设置指定行高
  187 + // 设置列宽
  188 + Iterator<String> ite = columName.keySet().iterator();
  189 + int i = 0;
  190 + while (ite.hasNext()) {
  191 + ws.setColumnView(i, 15);
  192 + String keyName = ite.next();
  193 + keyName = columName.get(keyName);
  194 + ws.addCell(new Label(i, 0, keyName, wcf));
  195 + i++;
  196 + }
  197 + //int j = 1;
  198 + int s=0;
  199 + for (Map.Entry<String,Map<String,Object>> entry:params.entrySet()) {
  200 + // 填充数据的内容
  201 + Map<String, Object> map= entry.getValue();
  202 + List<Map<String,Object>> dataList= data.get(entry.getKey());
  203 + /* if (j==1){
  204 + ws.addCell(new Label(0, j, String.valueOf(map.get("dept"))));
  205 + ws.addCell(new Label(1, j, String.valueOf(map.get("appointmentSumNum"))));
  206 + ws.addCell(new Label(2, j, String.valueOf(map.get("buildSumNum"))));
  207 + ws.addCell(new Label(3, j, String.valueOf(map.get("newBuildSumNum"))));
  208 + ws.addCell(new Label(4, j, String.valueOf(map.get("unBuildSumNum"))));
  209 + }else {*/
  210 + ////新建/(总-已建档+新建档)
  211 + ws.addCell(new Label(0, s+1, String.valueOf(map.get("dept"))));
  212 + ws.addCell(new Label(1, s+1, String.valueOf(map.get("appointmentSumNum"))));
  213 + ws.addCell(new Label(2, s+1, String.valueOf(map.get("buildSumNum"))));
  214 + ws.addCell(new Label(3, s+1, String.valueOf(map.get("newBuildSumNum"))));
  215 + ws.addCell(new Label(4, s+1, String.valueOf(map.get("unBuildSumNum"))));
  216 + if("0".equals(String.valueOf(map.get("appointmentSumNum")))){
  217 + ws.addCell(new Label(5, s+1,"0.00%"));
  218 + }else {
  219 + ws.addCell(new Label(5, s+1, new BigDecimal(String.valueOf(map.get("buildSumNum"))).multiply(new BigDecimal("100")).divide(new BigDecimal(String.valueOf(map.get("appointmentSumNum"))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%"));
  220 +
  221 + }
  222 + if ("0".equals(String.valueOf(map.get("buildSumNum")))){
  223 + ws.addCell(new Label(6, s+1,"0.00%"));
  224 + }else {
  225 + ws.addCell(new Label(6, s+1,new BigDecimal(String.valueOf(map.get("newBuildSumNum"))).multiply(new BigDecimal("100")).divide((new BigDecimal(String.valueOf(map.get("buildSumNum")))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%"));
  226 + }
  227 +
  228 +
  229 + if (CollectionUtils.isNotEmpty(dataList)){
  230 + for (int t = 0, len = dataList.size(); t < len; t++){
  231 + map=dataList.get(t);
  232 + ws.addCell(new Label(7, s+1+t, String.valueOf(map.get("doctor"))));
  233 + ws.addCell(new Label(8, s+1+t, String.valueOf(map.get("appointmentNum")!=null?map.get("appointmentNum"):0)));
  234 + ws.addCell(new Label(9, s+1+t, String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0)));
  235 + ws.addCell(new Label(10, s+1+t, String.valueOf(map.get("newBuildNum")!=null?map.get("newBuildNum"):0)));
  236 + ws.addCell(new Label(11, s+1+t, String.valueOf(map.get("unBuildNum")!=null?map.get("unBuildNum"):0)));
  237 + if (map.get("appointmentNum")==null){
  238 + ws.addCell(new Label(12, s+1+t,"0.00%"));
  239 + }else {
  240 + ws.addCell(new Label(12, s+1+t, new BigDecimal(String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0)).multiply(new BigDecimal("100")).divide(new BigDecimal(String.valueOf(map.get("appointmentNum")!=null?map.get("appointmentNum"):0)),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%"));
  241 + }
  242 + if (map.get("buildNum")==null){
  243 + ws.addCell(new Label(13, s+1+t,"0.00%"));
  244 + }else {
  245 + ws.addCell(new Label(13, s+1+t,new BigDecimal(String.valueOf(map.get("newBuildNum")!=null?map.get("newBuildNum"):0)).multiply(new BigDecimal("100")).divide((new BigDecimal(String.valueOf(map.get("buildNum")!=null?map.get("buildNum"):0))),2,BigDecimal.ROUND_HALF_UP).toPlainString()+"%"));
  246 + }
  247 + }
  248 +
  249 + ws.mergeCells(0, s+1, 0, s+dataList.size());
  250 + ws.mergeCells(1, s+1, 1, s+dataList.size());
  251 + ws.mergeCells(2, s+1, 2, s+dataList.size());
  252 + ws.mergeCells(3, s+1, 3, s+dataList.size());
  253 + ws.mergeCells(4, s+1, 4, s+dataList.size());
  254 + ws.mergeCells(5, s+1, 5, s+dataList.size());
  255 + ws.mergeCells(6, s+1, 6, s+dataList.size());
  256 + s+=dataList.size();
  257 + }
  258 + }
153 259 wwb.write();
154 260 wwb.close();
155 261 } catch (IOException e) {
platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentData.java View file @ 774a991
  1 +package com.lyms.platform.pojo;
  2 +
  3 +public class AppointmentData {
  4 + private static final long serialVersionUID = 1L;
  5 + private String doctor;
  6 + private String dept;
  7 + //预约人数
  8 + private Integer appointmentNum;
  9 + //已经建立档案人数
  10 + private Integer buildNum;
  11 + //未建档人数
  12 + private Integer unBuildNum;
  13 + //新建档人数(当天建档人数)
  14 + private Integer newBuildNum;
  15 +
  16 + public String getDept() {
  17 + return dept;
  18 + }
  19 +
  20 + public void setDept(String dept) {
  21 + this.dept = dept;
  22 + }
  23 +
  24 + public Integer getUnBuildNum() {
  25 + return unBuildNum!=null?unBuildNum:0;
  26 + }
  27 +
  28 + public void setUnBuildNum(Integer unBuildNum) {
  29 + this.unBuildNum = unBuildNum;
  30 + }
  31 +
  32 + public String getDoctor() {
  33 + return doctor;
  34 + }
  35 +
  36 + public void setDoctor(String doctor) {
  37 + this.doctor = doctor;
  38 + }
  39 +
  40 + public Integer getAppointmentNum() {
  41 + return appointmentNum!=null?appointmentNum:0;
  42 + }
  43 +
  44 + public void setAppointmentNum(Integer appointmentNum) {
  45 + this.appointmentNum = appointmentNum;
  46 + }
  47 +
  48 + public Integer getBuildNum() {
  49 + return buildNum!=null?buildNum:0;
  50 + }
  51 +
  52 + public void setBuildNum(Integer buildNum) {
  53 + this.buildNum = buildNum;
  54 + }
  55 +
  56 + public Integer getNewBuildNum() {
  57 + return newBuildNum!=null?newBuildNum:0;
  58 + }
  59 +
  60 + public void setNewBuildNum(Integer newBuildNum) {
  61 + this.newBuildNum = newBuildNum;
  62 + }
  63 +
  64 +}
platform-dal/src/main/java/com/lyms/platform/pojo/AppointmentModel.java View file @ 774a991
  1 +package com.lyms.platform.pojo;
  2 +
  3 +
  4 +
  5 +import org.springframework.data.annotation.Transient;
  6 +
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +import java.util.Map;
  10 +
  11 +public class AppointmentModel {
  12 + private static final long serialVersionUID = 1L;
  13 + private Integer id;
  14 + private String bhNum;
  15 + private String vccardNo;
  16 + private String name;
  17 + private String phone;
  18 + private String age;
  19 + private String idCard;
  20 + private String sex;
  21 + private Date checkTime;
  22 + private String doctor;
  23 + private String dept;
  24 + //是否建档 1为是 0为否
  25 + @Transient
  26 + private Integer isBuild;
  27 + @Transient
  28 + private Date serEndTime;
  29 + @Transient
  30 + private Date serStartTime;
  31 + //服务是否到期 1为是 0为否
  32 + @Transient
  33 + private Integer expire;
  34 + @Transient
  35 + private Date bookbuildingDate;//建档时间
  36 + private String pinyin;
  37 + private Date created;
  38 + @Transient
  39 + private List<Map> rlevel;//高危风险颜色
  40 + @Transient
  41 + private Integer appointmentNum;//未建档用户就诊次数
  42 +
  43 + public Date getSerStartTime() {
  44 + return serStartTime;
  45 + }
  46 +
  47 + public void setSerStartTime(Date serStartTime) {
  48 + this.serStartTime = serStartTime;
  49 + }
  50 +
  51 + public Date getBookbuildingDate() {
  52 + return bookbuildingDate;
  53 + }
  54 +
  55 + public void setBookbuildingDate(Date bookbuildingDate) {
  56 + this.bookbuildingDate = bookbuildingDate;
  57 + }
  58 +
  59 + public Integer getAppointmentNum() {
  60 + return appointmentNum;
  61 + }
  62 +
  63 + public void setAppointmentNum(Integer appointmentNum) {
  64 + this.appointmentNum = appointmentNum;
  65 + }
  66 +
  67 + public List<Map> getrlevel() {
  68 + return rlevel;
  69 + }
  70 +
  71 + public void setrlevel(List<Map> rlevel) {
  72 + this.rlevel = rlevel;
  73 + }
  74 +
  75 + public Integer getExpire() {
  76 + return expire;
  77 + }
  78 +
  79 + public void setExpire(Integer expire) {
  80 + this.expire = expire;
  81 + }
  82 +
  83 + public String getPinyin() {
  84 + return pinyin;
  85 + }
  86 +
  87 + public void setPinyin(String pinyin) {
  88 + this.pinyin = pinyin;
  89 + }
  90 +
  91 + public Integer getId() {
  92 + return id;
  93 + }
  94 +
  95 + public void setId(Integer id) {
  96 + this.id = id;
  97 + }
  98 +
  99 + public String getBhNum() {
  100 + return bhNum;
  101 + }
  102 +
  103 + public void setBhNum(String bhNum) {
  104 + this.bhNum = bhNum;
  105 + }
  106 +
  107 + public String getVccardNo() {
  108 + return vccardNo;
  109 + }
  110 +
  111 + public void setVccardNo(String vccardNo) {
  112 + this.vccardNo = vccardNo;
  113 + }
  114 +
  115 + public String getName() {
  116 + return name;
  117 + }
  118 +
  119 + public void setName(String name) {
  120 + this.name = name;
  121 + }
  122 +
  123 + public String getPhone() {
  124 + return phone;
  125 + }
  126 +
  127 + public void setPhone(String phone) {
  128 + this.phone = phone;
  129 + }
  130 +
  131 + public String getAge() {
  132 + return age;
  133 + }
  134 +
  135 + public void setAge(String age) {
  136 + this.age = age;
  137 + }
  138 +
  139 + public String getIdCard() {
  140 + return idCard;
  141 + }
  142 +
  143 + public void setIdCard(String idCard) {
  144 + this.idCard = idCard;
  145 + }
  146 +
  147 + public String getSex() {
  148 + return sex;
  149 + }
  150 +
  151 + public void setSex(String sex) {
  152 + this.sex = sex;
  153 + }
  154 +
  155 + public Date getCheckTime() {
  156 + return checkTime;
  157 + }
  158 +
  159 + public void setCheckTime(Date checkTime) {
  160 + this.checkTime = checkTime;
  161 + }
  162 +
  163 + public String getDoctor() {
  164 + return doctor;
  165 + }
  166 +
  167 + public void setDoctor(String doctor) {
  168 + this.doctor = doctor;
  169 + }
  170 +
  171 + public String getDept() {
  172 + return dept;
  173 + }
  174 +
  175 + public void setDept(String dept) {
  176 + this.dept = dept;
  177 + }
  178 +
  179 + public Date getCreated() {
  180 + return created;
  181 + }
  182 +
  183 + public void setCreated(Date created) {
  184 + this.created = created;
  185 + }
  186 +
  187 + public Integer getIsBuild() {
  188 + return isBuild;
  189 + }
  190 +
  191 + public void setIsBuild(Integer isBuild) {
  192 + this.isBuild = isBuild;
  193 + }
  194 +
  195 + public Date getSerEndTime() {
  196 + return serEndTime;
  197 + }
  198 +
  199 + public void setSerEndTime(Date serEndTime) {
  200 + this.serEndTime = serEndTime;
  201 + }
  202 +
  203 + @Override
  204 + public String toString() {
  205 + return "AppointmentModel{" +
  206 + "id=" + id +
  207 + ", bhNum='" + bhNum + '\'' +
  208 + ", vccardNo='" + vccardNo + '\'' +
  209 + ", name='" + name + '\'' +
  210 + ", phone='" + phone + '\'' +
  211 + ", age='" + age + '\'' +
  212 + ", idCard='" + idCard + '\'' +
  213 + ", sex='" + sex + '\'' +
  214 + ", checkTime=" + checkTime +
  215 + ", doctor='" + doctor + '\'' +
  216 + ", dept='" + dept + '\'' +
  217 + ", isBuild=" + isBuild +
  218 + ", serEndTime=" + serEndTime +
  219 + ", created=" + created +
  220 + '}';
  221 + }
  222 +}
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java View file @ 774a991
... ... @@ -424,7 +424,19 @@
424 424  
425 425 private String currentAreaId;
426 426 private Integer isComplete;
  427 + /**
  428 + * his病例ID
  429 + */
  430 + private String patientHId;
427 431  
  432 + public String getPatientHId() {
  433 + return patientHId;
  434 + }
  435 +
  436 + public void setPatientHId(String patientHId) {
  437 + this.patientHId = patientHId;
  438 + }
  439 +
428 440 public String getBooksuifangDoctor() {
429 441 return booksuifangDoctor;
430 442 }
... ... @@ -694,7 +706,9 @@
694 706 if (isHistory) {
695 707 condition = condition.and("isHistory", false, MongoOper.EXISTS);
696 708 }
697   -
  709 + if (StringUtils.isNotEmpty(patientHId)) {
  710 + condition = condition.and("patientHId", patientHId, MongoOper.IS);
  711 + }
698 712 if (null != isComplete) {
699 713 condition = condition.and("isComplete", isComplete, MongoOper.IS);
700 714 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java View file @ 774a991
1 1 package com.lyms.platform.operate.web.controller;
2 2  
  3 +import com.google.common.base.Strings;
3 4 import com.lyms.platform.biz.service.PatientsService;
4 5 import com.lyms.platform.common.constants.ErrorCodeConstants;
5 6 import com.lyms.platform.common.result.BaseResponse;
  7 +import com.lyms.platform.common.utils.StringUtils;
6 8 import com.lyms.platform.operate.web.utils.CollectionUtils;
7 9 import com.lyms.platform.operate.web.vo.PatientsDTO;
8 10 import com.lyms.platform.pojo.Patients;
9 11 import com.lyms.platform.query.PatientsQuery;
10 12 import org.springframework.beans.factory.annotation.Autowired;
11 13 import org.springframework.stereotype.Controller;
12   -import org.springframework.web.bind.annotation.RequestBody;
13   -import org.springframework.web.bind.annotation.RequestMapping;
14   -import org.springframework.web.bind.annotation.RequestMethod;
15   -import org.springframework.web.bind.annotation.ResponseBody;
  14 +import org.springframework.web.bind.annotation.*;
16 15  
17 16 import java.util.List;
18 17  
... ... @@ -21,6 +20,7 @@
21 20 @Autowired
22 21 private PatientsService patientsService;
23 22 //http://112.112.112.183:8085/viewhip-etyy/view/commView/layout.jsp?patientId=病人ID
  23 + //http://172.26.1.190:9090/xtwx/updatePatientId?idCard=?id= 威县his服务
24 24  
25 25 /**
26 26 * 获取威县孕产妇数据
27 27  
... ... @@ -53,13 +53,37 @@
53 53 if (CollectionUtils.isNotEmpty(patientsList)){
54 54 Patients patient= patientsList.get(0);
55 55 patient.setPatientHId(patientsDTO.getPatientHId());
56   - patient.setVisitsNum(patientsDTO.getVisitsNum());
57   - patient.setWxStatus(patientsDTO.getWxStatus());
  56 + if (StringUtils.isNotEmpty(patientsDTO.getVisitsNum())){
  57 + patient.setVisitsNum(patientsDTO.getVisitsNum());
  58 + }
  59 + if (StringUtils.isNotEmpty(patientsDTO.getWxStatus())){
  60 + patient.setWxStatus(patientsDTO.getWxStatus());
  61 + }
58 62 patientsService.updatePatientOne(patient,patient.getId());
59 63 baseResponse.setErrormsg("成功");
60 64 }
61 65  
62 66 }
  67 + return baseResponse;
  68 + }
  69 + @RequestMapping(method = RequestMethod.GET,value = "/xtwx/getWXPatient")
  70 + public BaseResponse getWxPatients(@RequestParam("patienId") String patienId){
  71 + BaseResponse baseResponse=new BaseResponse();
  72 + if (Strings.isNullOrEmpty(patienId)){
  73 + baseResponse.setErrorcode(-1);
  74 + baseResponse.setErrormsg("参数异常");
  75 + return baseResponse;
  76 + }
  77 + PatientsQuery patientsQuery =new PatientsQuery();
  78 + patientsQuery.setYn(1);
  79 + patientsQuery.setPatientHId(patienId);
  80 + List<Patients> patientsList=patientsService.queryPatient(patientsQuery);
  81 + if (CollectionUtils.isEmpty(patientsList)){
  82 + baseResponse.setErrorcode(10001);
  83 + baseResponse.setErrormsg("当前患者未建档");
  84 + return baseResponse;
  85 + }
  86 + //antex/antexrecordlist 参考这个接口返回
63 87 return baseResponse;
64 88 }
65 89 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientWxController.java View file @ 774a991
... ... @@ -9,15 +9,14 @@
9 9 import com.lyms.platform.common.result.CommonResult;
10 10 import com.lyms.platform.common.utils.*;
11 11 import com.lyms.platform.operate.web.facade.*;
12   -import com.lyms.platform.operate.web.request.AntExAddRequest;
13   -import com.lyms.platform.operate.web.request.AntExQueryRequest;
14   -import com.lyms.platform.operate.web.request.AntenatalExaminationQueryRequest;
15   -import com.lyms.platform.operate.web.request.PatientQueryRequest;
  12 +import com.lyms.platform.operate.web.request.*;
16 13 import com.lyms.platform.operate.web.service.PatientWeightService;
17 14 import com.lyms.platform.operate.web.utils.CollectionUtils;
18 15 import com.lyms.platform.operate.web.utils.FunvCommonUtil;
  16 +import com.lyms.platform.permission.model.AppointmentQuery;
19 17 import com.lyms.platform.permission.model.PatientService;
20 18 import com.lyms.platform.permission.model.PatientServiceQuery;
  19 +import com.lyms.platform.permission.service.AppointmentService;
21 20 import com.lyms.platform.permission.service.CouponService;
22 21 import com.lyms.platform.permission.service.PatientServiceService;
23 22 import com.lyms.platform.pojo.*;
24 23  
25 24  
... ... @@ -65,14 +64,14 @@
65 64 private PatientFacade patientFacade;
66 65 @Autowired
67 66 private CouponService couponService;
68   - /* @Autowired
69   - private AppointmentService appointmentService;*/
70 67 @Autowired
  68 + private AppointmentService appointmentService;
  69 + @Autowired
71 70 private PatientServiceService patientServiceService;
72 71 public static final String MEMBER_BABY_URL= PropertiesUtils.getPropertyValue("member_baby_url");
73 72  
74 73 final static Integer userId=2100006857;//默认为客服ID
75   - final static String hospitalId="2100002421";//大同医院ID
  74 + final static String hospitalId="2100002421";//威县ID
76 75 final static String Authorization="1d$l*Y8lslp4dJLTsbm7LkM90";
77 76  
78 77  
... ... @@ -302,7 +301,7 @@
302 301 * @param phone
303 302  
304 303 */
305   - @RequestMapping(value = "/dt/lisCrisisItems", method = RequestMethod.GET)
  304 + /*@RequestMapping(value = "/wx/lisCrisisItems", method = RequestMethod.GET)
306 305 public void getEmergenceTreatments(HttpServletResponse response,
307 306 @RequestHeader("Authorization")String authorization,
308 307 @RequestParam("page") int page,
309 308  
... ... @@ -384,9 +383,9 @@
384 383 result.setPageInfo(query.getPageInfo());
385 384  
386 385 ResultUtils.buildSuccessResultAndWrite(response, result);
387   - }
  386 + }*/
388 387  
389   - @RequestMapping(value = "/dt/findp2", method = RequestMethod.GET)
  388 + @RequestMapping(value = "/wx/findp2", method = RequestMethod.GET)
390 389 @ResponseBody
391 390 public BaseResponse getPatent2(@Valid PatientQueryRequest request,
392 391 @RequestHeader("Authorization")String authorization) {
393 392  
... ... @@ -396,14 +395,14 @@
396 395 return patientFacade.findPatient2(request, userId);
397 396 }
398 397  
399   - @RequestMapping(method = RequestMethod.GET, value = "/dt/getGongGaoCurve")
  398 + /* @RequestMapping(method = RequestMethod.GET, value = "/wx/getGongGaoCurve")
400 399 @ResponseBody
401 400 public BaseResponse getGongGaoLine(@RequestParam(required = true) String patientId, @RequestHeader("Authorization")String authorization) {
402 401 if (!authorization.contains(Authorization)){
403 402 return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
404 403 }
405 404 return antenatalExaminationFacade.getGongGaoLine(patientId, userId);
406   - }
  405 + }*/
407 406  
408 407 @RequestMapping(method = RequestMethod.GET, value = "/wx/antex")
409 408 @ResponseBody
410 409  
... ... @@ -426,12 +425,12 @@
426 425 return baseResponse;
427 426 }
428 427  
429   - /**
  428 +/* *//**
430 429 * 获取体重列表;
431 430 * @param authorization
432 431 * @param id
433 432 * @return
434   - */
  433 + *//*
435 434 @ResponseBody
436 435 @RequestMapping(value = "/dt/patient/weight/info/{id}", method = RequestMethod.GET)
437 436 public BaseResponse info(@RequestHeader("Authorization")String authorization, @PathVariable String id) {
... ... @@ -439,7 +438,7 @@
439 438 return new BaseResponse().setErrorcode(-1).setErrormsg("权限异常");
440 439 }
441 440 return patientWeightService1.info(id);
442   - }
  441 + }*/
443 442  
444 443 /**
445 444 * 添加体重管理
446 445  
... ... @@ -614,8 +613,9 @@
614 613 return antenatalExaminationFacade.addPatientNipt(patientNiptDTO,userId);
615 614 }*/
616 615 //大同需要特殊处理的护士名称
617   - private static final String doctors="孙慧洁,曹琴,温燕芳,牛冬燕,王改然,杜文瑞,习亚美,卫娜,施春花,胡雪娇,田保来";
618 616  
  617 + private static final String doctors="牛向静,梁永芹,尹慧东,刘亚静,吕淑华,张来花,王际普,王玉娥,赵辉,宋艳华,李广立,申立华,吴芳君,石良燕,李金辉,曹莺翠,郭俊彩,孙月荣,潘素芳,尼秋菊,石婧,邢芳,孙晓飞,刘学燕,付秋辉,高立焕,李薇,杨华丽,王海英,王印红,郭荣彩,田华,李丽娟,郭军格,穆立萌";
  618 +
619 619 /**
620 620 * 预约挂号列表查询
621 621 * @param authorization
... ... @@ -625,7 +625,7 @@
625 625 * @param name
626 626 * @return
627 627 */
628   - /*@RequestMapping(method = RequestMethod.GET, value = "/dt/appointment")
  628 + @RequestMapping(method = RequestMethod.GET, value = "/wx/appointment")
629 629 @ResponseBody
630 630 public BaseResponse getAppointment(@RequestHeader("Authorization")String authorization,
631 631 @RequestParam String doctor,
632 632  
... ... @@ -784,15 +784,15 @@
784 784 return baseResponse;
785 785 }
786 786  
787   - *//**
  787 + /**
788 788 * 预约统计管理科室统计列表
789 789 * @param authorization
790 790 * @param doctor
791 791 * @param startTime
792 792 * @param endTime
793 793 * @return
794   - *//*
795   - @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment/dept/statistics")
  794 + */
  795 + @RequestMapping(method = RequestMethod.GET, value = "/wx/appointment/dept/statistics")
796 796 @ResponseBody
797 797 public BaseResponse appointmentDeptStatistics(@RequestHeader("Authorization")String authorization,
798 798 @RequestParam String doctor,
799 799  
800 800  
... ... @@ -805,12 +805,15 @@
805 805 startTime=startTime+" 00:00:00";
806 806 endTime=endTime+" 23:59:59";
807 807 String dept=null;
  808 + if (doctors.contains(doctor)){
  809 + dept="产科";
  810 + }
808 811 //只有护士长和主任可以看统计(目前)
809   - if (doctor.equals("田保来")||doctor.equals("孙慧洁")){
  812 + /* if (doctor.equals("田保来")||doctor.equals("孙慧洁")){
810 813 dept="产科";
811 814 }else {
812 815 return new BaseObjectResponse().setErrorcode(-1).setErrormsg("权限异常");
813   - }
  816 + }*/
814 817 AppointmentQuery appointmentQuery=new AppointmentQuery();
815 818 appointmentQuery.setStartTime(startTime);
816 819 appointmentQuery.setEndTime(endTime);
817 820  
818 821  
819 822  
... ... @@ -867,16 +870,17 @@
867 870 params.put(depts,appointmentData);
868 871 }
869 872 }
  873 + baseResponse.setObject(params);
870 874 // 使用TreeMap进行排序
871   - Map<String, AppointmentData> sortedMap = new TreeMap<>(new ChineseComparator());
  875 + /* Map<String, AppointmentData> sortedMap = new TreeMap<>(new ChineseComparator());
872 876 sortedMap.putAll(params);
873   - baseResponse.setObject(sortedMap);
  877 + baseResponse.setObject(sortedMap);*/
874 878 }
875 879 baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功");
876 880 return baseResponse;
877 881 }
878 882 // 自定义Comparator,用于按照定义好的顺序排序
879   - static class ChineseComparator implements Comparator<String> {
  883 + /* static class ChineseComparator implements Comparator<String> {
880 884 @Override
881 885 public int compare(String s1, String s2) {
882 886 try {
... ... @@ -887,8 +891,8 @@
887 891 return 0;
888 892 }
889 893  
890   - }
891   - private static Integer getPinyin(String s) {
  894 + }*/
  895 +/* private static Integer getPinyin(String s) {
892 896 Map<String, Integer> map = new HashMap<>();
893 897 map.put("产后康复门诊", 10);
894 898 map.put("产科七病区", 7);
895 899  
896 900  
... ... @@ -898,17 +902,17 @@
898 902 map.put("产科六病区", 6);
899 903 map.put("产科门诊", 1);
900 904 return map.get(s);
901   - }
  905 + }*/
902 906  
903   - *//**
  907 + /**
904 908 * 预约统计管理列表
905 909 * @param authorization
906 910 * @param doctor
907 911 * @param startTime
908 912 * @param endTime
909 913 * @return
910   - *//*
911   - @RequestMapping(method = RequestMethod.GET, value = "/dt/appointment/statistics")
  914 + */
  915 + @RequestMapping(method = RequestMethod.GET, value = "/wx/appointment/statistics")
912 916 @ResponseBody
913 917 public BaseResponse appointmentStatistics(@RequestHeader("Authorization")String authorization,
914 918 @RequestParam String doctor,
915 919  
... ... @@ -995,10 +999,10 @@
995 999 return baseResponse;
996 1000 }
997 1001  
998   - *//**
  1002 + /**
999 1003 * 统计数据导出
1000   - *//*
1001   - @RequestMapping(method = RequestMethod.POST, value = "/dt/appointment/statistics/export")
  1004 + */
  1005 + @RequestMapping(method = RequestMethod.POST, value = "/wx/appointment/statistics/export")
1002 1006 @ResponseBody
1003 1007 public void statisticsExport(@RequestHeader("Authorization")String authorization,
1004 1008 @RequestBody AppointmentExport appointmentExport,
1005 1009  
... ... @@ -1112,14 +1116,14 @@
1112 1116 }
1113 1117 }
1114 1118  
1115   - *//**
  1119 + /**
1116 1120 * 挂号信息同步
1117 1121 * @param authorization
1118 1122 * @param doctor
1119 1123 * @param date
1120 1124 * @return
1121   - *//*
1122   - @RequestMapping(method = RequestMethod.GET, value = "/dt/sync/appointment")
  1125 + */
  1126 + @RequestMapping(method = RequestMethod.GET, value = "/wx/sync/appointment")
1123 1127 @ResponseBody
1124 1128 public BaseResponse syncAppointmentList(@RequestHeader("Authorization")String authorization,
1125 1129 @RequestParam(required = true) String doctor,
1126 1130  
1127 1131  
... ... @@ -1137,11 +1141,12 @@
1137 1141 HttpClientUtil.doGet("http://192.168.5.23:9090/dtdyrm/getdtAppointment" ,params,"utf-8",null);
1138 1142 return new BaseResponse();
1139 1143 }
1140   - @Autowired
  1144 + /*@Autowired
1141 1145 private IdtdyrmFmService idtdyrmFmService;
  1146 +
1142 1147 //导出
1143 1148 @ResponseBody
1144   - @RequestMapping(value = "/dt/appointment/export", method = RequestMethod.GET)
  1149 + @RequestMapping(value = "/wx/appointment/export", method = RequestMethod.GET)
1145 1150 public void reportFmRecord(@RequestHeader("Authorization")String authorization,
1146 1151 @RequestParam String doctor,
1147 1152 @RequestParam String startTime,
1148 1153  
... ... @@ -1156,11 +1161,11 @@
1156 1161 doctor="孙慧洁";
1157 1162 }
1158 1163 idtdyrmFmService.reportAppointmentList(response,doctor,startTime,endTime,name,doctorName);
1159   - }
  1164 + }*/
1160 1165  
1161 1166  
1162 1167  
1163   - @RequestMapping(method = RequestMethod.GET, value = "/pc/pregnancy")
  1168 + /* @RequestMapping(method = RequestMethod.GET, value = "/pc/pregnancy")
1164 1169 @ResponseBody
1165 1170 public String getPregnancyList( String page,
1166 1171 String limit,
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 774a991
... ... @@ -390,6 +390,7 @@
390 390 }
391 391 patient.setRiskLevelId(yunRequest.getLevel());
392 392  
  393 +
393 394 //孕妇档案
394 395 Patients p = yunBookbuildingService.addPregnantBookbuilding(patient);
395 396  
... ... @@ -399,7 +400,15 @@
399 400 return br;
400 401  
401 402 }
402   -
  403 + //如果是威县建档需要同步hisID
  404 + if("2100002421".equals(patient.getHospitalId())){
  405 + Map<String,String> params=new HashMap<>();
  406 + params.put("idCard",patient.getCardNo());
  407 + params.put("id",patient.getId());
  408 + //正式环境才走测试不管
  409 + //String str= HttpClientUtil.doGet("http://172.26.1.190:9090/xtwx/updatePatientId" ,params,"utf-8",null);
  410 + // logger.info("威县his获取病人ID--->"+str);
  411 + }
403 412 //添加追访信息
404 413 addTrackDownInfo(userId, p);
405 414  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AppointmentExport.java View file @ 774a991
  1 +package com.lyms.platform.operate.web.request;
  2 +
  3 +
  4 +import java.util.Map;
  5 +
  6 +public class AppointmentExport {
  7 + private Map<String, Map<String,Object>> params;
  8 + private String doctor;
  9 + private String startTime;
  10 + private String endTime;
  11 +
  12 + public Map<String, Map<String, Object>> getParams() {
  13 + return params;
  14 + }
  15 +
  16 + public void setParams(Map<String, Map<String, Object>> params) {
  17 + this.params = params;
  18 + }
  19 +
  20 + public String getDoctor() {
  21 + return doctor;
  22 + }
  23 +
  24 + public void setDoctor(String doctor) {
  25 + this.doctor = doctor;
  26 + }
  27 +
  28 + public String getStartTime() {
  29 + return startTime;
  30 + }
  31 +
  32 + public void setStartTime(String startTime) {
  33 + this.startTime = startTime;
  34 + }
  35 +
  36 + public String getEndTime() {
  37 + return endTime;
  38 + }
  39 +
  40 + public void setEndTime(String endTime) {
  41 + this.endTime = endTime;
  42 + }
  43 +}