Commit 01a510376c22a438c44067b9497cb60db6de4825

Authored by yangfei

Merge remote-tracking branch 'origin/master'

Showing 20 changed files

platform-common/src/main/java/com/lyms/platform/common/dao/BaseMongoDAOImpl.java View file @ 01a5103
... ... @@ -156,7 +156,10 @@
156 156 public static String mongo_crypto_key = Config.getItem("mongo_crypto_key", "0");
157 157 public static String mongo_sync = Config.getItem("mongo_sync", "0");
158 158 public void addSyncData(String action, Object data, String id) {
159   - if (!(data instanceof Serializable) ||"LisReport".equals(data.getClass().getSimpleName()) || "SyncDataModel".equals(data.getClass().getSimpleName())|| "SmsConfigModel".equals(data.getClass().getSimpleName())) {
  159 + if (!(data instanceof Serializable) ||"LisReport".equals(data.getClass().getSimpleName())
  160 + || "SyncDataModel".equals(data.getClass().getSimpleName())
  161 + || "SmsConfigModel".equals(data.getClass().getSimpleName())
  162 + || "OperateLogModel".equals(data.getClass().getSimpleName())) {
160 163 if(!"LisReport".equals(data.getClass().getSimpleName())){
161 164 //ExceptionUtils.catchException("NotSerializable for class :"+data.getClass().getSimpleName() );
162 165 }
platform-common/src/main/java/com/lyms/platform/common/enums/ErrorPatientEnums.java View file @ 01a5103
... ... @@ -4,6 +4,43 @@
4 4 * 健康异常孕妇
5 5 */
6 6 public enum ErrorPatientEnums {
7   - PATIENT_WEIGHT, TEMP, BLOOD_PRESSURE, BLOOD_SUGAR;
  7 + PATIENT_WEIGHT(1, "体重"), TEMP(2, "体温"), BLOOD_PRESSURE(3, "血压"), BLOOD_SUGAR(4, "血糖");
  8 +
  9 + private Integer id;
  10 + private String name;
  11 +
  12 + ErrorPatientEnums(Integer id, String name) {
  13 + this.id = id;
  14 + this.name = name;
  15 + }
  16 +
  17 + public static String getName(Integer id) {
  18 + if(id == null) {
  19 + return null;
  20 + }
  21 + ErrorPatientEnums[] values = ErrorPatientEnums.values();
  22 + for (ErrorPatientEnums value : values) {
  23 + if (value.getId() == id) {
  24 + return value.getName();
  25 + }
  26 + }
  27 + return null;
  28 + }
  29 +
  30 + public Integer getId() {
  31 + return id;
  32 + }
  33 +
  34 + public void setId(Integer id) {
  35 + this.id = id;
  36 + }
  37 +
  38 + public String getName() {
  39 + return name;
  40 + }
  41 +
  42 + public void setName(String name) {
  43 + this.name = name;
  44 + }
8 45 }
platform-common/src/main/java/com/lyms/platform/common/utils/DateUtil.java View file @ 01a5103
... ... @@ -1407,6 +1407,8 @@
1407 1407 System.out.println(" end>> " + getyyyy_MM_dd(map.get("end")));
1408 1408 }*/
1409 1409  
  1410 + Date yesterday = DateUtil.getYesterday();
  1411 + System.out.println(yesterday.toLocaleString());
1410 1412 System.out.println(getBetweenDay(7));
1411 1413  
1412 1414 Date date = parseDate("2017-11-30");
platform-dal/src/main/java/com/lyms/platform/pojo/SieveRecordModel.java View file @ 01a5103
... ... @@ -27,6 +27,17 @@
27 27 //保存时间的年月日
28 28 private Date time;
29 29  
  30 + //填写日期
  31 + private Date fillDate;
  32 +
  33 + public Date getFillDate() {
  34 + return fillDate;
  35 + }
  36 +
  37 + public void setFillDate(Date fillDate) {
  38 + this.fillDate = fillDate;
  39 + }
  40 +
30 41 public Date getTime() {
31 42 return time;
32 43 }
platform-dal/src/main/java/com/lyms/platform/query/SieveRecordQuery.java View file @ 01a5103
... ... @@ -58,6 +58,44 @@
58 58 //是否导出过 0 未导出 1导出
59 59 private Integer status;
60 60  
  61 + //居住地
  62 + private String provinceId;
  63 + private String cityId;
  64 + private String areaId;
  65 + private String streetId;
  66 +
  67 + public String getProvinceId() {
  68 + return provinceId;
  69 + }
  70 +
  71 + public void setProvinceId(String provinceId) {
  72 + this.provinceId = provinceId;
  73 + }
  74 +
  75 + public String getCityId() {
  76 + return cityId;
  77 + }
  78 +
  79 + public void setCityId(String cityId) {
  80 + this.cityId = cityId;
  81 + }
  82 +
  83 + public String getAreaId() {
  84 + return areaId;
  85 + }
  86 +
  87 + public void setAreaId(String areaId) {
  88 + this.areaId = areaId;
  89 + }
  90 +
  91 + public String getStreetId() {
  92 + return streetId;
  93 + }
  94 +
  95 + public void setStreetId(String streetId) {
  96 + this.streetId = streetId;
  97 + }
  98 +
61 99 public String getPatientId() {
62 100 return patientId;
63 101 }
... ... @@ -233,6 +271,21 @@
233 271 if (null != yn) {
234 272 condition = condition.and("yn", yn, MongoOper.IS);
235 273 }
  274 +
  275 +
  276 + if (StringUtils.isNotEmpty(areaId)) {
  277 + condition = condition.and("areaId", areaId, MongoOper.IS);
  278 + }
  279 + if(StringUtils.isNotEmpty(cityId)){
  280 + condition = condition.and("cityId", cityId, MongoOper.IS);
  281 + }
  282 + if(StringUtils.isNotEmpty(provinceId)){
  283 + condition = condition.and("provinceId", provinceId, MongoOper.IS);
  284 + }
  285 + if(StringUtils.isNotEmpty(streetId)){
  286 + condition = condition.and("streetId", streetId, MongoOper.IS);
  287 + }
  288 +
236 289  
237 290 Criteria c1 = null;
238 291 if (null != lastMensesStart) {
platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/ConnTools.java View file @ 01a5103
  1 +package com.lyms.hospitalapi.whfy;
  2 +
  3 +import java.sql.CallableStatement;
  4 +import java.sql.Connection;
  5 +import java.sql.DriverManager;
  6 +import java.sql.SQLException;
  7 +
  8 +/**
  9 + *
  10 + * 威海妇幼
  11 + * Created by Administrator on 2017/4/12.
  12 + */
  13 +public class ConnTools {
  14 + //分诊叫号
  15 + private static String dirverClassName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
  16 + private static String url = "jdbc:sqlserver://200.200.200.53:1433; DatabaseName=MZHSZ";
  17 + private static String user = "123qwe!@#";
  18 + private static String password = "sa";
  19 +
  20 + public static Connection makeHisConnection() {
  21 + Connection conn = null;
  22 + try {
  23 + Class.forName(dirverClassName);
  24 + } catch (ClassNotFoundException e) {
  25 + e.printStackTrace();
  26 + }
  27 + try {
  28 + conn = DriverManager.getConnection(url, user, password);
  29 + } catch (SQLException e) {
  30 + e.printStackTrace();
  31 + }
  32 + return conn;
  33 + }
  34 +
  35 + public static void close(Connection conn ,CallableStatement cs)
  36 + {
  37 + if (cs != null)
  38 + {
  39 + try {
  40 + cs.close();
  41 + } catch (SQLException e) {
  42 + e.printStackTrace();
  43 + }
  44 + }
  45 +
  46 + if (conn != null)
  47 + {
  48 + try {
  49 + conn.close();
  50 + } catch (SQLException e) {
  51 + e.printStackTrace();
  52 + }
  53 + }
  54 + }
  55 +
  56 +}
platform-operate-api/src/main/java/com/lyms/hospitalapi/whfy/VirtualCallService.java View file @ 01a5103
  1 +package com.lyms.hospitalapi.whfy;
  2 +
  3 +import com.lyms.platform.common.constants.ErrorCodeConstants;
  4 +import com.lyms.platform.common.result.BaseObjectResponse;
  5 +import com.lyms.platform.common.result.BaseResponse;
  6 +import com.lyms.platform.common.utils.DateUtil;
  7 +import com.lyms.platform.common.utils.ExceptionUtils;
  8 +import com.lyms.platform.permission.model.Departments;
  9 +import com.lyms.platform.permission.model.Users;
  10 +import com.lyms.platform.permission.service.DepartmentsService;
  11 +import com.lyms.platform.permission.service.UsersService;
  12 +import org.springframework.beans.factory.annotation.Autowired;
  13 +import org.springframework.stereotype.Service;
  14 +
  15 +import javax.servlet.http.HttpServletRequest;
  16 +import java.io.BufferedReader;
  17 +import java.io.IOException;
  18 +import java.io.InputStreamReader;
  19 +import java.io.LineNumberReader;
  20 +import java.net.InetAddress;
  21 +import java.net.NetworkInterface;
  22 +import java.sql.CallableStatement;
  23 +import java.sql.Connection;
  24 +import java.sql.ResultSet;
  25 +import java.sql.SQLException;
  26 +import java.util.*;
  27 +
  28 +import static com.lyms.hospitalapi.whfy.ConnTools.makeHisConnection;
  29 +
  30 +/**
  31 + * Created by Administrator on 2017-12-05.
  32 + */
  33 +
  34 +@Service("virtualCallService")
  35 +public class VirtualCallService {
  36 +
  37 + @Autowired
  38 + private UsersService usersService;
  39 +
  40 + @Autowired
  41 + private DepartmentsService departmentsService;
  42 +
  43 + public BaseResponse callLogin(HttpServletRequest request, Integer userId) {
  44 + BaseResponse result = new BaseResponse();
  45 +
  46 + Users user = usersService.getUsers(userId);
  47 + Departments departments = departmentsService.getDepartments(user.getDeptId());
  48 +
  49 + String code = departments.getShortCode();
  50 + String deptName = departments.getName();
  51 +
  52 + String doctorAccount = user.getAccount();
  53 + String doctorName = user.getName();
  54 +
  55 + String ip = request.getRemoteAddr();
  56 + String mac = getMACAddress(ip);
  57 +
  58 + System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";code="+code+";deptName="+deptName+";doctorAccount="+doctorAccount+";doctorName="+doctorName
  59 + +";ip="+ip+";mac="+mac);
  60 +
  61 +// Connection conn = null;
  62 +// CallableStatement cs = null;
  63 +// try {
  64 +// conn = makeHisConnection();
  65 +// //1.1 普通登录
  66 +// //exec usp_mzhs_hsfzinterface '1','192.168.1.219','2052','儿科门诊','00','supervisor','D8-9E-F3-13-A5-86','0',@sex='男'
  67 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?,?,?,?,?)}");
  68 +// cs.setString(1, "1");
  69 +// cs.setString(2, ip);
  70 +// cs.setString(3, code);
  71 +// cs.setString(4, deptName);
  72 +// cs.setString(5, doctorAccount);
  73 +// cs.setString(6, doctorName);
  74 +// cs.setString(7, mac);
  75 +// ResultSet rs = cs.executeQuery();
  76 +// }
  77 +// catch (SQLException e)
  78 +// {
  79 +// ExceptionUtils.catchException(e, "callLogin exception");
  80 +// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  81 +// result.setErrormsg("登陆异常");
  82 +// return result;
  83 +// }
  84 +// finally {
  85 +// ConnTools.close(conn,cs);
  86 +// }
  87 +
  88 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  89 + result.setErrormsg("登陆成功");
  90 + return result;
  91 + }
  92 +
  93 + public BaseResponse callLoginOut(HttpServletRequest request, Integer userId) {
  94 +
  95 + BaseResponse result = new BaseResponse();
  96 + String ip = request.getRemoteAddr();
  97 + System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip);
  98 +
  99 +// Connection conn = null;
  100 +// CallableStatement cs = null;
  101 +// try {
  102 +// conn = makeHisConnection();
  103 +// //5 退出登录
  104 +// //exec usp_mzhs_hsfzinterface 5,'192.168.1.219'
  105 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}");
  106 +// cs.setString(1, "5");
  107 +// cs.setString(2, ip);
  108 +// ResultSet rs = cs.executeQuery();
  109 +// }
  110 +// catch (SQLException e)
  111 +// {
  112 +// ExceptionUtils.catchException(e, "callLoginOut exception");
  113 +// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  114 +// result.setErrormsg("登出异常");
  115 +// return result;
  116 +// }
  117 +// finally {
  118 +// ConnTools.close(conn,cs);
  119 +// }
  120 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  121 + result.setErrormsg("登出成功");
  122 + return result;
  123 +
  124 + }
  125 +
  126 + public BaseResponse doWorkStatusChange(HttpServletRequest request, Integer userId, String status) {
  127 +
  128 + BaseResponse result = new BaseResponse();
  129 + String ip = request.getRemoteAddr();
  130 + System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip);
  131 +
  132 +// Connection conn = null;
  133 +// CallableStatement cs = null;
  134 +// try {
  135 +// conn = makeHisConnection();
  136 +// //14 更改诊间状态 --0 修改当前诊间为停诊,1 修改当前诊间为开诊,2 获取当前诊间状态(0 停诊 1 开诊)
  137 +// //exec usp_mzhs_hsfzinterface_km 14,'192.16.1.111',@zjzt=2
  138 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?)}");
  139 +// cs.setString(1, "14");
  140 +// cs.setString(2, ip);
  141 +// cs.setString(3, "@zjzt=" + status);
  142 +// ResultSet rs = cs.executeQuery();
  143 +// }
  144 +// catch (SQLException e)
  145 +// {
  146 +// ExceptionUtils.catchException(e, "doWorkStatusChange exception");
  147 +// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  148 +// result.setErrormsg("工作状态修改异常");
  149 +// return result;
  150 +// }
  151 +// finally {
  152 +// ConnTools.close(conn,cs);
  153 +// }
  154 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  155 + result.setErrormsg("工作状态修改成功");
  156 + return result;
  157 + }
  158 +
  159 + public BaseResponse rebackCall(HttpServletRequest request, Integer userId,String patientId) {
  160 +
  161 + BaseResponse result = new BaseResponse();
  162 + String ip = request.getRemoteAddr();
  163 + System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip);
  164 +
  165 +// Connection conn = null;
  166 +// CallableStatement cs = null;
  167 +// try {
  168 +// conn = makeHisConnection();
  169 +// // 7 复呼
  170 +// // exec usp_mzhs_hsfzinterface 7,'10.58.99.246',@ghxh=2795541
  171 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?,?)}");
  172 +// cs.setString(1, "7");
  173 +// cs.setString(2, ip);
  174 +// cs.setString(3, "@ghxh=" + patientId);
  175 +// ResultSet rs = cs.executeQuery();
  176 +// }
  177 +// catch (SQLException e)
  178 +// {
  179 +// ExceptionUtils.catchException(e, "rebackCall exception");
  180 +// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  181 +// result.setErrormsg("复呼异常");
  182 +// return result;
  183 +// }
  184 +// finally
  185 +// {
  186 +// ConnTools.close(conn,cs);
  187 +// }
  188 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  189 + result.setErrormsg("复呼成功");
  190 + return result;
  191 + }
  192 +
  193 +
  194 + public BaseResponse waitPatientList(HttpServletRequest request, Integer userId) {
  195 +
  196 + BaseObjectResponse result = new BaseObjectResponse();
  197 +
  198 + Users user = usersService.getUsers(userId);
  199 + Departments departments = departmentsService.getDepartments(user.getDeptId());
  200 +
  201 + String code = departments.getShortCode();
  202 + String doctorAccount = user.getAccount();
  203 +
  204 + String ip = request.getRemoteAddr();
  205 + System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip);
  206 +
  207 + List<Map<String,String>> datas = new ArrayList<>();
  208 + Map<String,String> map = new HashMap<>();
  209 + map.put("patientId","11111");
  210 + map.put("vcCardNo","1234123");
  211 + map.put("name", "张啊");
  212 + map.put("time", "11/21 10:22:21");
  213 + map.put("gender", "男");
  214 +
  215 +
  216 + Map<String,String> map1 = new HashMap<>();
  217 + map1.put("patientId","22222");
  218 + map1.put("vcCardNo","2341234");
  219 + map1.put("name", "王丹");
  220 + map1.put("time", "11/21 10:22:21");
  221 + map1.put("gender", "女");
  222 +
  223 + datas.add(map);
  224 + datas.add(map1);
  225 +
  226 +
  227 +
  228 +// Connection conn = null;
  229 +// CallableStatement cs = null;
  230 +// try {
  231 +// conn = makeHisConnection();
  232 +// //6 获取队列列表
  233 +// //exec usp_mzhs_hsfzinterface 6,'192.168.1.219',@ksdm='2052',@ysdm='00'
  234 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface_km(?,?,?,?)}");
  235 +// cs.setString(1, "6");
  236 +// cs.setString(2, ip);
  237 +// cs.setString(3, "@ksdm="+code);
  238 +// cs.setString(4, "@ysdm=" + doctorAccount);
  239 +// ResultSet rs = cs.executeQuery();
  240 +// Map<String,String> map = new HashMap<>();
  241 +// map.put("卡号","");
  242 +// map.put("姓名", "");
  243 +// map.put("挂号时间", "");
  244 +// map.put("性别", "");
  245 +// datas.add(map);
  246 +// }
  247 +// catch (SQLException e)
  248 +// {
  249 +// ExceptionUtils.catchException(e, "waitPatientList exception");
  250 +// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  251 +// result.setErrormsg("获取候诊队列失败");
  252 +// result.setData(datas);
  253 +// return result;
  254 +// }
  255 +// finally
  256 +// {
  257 +// ConnTools.close(conn,cs);
  258 +// }
  259 +
  260 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  261 + result.setErrormsg("复呼成功");
  262 + result.setData(datas);
  263 + return result;
  264 + }
  265 +
  266 +
  267 + public BaseResponse callPatients(HttpServletRequest request, Integer userId, String patientId) {
  268 +
  269 + BaseObjectResponse result = new BaseObjectResponse();
  270 +
  271 + String ip = request.getRemoteAddr();
  272 + System.out.println("time="+ DateUtil.getyyyy_MM_dd_hms(new Date())+";ip="+ip);
  273 +
  274 + nextPatient(ip);
  275 +
  276 + List<Map<String,String>> datas = new ArrayList<>();
  277 + Map<String,String> map = new HashMap<>();
  278 + map.put("patientId","11111");
  279 + map.put("vcCardNo","1234123");
  280 + map.put("name", "张啊");
  281 + map.put("time", "11/21 10:22:21");
  282 + map.put("gender", "男");
  283 +
  284 +
  285 + Map<String,String> map1 = new HashMap<>();
  286 + map1.put("patientId","22222");
  287 + map1.put("vcCardNo","2341234");
  288 + map1.put("name", "王丹");
  289 + map1.put("time", "11/21 10:22:21");
  290 + map1.put("gender", "女");
  291 +
  292 + datas.add(map);
  293 + datas.add(map1);
  294 +
  295 +// Connection conn = null;
  296 +// CallableStatement cs = null;
  297 +// try {
  298 +// conn = makeHisConnection();
  299 +// //16 已叫号病人列表
  300 +// //exec usp_mzhs_hsfzinterface 16,'192.168.1.219'
  301 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}");
  302 +// cs.setString(1, "16");
  303 +// cs.setString(2, ip);
  304 +// ResultSet rs = cs.executeQuery();
  305 +// Map<String,String> map = new HashMap<>();
  306 +// map.put("卡号","");
  307 +// map.put("姓名", "");
  308 +// map.put("叫号时间", "");
  309 +// map.put("性别", "");
  310 +// datas.add(map);
  311 +// }
  312 +// catch (SQLException e)
  313 +// {
  314 +// ExceptionUtils.catchException(e, "callPatients exception");
  315 +// result.setErrorcode(ErrorCodeConstants.SYSTEM_ERROR);
  316 +// result.setErrormsg("获取候诊队列失败");
  317 +// result.setData(datas);
  318 +// return result;
  319 +// }
  320 +// finally
  321 +// {
  322 +// ConnTools.close(conn,cs);
  323 +// }
  324 +
  325 + result.setErrorcode(ErrorCodeConstants.SUCCESS);
  326 + result.setErrormsg("复呼成功");
  327 + result.setData(datas);
  328 + return result;
  329 + }
  330 +
  331 +
  332 + private boolean nextPatient(String ip)
  333 + {
  334 +// Connection conn = null;
  335 +// CallableStatement cs = null;
  336 +// try {
  337 +// conn = makeHisConnection();
  338 +// //2 取下一个病人
  339 +// //exec usp_mzhs_hsfzinterface '2','192.168.1.219'
  340 +// cs = conn.prepareCall("{call usp_mzhs_hsfzinterface(?,?)}");
  341 +// cs.setString(1, "2");
  342 +// cs.setString(2, ip);
  343 +// cs.executeQuery();
  344 +// return true;
  345 +// }
  346 +// catch (SQLException e)
  347 +// {
  348 +// ExceptionUtils.catchException(e, "nextPatient exception");
  349 +// }
  350 +// finally
  351 +// {
  352 +// ConnTools.close(conn,cs);
  353 +// }
  354 + return false;
  355 + }
  356 +
  357 +
  358 + public String getMACAddress(String ip) {
  359 + String line = "";
  360 + String macAddress = "";
  361 + try {
  362 + final String MAC_ADDRESS_PREFIX = "MAC Address = ";
  363 + final String LOOPBACK_ADDRESS = "127.0.0.1";
  364 + //如果为127.0.0.1,则获取本地MAC地址。
  365 + if (LOOPBACK_ADDRESS.equals(ip)) {
  366 + InetAddress inetAddress = InetAddress.getLocalHost();
  367 + //貌似此方法需要JDK1.6。
  368 + byte[] mac = NetworkInterface.getByInetAddress(inetAddress).getHardwareAddress();
  369 + //下面代码是把mac地址拼装成String
  370 + StringBuilder sb = new StringBuilder();
  371 + for (int i = 0; i < mac.length; i++) {
  372 + if (i != 0) {
  373 + sb.append("-");
  374 + }
  375 + //mac[i] & 0xFF 是为了把byte转化为正整数
  376 + String s = Integer.toHexString(mac[i] & 0xFF);
  377 + sb.append(s.length() == 1 ? 0 + s : s);
  378 + }
  379 + //把字符串所有小写字母改为大写成为正规的mac地址并返回
  380 + macAddress = sb.toString().trim().toUpperCase();
  381 + return macAddress;
  382 + }
  383 +
  384 + //获取非本地IP的MAC地址
  385 + Process p = Runtime.getRuntime().exec("nbtstat -A " + ip);
  386 + InputStreamReader isr = new InputStreamReader(p.getInputStream());
  387 + BufferedReader br = new BufferedReader(isr);
  388 + while ((line = br.readLine()) != null) {
  389 + if (line != null) {
  390 + int index = line.indexOf(MAC_ADDRESS_PREFIX);
  391 + if (index != -1) {
  392 + macAddress = line.substring(index + MAC_ADDRESS_PREFIX.length()).trim().toUpperCase();
  393 + }
  394 + }
  395 + }
  396 + br.close();
  397 + } catch (IOException e) {
  398 + e.printStackTrace(System.out);
  399 + }
  400 + return macAddress;
  401 + }
  402 +
  403 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RemoteController.java View file @ 01a5103
