Commit 4db4332ca8e105208bdd83149b7f6f678bb11853
Exists in
master
and in
6 other branches
Merge remote-tracking branch 'origin/master'
Showing 4 changed files
- platform-msg-generate/src/main/java/com/lyms/platform/msg/controller/MsgGenerateController.java
- platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/SaveMessageService.java
- platform-msg-generate/src/main/resources/spring/applicationContext-quartz.xml
- platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
platform-msg-generate/src/main/java/com/lyms/platform/msg/controller/MsgGenerateController.java
View file @
4db4332
| ... | ... | @@ -18,11 +18,11 @@ |
| 18 | 18 | @RequestMapping("/msg") |
| 19 | 19 | public class MsgGenerateController extends BaseController { |
| 20 | 20 | |
| 21 | - private static final Logger logger = LoggerFactory.getLogger(MsgGenerateController.class); | |
| 21 | +// private static final Logger logger = LoggerFactory.getLogger(MsgGenerateController.class); | |
| 22 | +//// | |
| 23 | +// @Autowired | |
| 24 | +// private IMsgGenerateService msgGenerateService; | |
| 22 | 25 | // |
| 23 | - @Autowired | |
| 24 | - private IMsgGenerateService msgGenerateService; | |
| 25 | -// | |
| 26 | 26 | // /** |
| 27 | 27 | // * 生成孕妇ams消息 |
| 28 | 28 | // * @param hospitalId |
| ... | ... | @@ -70,20 +70,20 @@ |
| 70 | 70 | // return ""; |
| 71 | 71 | // } |
| 72 | 72 | // |
| 73 | - /** | |
| 74 | - * 生成模板推送消息 | |
| 75 | - * @param hospitalId | |
| 76 | - * @return | |
| 77 | - */ | |
| 78 | - @RequestMapping(method = RequestMethod.GET, value = "/generateTemplateMsg") | |
| 79 | - @ResponseBody | |
| 80 | - public String generateTemplateMsg(@RequestParam(required = false) String hospitalId) | |
| 81 | - { | |
| 82 | - | |
| 83 | - logger.info("The request hospital id is {} ", hospitalId); | |
| 84 | - msgGenerateService.generateTemplateMsg(hospitalId); | |
| 85 | - return ""; | |
| 86 | - } | |
| 73 | +// /** | |
| 74 | +// * 生成模板推送消息 | |
| 75 | +// * @param hospitalId | |
| 76 | +// * @return | |
| 77 | +// */ | |
| 78 | +// @RequestMapping(method = RequestMethod.GET, value = "/generateTemplateMsg") | |
| 79 | +// @ResponseBody | |
| 80 | +// public String generateTemplateMsg(@RequestParam(required = false) String hospitalId) | |
| 81 | +// { | |
| 82 | +// | |
| 83 | +// logger.info("The request hospital id is {} ", hospitalId); | |
| 84 | +// msgGenerateService.generateTemplateMsg(hospitalId); | |
| 85 | +// return ""; | |
| 86 | +// } | |
| 87 | 87 | // |
| 88 | 88 | // |
| 89 | 89 | // /** |
platform-msg-generate/src/main/java/com/lyms/platform/msg/remote/SaveMessageService.java
View file @
4db4332
| ... | ... | @@ -11,7 +11,6 @@ |
| 11 | 11 | import com.lyms.platform.common.utils.StringUtils; |
| 12 | 12 | import com.lyms.platform.msg.constants.ConfigInterface; |
| 13 | 13 | import com.lyms.platform.msg.utils.DateUtils; |
| 14 | -import com.lyms.platform.msg.utils.HttpsClientManager; | |
| 15 | 14 | import net.sf.json.JSONArray; |
| 16 | 15 | import net.sf.json.JSONObject; |
| 17 | 16 | import org.apache.commons.httpclient.HttpClient; |
| 18 | 17 | |
| ... | ... | @@ -27,15 +26,8 @@ |
| 27 | 26 | */ |
| 28 | 27 | public class SaveMessageService { |
| 29 | 28 | |
| 30 | - private static final Logger logger = LoggerFactory.getLogger(SaveMessageService.class); | |
| 29 | + private static final Logger resultLog = LoggerFactory.getLogger("GEN-RESULT"); | |
| 31 | 30 | |
| 32 | - private static HttpsClientManager https =new HttpsClientManager(); | |
| 33 | - { | |
| 34 | - https.setConnTimeout(10000); | |
| 35 | - https.setSoTimeout(120000); | |
| 36 | - https.setMaxConnectionsPerHost(200); | |
| 37 | - https.setMaxTotalConnections(300); | |
| 38 | - } | |
| 39 | 31 | |
| 40 | 32 | |
| 41 | 33 | /** |
| 42 | 34 | |
| 43 | 35 | |
| ... | ... | @@ -46,20 +38,15 @@ |
| 46 | 38 | public static boolean saveMsgCenter(MessageListRequest list) |
| 47 | 39 | { |
| 48 | 40 | String json = JsonUtil.obj2JsonString(list); |
| 49 | - String result = null; | |
| 50 | - try { | |
| 51 | - result = https.doPost(ConfigInterface.MSG_BASE_URL + "/biz-push-web/push", json, null); | |
| 52 | - | |
| 53 | - if (StringUtils.isNotEmpty(result)) | |
| 41 | + //resultLog.info(json); | |
| 42 | + String result = HttpClientUtil.doPostSSL(ConfigInterface.MSG_BASE_URL+"/biz-push-web/push",json); | |
| 43 | + if (StringUtils.isNotEmpty(result)) | |
| 44 | + { | |
| 45 | + Map<String,String> map = JsonUtil.str2Obj(result, Map.class); | |
| 46 | + if ("0".equals(String.valueOf(map.get("errorcode")))) | |
| 54 | 47 | { |
| 55 | - Map<String,String> map = JsonUtil.str2Obj(result, Map.class); | |
| 56 | - if ("0".equals(String.valueOf(map.get("errorcode")))) | |
| 57 | - { | |
| 58 | - return true; | |
| 59 | - } | |
| 48 | + return true; | |
| 60 | 49 | } |
| 61 | - } catch (Exception e) { | |
| 62 | - logger.error("save msg is error",e); | |
| 63 | 50 | } |
| 64 | 51 | return false; |
| 65 | 52 | } |
| 66 | 53 | |
| 67 | 54 | |
| ... | ... | @@ -79,21 +66,16 @@ |
| 79 | 66 | param.put("limit","10"); |
| 80 | 67 | param.put("patientId",patientId); |
| 81 | 68 | param.put("tempId",tempId); |
| 82 | - String result = null; | |
| 83 | - try { | |
| 84 | - result = https.doGet(ConfigInterface.MSG_BASE_URL + "/biz-push-web/push", param,null); | |
| 85 | - JSONObject jsonObject = JsonUtil.getObj(result); | |
| 86 | - if (jsonObject != null && jsonObject.getJSONObject("pageInfo") != null) | |
| 69 | + String result = HttpClientUtil.doGet(ConfigInterface.MSG_BASE_URL + "/biz-push-web/push", param,"utf-8",null); | |
| 70 | + JSONObject jsonObject = JsonUtil.getObj(result); | |
| 71 | + if (jsonObject != null && jsonObject.getJSONObject("pageInfo") != null) | |
| 72 | + { | |
| 73 | + JSONObject jsonObject1 = jsonObject.getJSONObject("pageInfo"); | |
| 74 | + int count = jsonObject1.getInt("count"); | |
| 75 | + if (count > 0) | |
| 87 | 76 | { |
| 88 | - JSONObject jsonObject1 = jsonObject.getJSONObject("pageInfo"); | |
| 89 | - int count = jsonObject1.getInt("count"); | |
| 90 | - if (count > 0) | |
| 91 | - { | |
| 92 | - return true; | |
| 93 | - } | |
| 77 | + return true; | |
| 94 | 78 | } |
| 95 | - } catch (Exception e) { | |
| 96 | - logger.error("get msg is exist error,url="+ConfigInterface.MSG_BASE_URL + "/biz-push-web/push",e); | |
| 97 | 79 | } |
| 98 | 80 | return false; |
| 99 | 81 | } |
platform-msg-generate/src/main/resources/spring/applicationContext-quartz.xml
View file @
4db4332
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> |
| 30 | 30 | <property name="triggers" > |
| 31 | 31 | <list> |
| 32 | - <ref bean="msgGenerateWorkTrigger"/> | |
| 32 | + <!--<ref bean="msgGenerateWorkTrigger"/>--> | |
| 33 | 33 | </list> |
| 34 | 34 | </property> |
| 35 | 35 | </bean> |
platform-operate-api/src/main/resources/spring/applicationContext-quartz.xml
View file @
4db4332
| ... | ... | @@ -107,6 +107,18 @@ |
| 107 | 107 | <property name="concurrent" value="false"></property> |
| 108 | 108 | </bean> |
| 109 | 109 | |
| 110 | + | |
| 111 | + <!-- 德州妇幼医院分娩接口--> | |
| 112 | + <bean id="dzfyFmTimerWork" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> | |
| 113 | + <!-- 要调用的bean --> | |
| 114 | + <property name="targetObject" ref="dzfyFmService"></property> | |
| 115 | + <!-- 要调用的Method --> | |
| 116 | + <property name="targetMethod" value="fmTimerWork"></property> | |
| 117 | + <!-- 是否并发,false表示 如果发生错误也不影响下一次的调用 --> | |
| 118 | + <property name="concurrent" value="false"></property> | |
| 119 | + </bean> | |
| 120 | + | |
| 121 | + | |
| 110 | 122 | <!-- 秦皇岛医院分娩接口--> |
| 111 | 123 | <bean id="qhdFmHistoryTimerWork" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> |
| 112 | 124 | <!-- 要调用的bean --> |
| ... | ... | @@ -163,6 +175,12 @@ |
| 163 | 175 | </bean> |
| 164 | 176 | |
| 165 | 177 | |
| 178 | + <bean id="dzfyFmTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> | |
| 179 | + <property name="jobDetail" ref="dzfyFmTimerWork"></property> | |
| 180 | + <property name="cronExpression" value="0 0 0/1 * * ?"></property> | |
| 181 | + </bean> | |
| 182 | + | |
| 183 | + | |
| 166 | 184 | <!-- 总调度,用于启动定时器 --> |
| 167 | 185 | <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> |
| 168 | 186 | <property name="triggers" > |
| ... | ... | @@ -175,6 +193,7 @@ |
| 175 | 193 | <!--乐陵住院系统同步--> |
| 176 | 194 | <!--<ref bean="synLlHisDataTrigger"/>--> |
| 177 | 195 | <!--<ref bean="qhdFmTrigger"/>--> |
| 196 | + <!--<ref bean="dzfyFmTrigger"/>--> | |
| 178 | 197 | <!--<ref bean="crisisTrigger"/>--> |
| 179 | 198 | <!--<ref bean="qhdFmHistoryTrigger"/>--> |
| 180 | 199 | </list> |