Commit 3e668bfb01927836ddd7593d77ddf844843de9e2

Authored by wtt
1 parent 094ca037ca

update

Showing 12 changed files with 168 additions and 20 deletions

platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/MasterOrganizationMapper.java View file @ 3e668bf
... ... @@ -42,5 +42,7 @@
42 42 List<Map<String, Object>> findIdByTownOrgId(@Param("townOrgId") String townOrgId);
43 43  
44 44 List<Organization> getOrganizationByHosps(@Param("hospPermissions") List<String> hospPermissions);
  45 +
  46 + List<Organization> getOrganizationByHospsHs(@Param("hospPermissions") List<String> hospPermissions);
45 47 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/OrganizationService.java View file @ 3e668bf
... ... @@ -47,5 +47,6 @@
47 47 List<Map<String, Object>> findIdByTownOrgId(String townOrgId);
48 48  
49 49 List<Organization> getOrganizationByHosps(List<String> hospPermissions);
  50 + List<Organization> getOrganizationByHospsHs(List<String> hospPermissions);
50 51 }
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/OrganizationServiceImpl.java View file @ 3e668bf
... ... @@ -328,6 +328,10 @@
328 328 public List<Organization> getOrganizationByHosps(List<String> hospPermissions) {
329 329 return masterOrganizationMapper.getOrganizationByHosps(hospPermissions);
330 330 }
  331 + @Override
  332 + public List<Organization> getOrganizationByHospsHs(List<String> hospPermissions) {
  333 + return masterOrganizationMapper.getOrganizationByHospsHs(hospPermissions);
  334 + }
331 335  
332 336 }
platform-biz-service/src/main/resources/mainOrm/master/BabyDiagnoseMapper.xml View file @ 3e668bf
... ... @@ -137,7 +137,7 @@
137 137 <select id="queryBabyDiagnosesList" parameterType="com.lyms.platform.permission.model.BabyDiagnoseQuery"
138 138 resultMap="babyDiagnoseResultMap">
139 139 SELECT
140   - id,blh,syxh,hzxm,birth,
  140 + type,id,blh,syxh,hzxm,birth,
141 141 birthtime,sex,sfzh,lxdh,lxdz,lxr,lxrdh,
142 142 curraddr,lrrq,ryrq,rqrq,cyrq,cqrq,cyzddm,
143 143 cyzdmc,ksdm,bqdm,mblh,msyxh,isbuild
platform-biz-service/src/main/resources/mainOrm/master/MasterOrganization.xml View file @ 3e668bf
... ... @@ -291,6 +291,17 @@
291 291 </foreach>
292 292 </select>
293 293  
294   -
  294 + <select id="getOrganizationByHospsHs" resultType="com.lyms.platform.permission.model.Organization">
  295 + SELECT
  296 + id,
  297 + NAME as "name"
  298 + FROM
  299 + organization
  300 + WHERE
  301 + id IN
  302 + <foreach collection="hospPermissions" item="item" open="(" close=")" separator=",">
  303 + #{item}
  304 + </foreach>
  305 + </select>
295 306 </mapper>
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/BabyDischargeDiagnosisModel.java View file @ 3e668bf
... ... @@ -6,6 +6,9 @@
6 6 import com.lyms.platform.pojo.BabyDiagnoseModel;
7 7  
8 8 public class BabyDischargeDiagnosisModel implements IBasicRequestConvert<BabyDiagnoseModel> {
  9 +
  10 + //1新生儿科 2 产科住院数据
  11 + private String type;
9 12 //病历号=住院号
10 13 private String blh;
11 14  
... ... @@ -74,6 +77,14 @@
74 77 return syxh;
75 78 }
76 79  
  80 + public String getType() {
  81 + return type;
  82 + }
  83 +
  84 + public void setType(String type) {
  85 + this.type = type;
  86 + }
  87 +
77 88 public void setSyxh(String syxh) {
78 89 this.syxh = syxh;
79 90 }
80 91  
... ... @@ -305,10 +316,13 @@
305 316 model.setBqdm(bqdm);
306 317 model.setMblh(mblh);
307 318 model.setMsyxh(msyxh);
  319 + model.setType(type);
308 320  
309 321 model.setIsbuild(1);
310 322  
311 323 return model;
312 324 }
  325 +
  326 +
