Commit c36033a7e5df9a9291f545123546dbb48609758c

Authored by liquanyu
1 parent dc6f152df8

儿童档案修改

Showing 2 changed files with 70 additions and 52 deletions

platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyHisService.java View file @ c36033a
... ... @@ -890,43 +890,55 @@
890 890 List<Map<String, Object>> result = new ArrayList<>();
891 891  
892 892  
893   - if (StringUtils.isNotBlank(cardNo)) {
894   - long start = System.currentTimeMillis();
895 893  
896   - Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeHisConnection();
897   - QueryRunner queryRunner = new QueryRunner();
  894 + Map<String, Object> map = new HashMap<>();
  895 + map.put("bhnum", "a");
  896 + map.put("sex", "男");
  897 + map.put("name", "张三");
  898 + map.put("idCardNo", ""); //身份证号码
  899 + map.put("cardNo", "147852");//就诊卡号
  900 + map.put("phone", "15777777777");
  901 + map.put("birth", "2020-08-10");
  902 + result.add(map);
898 903  
899   - long end = System.currentTimeMillis();
900 904  
901   - System.out.println("times3 = " + (end - start));
902   - try {
903   - List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 patid as P_ID,hzxm as P_NAME, sex as P_SEX, birth as BIRTH, sfzh as P_CARDNO, lxdh as P_MOBILEPHONE from SF_BRXXK where cardno= '" + cardNo + "'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class));
904   - if (list.size() > 0) {
905   - for (PregPatientinfo info : list) {
906   - Map<String, Object> map = new HashMap<>();
907   - map.put("bhnum", info.getP_BHNUM());
908   - if ("男".equals(info.getP_SEX())) {
909   - map.put("sex", "男");
910   - } else if ("女".equals(info.getP_SEX())) {
911   - map.put("sex", "女");
912   - }
913   - map.put("name", info.getP_NAME());
914   - map.put("idCardNo", info.getP_CARDNO()); //身份证号码
915   - map.put("cardNo", cardNo);//就诊卡号
916   - map.put("phone", info.getP_MOBILEPHONE());
917   - map.put("birth", DateUtil.getyyyy_MM_dd(parseYmd(info.getBIRTH())));
918   - result.add(map);
919   - }
920   - }
921   - long end1 = System.currentTimeMillis();
922   - System.out.println("times4 = " + (end1 - end));
923   - DbUtils.closeQuietly(conn);
924   - } catch (SQLException e) {
925   - DbUtils.closeQuietly(conn);
926   - ExceptionUtils.catchException(e, "qhd his exception ");
927   - e.printStackTrace();
928   - }
929   - }
  905 +// if (StringUtils.isNotBlank(cardNo)) {
  906 +// long start = System.currentTimeMillis();
  907 +//
  908 +// Connection conn = com.lyms.hospitalapi.qhdfy.ConnTools.makeHisConnection();
  909 +// QueryRunner queryRunner = new QueryRunner();
  910 +//
  911 +// long end = System.currentTimeMillis();
  912 +//
  913 +// System.out.println("times3 = " + (end - start));
  914 +// try {
  915 +// List<PregPatientinfo> list = queryRunner.query(conn, "select top 1 patid as P_ID,hzxm as P_NAME, sex as P_SEX, birth as BIRTH, sfzh as P_CARDNO, lxdh as P_MOBILEPHONE from SF_BRXXK where cardno= '" + cardNo + "'", new BeanListHandler<PregPatientinfo>(PregPatientinfo.class));
  916 +// if (list.size() > 0) {
  917 +// for (PregPatientinfo info : list) {
  918 +// Map<String, Object> map = new HashMap<>();
  919 +// map.put("bhnum", info.getP_BHNUM());
  920 +// if ("男".equals(info.getP_SEX())) {
  921 +// map.put("sex", "男");
  922 +// } else if ("女".equals(info.getP_SEX())) {
  923 +// map.put("sex", "女");
  924 +// }
  925 +// map.put("name", info.getP_NAME());
  926 +// map.put("idCardNo", info.getP_CARDNO()); //身份证号码
  927 +// map.put("cardNo", cardNo);//就诊卡号
  928 +// map.put("phone", info.getP_MOBILEPHONE());
  929 +// map.put("birth", DateUtil.getyyyy_MM_dd(parseYmd(info.getBIRTH())));
  930 +// result.add(map);
  931 +// }
  932 +// }
  933 +// long end1 = System.currentTimeMillis();
  934 +// System.out.println("times4 = " + (end1 - end));
  935 +// DbUtils.closeQuietly(conn);
  936 +// } catch (SQLException e) {
  937 +// DbUtils.closeQuietly(conn);
  938 +// ExceptionUtils.catchException(e, "qhd his exception ");
  939 +// e.printStackTrace();
  940 +// }
  941 +// }
