ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjCustomerController.java
@@ -6,6 +6,7 @@ import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.date.DateUnit; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.json.JSONArray; import cn.hutool.json.JSONObject; @@ -47,6 +48,9 @@ import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.common.core.page.TableDataInfo; import java.io.File; import java.io.FileOutputStream; import java.io.OutputStream; import java.util.*; import java.util.stream.Collectors; @@ -544,11 +548,13 @@ TjCustomer requestCommonHisApi = isRequestCommonHisApi(tjCustomer); if (null !=requestCommonHisApi){ if (tjCustomerService.save(requestCommonHisApi)) { saveCustomerSfzImg(tjCustomer,dataSourceType); return AjaxResult.success(requestCommonHisApi); } } }else { if (tjCustomerService.save(tjCustomer)) { saveCustomerSfzImg(tjCustomer,dataSourceType); return AjaxResult.success(tjCustomer); } } @@ -556,6 +562,32 @@ 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) { String apiUrl = sysConfigService.selectConfigByKey("common_api_url"); String hospbm = sysConfigService.selectConfigByKey("common_api_service_hospbm"); ltkj-framework/src/main/java/com/ltkj/framework/security/handle/LogoutSuccessHandlerImpl.java
@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.db.DataSourceContextHolder; import com.ltkj.framework.web.service.TokenService; @@ -44,6 +45,10 @@ public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { String hospId = request.getHeader("hospId"); if (StrUtil.isBlank(hospId) || hospId.equals("undefined")){ ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.success("退出成功"))); return; } LambdaQueryWrapper<DictHosp> wrapper = new LambdaQueryWrapper<>(); wrapper.eq(DictHosp::getCode,hospId); DictHosp hosp = hospService.getOne(wrapper); ltkj-hosp/src/main/java/com/ltkj/hosp/domain/TjCustomer.java
@@ -335,6 +335,9 @@ private String hisJzkh; @TableField(exist = false) private String sfzImg; @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjOrderMapper.java
@@ -346,26 +346,28 @@ @Select("SELECT\n" + " DISTINCT a.tj_number \n" + "FROM\n" + " tj_order_remark a\n" + " JOIN sys_dept b ON b.dept_id = a.dept_id \n" + "WHERE\n" + " a.deleted = 0 \n" + " AND b.org_type = 1 \n" + " AND a.type=0") " DISTINCT a.tj_number \n" + " FROM\n" + " tj_order_remark a\n" + " JOIN sys_dept b ON b.dept_id = a.dept_id \n" + " JOIN tj_order o ON a.tj_number = o.tj_number\n" + " WHERE\n" + " a.deleted = 0 \n" + " AND b.org_type = 1 \n" + " AND a.type=0 AND o.deleted = 0") List<String> getDingShiTongBuJianYanTjNum(); @Select(" SELECT\n" + " DISTINCT a.tj_number \n" + "FROM\n" + " tj_order_remark a\n" + " JOIN sys_dept b ON b.dept_id = a.dept_id \n" + "WHERE\n" + " a.deleted = 0 \n" + " AND b.org_type = 2 \n" + " AND a.type =0") @Select("SELECT\n" + " DISTINCT a.tj_number\n" + " FROM\n" + " tj_order_remark a\n" + " JOIN sys_dept b ON b.dept_id = a.dept_id\n" + " JOIN tj_order o ON o.tj_number = a.tj_number\n" + " WHERE\n" + " a.deleted = 0\n" + " AND b.org_type = 2\n" + " AND a.type =0 AND o.deleted = 0") List<String> getDingShiTongBuJianChaTjNum();