313 327 }
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/ConnTools.java View file @ 3e668bf
... ... @@ -59,6 +59,10 @@
59 59 private static String jbgwUser = "LYMS_QHD_JBGW";
60 60 private static String jbgwPassword = "LYMS_QHD_JBGW";
61 61  
  62 + private static String qhdzdDirverClassName = "oracle.jdbc.driver.OracleDriver";
  63 + private static String qhdzdUrl = "jdbc:oracle:thin:@168.254.0.80:1521:jhemr";
  64 + private static String qhdzdUser = "lyms";
  65 + private static String qhdzdPassword = "lyms";
62 66  
63 67 private static String tyDirverClassName = "oracle.jdbc.driver.OracleDriver";
64 68 private static String tyUrl = "jdbc:oracle:thin:@13.14.12.82:1526:orcl";
... ... @@ -143,7 +147,20 @@
143 147 return conn;
144 148 }
145 149  
146   -
  150 + public static Connection qhdzdConnection() {
  151 + Connection conn = null;
  152 + try {
  153 + Class.forName(qhdzdDirverClassName);
  154 + } catch (ClassNotFoundException e) {
  155 + e.printStackTrace();
  156 + }
  157 + try {
  158 + conn = DriverManager.getConnection(qhdzdUrl, qhdzdUser, qhdzdPassword);
  159 + } catch (SQLException e) {
  160 + e.printStackTrace();
  161 + }
  162 + return conn;
  163 + }
147 164  
148 165 public static Connection makeQhdTyConnection() {
149 166 Connection conn = null;
platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java View file @ 3e668bf
... ... @@ -1020,17 +1020,15 @@
1020 1020 //新生儿科和产科返回数据字段相同
1021 1021 List<BabyDischargeDiagnosisModel> list = null;
1022 1022  
1023   - //新生儿,
  1023 + //新生儿住院婴儿,
1024 1024 if("1".equals(type)){
1025   - // 1 获取基础数据
1026 1025 Connection conn = null;
1027   - String sql = "select blh,syxh,hzxm,birth,birthtime,sex,sfzh,lxdh,lxdz,lxr,lxrdh,curraddr,lrrq,ryrq,rqrq,cyrq,cqrq,cyzddm,cyzdmc,ksdm,bqdm,mblh,msyxh from VW_LYMS_XSE_BRSYK where cyrq is not null and mblh is null ";
  1026 +// String sql = "select blh,syxh,hzxm,birth,birthtime,sex,sfzh,lxdh,lxdz,lxr,lxrdh,curraddr,lrrq,ryrq,rqrq,cyrq,cqrq,cyzddm,cyzdmc,ksdm,bqdm,mblh,msyxh from VW_LYMS_XSE_BRSYK where cyrq is not null and mblh is null ";
  1027 + String sql = "select type='1',blh,syxh,hzxm,birth,birthtime,sex,sfzh,lxdh,lxdz,lxr,lxrdh,curraddr,lrrq,ryrq,rqrq,cyrq,cqrq,cyzddm,cyzdmc,ksdm,bqdm,mblh,msyxh from VW_LYMS_XSE_BRSYK where cyrq is not null and ksdm ='2545' and bqdm <> '206' ";
1028 1028 try {
1029   -
1030 1029 if (StringUtils.isNotEmpty(lrrqStart) && StringUtils.isNotEmpty(lrrqEnd)) {
1031 1030 sql += " and lrrq >= CONVERT(varchar(100),'" + lrrqStart + "', 120) and lrrq <= CONVERT(varchar(100),'" + lrrqEnd + "', 120)";
1032 1031 }
1033   -
1034 1032 conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeHisConnection();
1035 1033 QueryRunner queryRunner = new QueryRunner();
1036 1034  
1037 1035  
1038 1036  
1039 1037  
1040 1038  
1041 1039  
... ... @@ -1040,22 +1038,17 @@
1040 1038 } finally {
1041 1039 DbUtils.closeQuietly(conn);
1042 1040 }
1043   - // 2 获取详情数据,查询80数据库获取详情,在将结果遍历填充到list详情字段
  1041 + // 2 获取诊断详情结果遍历填充到list详情字段
  1042 + getDetails(list, conn, sql);
1044 1043  
1045   -
1046   -
1047   -
1048 1044 }//产科住院数据
1049 1045 else if ("2".equals(type)){
1050   - //1 获取基础数据
1051 1046 Connection conn = null;
1052   - String sql = "select blh,syxh,hzxm,birth,birthtime,sex,sfzh,lxdh,lxdz,lxr,lxrdh,curraddr,lrrq,ryrq,rqrq,cyrq,cqrq,cyzddm,cyzdmc,ksdm,bqdm,mblh,msyxh from VW_LYMS_XSE_BRSYK where cyrq is not null and mblh is null ";
  1047 + String sql = "select type='2',blh,syxh,hzxm,birth,birthtime,sex,sfzh,lxdh,lxdz,lxr,lxrdh,curraddr,lrrq,ryrq,rqrq,cyrq,cqrq,cyzddm,cyzdmc,ksdm,bqdm,mblh,msyxh from VW_LYMS_XSE_BRSYK where cyrq is not null and ksdm ='2545' and bqdm <> '206' ";
1053 1048 try {
1054   -
1055 1049 if (StringUtils.isNotEmpty(lrrqStart) && StringUtils.isNotEmpty(lrrqEnd)) {
1056 1050 sql += " and lrrq >= CONVERT(varchar(100),'" + lrrqStart + "', 120) and lrrq <= CONVERT(varchar(100),'" + lrrqEnd + "', 120)";
1057 1051 }
1058   -
1059 1052 conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeHisConnection();
1060 1053 QueryRunner queryRunner = new QueryRunner();
1061 1054  
1062 1055  
1063 1056  
1064 1057  
... ... @@ -1065,15 +1058,43 @@
1065 1058 } finally {
1066 1059 DbUtils.closeQuietly(conn);
1067 1060 }
1068   - // 2 获取详情数据,查询80数据库获取详情,在将结果遍历填充到list详情字段
  1061 + getDetails(list, conn, sql);
  1062 + }
1069 1063  
1070 1064  
1071 1065  
1072   - }
  1066 + return list;
  1067 + }