... ... @@ -6,6 +6,8 @@
6 6 import com.lyms.platform.common.base.BaseController;
7 7 import com.lyms.platform.common.base.LoginContext;
8 8 import com.lyms.platform.common.enums.YnEnums;
  9 +import com.lyms.platform.common.result.BaseResponse;
  10 +import com.lyms.platform.common.result.RespBuilder;
9 11 import com.lyms.platform.common.utils.JsonUtil;
10 12 import com.lyms.platform.common.utils.MessageUtil;
11 13 import com.lyms.platform.common.utils.PropertiesUtils;
... ... @@ -53,9 +55,9 @@
53 55 public static final String center_statistics_url= PropertiesUtils.getPropertyValue("center_statistics_url");
54 56  
55 57 @ResponseBody
56   - @RequestMapping(value = "/error/fy/list/{operaterId}", method = RequestMethod.GET)
57   - public List<Map<String, Object>> errorYfList(@PathVariable String operaterId) {
58   - return remoteFacade.errorYfList(operaterId);
  58 + @RequestMapping(value = "/error/fy/list", method = RequestMethod.GET)
  59 + public BaseResponse errorYfList() {
  60 + return RespBuilder.buildSuccess(remoteFacade.errorYfList());
59 61 }
60 62  
61 63 @RequestMapping(value = "/bookArchive",method = RequestMethod.GET)
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/SieveRecordController.java View file @ 01a5103
... ... @@ -100,9 +100,15 @@
100 100 @RequestParam(required = true)Integer limit,
101 101 @RequestParam(required = false)String createTime,
102 102 @RequestParam(required = false)String keyword,
  103 + @RequestParam(required = false)String provinceRegisterId,
  104 + @RequestParam(required = false)String cityRegisterId,
  105 + @RequestParam(required = false)String areaRegisterId,
  106 + @RequestParam(required = false)String streetRegisterId,
103 107 HttpServletRequest request) {
104 108 LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
105   - return sieveRecordFacade.getSieveRecords(status, createTime, keyword, page, limit, loginState.getId());
  109 + return sieveRecordFacade.getSieveRecords(status, createTime, keyword,
  110 + provinceRegisterId,cityRegisterId,areaRegisterId,streetRegisterId,
  111 + page, limit, loginState.getId());
106 112 }
107 113  
108 114  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/ViewController.java View file @ 01a5103
... ... @@ -582,5 +582,17 @@
582 582 }
583 583  
584 584  
  585 + /**
  586 + * 打印儿童出生证明
  587 + * @return
  588 + */
  589 + @RequestMapping(value = "/findMatDeliverPrint", method = RequestMethod.GET)
  590 + @ResponseBody
  591 + @TokenRequired
  592 + public BaseObjectResponse findMatDeliverPrint(@RequestParam(required = true) String id) {
  593 + return viewFacade.findMatDeliverPrint(id);
  594 + }
  595 +
  596 +
