Commit 3cc4affd5ca121ee2a5437f539006d30ed2b8feb

Authored by liquanyu
1 parent 5372250935

code update

Showing 4 changed files with 208 additions and 2 deletions

platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java View file @ 3cc4aff
... ... @@ -299,6 +299,7 @@
299 299 return tireData;
300 300 }
301 301  
  302 +
302 303 public void setTireData(List tireData) {
303 304 this.tireData = tireData;
304 305 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java View file @ 3cc4aff
... ... @@ -153,8 +153,22 @@
153 153 @RequestParam(required = false) String keyWord,
154 154 @RequestParam(required = false) Integer page,
155 155 @RequestParam(required = false) Integer limit){
156   -// LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
157   - BaseObjectResponse objectResponse = bookbuildingFacade.queryHospitals(keyWord, page,limit);
  156 + BaseObjectResponse objectResponse = bookbuildingFacade.queryHospitals(keyWord, page, limit);
  157 + return objectResponse;
  158 + }
  159 +
  160 + /**
  161 + * 产检报告
  162 + * @param request
  163 + * @return
  164 + */
  165 +
  166 + @RequestMapping(value = "/queryChanJianReport", method = RequestMethod.GET)
  167 + @ResponseBody
  168 + @TokenRequired
  169 + public BaseObjectResponse queryChanJianReport(HttpServletRequest request){
  170 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  171 + BaseObjectResponse objectResponse = bookbuildingFacade.queryChanJianReport(loginState.getId());
158 172 return objectResponse;
159 173 }
160 174 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 3cc4aff
... ... @@ -15,6 +15,7 @@
15 15 import com.lyms.platform.operate.web.result.BookbuildingRecordResult;
16 16 import com.lyms.platform.operate.web.result.HighScoreResult;
17 17 import com.lyms.platform.operate.web.result.PregnantInfoResult;
  18 +import com.lyms.platform.operate.web.utils.JdbcUtil;