1073 1068  
  1069 + private void getDetails(List<BabyDischargeDiagnosisModel> list, Connection conn, String sql) {
  1070 + if(CollectionUtils.isNotEmpty(list)){
  1071 + for (int i = 0; i <list.size() ; i++) {
  1072 + BabyDischargeDiagnosisModel babyDischargeDiagnosisModel = list.get(i);
  1073 + if(babyDischargeDiagnosisModel!=null && StringUtils.isNotEmpty(babyDischargeDiagnosisModel.getSyxh())){
  1074 + String sqlstr = "select ZDMC as cyzdmc from jhemr.v_卫宁诊断数据 where syxh='"+babyDischargeDiagnosisModel.getSyxh()+"' ORDER BY ZDRQ desc;";
  1075 + try {
  1076 + conn = ConnTools.qhdzdConnection();
  1077 + System.out.println("获取80数据库连接:"+conn);
  1078 + QueryRunner queryRunner = new QueryRunner();
  1079 + List<BabyDischargeDiagnosisModel> listxq = queryRunner.query(conn, sql, new BeanListHandler<BabyDischargeDiagnosisModel>(BabyDischargeDiagnosisModel.class));
  1080 + String cyzdxq = "";
  1081 + for (int j = 0; j < listxq.size(); j++) {
  1082 + BabyDischargeDiagnosisModel babyDischargeDiagnosisModel1 = listxq.get(i);
  1083 + if(babyDischargeDiagnosisModel1 !=null && StringUtils.isNotEmpty(babyDischargeDiagnosisModel1.getCyzdmc())){
  1084 + cyzdxq = babyDischargeDiagnosisModel1.getCyzdmc()+" ";
  1085 + }
  1086 + }
  1087 + babyDischargeDiagnosisModel.setCyzdmc(cyzdxq);//将诊断详情覆盖以前的主要诊断
  1088 + } catch (SQLException e) {
  1089 + e.printStackTrace();
  1090 + }finally {
  1091 + DbUtils.closeQuietly(conn);
  1092 + }
  1093 + }
1074 1094  
1075 1095  
1076   - return list;
  1096 + }
  1097 + }
1077 1098 }
1078 1099  
1079 1100  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java View file @ 3e668bf
... ... @@ -287,7 +287,27 @@
287 287 BaseObjectResponse objectResponse = bookbuildingFacade.queryHospitals(keyWord, page, limit);
288 288 return objectResponse;
289 289 }
290   -
  290 + /**
  291 + * 衡水产筛区域统计查询申请医院下拉框,权限限制
  292 + *
  293 + * @param request
  294 + * @param keyWord
  295 + * @param page
  296 + * @param limit
  297 + * @Author: 武涛涛
  298 + * @Date: 2020/7/17 16:33
  299 + */
  300 + @RequestMapping(value = "/queryHospitalsHs", method = RequestMethod.GET)
  301 + @ResponseBody
  302 + @TokenRequired
  303 + public BaseObjectResponse queryHospitalsHs(HttpServletRequest request,
  304 + @RequestParam(required = false) String keyWord,
  305 + @RequestParam(required = false) Integer page,
  306 + @RequestParam(required = false) Integer limit) {
  307 + LoginContext loginState = (LoginContext) request.getAttribute("loginContext");
  308 + BaseObjectResponse objectResponse = bookbuildingFacade.queryHospitalsHs(loginState.getId(),keyWord, page, limit);
  309 + return objectResponse;
  310 + }
