Commit 3647ce6b0d635b2cb7e43642955ed6b3f0bd7285
1 parent
ece1ed4d2d
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 75 additions and 67 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
3647ce6
| ... | ... | @@ -1194,87 +1194,95 @@ |
| 1194 | 1194 | |
| 1195 | 1195 | private void qhdCouponUse(String hospitalId,String code,Integer userId) |
| 1196 | 1196 | { |
| 1197 | - //获取优惠劵类型 | |
| 1198 | - Map<String,String> param = new HashMap<>(); | |
| 1199 | - param.put("hospitalId",hospitalId); | |
| 1200 | - param.put("code", code); | |
| 1201 | - Map<String,String> couponInfo = couponService.findCouponByCode(param); | |
| 1202 | 1197 | |
| 1203 | - if (couponInfo == null || couponInfo.size() == 0) | |
| 1204 | - { | |
| 1205 | - return ; | |
| 1206 | - } | |
| 1198 | + try { | |
| 1199 | + //获取优惠劵类型 | |
| 1200 | + Map<String,String> param = new HashMap<>(); | |
| 1201 | + param.put("hospitalId",hospitalId); | |
| 1202 | + param.put("code", code); | |
| 1203 | + Map<String,String> couponInfo = couponService.findCouponByCode(param); | |
| 1207 | 1204 | |
| 1208 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 1209 | - patientsQuery.setPid(couponInfo.get("pId")); | |
| 1210 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 1205 | + if (couponInfo == null || couponInfo.size() == 0) | |
| 1206 | + { | |
| 1207 | + return ; | |
| 1208 | + } | |
| 1211 | 1209 | |
| 1212 | - List<Patients> list = patientsService.queryPatient1(patientsQuery, "created"); | |
| 1213 | - QhdDjq model = new QhdDjq(); | |
| 1214 | - if (CollectionUtils.isNotEmpty(list)) | |
| 1215 | - { | |
| 1216 | - Patients patient = list.get(0); | |
| 1217 | - model.setPatName(patient.getUsername()); | |
| 1218 | - model.setPatIdCardNo(patient.getCardNo()); | |
| 1219 | - model.setPatCardNo(patient.getVcCardNo()); | |
| 1220 | - model.setPatPhoneNumber(patient.getPhone()); | |
| 1221 | - model.setTokenCardNo(code); | |
| 1222 | - model.setCardStatus("1");//1 正常 9作废 默认1(必须填写) | |
| 1223 | - model.setLmpDate(DateUtil.getyyyy_MM_dd_hms(patient.getLastMenses())); | |
| 1210 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 1211 | + patientsQuery.setPid(couponInfo.get("pId")); | |
| 1212 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 1224 | 1213 | |
| 1225 | - AntExChuQuery antExChuQuery1 = new AntExChuQuery(); | |
| 1226 | - antExChuQuery1.setParentId(patient.getId()); | |
| 1227 | - antExChuQuery1.setYn(YnEnums.YES.getId()); | |
| 1228 | - List<AntExChuModel> data = antenatalExaminationService.queryAntExChu(antExChuQuery1); | |
| 1229 | - Integer gravidity = 1; //孕次 | |
| 1230 | - if (CollectionUtils.isNotEmpty(data)) | |
| 1214 | + List<Patients> list = patientsService.queryPatient1(patientsQuery, "created"); | |
| 1215 | + QhdDjq model = new QhdDjq(); | |
| 1216 | + if (CollectionUtils.isNotEmpty(list)) | |
| 1231 | 1217 | { |
| 1232 | - AntExChuModel chuModel = data.get(0); | |
| 1233 | - if (chuModel != null && chuModel.getPregnancyTimes() != null) | |
| 1218 | + Patients patient = list.get(0); | |
| 1219 | + model.setPatName(patient.getUsername()); | |
| 1220 | + model.setPatIdCardNo(patient.getCardNo()); | |
| 1221 | + model.setPatCardNo(patient.getVcCardNo()); | |
| 1222 | + model.setPatPhoneNumber(patient.getPhone()); | |
| 1223 | + model.setTokenCardNo(code); | |
| 1224 | + model.setCardStatus("1");//1 正常 9作废 默认1(必须填写) | |
| 1225 | + model.setLmpDate(DateUtil.getyyyy_MM_dd_hms(patient.getLastMenses())); | |
| 1226 | + | |
| 1227 | + AntExChuQuery antExChuQuery1 = new AntExChuQuery(); | |
| 1228 | + antExChuQuery1.setParentId(patient.getId()); | |
| 1229 | + antExChuQuery1.setYn(YnEnums.YES.getId()); | |
| 1230 | + List<AntExChuModel> data = antenatalExaminationService.queryAntExChu(antExChuQuery1); | |
| 1231 | + Integer gravidity = 1; //孕次 | |
| 1232 | + if (CollectionUtils.isNotEmpty(data)) | |
| 1234 | 1233 | { |
| 1235 | - gravidity = chuModel.getPregnancyTimes(); | |
| 1234 | + AntExChuModel chuModel = data.get(0); | |
| 1235 | + if (chuModel != null && chuModel.getPregnancyTimes() != null) | |
| 1236 | + { | |
| 1237 | + gravidity = chuModel.getPregnancyTimes(); | |
| 1238 | + } | |
| 1236 | 1239 | } |
| 1237 | - } | |
| 1238 | 1240 | |
| 1239 | - model.setGravidity(String.valueOf(gravidity)); | |
| 1240 | - Object order = couponInfo.get("couponOrder"); | |
| 1241 | - model.setSerialNumber(order == null ? "0" : order.toString()); | |
| 1241 | + model.setGravidity(String.valueOf(gravidity)); | |
| 1242 | + Object order = couponInfo.get("couponOrder"); | |
| 1243 | + model.setSerialNumber(order == null ? "0" : order.toString()); | |
| 1242 | 1244 | |
| 1243 | - String hospital = ""; | |
| 1244 | - if (org.apache.commons.lang.StringUtils.isNotEmpty(couponInfo.get("createHospitalId"))) { | |
| 1245 | - Organization organization = organizationService.getOrganization(Integer.parseInt(couponInfo.get("createHospitalId"))); | |
| 1246 | - if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
| 1247 | - hospital = organization.getName(); | |
| 1248 | - String areaId = organization.getAreaId(); | |
| 1249 | - BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(areaId); | |
| 1250 | - String areaName = basicConfig.getName(); | |
| 1251 | - model.setAreaFrom(areaName); | |
| 1245 | + String hospital = ""; | |
| 1246 | + if (org.apache.commons.lang.StringUtils.isNotEmpty(couponInfo.get("createHospitalId"))) { | |
| 1247 | + Organization organization = organizationService.getOrganization(Integer.parseInt(couponInfo.get("createHospitalId"))); | |
| 1248 | + if (organization != null && organization.getYn() == YnEnums.YES.getId()) { | |
| 1249 | + hospital = organization.getName(); | |
| 1250 | + String areaId = organization.getAreaId(); | |
| 1251 | + BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(areaId); | |
| 1252 | + String areaName = basicConfig.getName(); | |
| 1253 | + model.setAreaFrom(areaName); | |
| 1254 | + } | |
| 1252 | 1255 | } |
| 1253 | - } | |
| 1254 | - model.setPostHos(hospital); | |
| 1256 | + model.setPostHos(hospital); | |
| 1255 | 1257 | |
| 1256 | - String checkDoctor = CommonsHelper.getUserName(patient.getBookbuildingDoctor(), usersService); | |
| 1258 | + String checkDoctor = CommonsHelper.getUserName(patient.getBookbuildingDoctor(), usersService); | |
| 1257 | 1259 | |
| 1258 | - model.setPostDoc(checkDoctor); | |
| 1259 | - model.setApplyInfo("产检"); | |
| 1260 | - model.setApplyTime(DateUtil.getyyyy_MM_dd_hms(new Date())); | |
| 1261 | - model.setRemark(""); | |
| 1262 | - Users users = usersService.getUsers(userId); | |
| 1263 | - if (users != null) { | |
| 1264 | - model.setWorkerId(users.getAccount()); | |
| 1260 | + model.setPostDoc(checkDoctor); | |
| 1261 | + model.setApplyInfo("产检"); | |
| 1262 | + model.setApplyTime(DateUtil.getyyyy_MM_dd_hms(new Date())); | |
| 1263 | + model.setRemark(""); | |
| 1264 | + Users users = usersService.getUsers(userId); | |
| 1265 | + if (users != null) { | |
| 1266 | + model.setWorkerId(users.getAccount()); | |
| 1267 | + } | |
| 1268 | + else | |
| 1269 | + { | |
| 1270 | + model.setWorkerId(""); | |
| 1271 | + } | |
| 1265 | 1272 | } |
| 1266 | - else | |
| 1267 | - { | |
| 1268 | - model.setWorkerId(""); | |
| 1273 | + | |
| 1274 | + System.out.println(model.toString()); | |
| 1275 | + String result = HospitalCouponPrintUtils.qhdCouponUse(model); | |
| 1276 | + if("0".equals(result)){ | |
| 1277 | + int count = couponService.updateCouponStatus(param); | |
| 1278 | + System.out.println("update coupon count " + count); | |
| 1269 | 1279 | } |
| 1270 | 1280 | } |
| 1271 | - | |
| 1272 | - System.out.println(model.toString()); | |
| 1273 | - String result = HospitalCouponPrintUtils.qhdCouponUse(model); | |
| 1274 | - if("0".equals(result)){ | |
| 1275 | - int count = couponService.updateCouponStatus(param); | |
| 1276 | - System.out.println("update coupon count " + count); | |
| 1281 | + catch (Exception e) | |
| 1282 | + { | |
| 1283 | + System.out.println("秦皇岛优惠劵传入his失败"+e.toString()); | |
| 1277 | 1284 | } |
| 1285 | + | |
| 1278 | 1286 | } |
| 1279 | 1287 | |
| 1280 | 1288 | public void saveTrackCount(Date nextCheckTime,Patients patients) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java
View file @
3647ce6
| ... | ... | @@ -71,8 +71,8 @@ |
| 71 | 71 | */ |
| 72 | 72 | public static String qhdCouponUse(QhdDjq model){ |
| 73 | 73 | String json = JsonUtil.obj2Str(model); |
| 74 | - //String result = HttpClientUtil.doPost("http://localhost:9090/his/insertQhdfycjDjq", json, "utf-8"); | |
| 75 | - String result = "0"; | |
| 74 | + String result = HttpClientUtil.doPost("http://localhost:9090/his/insertQhdfycjDjq", json, "utf-8"); | |
| 75 | + //String result = "0"; | |
| 76 | 76 | return result; |
| 77 | 77 | } |
| 78 | 78 |