Commit 25c25da3b4d6fe6696789aaab85510daaa60dad3
1 parent
be831e433a
Exists in
master
and in
1 other branch
update code
Showing 6 changed files with 94 additions and 229 deletions
- platform-msg-generate/src/main/java/com/lyms/platform/msg/service/impl/BaseServiceImpl.java
- platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java
- platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/QhdDjq.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CouponPrintController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
- platform-operate-api/src/main/resources/database.properties
platform-msg-generate/src/main/java/com/lyms/platform/msg/service/impl/BaseServiceImpl.java
View file @
25c25da
| ... | ... | @@ -236,6 +236,34 @@ |
| 236 | 236 | */ |
| 237 | 237 | public String getSmsPrefix(SmsConfigModel config,String doctorId) |
| 238 | 238 | { |
| 239 | + String prefix = ""; | |
| 240 | + //是否收费,孕妇,儿童,产妇 {"pregnant":"true","baby":"false","puerperant":"true"} | |
| 241 | + if (StringUtils.isNotEmpty(config.getIsCharge())) | |
| 242 | + { | |
| 243 | + prefix = config.getAreaPrefix(); | |
| 244 | + String isCharge = config.getIsCharge(); | |
| 245 | + Map<String,String> chargeMap = JsonUtil.getMap(isCharge); | |
| 246 | + if (chargeMap != null && chargeMap.size() > 0) | |
| 247 | + { | |
| 248 | + String pregnant = chargeMap.get("pregnant"); | |
| 249 | + if (StringUtils.isNotEmpty(pregnant) && "true".equals(pregnant)) | |
| 250 | + { | |
| 251 | + prefix = getPrefix(config,doctorId); | |
| 252 | + } | |
| 253 | + } | |
| 254 | + } | |
| 255 | + | |
| 256 | + return prefix; | |
| 257 | + } | |
| 258 | + | |
| 259 | + /** | |
| 260 | + * 获取医院前缀或者可是前缀 | |
| 261 | + * @param config | |
| 262 | + * @param doctorId | |
| 263 | + * @return | |
| 264 | + */ | |
| 265 | + private String getPrefix(SmsConfigModel config,String doctorId) | |
| 266 | + { | |
| 239 | 267 | String messagePrefix = config.getHospitalPrefix(); |
| 240 | 268 | //前缀类型 0医院前缀 1科室前缀 |
| 241 | 269 | if (config.getPrefixType() != null && config.getPrefixType() == 1) |
| ... | ... | @@ -245,6 +273,7 @@ |
| 245 | 273 | } |
| 246 | 274 | return messagePrefix; |
| 247 | 275 | } |
| 276 | + | |
| 248 | 277 | |
| 249 | 278 | |
| 250 | 279 | /** |
platform-msg-generate/src/main/java/com/lyms/platform/msg/worker/TempleteMsgGenerateWorker.java
View file @
25c25da
platform-operate-api/src/main/java/com/lyms/hospitalapi/pojo/QhdDjq.java
View file @
25c25da
| ... | ... | @@ -44,6 +44,17 @@ |
| 44 | 44 | //备注 |
| 45 | 45 | private String remark; |
| 46 | 46 | |
| 47 | + //姓名 | |
| 48 | + private String patName; | |
| 49 | + | |
| 50 | + public String getPatName() { | |
| 51 | + return patName; | |
| 52 | + } | |
| 53 | + | |
| 54 | + public void setPatName(String patName) { | |
| 55 | + this.patName = patName; | |
| 56 | + } | |
| 57 | + | |
| 47 | 58 | public String getSerialNumber() { |
| 48 | 59 | return serialNumber; |
| 49 | 60 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CouponPrintController.java
View file @
25c25da
| ... | ... | @@ -236,6 +236,7 @@ |
| 236 | 236 | if (CollectionUtils.isNotEmpty(list)) |
| 237 | 237 | { |
| 238 | 238 | Patients patient = list.get(0); |
| 239 | + model.setPatName(patient.getUsername()); | |
| 239 | 240 | model.setPatIdCardNo(patient.getCardNo()); |
| 240 | 241 | model.setPatCardNo(patient.getVcCardNo()); |
| 241 | 242 | model.setPatPhoneNumber(patient.getPhone()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/SyncDataTaskService.java
View file @
25c25da
| ... | ... | @@ -42,6 +42,18 @@ |
| 42 | 42 | @Service("syncDataTaskService") |
| 43 | 43 | public class SyncDataTaskService { |
| 44 | 44 | |
| 45 | + private static final Map<String,String> urls = new HashMap<>(); | |
| 46 | + | |
| 47 | + static | |
| 48 | + { | |
| 49 | + urls.put("area-lc-api.healthbaby.com.cn:55581","聊城"); | |
| 50 | + urls.put("area-dz-api.healthbaby.com.cn:12356","德州"); | |
| 51 | + urls.put("area-qhd-api.healthbaby.com.cn:18019","秦皇岛"); | |
| 52 | + urls.put("area-nc-api.healthbaby.com.cn:12356","南充"); | |
| 53 | + urls.put("area-laoling-api.healthbaby.com.cn:12356","乐陵"); | |
| 54 | + urls.put("rp-hbnq-api.healthbaby.com.cn:18019","内丘"); | |
| 55 | + } | |
| 56 | + | |
| 45 | 57 | @Autowired |
| 46 | 58 | private SyncDataService syncDataService; |
| 47 | 59 | |
| 48 | 60 | |
| 49 | 61 | |
| 50 | 62 | |
| 51 | 63 | |
| 52 | 64 | |
| 53 | 65 | |
| 54 | 66 | |
| 55 | 67 | |
| 56 | 68 | |
| 57 | 69 | |
| 58 | 70 | |
| ... | ... | @@ -133,245 +145,58 @@ |
| 133 | 145 | } |
| 134 | 146 | } |
| 135 | 147 | |
| 136 | - /** | |
| 137 | - * 该方法是定时去取秦皇岛要同步的数据 | |
| 138 | - * 定时任务配置applicationContext.xml | |
| 139 | - */ | |
| 140 | - public void qhdfySyncDataSSL() { | |
| 141 | 148 | |
| 142 | - try{ | |
| 143 | - | |
| 144 | - String json = HttpClientUtil.doPost("https://area-qhd-api.healthbaby.com.cn:18019/findSyncData", new HashMap<String, String>(), "utf-8"); | |
| 145 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) | |
| 146 | - { | |
| 147 | - List<SyncDataModel> list = JsonUtil.toList(json, SyncDataModel.class); | |
| 148 | - System.out.println("qdhfy syncdata size = "+ list.size()); | |
| 149 | - | |
| 150 | - | |
| 151 | - int batchSize = 200; | |
| 152 | - int end = 0; | |
| 153 | - for (int i = 0; i < list.size(); i += batchSize) { | |
| 154 | - end = (end + batchSize); | |
| 155 | - if (end > list.size()) { | |
| 156 | - end = list.size(); | |
| 157 | - } | |
| 158 | - System.out.println("qhdfy start:" + i + ",end:" + end); | |
| 159 | - final List<SyncDataModel> tempList = list.subList(i, end); | |
| 160 | - new Thread(new Runnable() { | |
| 161 | - @Override | |
| 162 | - public void run() { | |
| 163 | - if (CollectionUtils.isNotEmpty(tempList)) | |
| 164 | - { | |
| 165 | - StringBuffer ids = new StringBuffer(); | |
| 166 | - for (SyncDataModel model : tempList) { | |
| 167 | - boolean boo = mongoSyncService.syncData(model.getAction(), model.getDataId(), model.getClassName(), model.getJsonData()); | |
| 168 | - if (boo) { | |
| 169 | - ids.append(model.getId()); | |
| 170 | - ids.append(","); | |
| 171 | - } | |
| 172 | - } | |
| 173 | - if (ids.length() > 0) { | |
| 174 | - Map<String,String> params = new HashMap<String, String>(); | |
| 175 | - params.put("ids", ids.toString()); | |
| 176 | - String result = HttpClientUtil.doPost("https://area-qhd-api.healthbaby.com.cn:18019/updateSyncData", params, "utf-8"); | |
| 177 | - System.out.println("exc result = "+ result); | |
| 178 | - } | |
| 179 | - } | |
| 180 | - } | |
| 181 | - }).start(); | |
| 182 | - } | |
| 183 | - } | |
| 184 | - }catch(Exception ex){ | |
| 185 | - ExceptionUtils.catchException(ex, "qhdfySyncDataSSL Error."); | |
| 186 | - } | |
| 187 | - } | |
| 188 | - | |
| 189 | - | |
| 190 | 149 | /** |
| 191 | - * 同步德州妇幼的数据到线上 | |
| 150 | + * 同步区域数据到线上服务器 | |
| 192 | 151 | * 定时任务配置applicationContext.xml |
| 152 | + * | |
| 193 | 153 | */ |
| 194 | - public void dzfySyncDataSSL() { | |
| 195 | - | |
| 196 | - try{ | |
| 197 | - String json = HttpClientUtil.doPost("https://area-dz-api.healthbaby.com.cn:12356/findSyncData", new HashMap<String, String>(), "utf-8"); | |
| 198 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) | |
| 199 | - { | |
| 200 | - List<SyncDataModel> list = JsonUtil.toList(json, SyncDataModel.class); | |
| 201 | - System.out.println("dzfy syncdata size = "+ list.size()); | |
| 202 | - int batchSize = 200; | |
| 203 | - int end = 0; | |
| 204 | - for (int i = 0; i < list.size(); i += batchSize) { | |
| 205 | - end = (end + batchSize); | |
| 206 | - if (end > list.size()) { | |
| 207 | - end = list.size(); | |
| 208 | - } | |
| 209 | - System.out.println("dzfy start:" + i + ",end:" + end); | |
| 210 | - final List<SyncDataModel> tempList = list.subList(i, end); | |
| 211 | - new Thread(new Runnable() { | |
| 212 | - @Override | |
| 213 | - public void run() { | |
| 214 | - if (CollectionUtils.isNotEmpty(tempList)) | |
| 215 | - { | |
| 216 | - StringBuffer ids = new StringBuffer(); | |
| 217 | - for (SyncDataModel model : tempList) { | |
| 218 | - boolean boo = mongoSyncService.syncData(model.getAction(), model.getDataId(), model.getClassName(), model.getJsonData()); | |
| 219 | - if (boo) { | |
| 220 | - ids.append(model.getId()); | |
| 221 | - ids.append(","); | |
| 222 | - } | |
| 223 | - } | |
| 224 | - if (ids.length() > 0) { | |
| 225 | - Map<String,String> params = new HashMap<String, String>(); | |
| 226 | - params.put("ids", ids.toString()); | |
| 227 | - String result = HttpClientUtil.doPost("https://area-dz-api.healthbaby.com.cn:12356/updateSyncData", params, "utf-8"); | |
| 228 | - System.out.println("exc result = "+ result); | |
| 229 | - } | |
| 230 | - } | |
| 154 | + public void syncDataSSL() | |
| 155 | + { | |
| 156 | + for (final String url : urls.keySet()) | |
| 157 | + { | |
| 158 | + try{ | |
| 159 | + String areaName = urls.get(url); | |
| 160 | + String json = HttpClientUtil.doPost("https://"+url+"/findSyncData", new HashMap<String, String>(), "utf-8"); | |
| 161 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) | |
| 162 | + { | |
| 163 | + List<SyncDataModel> list = JsonUtil.toList(json, SyncDataModel.class); | |
| 164 | + System.out.println(areaName+" syncdata size = "+ list.size()); | |
| 165 | + int batchSize = 200; | |
| 166 | + int end = 0; | |
| 167 | + for (int i = 0; i < list.size(); i += batchSize) { | |
| 168 | + end = (end + batchSize); | |
| 169 | + if (end > list.size()) { | |
| 170 | + end = list.size(); | |
| 231 | 171 | } |
| 232 | - }).start(); | |
| 233 | - } | |
| 234 | - } | |
| 235 | - }catch(Exception ex){ | |
| 236 | - ExceptionUtils.catchException(ex, "dzfySyncDataSSL Error."); | |
| 237 | - } | |
| 238 | - } | |
| 239 | - | |
| 240 | - | |
| 241 | - /** | |
| 242 | - * 同步南充中心医院的数据到线上 | |
| 243 | - * 定时任务配置applicationContext.xml | |
| 244 | - */ | |
| 245 | - public void nczxyySyncDataSSL() { | |
| 246 | - | |
| 247 | - try{ | |
| 248 | - String json = HttpClientUtil.doPost("https://area-nc-api.healthbaby.com.cn:12356/findSyncData", new HashMap<String, String>(), "utf-8"); | |
| 249 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) | |
| 250 | - { | |
| 251 | - List<SyncDataModel> list = JsonUtil.toList(json, SyncDataModel.class); | |
| 252 | - System.out.println("nczxyy syncdata size = "+ list.size()); | |
| 253 | - int batchSize = 200; | |
| 254 | - int end = 0; | |
| 255 | - for (int i = 0; i < list.size(); i += batchSize) { | |
| 256 | - end = (end + batchSize); | |
| 257 | - if (end > list.size()) { | |
| 258 | - end = list.size(); | |
| 259 | - } | |
| 260 | - System.out.println("nczxyy start:" + i + ",end:" + end); | |
| 261 | - final List<SyncDataModel> tempList = list.subList(i, end); | |
| 262 | - new Thread(new Runnable() { | |
| 263 | - @Override | |
| 264 | - public void run() { | |
| 265 | - if (CollectionUtils.isNotEmpty(tempList)) | |
| 266 | - { | |
| 267 | - StringBuffer ids = new StringBuffer(); | |
| 268 | - for (SyncDataModel model : tempList) { | |
| 269 | - boolean boo = mongoSyncService.syncData(model.getAction(), model.getDataId(), model.getClassName(), model.getJsonData()); | |
| 270 | - if (boo) { | |
| 271 | - ids.append(model.getId()); | |
| 272 | - ids.append(","); | |
| 172 | + final List<SyncDataModel> tempList = list.subList(i, end); | |
| 173 | + new Thread(new Runnable() { | |
| 174 | + @Override | |
| 175 | + public void run() { | |
| 176 | + if (CollectionUtils.isNotEmpty(tempList)) | |
| 177 | + { | |
| 178 | + StringBuffer ids = new StringBuffer(); | |
| 179 | + for (SyncDataModel model : tempList) { | |
| 180 | + boolean boo = mongoSyncService.syncData(model.getAction(), model.getDataId(), model.getClassName(), model.getJsonData()); | |
| 181 | + if (boo) { | |
| 182 | + ids.append(model.getId()); | |
| 183 | + ids.append(","); | |
| 184 | + } | |
| 273 | 185 | } |
| 274 | - } | |
| 275 | - if (ids.length() > 0) { | |
| 276 | - Map<String,String> params = new HashMap<String, String>(); | |
| 277 | - params.put("ids", ids.toString()); | |
| 278 | - String result = HttpClientUtil.doPost("https://area-nc-api.healthbaby.com.cn:12356/updateSyncData", params, "utf-8"); | |
| 279 | - System.out.println("exc result = "+ result); | |
| 280 | - } | |
| 281 | - } | |
| 282 | - } | |
| 283 | - }).start(); | |
| 284 | - } | |
| 285 | - } | |
| 286 | - }catch(Exception ex){ | |
| 287 | - ExceptionUtils.catchException(ex, "nczxyySyncDataSSL Error."); | |
| 288 | - } | |
| 289 | - } | |
| 290 | - | |
| 291 | - /** | |
| 292 | - * 同步聊城东昌区妇幼数据到线上 | |
| 293 | - * 定时任务配置applicationContext.xml | |
| 294 | - */ | |
| 295 | - public void lcdcqfySyncDataSSL() { | |
| 296 | - | |
| 297 | - try{ | |
| 298 | - String json = HttpClientUtil.doPost("https://area-lc-api.healthbaby.com.cn:55581/findSyncData", new HashMap<String, String>(), "utf-8"); | |
| 299 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(json)) | |
| 300 | - { | |
| 301 | - List<SyncDataModel> list = JsonUtil.toList(json, SyncDataModel.class); | |
| 302 | - System.out.println("lcdcqfy syncdata size = "+ list.size()); | |
| 303 | - int batchSize = 200; | |
| 304 | - int end = 0; | |
| 305 | - for (int i = 0; i < list.size(); i += batchSize) { | |
| 306 | - end = (end + batchSize); | |
| 307 | - if (end > list.size()) { | |
| 308 | - end = list.size(); | |
| 309 | - } | |
| 310 | - System.out.println("lcdcqfy start:" + i + ",end:" + end); | |
| 311 | - final List<SyncDataModel> tempList = list.subList(i, end); | |
| 312 | - new Thread(new Runnable() { | |
| 313 | - @Override | |
| 314 | - public void run() { | |
| 315 | - if (CollectionUtils.isNotEmpty(tempList)) | |
| 316 | - { | |
| 317 | - StringBuffer ids = new StringBuffer(); | |
| 318 | - for (SyncDataModel model : tempList) { | |
| 319 | - boolean boo = mongoSyncService.syncData(model.getAction(), model.getDataId(), model.getClassName(), model.getJsonData()); | |
| 320 | - if (boo) { | |
| 321 | - ids.append(model.getId()); | |
| 322 | - ids.append(","); | |
| 186 | + if (ids.length() > 0) { | |
| 187 | + Map<String,String> params = new HashMap<String, String>(); | |
| 188 | + params.put("ids", ids.toString()); | |
| 189 | + HttpClientUtil.doPost("https://" + url + "/updateSyncData", params, "utf-8"); | |
| 323 | 190 | } |
| 324 | 191 | } |
| 325 | - if (ids.length() > 0) { | |
| 326 | - Map<String,String> params = new HashMap<String, String>(); | |
| 327 | - params.put("ids", ids.toString()); | |
| 328 | - String result = HttpClientUtil.doPost("https://area-lc-api.healthbaby.com.cn:55581/updateSyncData", params, "utf-8"); | |
| 329 | - System.out.println("lcdcqfy exc result = "+ result); | |
| 330 | - } | |
| 331 | 192 | } |
| 332 | - } | |
| 333 | - }).start(); | |
| 193 | + }).start(); | |
| 194 | + } | |
| 334 | 195 | } |
| 196 | + }catch(Exception ex){ | |
| 197 | + ExceptionUtils.catchException(ex, url+": syncData Error."); | |
| 335 | 198 | } |
| 336 | - }catch(Exception ex){ | |
| 337 | - ExceptionUtils.catchException(ex, "lcdcqfy Error."); | |
| 338 | 199 | } |
| 339 | - } | |
| 340 | - | |
| 341 | - | |
| 342 | - /** | |
| 343 | - * 定时任务配置applicationContext.xml | |
| 344 | - * | |
| 345 | - */ | |
| 346 | - public void syncDataSSL() | |
| 347 | - { | |
| 348 | - new Thread(new Runnable() { | |
| 349 | - @Override | |
| 350 | - public void run() { | |
| 351 | - qhdfySyncDataSSL(); | |
| 352 | - } | |
| 353 | - },"qhdfy-thread").start(); | |
| 354 | - | |
| 355 | - | |
| 356 | - new Thread(new Runnable() { | |
| 357 | - @Override | |
| 358 | - public void run() { | |
| 359 | - dzfySyncDataSSL(); | |
| 360 | - } | |
| 361 | - },"dzfy-thread").start(); | |
| 362 | - | |
| 363 | - new Thread(new Runnable() { | |
| 364 | - @Override | |
| 365 | - public void run() { | |
| 366 | - nczxyySyncDataSSL(); | |
| 367 | - } | |
| 368 | - },"nczxyy-thread").start(); | |
| 369 | - new Thread(new Runnable() { | |
| 370 | - @Override | |
| 371 | - public void run() { | |
| 372 | - lcdcqfySyncDataSSL(); | |
| 373 | - } | |
| 374 | - },"lcdcqfy-thread").start(); | |
| 375 | 200 | |
| 376 | 201 | } |
| 377 | 202 |