291 311  
292 312 public static final String center_statistics_url = PropertiesUtils.getPropertyValue("center_statistics_url");
293 313  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ 3e668bf
... ... @@ -4348,6 +4348,7 @@
4348 4348 map.put("contactsPhone", info.getLxrdh());
4349 4349 map.put("contactPhone", info.getLxdh());
4350 4350 map.put("contacts", info.getLxr());
  4351 + map.put("type", info.getType());
4351 4352 result.add(map);
4352 4353 }
4353 4354 }
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java View file @ 3e668bf
... ... @@ -102,6 +102,8 @@
102 102 @Autowired
103 103 private SmsTemplateService smsTemplateService;
104 104  
  105 + @Autowired
  106 + private DataPermissionService dataPermissionService;
105 107  
106 108 @Autowired
107 109 private AutoMatchFacade autoMatchFacade;
... ... @@ -2199,6 +2201,59 @@
2199 2201 BaseObjectResponse objectResponse = new BaseObjectResponse();
2200 2202 objectResponse.setData(mapList);
2201 2203  
  2204 + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
  2205 + objectResponse.setErrormsg("成功");
  2206 + return objectResponse;
  2207 + }
  2208 + /**
  2209 + * 获取医院列表,授权限限制
  2210 + *
  2211 + * @param keyWord
  2212 + * @param page
  2213 + * @param limit
  2214 + * @Author: 武涛涛
  2215 + * @Date: 2020/7/17 16:35
  2216 + */
  2217 + public BaseObjectResponse queryHospitalsHs( Integer userId,String keyWord, Integer page, Integer limit) {
  2218 +
  2219 + String hospitalId = autoMatchFacade.getHospitalId(userId);
  2220 + List<String> hospitalList = new ArrayList<>();
  2221 + if(null!=hospitalId){
  2222 + //当前用户本院
  2223 + hospitalList.add(hospitalId);
  2224 + }
  2225 + //查询用户是否有区域权限
  2226 + DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery();
  2227 + dataPermissionsModelQuery.setUserId(userId);
  2228 + List<DataPermissionsModel> permissionsModels = dataPermissionService.queryPermission(dataPermissionsModelQuery);
  2229 + if (CollectionUtils.isNotEmpty(permissionsModels)) {
  2230 + Set<String> set = permissionsModels.get(0).getData().keySet();
  2231 + Iterator<String> it = set.iterator();
  2232 + while (it.hasNext()) {
  2233 + String id = it.next();
  2234 + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(id) && !hospitalList.contains(id)) {
  2235 + hospitalList.add(id);
  2236 + }
  2237 + }
  2238 + }
  2239 +
  2240 + List<Map<String, String>> mapList = new ArrayList<>();
  2241 + List<String> hospPermissions = new ArrayList<>();
  2242 + hospPermissions.addAll(hospitalList);
  2243 + if (CollectionUtils.isNotEmpty(hospPermissions)) {
  2244 + List<Organization> organizations = organizationService.getOrganizationByHospsHs(hospPermissions);
  2245 + if (CollectionUtils.isNotEmpty(organizations)) {
  2246 + for (Organization model : organizations) {
  2247 + Map data = new HashMap();
  2248 + data.put("id", model.getId());
  2249 + data.put("name", model.getName());
  2250 + mapList.add(data);
  2251 + }
  2252 + }
  2253 + }
  2254 +
  2255 + BaseObjectResponse objectResponse = new BaseObjectResponse();
  2256 + objectResponse.setData(mapList);
2202 2257 objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS);
2203 2258 objectResponse.setErrormsg("成功");
2204 2259 return objectResponse;
platform-operate-api/src/main/resources/mybatis.xml View file @ 3e668bf
... ... @@ -12,6 +12,8 @@
12 12 <setting name="defaultExecutorType" value="SIMPLE" />
13 13 <setting name="defaultStatementTimeout" value="25000" />
14 14 <setting name="callSettersOnNulls" value="true"/>
  15 + <!-- 控制台打印sql语句
  16 + <setting name="logImpl" value="STDOUT_LOGGING"/>-->
15 17 </settings>
16 18 <!--<plugins>-->
17 19 <!--<plugin interceptor="com.lyms.platform.operate.web.inteceptor.MybatisSqlInterceptor">-->