From 5978bf12f908c76e18dd229293bdedd729e1183c Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期三, 31 七月 2024 14:38:39 +0800 Subject: [PATCH] zjh 2024/07/31-1 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java | 48 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 37 insertions(+), 11 deletions(-) diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java index 4dbdc3a..7d4b702 100644 --- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java +++ b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java @@ -212,9 +212,9 @@ wq.eq(TjReservation::getIsExpire, 2); TjReservation tjReservation = tjReservationService.getOne(wq); if (tjReservation != null) { - if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) { - return AjaxResult.error("鏈埌棰勭害鏃堕棿"); - } +// if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) { +// return AjaxResult.error("鏈埌棰勭害鏃堕棿"); +// } if (null != tjReservation.getReservationTime() && DateUtil.endOfDay(tjReservation.getReservationTime()).before(new Date())) { tjReservation.setIsExpire(1); tjReservationService.updateById(tjReservation); @@ -227,7 +227,7 @@ tjCustomer1.setTjType(tjReservation.getTjType()); tjCustomer1.setCusName(tjReservation.getName()); tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex())); - tjCustomer1.setCusBrithday(tjReservation.getBirthday()); + tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); tjCustomer1.setCusPhone(tjReservation.getPhoe()); tjCustomer1.setCusEmail(tjReservation.getEmail()); tjCustomer1.setCusAddr(tjReservation.getAddress()); @@ -239,7 +239,33 @@ tjCustomer1.setAgeUnit(tjReservation.getAgeUnit()); tjCustomer1.setCareer(tjReservation.getCareer()); tjCustomer1.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),"")); - tjCustomerService.updateById(tjCustomer1); +/* if (null != key && key.equals("Y")) + { + AjaxResult result = controller.Outpincreateapply(tjCustomer1); + String result1 = getAjaxResult(result); + JSONObject object = getJSONObject(result1); + String code = object.getStr("ResultCode"); + if (code.equals("0")) { + JSONArray resultDatass = object.getJSONArray("ResultData"); + Map<String, Object> resultData = (Map<String, Object>) resultDatass.get(0); + if (null != resultData && resultData.size() > 0) { + String pationid = resultData.get("PationId").toString(); + if (null != pationid) { +// tjCustomer1.setPationId(pationid); + tjCustomerService.updateById(tjCustomer1); + //淇濆瓨娉ㄥ唽鍏ュ弬鍑哄弬 + resultData.put("cardId",pationid); + JSONObject object4 = JSONUtil.parseObj(resultData); + LambdaQueryWrapper<HisApiConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(HisApiConfig::getApiMethod, "Outpincreateapply"); + HisApiConfig hisApiConfig = hisApiConfigService.getOne(lambdaQueryWrapper); + hisApiGetMethodService.save(object4, "Outpincreateapply", hisApiConfig, JSONUtil.toJsonStr(BeanUtil.beanToMap(tjCustomer1))); + } + } + } + }else { + tjCustomerService.updateById(tjCustomer1); + }*/ tjCustomer1.setTeamNo(tjReservation.getTeamNo()); tjCustomer1.setCompId(tjReservation.getCompanyId()); tjCustomer1.setReservationId(tjReservation.getId()); @@ -251,7 +277,7 @@ tjCustomer.setCusIdcard(tjReservation.getIdCard()); tjCustomer.setCusName(tjReservation.getName()); tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex())); - tjCustomer.setCusBrithday(tjReservation.getBirthday()); + tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); tjCustomer.setCusPhone(tjReservation.getPhoe()); tjCustomer.setCusEmail(tjReservation.getEmail()); tjCustomer.setCusAddr(tjReservation.getAddress()); @@ -263,7 +289,7 @@ tjCustomer.setAgeUnit(tjReservation.getAgeUnit()); tjCustomer.setCareer(tjReservation.getCareer()); tjCustomer.setDwPhone(tjReservation.getDwPhone()); - tjCustomer.setCardId(tjReservation.getCardId()); +// tjCustomer.setCardId(tjReservation.getCardId()); tjCustomer.setIndexCard(tjReservation.getIndexCard()); //鎴彇瀵嗙爜鑷姩鐢熸垚set杩涘幓 String substring = cusIdcard.substring(cusIdcard.length() - 6); @@ -271,7 +297,6 @@ tjCustomer.setCusPassword(substring); tjCustomer.setTjType(tjReservation.getTjType()); tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),"")); - tjCustomerService.save(tjCustomer); if (null != key && key.equals("Y")) { AjaxResult result = controller.Outpincreateapply(tjCustomer); @@ -285,7 +310,7 @@ String pationid = resultData.get("PationId").toString(); if (null != pationid) { tjCustomer.setPationId(pationid); - tjCustomerService.updateById(tjCustomer); + tjCustomerService.save(tjCustomer); //淇濆瓨娉ㄥ唽鍏ュ弬鍑哄弬 resultData.put("cardId",pationid); JSONObject object4 = JSONUtil.parseObj(resultData); @@ -296,6 +321,8 @@ } } } + }else { + tjCustomerService.save(tjCustomer); } tjCustomer.setTeamNo(tjReservation.getTeamNo()); tjCustomer.setCompId(tjReservation.getCompanyId()); @@ -482,7 +509,7 @@ String pationid = resultData.get("PationId").toString(); if (null != pationid) { tjCustomer.setPationId(pationid); - tjCustomerService.updateById(tjCustomer); +// tjCustomerService.updateById(tjCustomer); //淇濆瓨娉ㄥ唽鍏ュ弬鍑哄弬 resultData.put("cardId",pationid); JSONObject object4 = JSONUtil.parseObj(resultData); @@ -529,7 +556,6 @@ if (tjCustomerService.updateById(tjCustomer)) { String config = sysConfigService.selectConfigByKey("sfkqdyhis"); if (null != config && config.equals("Y")) { - tjCustomer.setPationId(customer.getPationId()); AjaxResult result = controller.Outpincreateapply(tjCustomer); String result1 = getAjaxResult(result); JSONObject object = getJSONObject(result1); -- Gitblit v1.8.0