18 19 import com.lyms.platform.operate.web.utils.MessageCenterService;
19 20 import com.lyms.platform.permission.model.Organization;
20 21 import com.lyms.platform.permission.model.OrganizationQuery;
... ... @@ -1042,6 +1043,46 @@
1042 1043  
1043 1044 BaseObjectResponse objectResponse = new BaseObjectResponse();
1044 1045 objectResponse.setData(mapList);
  1046 +
  1047 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  1048 + objectResponse.setErrormsg("成功");
  1049 + return objectResponse;
  1050 + }
  1051 +
  1052 + public BaseObjectResponse queryChanJianReport(Integer userId) {
  1053 +
  1054 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  1055 + String sql = "SELECT A.EXAMINE_DATE,\n" +
  1056 + " A.NAME,\n" +
  1057 + " A.AGE,\n" +
  1058 + " A.NOW_WEEKS,\n" +
  1059 + " A.NOW_WEEKS_DAY,\n" +
  1060 + " B.EDD_DATE,\n" +
  1061 + " A.HBSAG,\n" +
  1062 + " A.HBSAB,\n" +
  1063 + " A.HBEAG,\n" +
  1064 + " A.HBEAB,\n" +
  1065 + " A.HBCAB,\n" +
  1066 + " A.SYPHILIS,\n" +
  1067 + " A.HIV,\n" +
  1068 + " A.HCV,\n" +
  1069 + " (CASE WHEN A.HIGH_RISK_GRADE IS NULL THEN '绿色预警' ELSE A.HIGH_RISK_GRADE END) AS HIGH_RISK_GRADE,\n" +
  1070 + " (CASE WHEN A.HIGH_RISK_FACTOR IS NULL THEN '健康' ELSE A.HIGH_RISK_FACTOR END) AS HIGH_RISK_FACTOR,\n" +
  1071 + " A.NEXT_EXAMINE_DATE,\n" +
  1072 + " A.EXAMINE_HISTORY_NUM,\n" +
  1073 + " A.DOCTOR_NAME,\n" +
  1074 + " A.DOCTOR_NAME AS BOOKER,\n" +
  1075 + " DECODE(B.IS_VIP_ID,1,'增值服务','标准服务') AS SERVICE_STATUS,\n" +
  1076 + " A.SUGGESTION,\n" +
  1077 + " B.TEL_NO,\n" +
  1078 + " B.HOME_ADDR\n" +
  1079 + " FROM ODS_F_AUXILIARY_EXAMI A\n" +
  1080 + " INNER JOIN ODS_F_GRAVIDA_RECORD B ON A.RECORD_ID=B.RECORD_ID\n" +
  1081 + " INNER JOIN ODS_D_HOSPITAL C ON A.HOSPITAL_NO=C.HOSPITAL_NO\n" +
  1082 + " WHERE C.YCY_STSTEM_ID= '"+hospitalId+"'";
  1083 + List<Map<String,Object>> list = JdbcUtil.getListDataBySql(sql);
  1084 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  1085 + objectResponse.setData(list);
1045 1086  
1046 1087 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
1047 1088 objectResponse.setErrormsg("成功");
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/JdbcUtil.java View file @ 3cc4aff
  1 +package com.lyms.platform.operate.web.utils;
  2 +
  3 +import java.sql.*;
  4 +import java.util.ArrayList;
  5 +import java.util.HashMap;
  6 +import java.util.List;
  7 +import java.util.Map;
  8 +
  9 +/**
  10 + * Created by Administrator on 2016/9/29.
  11 + */
  12 +public class JdbcUtil {
  13 + public static Connection getOracleConnection() {
  14 + Connection con = null;
  15 + try {
  16 + Class.forName("oracle.jdbc.driver.OracleDriver");
  17 + String url = "jdbc:oracle:thin:@192.168.1.32:1521:orcl";
  18 + String userName = "LYMS_ODS";
  19 + String pwd = "Welcome1";
  20 + con = DriverManager.getConnection(url, userName, pwd);
  21 + } catch (Exception e) {
  22 + e.printStackTrace();
  23 + }
  24 + return con;
  25 + }
  26 +
  27 +
  28 + public static Connection getMysqlConnection() {
  29 + Connection con = null;
  30 + try {
  31 + Class.forName("com.mysql.jdbc.Driver");
  32 + String url = "jdbc:mysql://119.90.57.26:3306/platform?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
  33 + String userName = "platform";
  34 + String pwd = "platform123";
  35 + con = DriverManager.getConnection(url, userName, pwd);
  36 + } catch (Exception e) {
  37 + e.printStackTrace();
  38 + }
  39 + return con;
  40 + }
  41 +
  42 + public static void freeConnection(Connection connection,PreparedStatement ps,ResultSet rs){
  43 + try {
  44 + if(rs != null){
  45 + rs.close();
  46 + }
  47 + if(ps != null){
  48 + ps.close();
  49 + }
  50 + if( null != connection)
  51 + {
  52 + connection.close();
  53 + }
  54 + } catch (SQLException e) {
  55 + }
  56 + }
  57 +
  58 + /**
  59 + *
  60 + * @param sql
  61 + * @return
  62 + */
  63 + public static List<Map<String,Object>> getListDataBySql(String sql)
  64 + {
  65 + Connection conn = getOracleConnection();
  66 + PreparedStatement pst = null;
  67 + ResultSet rs = null;
  68 + List<Map<String,Object>> list = new ArrayList<>();
  69 + try {
  70 + pst = conn.prepareStatement(sql);
  71 + rs = pst.executeQuery();
  72 + int count = rs.getMetaData().getColumnCount();
  73 + while (rs.next()) {
  74 + Map<String,Object> maps = new HashMap<>();
  75 + for (int i = 1; i <= count; i++) {
  76 + String columnName = rs.getMetaData().getColumnName(i);
  77 + Object obj = rs.getObject(columnName);
  78 + if (obj != null) {
  79 + maps.put(columnName, obj);
  80 + }
  81 + else
  82 + {
  83 + maps.put(columnName,null);
  84 + }
  85 + }
  86 + list.add(maps);
  87 + }
  88 + }catch (Exception e)
  89 + {
  90 + e.printStackTrace();
  91 + } finally {
  92 + freeConnection(conn,pst,rs);
  93 + }
  94 + return list;
  95 + }
  96 +
  97 + public static Object getOralceSingleObjBySql(String sql)
  98 + {
  99 + Connection conn = getOracleConnection();
  100 + PreparedStatement pst = null;
  101 + ResultSet rs = null;
  102 + try {
  103 + pst = conn.prepareStatement(sql);
  104 + rs = pst.executeQuery();
  105 + int count = rs.getMetaData().getColumnCount();
  106 + for (int i = 1 ; i <= count ;i++)
  107 + {
  108 + String columnName = rs.getMetaData().getColumnName(i);
  109 + while (rs.next()){
  110 + return rs.getObject(columnName);
  111 + }
  112 +
  113 + }
  114 + }catch (Exception e)
  115 + {
  116 + e.printStackTrace();
  117 + } finally {
  118 + freeConnection(conn,pst,rs);
  119 + }
  120 + return null;
  121 + }
  122 +
  123 +
  124 + public static Object getMysqlSingleObjBySql(String sql)
  125 + {
  126 + Connection conn = getMysqlConnection();
  127 + PreparedStatement pst = null;
  128 + ResultSet rs = null;
  129 + try {
  130 + pst = conn.prepareStatement(sql);
  131 + rs = pst.executeQuery();
  132 + int count = rs.getMetaData().getColumnCount();
  133 + for (int i = 1 ; i <= count ;i++)
  134 + {
  135 + String columnName = rs.getMetaData().getColumnName(i);
  136 + while (rs.next()){
  137 + return rs.getObject(columnName);
  138 + }
  139 +
  140 + }
  141 + }catch (Exception e)
  142 + {
  143 + e.printStackTrace();
  144 + } finally {
  145 + freeConnection(conn,pst,rs);
  146 + }
  147 + return null;
  148 + }
  149 +
  150 +}