585 597 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/VirtualCallController.java View file @ 01a5103
  1 +package com.lyms.platform.operate.web.controller;
  2 +
  3 +import com.lyms.hospitalapi.whfy.VirtualCallService;
  4 +import com.lyms.platform.common.annotation.TokenRequired;
  5 +import com.lyms.platform.common.base.BaseController;
  6 +import com.lyms.platform.common.base.LoginContext;
  7 +import com.lyms.platform.common.result.BaseResponse;
  8 +import org.springframework.beans.factory.annotation.Autowired;
  9 +import org.springframework.stereotype.Controller;
  10 +import org.springframework.web.bind.annotation.*;
  11 +
  12 +import javax.servlet.http.HttpServletRequest;
  13 +
  14 +/**
  15 + * 虚拟叫号接口
  16 + * Created by Administrator on 2017-12-05.
  17 + */
  18 +@Controller
  19 +public class VirtualCallController extends BaseController {
  20 +
  21 +
  22 + @Autowired
  23 + private VirtualCallService virtualCallService;
  24 +
  25 +
  26 + /**
  27 + * 叫号登陆
  28 + * @param httpServletRequest
  29 + * @return
  30 + */
  31 + @RequestMapping(method = RequestMethod.GET, value = "/callLogin")
  32 + @ResponseBody
  33 + @TokenRequired
  34 + public BaseResponse callLogin(HttpServletRequest httpServletRequest) {
  35 + return virtualCallService.callLogin(httpServletRequest, getUserId(httpServletRequest));
  36 + }
  37 +
  38 + /**
  39 + * 叫号登出
  40 + * @param httpServletRequest
  41 + * @return
  42 + */
  43 + @RequestMapping(method = RequestMethod.GET, value = "/callLoginOut")
  44 + @ResponseBody
  45 + @TokenRequired
  46 + public BaseResponse callLoginOut(HttpServletRequest httpServletRequest) {
  47 + return virtualCallService.callLoginOut(httpServletRequest, getUserId(httpServletRequest));
  48 + }
  49 +
  50 +
  51 + /**
  52 + * 0 修改当前诊间为停诊,1 修改当前诊间为开诊,
  53 + * @param status 0停诊 1开诊
  54 + * @param request
  55 + * @return
  56 + */
  57 + @RequestMapping(method = RequestMethod.GET, value = "/doWorkStatusChange")
  58 + @ResponseBody
  59 + @TokenRequired
  60 + public BaseResponse doWorkStatusChange(@RequestParam(required = true) String status,HttpServletRequest request) {
  61 + return virtualCallService.doWorkStatusChange(request, getUserId(request), status);
  62 + }
  63 +
  64 +
  65 +
  66 + /**
  67 + * 复呼
  68 + * @param httpServletRequest
  69 + * @return
  70 + */
  71 + @RequestMapping(method = RequestMethod.GET, value = "/rebackCall")
  72 + @ResponseBody
  73 + @TokenRequired
  74 + public BaseResponse rebackCall(@RequestParam("patientId") String patientId,HttpServletRequest httpServletRequest) {
  75 + return virtualCallService.rebackCall(httpServletRequest, getUserId(httpServletRequest), patientId);
  76 + }
  77 +
  78 +
  79 +
  80 +
  81 + /**
  82 + * 候诊队列
  83 + * @param httpServletRequest
  84 + * @return
  85 + */
  86 + @RequestMapping(method = RequestMethod.GET, value = "/waitPatientList")
  87 + @ResponseBody
  88 + @TokenRequired
  89 + public BaseResponse waitPatientList(HttpServletRequest httpServletRequest) {
  90 + return virtualCallService.waitPatientList(httpServletRequest, getUserId(httpServletRequest));
  91 + }
  92 +
  93 +
  94 +
  95 + /**
  96 + * 叫号
  97 + * 点击叫号同时修改传入的患者状态,并且返回已呼号队列
  98 + * @param patientId
  99 + * @param httpServletRequest
  100 + * @return
  101 + */
  102 + @RequestMapping(method = RequestMethod.GET, value = "/callPatients")
  103 + @ResponseBody
  104 + @TokenRequired
  105 + public BaseResponse callPatients(@RequestParam("patientId") String patientId,HttpServletRequest httpServletRequest) {
  106 + return virtualCallService.callPatients(httpServletRequest, getUserId(httpServletRequest),patientId);
  107 + }
  108 +
  109 +
  110 +}
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/LisFacade.java View file @ 01a5103
... ... @@ -491,6 +491,11 @@
491 491 {
492 492 model.setVcCardNo(wxrmyyHisService.findId(vcCardNo));
493 493 }
  494 + //诸城
  495 + else if ("21".equals(HIS_VERSION))
  496 + {
  497 + model.setVcCardNo(getZcVcardNo(vcCardNo));
  498 + }