930 942 return result;
931 943 }
932 944  
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java View file @ c36033a
... ... @@ -2170,25 +2170,24 @@
2170 2170 map.put("hisPatient", qingLongXianHisService.getPatientInfoList(param.getVcCardNo()));
2171 2171 } else if ("5".equals(HIS_VERSION)) {
2172 2172 map.put("hisPatient", fnfyHisService.getPatientInfoList(param.getVcCardNo()));
2173   - } else if ("4".equals(HIS_VERSION)) {
  2173 + } else if ("216".equals(param.getHospitalId())) {
2174 2174  
2175 2175 List <Map <String, Object>> hisPatient = qhdfyHisService.getPatientInfoList(StringUtils.isNotEmpty(param.getVcCardNo()) ? param.getVcCardNo() : param.getsINCard());
2176 2176 if (CollectionUtils.isNotEmpty(hisPatient)) {
2177 2177 Map <String, Object> babyHis = hisPatient.get(0);
2178 2178 if (babyHis != null && babyHis.get("phone") != null && StringUtils.isNotEmpty(babyHis.get("phone").toString())) {
2179 2179 BabyModelQuery babyModelQuery = new BabyModelQuery();
2180   - babyModelQuery.setYn(YnEnums.YES.getId());
2181   - babyModelQuery.setMphone(babyHis.get("phone").toString());
2182   - if (org.apache.commons.lang.StringUtils.isNotEmpty(groupsFacade.findByCurrentUserId(autoMatchFacade.getHospitalId(userId)))) {
2183   - List list = new ArrayList();
2184   - list.add("1");
2185   - list.add("2");
2186   - babyQuery.setEnableListNot(list);
2187   - }
  2180 +// babyModelQuery.setYn(YnEnums.YES.getId());
  2181 + babyModelQuery.setMphoneOrFphone(babyHis.get("phone").toString());
  2182 +// List list1 = new ArrayList();
  2183 +// list1.add("1");
  2184 +// list1.add("2");
  2185 +// babyQuery.setEnableListNot(list1);
2188 2186  
2189   - babyQuery.setHospitalIdList(groupsFacade.findGroupHospital(userId, false));
  2187 + //babyQuery.setHospitalIdList(groupsFacade.findGroupHospital(userId, false));
2190 2188 //
2191   - List <BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyQuery);
  2189 + System.out.println(babyModelQuery.convertToQuery().convertToMongoQuery().toString());
  2190 + List <BabyModel> models = babyBookbuildingService.queryBabyBuildByCond(babyModelQuery);
2192 2191  
2193 2192 if (CollectionUtils.isNotEmpty(models)) {
2194 2193 BabyModel model = models.get(0);
2195 2194  
2196 2195  
2197 2196  
2198 2197  
... ... @@ -2208,23 +2207,30 @@
2208 2207 }
2209 2208  
2210 2209 BabyModelQuery babyBuildQuery = new BabyModelQuery();
2211   - babyBuildQuery.setYn(YnEnums.YES.getId());
  2210 + // babyBuildQuery.setYn(YnEnums.YES.getId());
2212 2211 babyBuildQuery.setPid(model.getPid());
2213   - List <BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyQuery, "buildDate", Sort.Direction.DESC);
  2212 + List <BabyModel> builds = babyBookbuildingService.queryBabyBuildByCond(babyBuildQuery, "buildDate", Sort.Direction.DESC);
2214 2213  
2215 2214 List <Map <String, String>> list = new ArrayList <>();
2216 2215 if (CollectionUtils.isNotEmpty(builds)) {
2217 2216 for (BabyModel build : builds) {
2218 2217  
2219   - if (build != null && StringUtils.isNotEmpty(build.getHospitalId()) && build.getHospitalId().equals(param.getHospitalId())) {
  2218 + if (build == null || StringUtils.isEmpty(build.getHospitalId())) {
  2219 + continue;
  2220 + }
  2221 + if (build.getHospitalId().equals(param.getHospitalId())) {
2220 2222 isCurrentHosp = true;
2221 2223 buildInfo = build;
2222 2224 }
2223 2225  
  2226 + if (build != null && build.getYn() == YnEnums.YES.getId()) {
  2227 + result.setIsBuild(true);
  2228 + }
  2229 +
  2230 +
2224 2231 Map <String, String> buildRecords = new HashMap <>();
2225 2232 buildRecords.put("id", build.getId());
2226 2233 buildRecords.put("buildDate", DateUtil.getyyyy_MM_dd(build.getBuildDate()));
2227   -
2228 2234 buildRecords.put("hospitalId", build.getHospitalId());
2229 2235 //查询建档医院
2230 2236 Organization org = organizationService.getOrganization(Integer.valueOf(build.getHospitalId()));