From f7e792f1ada1d9d1e9db60848862814ff0973a4d Mon Sep 17 00:00:00 2001 From: liquanyu Date: Thu, 2 Mar 2017 16:28:15 +0800 Subject: [PATCH] update code --- .../com/lyms/hospitalapi/qhdfy/QhdfyFmService.java | 23 ++++++++++++++++++---- .../web/controller/PregnantBuildController.java | 2 +- .../operate/web/facade/BabyBookbuildingFacade.java | 14 ++++++++++++- .../platform/operate/web/facade/PatientFacade.java | 17 +++++++++++++++- .../operate/web/facade/ResidentsArchiveFacade.java | 17 +++++++++++++++- 5 files changed, 65 insertions(+), 8 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java index ba34be3..6037af5 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/qhdfy/QhdfyFmService.java @@ -113,10 +113,11 @@ public class QhdfyFmService { Connection conn = ConnTools.makeFmConnection(); QueryRunner queryRunner = new QueryRunner(); SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMddHH:mm:ss"); + SimpleDateFormat fmt2 = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat fmt1 = new SimpleDateFormat("yyyy-MM-dd HH:mm"); try { String sql ="select "+cloumns+" from JHMK_FMJL where " + - " CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)" + + " CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)" + " and SYXH not in (select SYXH from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and SH is not null and CCQK is not null and CCQK <> '' " + " and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ')) "; @@ -140,7 +141,15 @@ public class QhdfyFmService { if (!StringUtils.isNotEmpty(dueDateStr)) { continue; } - Date dueDate = fmt.parse(dueDateStr); + Date dueDate = null; + try{ + dueDate = fmt2.parse(dueDateStr); + }catch (Exception e) + { + dueDate = fmt.parse(dueDateStr); + } + + FmPatInfo patInfo = getFmPatInfoById(item.getSyxh()); if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone())) { PatientsQuery query = new PatientsQuery(); @@ -280,7 +289,7 @@ public class QhdfyFmService { String sql1="select "+cloumns+" from JHMK_FMJL where JSZ is not null and SC is not null and TZ is not null and YFZ is not null and CCQK is not null and CCQK <> '' " + " and SH is not null and (SFFZRSTDT = ' 是 ' or SFSTDT = ' 是 ') and " + - " CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(SSRQ,8)+' '+RIGHT(SSRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)"; + " CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) > CONVERT(DATETIME,'"+start+"', 120) and CONVERT(DATETIME,left(JLRQ,8)+' '+RIGHT(JLRQ,8),20) <= CONVERT(DATETIME,'"+end+"', 120)"; if (StringUtils.isNotEmpty(syxh)) { @@ -327,7 +336,13 @@ public class QhdfyFmService { { continue; } - Date dueDate = fmt.parse(dueDateStr); + Date dueDate = null; + try{ + dueDate = fmt2.parse(dueDateStr); + }catch (Exception e) + { + dueDate = fmt.parse(dueDateStr); + } FmPatInfo patInfo = getFmPatInfoById(item.getSyxh()); if (patInfo != null && StringUtils.isNotEmpty(patInfo.getPhone())) { diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java index bd8886f..520720f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PregnantBuildController.java @@ -35,7 +35,7 @@ import java.net.URLEncoder; */ @Controller public class PregnantBuildController extends BaseController{ - + @Autowired private YunBookbuildingService yunBookbuildingService; diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java index 66fd7b9..a2ae3fa 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java @@ -2008,9 +2008,21 @@ public class BabyBookbuildingFacade { smsList.setTypeId(ProjectTypeEnums.YNXT.getId()); smsList.setMessages(messages); //调用发送接口 - if (!syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) { +// if (!syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) { +// MessageCenterService.saveSmsCenter(smsList); +// } + if ("4".equals(HIS_VERSION)) + { + //秦皇岛 + //保存到同步表中 + syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1()); + } + else + { + //保存到短信中心 线上 MessageCenterService.saveSmsCenter(smsList); } + } BaseResponse objectResponse = new BaseResponse(); objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java index 1a56e8b..85533e6 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java @@ -44,6 +44,9 @@ import java.util.concurrent.TimeUnit; @Component public class PatientFacade { private static final Logger logger = LoggerFactory.getLogger(PatientFacade.class); + + public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); + @Autowired private PatientsService patientsService; @Autowired @@ -610,7 +613,19 @@ public class PatientFacade { smsList.setTypeId(ProjectTypeEnums.YNXT.getId()); smsList.setMessages(messages); //调用发送接口 - if (!syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) { +// if (!syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) { +// MessageCenterService.saveSmsCenter(smsList); +// } + + if ("4".equals(HIS_VERSION)) + { + //秦皇岛 + //保存到同步表中 + syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1()); + } + else + { + //保存到短信中心 线上 MessageCenterService.saveSmsCenter(smsList); } } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java index 62c2dd4..edc150f 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ResidentsArchiveFacade.java @@ -42,6 +42,9 @@ import java.util.*; @Component public class ResidentsArchiveFacade{ + + public static final String HIS_VERSION = PropertiesUtils.getPropertyValue("his_version"); + @Autowired private ResidentsArchiveService residentsArchiveService; @Autowired @@ -781,9 +784,21 @@ public class ResidentsArchiveFacade{ smsList.setTypeId(ProjectTypeEnums.YNXT.getId()); smsList.setMessages(messages); //调用发送接口 - if (!syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) { +// if (!syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1())) { +// MessageCenterService.saveSmsCenter(smsList); +// } + if ("4".equals(HIS_VERSION)) + { + //秦皇岛 + //保存到同步表中 + syncDataService.savePostMsg(JsonUtil.obj2JsonString(smsList), messages.get(0).getExt1()); + } + else + { + //保存到短信中心 线上 MessageCenterService.saveSmsCenter(smsList); } + } } return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); -- 1.8.3.1