494 499 else
495 500 {
496 501 model.setVcCardNo(vcCardNo);
... ... @@ -542,6 +547,21 @@
542 547 }
543 548 return reportModelList;
544 549  
  550 + }
  551 +
  552 + /**
  553 + * 诸城就诊卡号处理
  554 + * @param vcCardNo
  555 + * @return
  556 + */
  557 + private String getZcVcardNo(String vcCardNo) {
  558 + if (StringUtils.isNotEmpty(vcCardNo) && vcCardNo.length() > 7)
  559 + {
  560 + String no = "0000"+vcCardNo.substring(0,8);
  561 + System.out.println(no);
  562 + return no;
  563 + }
  564 + return vcCardNo;
545 565 }
546 566  
547 567  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/RemoteFacade.java View file @ 01a5103
1 1 package com.lyms.platform.operate.web.facade;
2 2  
  3 +import com.lyms.platform.common.enums.BloodSugarEnums;
3 4 import com.lyms.platform.common.enums.ErrorPatientEnums;
4 5 import com.lyms.platform.common.utils.DateUtil;
  6 +import com.lyms.platform.operate.web.utils.CollectionUtils;
5 7 import com.lyms.platform.operate.web.utils.MathUtil;
6   -import com.lyms.platform.pojo.BloodPressure;
7   -import com.lyms.platform.pojo.PatientWeight;
8   -import com.lyms.platform.pojo.Patients;
9   -import com.lyms.platform.pojo.TempModel;
  8 +import com.lyms.platform.pojo.*;
