From bda1ce873514c0848c4ad76bdd2274f01ab5dcc1 Mon Sep 17 00:00:00 2001 From: zjh <1084500556@qq.com> Date: 星期一, 11 八月 2025 08:48:08 +0800 Subject: [PATCH] zjh202500811 --- ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java | 39 +++++++++------------------------------ 1 files changed, 9 insertions(+), 30 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 d0c659a..93c8b99 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 @@ -33,6 +33,7 @@ import com.ltkj.web.controller.his.HisApiGetMethodService; import com.ltkj.web.controller.his.HisApiMethod; import com.ltkj.web.controller.his.HisApiMethodService; +import com.ltkj.web.controller.service.UtilsService; import com.ltkj.web.wxUtils.HttpClientUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -93,6 +94,8 @@ private HisApiMethod hisApiMethod; @Autowired private HisApiMethodService controller; + @Autowired + private UtilsService utilsService; //灏嗘柟娉曡繑鍥炲�艰В鏋愭垚json鏍煎紡 @@ -273,6 +276,7 @@ // if(null !=tjReservation.getCompanyId())tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId())); if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany()); + if(null !=tjReservation.getDepartment())tjCustomer1.setDepartment(tjReservation.getDepartment()); // tjCustomerService.updateById(tjCustomer1); @@ -308,6 +312,7 @@ tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),"")); if(null !=tjReservation.getCompanyId())tjCustomer.setCompId(tjReservation.getCompanyId()); if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany()); + if(null !=tjReservation.getDepartment())tjCustomer.setDepartment(tjReservation.getDepartment()); if (null != key && key.equals("Y")) { AjaxResult result = controller.Outpincreateapply(tjCustomer); @@ -548,44 +553,18 @@ TjCustomer requestCommonHisApi = isRequestCommonHisApi(tjCustomer); if (null !=requestCommonHisApi){ if (tjCustomerService.save(requestCommonHisApi)) { - saveCustomerSfzImg(tjCustomer,dataSourceType); + utilsService.saveCustomerSfzImg(tjCustomer,dataSourceType); return AjaxResult.success(requestCommonHisApi); } } }else { if (tjCustomerService.save(tjCustomer)) { - saveCustomerSfzImg(tjCustomer,dataSourceType); + utilsService.saveCustomerSfzImg(tjCustomer,dataSourceType); return AjaxResult.success(tjCustomer); } } } return AjaxResult.error(); - } - - private void saveCustomerSfzImg(TjCustomer tjCustomer,String hospId){ - if (StrUtil.isNotBlank(tjCustomer.getSfzImg())){ - hospId = hospId.replace("ltkjpeis10_",""); - String value = sysConfigService.selectConfigByKey("path_sfzfilePath"); - String outputPath = value + File.separator + hospId + File.separator+tjCustomer.getCusId()+".jpg"; - File outFile = new File(outputPath); - File parentDir = outFile.getParentFile(); - if (!parentDir.exists()) { - parentDir.mkdirs(); - } - try { - String base64Str = tjCustomer.getSfzImg(); - if (base64Str.contains(",")) { - base64Str = base64Str.split(",")[1]; - } - byte[] imageBytes = Base64.getDecoder().decode(base64Str); - try (OutputStream out = new FileOutputStream(outFile)) { - out.write(imageBytes); - out.flush(); - } - } catch (Exception e) { - log.error("淇濆瓨韬唤璇佷汉鍍忓浘鐗囧け璐�",e); - } - } } private TjCustomer isRequestCommonHisApi(TjCustomer tjCustomer) { @@ -617,7 +596,7 @@ } map.put("cusName", tjCustomer.getCusName()); map.put("cusSex", tjCustomer.getCusSex()); - map.put("cusBrithday", tjCustomer.getCusBrithday() != null ? DateUtil.format(tjCustomer.getCusBrithday(), "yyyy-MM-dd") : ""); + map.put("cusBrithday", tjCustomer.getCusBrithday() != null ? tjCustomer.getCusBrithday() : ""); map.put("cusAddr", tjCustomer.getCusAddr()); map.put("cusPhone", tjCustomer.getCusPhone()); map.put("compName",""); @@ -733,7 +712,7 @@ map.put("cusSex",tjCustomer.getCusSex()); map.put("cusIdCard",tjCustomer.getCusIdcard()); map.put("compId",""); - map.put("cusBrithday",tjCustomer.getCusBrithday() != null ? DateUtil.format(tjCustomer.getCusBrithday(), "yyyy-MM-dd") : ""); + map.put("cusBrithday",tjCustomer.getCusBrithday() != null ? tjCustomer.getCusBrithday() : ""); map.put("cusAddr",tjCustomer.getCusAddr()); map.put("cusPhone",tjCustomer.getCusPhone()); map.put("compName",""); -- Gitblit v1.8.0