Commit a6bf551e42423b1ac335cd33ae79f15a81349432
1 parent
ed278ad8ff
Exists in
master
and in
6 other branches
update
Showing 1 changed file with 23 additions and 24 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
a6bf551
| ... | ... | @@ -1218,14 +1218,13 @@ |
| 1218 | 1218 | public void run() { |
| 1219 | 1219 | try { |
| 1220 | 1220 | //获取优惠劵类型 |
| 1221 | - Map<String,String> param = new HashMap<>(); | |
| 1222 | - param.put("hospitalId",hospitalId); | |
| 1221 | + Map<String, String> param = new HashMap<>(); | |
| 1222 | + param.put("hospitalId", hospitalId); | |
| 1223 | 1223 | param.put("code", code); |
| 1224 | - Map<String,String> couponInfo = couponService.findCouponByCode(param); | |
| 1224 | + Map<String, String> couponInfo = couponService.findCouponByCode(param); | |
| 1225 | 1225 | |
| 1226 | - if (couponInfo == null || couponInfo.size() == 0) | |
| 1227 | - { | |
| 1228 | - return ; | |
| 1226 | + if (couponInfo == null || couponInfo.size() == 0) { | |
| 1227 | + return; | |
| 1229 | 1228 | } |
| 1230 | 1229 | |
| 1231 | 1230 | PatientsQuery patientsQuery = new PatientsQuery(); |
| ... | ... | @@ -1234,8 +1233,7 @@ |
| 1234 | 1233 | |
| 1235 | 1234 | List<Patients> list = patientsService.queryPatient1(patientsQuery, "created"); |
| 1236 | 1235 | QhdDjq model = new QhdDjq(); |
| 1237 | - if (CollectionUtils.isNotEmpty(list)) | |
| 1238 | - { | |
| 1236 | + if (CollectionUtils.isNotEmpty(list)) { | |
| 1239 | 1237 | Patients patient = list.get(0); |
| 1240 | 1238 | model.setPatName(patient.getUsername()); |
| 1241 | 1239 | model.setPatIdCardNo(patient.getCardNo()); |
| 1242 | 1240 | |
| ... | ... | @@ -1249,12 +1247,10 @@ |
| 1249 | 1247 | antExChuQuery1.setParentId(patient.getId()); |
| 1250 | 1248 | antExChuQuery1.setYn(YnEnums.YES.getId()); |
| 1251 | 1249 | List<AntExChuModel> data = antenatalExaminationService.queryAntExChu(antExChuQuery1); |
| 1252 | - Integer gravidity = 1; //孕次 | |
| 1253 | - if (CollectionUtils.isNotEmpty(data)) | |
| 1254 | - { | |
| 1250 | + Integer gravidity = 1; //孕次 | |
| 1251 | + if (CollectionUtils.isNotEmpty(data)) { | |
| 1255 | 1252 | AntExChuModel chuModel = data.get(0); |
| 1256 | - if (chuModel != null && chuModel.getPregnancyTimes() != null) | |
| 1257 | - { | |
| 1253 | + if (chuModel != null && chuModel.getPregnancyTimes() != null) { | |
| 1258 | 1254 | gravidity = chuModel.getPregnancyTimes(); |
| 1259 | 1255 | } |
| 1260 | 1256 | } |
| 1261 | 1257 | |
| 1262 | 1258 | |
| 1263 | 1259 | |
| 1264 | 1260 | |
| ... | ... | @@ -1285,30 +1281,26 @@ |
| 1285 | 1281 | Users users = usersService.getUsers(userId); |
| 1286 | 1282 | if (users != null) { |
| 1287 | 1283 | model.setWorkerId(users.getAccount()); |
| 1288 | - } | |
| 1289 | - else | |
| 1290 | - { | |
| 1284 | + } else { | |
| 1291 | 1285 | model.setWorkerId(""); |
| 1292 | 1286 | } |
| 1293 | 1287 | } |
| 1294 | 1288 | |
| 1295 | 1289 | System.out.println(model.toString()); |
| 1296 | - String result = HospitalCouponPrintUtils.qhdCouponUse(model); | |
| 1297 | - if("0".equals(result)){ | |
| 1298 | - int count = couponService.updateCouponStatus(param); | |
| 1290 | + String result = HospitalCouponPrintUtils.qhdCouponUse(model); | |
| 1291 | + if ("0".equals(result)) { | |
| 1292 | + int count = couponService.updateCouponStatus(param); | |
| 1299 | 1293 | System.out.println("update coupon count " + count); |
| 1300 | 1294 | } |
| 1295 | + } catch (Exception e) { | |
| 1296 | + System.out.println("秦皇岛优惠劵传入his失败" + e.toString()); | |
| 1301 | 1297 | } |
| 1302 | - catch (Exception e) | |
| 1303 | - { | |
| 1304 | - System.out.println("秦皇岛优惠劵传入his失败"+e.toString()); | |
| 1305 | - } | |
| 1306 | 1298 | |
| 1307 | 1299 | } |
| 1308 | 1300 | }); |
| 1309 | 1301 | } |
| 1310 | 1302 | |
| 1311 | - public void saveTrackCount(Date nextCheckTime,Patients patients) | |
| 1303 | + public TrackCountRecord saveTrackCount(Date nextCheckTime,Patients patients) | |
| 1312 | 1304 | { |
| 1313 | 1305 | TrackCountRecord record = new TrackCountRecord(); |
| 1314 | 1306 | record.setHospitalId(patients.getHospitalId()); |
| ... | ... | @@ -1318,6 +1310,7 @@ |
| 1318 | 1310 | record.setCreated(new Date()); |
| 1319 | 1311 | record.setModified(new Date()); |
| 1320 | 1312 | mongoTemplate.save(record); |
| 1313 | + return record; | |
| 1321 | 1314 | } |
| 1322 | 1315 | |
| 1323 | 1316 | public void updateTrackCount(Date checkTime,Date nextCheckTime,Patients patients) |
| ... | ... | @@ -1335,6 +1328,12 @@ |
| 1335 | 1328 | if (CollectionUtils.isNotEmpty(recordModels) && recordModels.size() > 1) |
| 1336 | 1329 | { |
| 1337 | 1330 | TrackCountRecord record = mongoTemplate.findOne(Query.query(Criteria.where("pid").is(patients.getPid())).with(new Sort(Sort.Direction.DESC, "created")), TrackCountRecord.class); |
| 1331 | + | |
| 1332 | + if (record == null) | |
| 1333 | + { | |
| 1334 | + record = saveTrackCount(nextCheckTime,patients); | |
| 1335 | + } | |
| 1336 | + | |
| 1338 | 1337 | System.out.println("record="+record); |
| 1339 | 1338 | AntExRecordModel recordModel = recordModels.get(1); |
| 1340 | 1339 | System.out.println("recordModel="+recordModel); |