10 9 import org.apache.commons.collections.MapUtils;
11 10 import org.apache.commons.lang.StringUtils;
12 11 import org.springframework.beans.factory.annotation.Autowired;
13 12  
14 13  
15 14  
16 15  
17 16  
18 17  
19 18  
20 19  
21 20  
... ... @@ -24,51 +23,107 @@
24 23 @Component
25 24 public class RemoteFacade {
26 25  
  26 + private static final String ID_SEPARATOR = "_";
  27 +
27 28 @Autowired
28 29 private MongoTemplate mongoTemplate;
29 30  
30   - public List<Map<String, Object>> errorYfList(String operaterId) {
  31 + public List<Map<String, Object>> errorYfList() {
31 32 Date yesterday = DateUtil.getYesterday();
32 33 List<Map<String, Object>> restList = new ArrayList<>();
  34 + Query pwQuery = Query.query(new Criteria());
  35 + Query bpQuery = Query.query(Criteria.where("modified").gt(yesterday)).with(new Sort(Sort.Direction.ASC, "created"));
  36 + Query bsQuery = Query.query(Criteria.where("modified").gt(yesterday)).with(new Sort(Sort.Direction.ASC, "created"));
  37 + Query tempQuery = Query.query(Criteria.where("modified").gt(yesterday)).with(new Sort(Sort.Direction.ASC, "created"));
33 38  
34   - List<PatientWeight> patientWeights = mongoTemplate.find(Query.query(Criteria.where("operaterId").is(operaterId)).with(new Sort(Sort.Direction.DESC, "created")), PatientWeight.class);
35   - List<BloodPressure> bloodPressures = mongoTemplate.find(Query.query(Criteria.where("operaterId").is(operaterId)).with(new Sort(Sort.Direction.DESC, "created")), BloodPressure.class);
36   - List<TempModel> tempModels = mongoTemplate.find(Query.query(Criteria.where("operaterId").is(operaterId)).with(new Sort(Sort.Direction.DESC, "created")), TempModel.class);
  39 + /** 体重未记录修改日期 所以全表扫描 */
  40 + List<PatientWeight> patientWeights = mongoTemplate.find(pwQuery, PatientWeight.class);
  41 + List<BloodPressure> bloodPressures = mongoTemplate.find(bpQuery, BloodPressure.class);
  42 + List<BloodSugar> bloodSugars = mongoTemplate.find(bsQuery, BloodSugar.class);
  43 + List<TempModel> tempModels = mongoTemplate.find(tempQuery, TempModel.class);
37 44  
  45 + /** 血压 */
  46 + for (BloodPressure bloodPressure : bloodPressures) {
  47 + Map<String, Object> temp = new HashMap<>();
  48 + Patients patients = null;
  49 + for (Map.Entry<String,Map<String,Object>> entry : bloodPressure.getInfos().entrySet()) {
  50 + if(DateUtil.parseYMD(entry.getKey()).getTime() >= yesterday.getTime()) {
  51 + String bpStatus = getBpStatus(entry.getValue().get("ssy").toString(), entry.getValue().get("szy").toString());
  52 + if(StringUtils.isNotEmpty(bpStatus)) {
  53 + patients = (patients == null ? mongoTemplate.findById(bloodPressure.getParentId(), Patients.class) : patients);
  54 + setTempInfo(bloodPressure.getId() + ID_SEPARATOR + entry.getKey(), temp, patients,
  55 + entry.getValue().get("ssy") + "/" + entry.getValue().get("szy") + "mmHg", bpStatus, "(收缩压:90-140 舒张压:60-90)", ErrorPatientEnums.BLOOD_PRESSURE, bloodPressure.getModified());
  56 + }
  57 + }
  58 + }
  59 + if(temp != null) {
  60 + restList.add(temp);
  61 + }
  62 + }
  63 +
  64 + /** 血糖 */
  65 + Map<String, Map<String, Object>> bloodSugarCache = new HashMap<>();
  66 + for (BloodSugar bloodSugar : bloodSugars) {
  67 + Integer type = bloodSugar.getBloodSugarType();
  68 + Double min = 0D;
  69 + Double max = 0D;
  70 + if(type == BloodSugarEnums.A.getId()) {
  71 + min = 3.3D;
  72 + max = 5.6D;
  73 + } else if(type == BloodSugarEnums.B.getId() || type == BloodSugarEnums.D.getId() || type == BloodSugarEnums.F.getId() ) {
  74 + min = 3.3D;
  75 + max = 5.8D;
  76 + } else if(type == BloodSugarEnums.I.getId()) {
  77 + min = 6.1D;
  78 + max = 7.8D;
  79 + } else {
  80 + min = 4.4D;
  81 + max = 6.7D;
  82 + }
  83 + if(Double.parseDouble(bloodSugar.getBloodSugar()) > max || Double.parseDouble(bloodSugar.getBloodSugar()) < min) {
  84 + Map<String, Object> temp = new HashMap<>();
  85 + temp.put("name", BloodSugarEnums.getName(bloodSugar.getBloodSugarType()));
  86 + bloodSugarCache.put(bloodSugar.getId(), temp);
  87 + setTempInfo(bloodSugar.getId(), temp, mongoTemplate.findById(bloodSugar.getParentId(), Patients.class), bloodSugar.getBloodSugar(), Double.parseDouble(bloodSugar.getBloodSugar()) > max ? "高血糖" : "低血糖",
  88 + "(" + min +"-" + max + ")", ErrorPatientEnums.BLOOD_SUGAR, bloodSugar.getModified());
  89 + }
  90 + }
  91 + restList.addAll(bloodSugarCache.values());
  92 +
  93 + /** 体重 */
38 94 for (PatientWeight patientWeight : patientWeights) {
39   - Patients patients = mongoTemplate.findById(patientWeight.getPatientId(), Patients.class);
  95 + Patients patients = null;
40 96 String bmi = patientWeight.getBmi();
41 97 Map<Integer, Double> highMap = new LinkedHashMap<>();
42 98 Map<Integer, Double> lowMap = new LinkedHashMap<>();
43 99 setMapInfo(highMap, lowMap, bmi);
44 100 Map<String, String> dayWeights = patientWeight.getDayWeights();
45 101 Map<String, Object> temp = new HashMap<>();
46   - for (Map.Entry<String, String> entry : dayWeights.entrySet()) {
47   - if(DateUtil.parseYMD(entry.getKey()).getTime() >= yesterday.getTime()) {
48   - Integer week = DateUtil.getWeek2(patients.getLastMenses(), DateUtil.parseYMD(entry.getKey()));
49   - Double addWeight = getAddWeight(patientWeight.getBeforeWeight(), entry.getValue());
50   - Double low = lowMap.get(week);
51   - Double high = highMap.get(week);
52   - if(addWeight < low || addWeight > high) {
53   - temp.put("username", patients.getUsername());
54   - temp.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), new Date()));
55   - temp.put("parentId", patientWeight.getPatientId());
56   - temp.put("id", patientWeight.getId());
57   - temp.put("day", entry.getKey());
58   - temp.put("desc", addWeight < low ? "增重过少" : "增重过多");
59   - temp.put("beforeWeight", patientWeight.getBeforeWeight());
60   - temp.put("nowWeight", patientWeight.getNowWeight());
61   - temp.put("addWeight", addWeight);
62   - temp.put("ckz", "(" + lowMap.get(0) + "~" + highMap.get(0) + ")");
63   - temp.put("type", ErrorPatientEnums.PATIENT_WEIGHT);
  102 + if(MapUtils.isNotEmpty(dayWeights) && CollectionUtils.isNotEmpty(dayWeights.entrySet())) {
  103 + for (Map.Entry<String, String> entry : dayWeights.entrySet()) {
  104 + System.out.println(patientWeight.getId() + ">>> " + entry);
  105 + if(DateUtil.parseYMD(entry.getKey()).getTime() >= yesterday.getTime()) {
  106 + patients = (patients == null ? mongoTemplate.findById(patientWeight.getPatientId(), Patients.class) : patients);
  107 + Integer week = DateUtil.getWeek2(patients.getLastMenses(), DateUtil.parseYMD(entry.getKey()));
  108 + Double addWeight = getAddWeight(patientWeight.getBeforeWeight(), entry.getValue());
  109 + Double low = lowMap.get(week);
  110 + Double high = highMap.get(week);
  111 + if(addWeight < low || addWeight > high) {
  112 + setTempInfo(patientWeight.getId() + ID_SEPARATOR + entry.getKey(), temp, patients, null, addWeight < low ? "增重过少" : "增重过多",
  113 + "(" + lowMap.get(0) + "~" + highMap.get(0) + ")", ErrorPatientEnums.PATIENT_WEIGHT, patientWeight.getCreated());
  114 + temp.put("beforeWeight", patientWeight.getBeforeWeight());
  115 + temp.put("nowWeight", patientWeight.getNowWeight());
  116 + temp.put("addWeight", addWeight);
  117 + }
64 118 }
65 119 }
  120 + if(MapUtils.isNotEmpty(temp)) {
  121 + restList.add(temp);
  122 + }
66 123 }
67   - if(MapUtils.isNotEmpty(temp)) {
68   - restList.add(temp);
69   - }
70 124 }
71 125  
  126 + /** 体温 */
72 127 for (TempModel tempModel : tempModels) {
73 128 Map<String, Object> temp = new HashMap<>();
74 129 LinkedHashMap<String, Double> tempList = tempModel.getTempList();
... ... @@ -77,15 +132,8 @@
77 132 if(DateUtil.parseYMD(entry.getKey()).getTime() >= yesterday.getTime()) {
78 133 if(entry.getValue() < 36D || entry.getValue() > 38.5D ) {
79 134 patients = (patients == null ? mongoTemplate.findById(tempModel.getParentId(), Patients.class) : patients);
80   - temp.put("username", patients.getUsername());
81   - temp.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), new Date()));
82   - temp.put("parentId", tempModel.getParentId());
83   - temp.put("id", tempModel.getId());
84   - temp.put("day", entry.getKey());
85   - temp.put("desc", entry.getValue() < 36D ? "低热" : "高热");
86   - temp.put("temp", entry.getValue());
87   - temp.put("ckz", "(36-37.4)");
88   - temp.put("type", ErrorPatientEnums.TEMP);
  135 + setTempInfo(tempModel.getId() + ID_SEPARATOR + entry.getKey(), temp, patients, entry.getValue() + " °C", entry.getValue() < 36D ? "低热" : "高热",
  136 + "(36-37.4)", ErrorPatientEnums.TEMP, tempModel.getModified());
89 137 }
90 138 }
91 139 }
... ... @@ -94,6 +142,33 @@
94 142 }
95 143 }
96 144 return restList;
  145 + }
  146 +
  147 + private void setTempInfo(String id, Map<String, Object> temp, Patients patients, String value, String desc, String ckz, ErrorPatientEnums errorPatientEnums, Date modified) {
  148 + if(patients == null) return;
  149 + temp.put("id", id);
  150 + temp.put("username", patients.getUsername());
  151 + temp.put("week", DateUtil.getWeekDesc(patients.getLastMenses(), new Date()));
  152 + temp.put("parentId", patients.getId());
  153 + temp.put("value", value);
  154 + temp.put("desc", desc);
  155 + temp.put("ckz", ckz);
  156 + temp.put("type", errorPatientEnums.getId());
  157 + temp.put("modified", modified);
  158 + }
  159 +
  160 + private String getBpStatus(String ssy, String szy) {
  161 + String status = null;
  162 + if(StringUtils.isNotEmpty(ssy) && StringUtils.isNotEmpty(szy)) {
  163 + if(Double.parseDouble(ssy) < 90 || Double.parseDouble(szy) < 60) {
  164 + status = "低血压";
  165 + } else if(Double.parseDouble(ssy) > 140 || Double.parseDouble(szy) < 90) {
  166 + status = "高血压";
  167 + } else {
  168 + status = "正常";
  169 + }
  170 + }
  171 + return status;
97 172 }
98 173  
99 174 /**
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveRecordFacade.java View file @ 01a5103
... ... @@ -132,6 +132,7 @@
132 132 SieveRecordModel patient = new SieveRecordModel();
133 133  
134 134 patient.setTime(DateUtil.getYMDTime());
  135 + patient.setFillDate(DateUtil.parseYMD(yunRequest.getFillDate()));
135 136  
136 137 patient.setPatientId(yunRequest.getPatientdId());
137 138  
138 139  
... ... @@ -251,12 +252,17 @@
251 252  
252 253  
253 254  
254   - public BaseResponse getSieveRecords(Integer status, String createTime,String keyword, Integer page, Integer limit, Integer userId) {
  255 + public BaseResponse getSieveRecords(Integer status, String createTime,String keyword,String provinceRegisterId,String cityRegisterId,String areaRegisterId,String streetRegisterId, Integer page, Integer limit, Integer userId) {
255 256  
256 257 String hospitalId = autoMatchFacade.getHospitalId(userId);
257 258 SieveRecordQuery query = new SieveRecordQuery();
258 259 query.setYn(YnEnums.YES.getId());
259 260  
  261 + query.setAreaId(provinceRegisterId);
  262 + query.setProvinceId(cityRegisterId);
  263 + query.setCityId(areaRegisterId);
  264 + query.setStreetId(streetRegisterId);
  265 +
260 266 query.setPage(page);
261 267 query.setLimit(limit);
262 268 query.setNeed("true");
... ... @@ -306,6 +312,7 @@
306 312 map.put("currentDueWeek",week); //当前孕周
307 313 map.put("dueDate",DateUtil.getyyyy_MM_dd(model.getDueDate())); //预产期
308 314 map.put("created",DateUtil.gety_m_dhm(model.getCreated()));//创建日期
  315 + map.put("fillDate",model.getFillDate() == null ? DateUtil.gety_m_dhm(model.getCreated()) : DateUtil.gety_m_dhm(model.getFillDate()));//填写日期
309 316 map.put("status",model.getStatus());//导出状态
310 317 map.put("statusStr",model.getStatus() == 0 ? "未导出" : "已导出");//导出状态
311 318 result.add(map);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/TempFacade.java View file @ 01a5103
... ... @@ -245,7 +245,7 @@
245 245 if(patients != null) {
246 246 tempModel.setPid(patients.getPid());
247 247 }
248   - mongoTemplate.save(tempModel);
  248 + tempService.addOneTemp(tempModel);
249 249 }
250 250 return RespBuilder.buildSuccess();
251 251 }
... ... @@ -262,6 +262,7 @@
262 262 restList.add(map);
263 263 }
264 264 }
  265 + com.lyms.platform.operate.web.utils.CollectionUtils.reverseList(restList);
265 266 return RespBuilder.buildSuccess(restList);
266 267 }
267 268 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 01a5103
... ... @@ -94,6 +94,9 @@
94 94 private YunBookbuildingService yunBookbuildingService;
95 95  
96 96 @Autowired
  97 + private AntenatalExaminationService antenatalExaminationService;
  98 +
  99 + @Autowired
97 100 private MongoTemplate mongoTemplate;
98 101  
99 102 @Autowired
... ... @@ -3727,6 +3730,165 @@
3727 3730 plantformConfigModel.setValue(id);
3728 3731 mongoTemplate.save(plantformConfigModel);
3729 3732 return RespBuilder.buildSuccess();
  3733 + }
  3734 +
  3735 + public BaseObjectResponse findMatDeliverPrint(String id) {
  3736 + BaseObjectResponse br = new BaseObjectResponse();
  3737 + MaternalDeliverModel data = matDeliverService.getOneMatDeliver(id);
  3738 + if (data == null || data.getYn() == YnEnums.NO.getId()) {
  3739 + br.setErrorcode(ErrorCodeConstants.NO_DATA);
  3740 + br.setErrormsg("没有查询到数据");
  3741 + return br;
  3742 + }
  3743 +
  3744 + Patients patients = patientsService.findOnePatientById(data.getParentId());
  3745 +
  3746 + if (patients == null) {
  3747 + br.setErrorcode(ErrorCodeConstants.PARAMETER_ERROR);
  3748 + br.setErrormsg("数据异常");
  3749 + return br;
  3750 + }
  3751 +
  3752 + Map<String, Object> map = new HashMap<>();
  3753 + map.put("id", data.getId());
  3754 +
  3755 + //新生儿信息
  3756 + List<Map<String, Object>> babyList = new ArrayList<>();
  3757 + if (CollectionUtils.isNotEmpty(data.getBaby())) {
  3758 + for (MaternalDeliverModel.Baby temp : data.getBaby()) {
  3759 + Map<String, Object> babyMap = new HashMap<>();
  3760 +
  3761 + //性别
  3762 + babyMap.put("babyGender", temp.getBabyGender() == null ? "" : SexEnum.getTextById(
  3763 + Integer.parseInt(temp.getBabyGender())));
  3764 + //分娩时间
  3765 + babyMap.put("dueTime", temp.getDueTime());
  3766 + //体重
  3767 + babyMap.put("babyWeight", UnitUtils.unitSplice(temp.getBabyWeight(), UnitConstants.G));
  3768 + //身高
  3769 + babyMap.put("babyHeight", UnitUtils.unitSplice(temp.getBabyHeight(), UnitConstants.CM));
  3770 + //健康状态
  3771 + babyMap.put("babyHealthy", temp.getBabyHealthy());
  3772 +
  3773 + babyList.add(babyMap);
  3774 + }
  3775 + }
  3776 +
  3777 + AntExChuQuery antExChuQuery = new AntExChuQuery();
  3778 + antExChuQuery.setYn(YnEnums.YES.getId());
  3779 + antExChuQuery.setParentId(patients.getId());
  3780 + List<AntExChuModel> list = antenatalExaminationService.queryAntExChu(antExChuQuery);
  3781 +
  3782 +
  3783 + String tc = "";
  3784 + String cc = "";
  3785 + if (CollectionUtils.isNotEmpty(list))
  3786 + {
  3787 + AntExChuModel chuModel = list.get(0);
  3788 + //孕次
  3789 + tc = chuModel.getPregnancyTimes() == null ? "" : String.valueOf(chuModel.getPregnancyTimes());
  3790 + // 产次
  3791 + tc = chuModel.getProdTime() == null ? "" : String.valueOf(chuModel.getProdTime());
  3792 + }
  3793 +
  3794 + map.put("baby", babyList);
  3795 + //胎次
  3796 + map.put("tc", "");
  3797 + //产次
  3798 + map.put("cc", "");
  3799 +
  3800 + //双胎
  3801 + map.put("isShuangTai", "");
  3802 +
  3803 + //生产状况
  3804 + map.put("scStatus", "");
  3805 +
  3806 + //接生方法
  3807 + map.put("jsff", "");
  3808 +
  3809 + //出生孕周
  3810 + map.put("dueWeek", data.getDueWeek());
  3811 +
  3812 +
  3813 + //母亲姓名
  3814 + map.put("username", patients.getUsername());
  3815 + //母亲年龄
  3816 + map.put("age", UnitUtils.unitSplice(DateUtil.getAge(patients.getBirth()), UnitConstants.SUI));
  3817 + //母亲地址
  3818 + map.put("motherAddr", "");
  3819 +
  3820 + //父亲姓名
  3821 + map.put("fatherName",patients.getHusbandName());
  3822 + //父亲年龄
  3823 + map.put("fatherAge", UnitUtils.unitSplice(DateUtil.getAge(patients.getHusbandBirth()), UnitConstants.SUI));
  3824 + //父亲工作单位
  3825 + map.put("fatherWorkUnit", patients.getHworkUnit());
  3826 +
  3827 +
  3828 + //出生地点(县)
  3829 + map.put("csAddress", "");
  3830 +
  3831 +
  3832 + String fmHospital = "";
  3833 + if (StringUtils.isNotEmpty(data.getFmHospital())) {
  3834 + if (com.lyms.platform.common.utils.StringUtils.isNum(data.getFmHospital())) {
  3835 + Organization organization = organizationService.getOrganization(Integer.parseInt(data.getFmHospital()));
  3836 + if (organization != null && organization.getYn() == YnEnums.YES.getId()) {
  3837 + fmHospital = organization.getName();
  3838 + }
  3839 + } else {
  3840 + fmHospital = data.getFmHospital();
  3841 + }
  3842 +
  3843 + }
  3844 + //分娩医院
  3845 + map.put("fmHospital", fmHospital);
  3846 +
  3847 + //新生儿缺陷
  3848 + map.put("xseqx", "");
  3849 +
  3850 + //诊断
  3851 + map.put("zhenDuan", "");
  3852 +
  3853 +
  3854 + //母亲身份证号码
  3855 + map.put("motherCardNo", patients.getCardNo());
  3856 +
  3857 + //父亲身份证号码
  3858 + map.put("motherCardNo", patients.getHcertificateNum());
  3859 +
  3860 + String deliverDoctor = "";
  3861 +
  3862 + if (StringUtils.isNotEmpty(data.getDeliverDoctor())) {
  3863 + if (com.lyms.platform.common.utils.StringUtils.isNum(data.getDeliverDoctor())) {
  3864 + Users users = usersService.getUsers(Integer.parseInt(data.getDeliverDoctor()));
  3865 + if (users != null && users.getYn() == YnEnums.YES.getId()) {
  3866 + deliverDoctor = users.getName();
  3867 + }
  3868 + } else {
  3869 + deliverDoctor = data.getDeliverDoctor();
  3870 + }
  3871 + }
  3872 +
  3873 + //接生者
  3874 + map.put("deliverDoctor", deliverDoctor);
  3875 +
  3876 + //签发日期
  3877 + map.put("qfDate", DateUtil.getyyyy_MM_dd(new Date()));
  3878 +
  3879 + //母亲国籍
  3880 + map.put("motherGj", "");
  3881 +
  3882 + //母亲民族
  3883 + map.put("motherMz", "");
  3884 +
  3885 + //家庭住址
  3886 + map.put("homeAddress", "");
  3887 +
  3888 + br.setErrorcode(ErrorCodeConstants.SUCCESS);
  3889 + br.setErrormsg("成功");
  3890 + br.setData(map);
  3891 + return br;
3730 3892 }
3731 3893 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/YunBookbuildingAddRequest.java View file @ 01a5103
... ... @@ -289,6 +289,19 @@
289 289  
290 290 private String patientdId;
291 291  
  292 + //填写日期
  293 + @FormParam
  294 + @NotEmpty(message = "填写日期")
  295 + private String fillDate;
  296 +
  297 + public String getFillDate() {
  298 + return fillDate;
  299 + }
  300 +
  301 + public void setFillDate(String fillDate) {
  302 + this.fillDate = fillDate;
  303 + }
  304 +
292 305 public String getPatientdId() {
293 306 return patientdId;
294 307 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodPressureServiceImpl.java View file @ 01a5103
... ... @@ -51,13 +51,13 @@
51 51 public BaseResponse addOrUpdate(Integer userId, BloodPressure bloodPressure) {
52 52 String hospitalId = autoMatchFacade.getHospitalId(userId);
53 53 Map<String, Object> temp = new LinkedHashMap<>();
  54 + bloodPressure.setModified(new Date());
54 55 temp.put("szy", bloodPressure.getSzy());
55 56 temp.put("ssy", bloodPressure.getSsy());
56 57 temp.put("pulse", bloodPressure.getPulse());
57 58 temp.put("timestamp", DateUtil.getyyyy_MM_dd_hms(new Date()));
58 59 temp.put("hospitalId", hospitalId);
59 60 BloodPressure bp = mongoTemplate.findOne(Query.query(Criteria.where("parentId").is(bloodPressure.getParentId()).and("yn").ne(0)), BloodPressure.class);
60   - bloodPressure.setModified(new Date());
61 61 if(bp == null) {
62 62 String parentId = mongoUtil.doHidePatient(bloodPressure.getParentId(), hospitalId);
63 63 bloodPressure.setParentId(parentId);
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/BloodSugarServiceImpl.java View file @ 01a5103
... ... @@ -230,7 +230,7 @@
230 230 for (BloodSugar bloodSugar : bloodSugars) {
231 231 Map<String, Object> temp = new HashMap<>();
232 232 temp.put("bloodSugar", bloodSugar.getBloodSugar());
233   - temp.put("craeted", bloodSugar.getCreated());
  233 + temp.put("craeted", DateUtil.getyyyy_MM_dd_hms(bloodSugar.getCreated()));
234 234 temp.put("type", bloodSugar.getBloodSugarType());
235 235 restList.add(temp);
236 236 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/CollectionUtils.java View file @ 01a5103
... ... @@ -209,5 +209,16 @@
209 209 return data.subList(startIndex, endIndex);
210 210 }
211 211  
  212 + public static void reverseList(List<Map<String, Object>> restList) {
  213 + if(CollectionUtils.isNotEmpty(restList)) {
  214 + List<Map<String, Object>> tempList = new ArrayList<>();
  215 + int size = restList.size();
  216 + for (int i = size - 1; i > 0 ; i--) {
  217 + tempList.add(restList.get(i));
  218 + }
  219 + restList.clear();
  220 + restList.addAll(tempList);
  221 + }
  222 + }
212 223 }