From b4b5c838cd687ec80e0cdfaa666894ec456285e0 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Thu, 9 Oct 2025 14:51:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B5=84=E6=BA=90=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=87=B3=E7=AE=A1=E7=90=86=E5=B9=B3=E5=8F=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/commonutils/SysBaseInfoApi.java | 1 + .../com/nu/entity/SysUploadPreEntity.java | 19 + .../eldertag/listener/ElderTagMQListener.java | 54 +- .../impl/EmployeesApplyServiceImpl.java | 2 + .../listener/EmployeesMQListener.java | 2074 ++++++++--------- .../ConfigServiceDirectiveController.java | 2 +- .../ConfigServiceDirectiveServiceImpl.java | 58 +- .../listener/DirectiveMQListener.java | 748 +++--- .../system/controller/CommonController.java | 59 +- 9 files changed, 1543 insertions(+), 1474 deletions(-) create mode 100644 nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java diff --git a/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java b/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java index 6aaadd35..ebc700c9 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/commonutils/SysBaseInfoApi.java @@ -37,4 +37,5 @@ public class SysBaseInfoApi { result.put("url",deptInfo.getString("url")); return Result.ok(result); } + } diff --git a/nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java b/nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java new file mode 100644 index 00000000..9fbf4de7 --- /dev/null +++ b/nursing-unit-common/src/main/java/com/nu/entity/SysUploadPreEntity.java @@ -0,0 +1,19 @@ +package com.nu.entity; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description: 文件上传前置参数 + * @Author: zmy + * @Date: 2025-10-9 09:26:22 + * @Version: V1.0 + */ +@Data +public class SysUploadPreEntity implements Serializable { + + private String fileName; + private String fileSubfix; + private String fileSize; +} diff --git a/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/mq/eldertag/listener/ElderTagMQListener.java b/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/mq/eldertag/listener/ElderTagMQListener.java index 69cab9b4..518a3c34 100644 --- a/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/mq/eldertag/listener/ElderTagMQListener.java +++ b/nursing-unit-elder/nu-elder-biz/src/main/java/com/nu/modules/mq/eldertag/listener/ElderTagMQListener.java @@ -57,7 +57,7 @@ public class ElderTagMQListener { //增量处理数据 handleIncremental(dto); //数据处理出错的话就不能继续处理标签资源了 所以方法放到这个位置 - handleCreateMedia(dto); +// handleCreateMedia(dto); } catch (Exception e) { e.printStackTrace(); //返回错误日志 @@ -110,32 +110,32 @@ public class ElderTagMQListener { String baseUrl = dto.getApi(); //处理长者标签图片 - if (StringUtils.isNotBlank(dto.getPicMd5()) && !dto.getPicMd5().equals(currentElderTag.getPicMd5())) { - String pic = dto.getPic(); - if (StringUtils.isNotBlank(pic)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(pic, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = pic.substring(0, pic.lastIndexOf("/")); - String fileName = pic.substring(pic.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getPicMd5()) && !dto.getPicMd5().equals(currentElderTag.getPicMd5())) { +// String pic = dto.getPic(); +// if (StringUtils.isNotBlank(pic)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(pic, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = pic.substring(0, pic.lastIndexOf("/")); +// String fileName = pic.substring(pic.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); et.setPic(dto.getPic());//长者标签图片 et.setPicMd5(dto.getPicMd5()); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(pic); - mediaAsyncErrorLog.setMsg(e.getMessage()); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("长者标签图片文件拉取错误,标签id" + currentElderTag.getId()); - } - } - } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(pic); +// mediaAsyncErrorLog.setMsg(e.getMessage()); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("长者标签图片文件拉取错误,标签id" + currentElderTag.getId()); +// } +// } +// } elderTagService.updateById(et); } }); @@ -199,8 +199,8 @@ public class ElderTagMQListener { for (ElderTag elderTag : allData) { if (needAddIds.contains(elderTag.getId())) { //这里都是新增的标签 不存储标签资源字段 在标签资源mq中会存储这个值 - elderTag.setPic(null); - elderTag.setPicMd5(null); + elderTag.setPic(elderTag.getPic()); + elderTag.setPicMd5(elderTag.getPicMd5()); elderTag.setSort(0); elderTag.setPrice(new BigDecimal("0")); needAddETList.add(elderTag); diff --git a/nursing-unit-employee/nu-employee-biz/src/main/java/com/nu/modules/employeesapply/service/impl/EmployeesApplyServiceImpl.java b/nursing-unit-employee/nu-employee-biz/src/main/java/com/nu/modules/employeesapply/service/impl/EmployeesApplyServiceImpl.java index 5982a69e..28d617a9 100644 --- a/nursing-unit-employee/nu-employee-biz/src/main/java/com/nu/modules/employeesapply/service/impl/EmployeesApplyServiceImpl.java +++ b/nursing-unit-employee/nu-employee-biz/src/main/java/com/nu/modules/employeesapply/service/impl/EmployeesApplyServiceImpl.java @@ -172,6 +172,7 @@ public class EmployeesApplyServiceImpl extends ServiceImpl list = Arrays.asList(qualification.split(",")); - for (int i = 0; i < list.size(); i++) { - String qua = list.get(i); - if (StringUtils.isNotBlank(qua)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = qua.substring(0, qua.lastIndexOf("/")); - String fileName = qua.substring(qua.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(qualification); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); - } - } - } - mediaData.setQualification(qualification); - } - } - //无犯罪证明 - { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); - String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setNoCrimeCertificate(noCrimeCertificate); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(noCrimeCertificate); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - employeesApplyService.updateById(mediaData); - } +// { +// EmployeesApply mediaData = new EmployeesApply(); +// mediaData.setId(employeesApply.getId()); +// +// JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); +// String baseUrl = opeOpenUrl.getString("configValue"); +// if (baseUrl.endsWith("/")) { +// baseUrl = baseUrl.substring(0, baseUrl.length() - 1); +// } +// //身份证正面 +// { +// if (StringUtils.isNotBlank(idCardPositive)) { +// if (StringUtils.isNotBlank(idCardPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); +// String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setIdCardPositive(idCardPositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //身份证反面 +// { +// if (StringUtils.isNotBlank(idCardNegative)) { +// if (StringUtils.isNotBlank(idCardNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); +// String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setIdCardNegative(idCardNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证正面 +// { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); +// String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setHealthCertificatePositive(healthCertificatePositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificatePositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证反面 +// { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); +// String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setHealthCertificateNegative(healthCertificateNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificateNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡正面 +// { +// if (StringUtils.isNotBlank(bankPositive)) { +// if (StringUtils.isNotBlank(bankPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); +// String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setBankPositive(bankPositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡反面 +// { +// if (StringUtils.isNotBlank(bankNegative)) { +// if (StringUtils.isNotBlank(bankNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); +// String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setBankNegative(bankNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //资质证(多张使用逗号分隔) +// { +// if (StringUtils.isNotBlank(qualification)) { +// List list = Arrays.asList(qualification.split(",")); +// for (int i = 0; i < list.size(); i++) { +// String qua = list.get(i); +// if (StringUtils.isNotBlank(qua)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = qua.substring(0, qua.lastIndexOf("/")); +// String fileName = qua.substring(qua.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(qualification); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); +// } +// } +// } +// mediaData.setQualification(qualification); +// } +// } +// //无犯罪证明 +// { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); +// String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setNoCrimeCertificate(noCrimeCertificate); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(noCrimeCertificate); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// employeesApplyService.updateById(mediaData); +// } } @@ -385,241 +385,241 @@ public class EmployeesMQListener { String qualification = employeesApply.getQualification(); String noCrimeCertificate = employeesApply.getNoCrimeCertificate(); { - employeesApply.setIdCardPositive(null);//身份证正面 - employeesApply.setIdCardNegative(null);//身份证反面 - employeesApply.setHealthCertificatePositive(null);//健康证正面 - employeesApply.setHealthCertificateNegative(null);//健康证反面 - employeesApply.setBankPositive(null);//银行卡正面 - employeesApply.setBankNegative(null);//银行卡反面 - employeesApply.setQualification(null);//资质证 - employeesApply.setNoCrimeCertificate(null);//无犯罪证明 +// employeesApply.setIdCardPositive(null);//身份证正面 +// employeesApply.setIdCardNegative(null);//身份证反面 +// employeesApply.setHealthCertificatePositive(null);//健康证正面 +// employeesApply.setHealthCertificateNegative(null);//健康证反面 +// employeesApply.setBankPositive(null);//银行卡正面 +// employeesApply.setBankNegative(null);//银行卡反面 +// employeesApply.setQualification(null);//资质证 +// employeesApply.setNoCrimeCertificate(null);//无犯罪证明 } employeesApplyService.save(employeesApply); //去管理平台拉取资源 - { - EmployeesApply mediaData = new EmployeesApply(); - mediaData.setId(employeesApply.getId()); - - JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); - String baseUrl = opeOpenUrl.getString("configValue"); - if (baseUrl.endsWith("/")) { - baseUrl = baseUrl.substring(0, baseUrl.length() - 1); - } - //身份证正面 - { - if (StringUtils.isNotBlank(idCardPositive)) { - if (StringUtils.isNotBlank(idCardPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); - String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setIdCardPositive(idCardPositive); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //身份证反面 - { - if (StringUtils.isNotBlank(idCardNegative)) { - if (StringUtils.isNotBlank(idCardNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); - String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setIdCardNegative(idCardNegative); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //健康证正面 - { - if (StringUtils.isNotBlank(healthCertificatePositive)) { - if (StringUtils.isNotBlank(healthCertificatePositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); - String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setHealthCertificatePositive(healthCertificatePositive); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(healthCertificatePositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //健康证反面 - { - if (StringUtils.isNotBlank(healthCertificateNegative)) { - if (StringUtils.isNotBlank(healthCertificateNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); - String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setHealthCertificateNegative(healthCertificateNegative); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(healthCertificateNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //银行卡正面 - { - if (StringUtils.isNotBlank(bankPositive)) { - if (StringUtils.isNotBlank(bankPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); - String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setBankPositive(bankPositive); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(bankPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //银行卡反面 - { - if (StringUtils.isNotBlank(bankNegative)) { - if (StringUtils.isNotBlank(bankNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); - String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setBankNegative(bankNegative); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(bankNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //资质证(多张使用逗号分隔) - { - if (StringUtils.isNotBlank(qualification)) { - List list = Arrays.asList(qualification.split(",")); - for (int i = 0; i < list.size(); i++) { - String qua = list.get(i); - if (StringUtils.isNotBlank(qua)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = qua.substring(0, qua.lastIndexOf("/")); - String fileName = qua.substring(qua.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(qualification); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); - } - } - } - mediaData.setQualification(qualification); - } - } - //无犯罪证明 - { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); - String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setNoCrimeCertificate(noCrimeCertificate); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(noCrimeCertificate); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - employeesApplyService.updateById(mediaData); - } +// { +// EmployeesApply mediaData = new EmployeesApply(); +// mediaData.setId(employeesApply.getId()); +// +// JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); +// String baseUrl = opeOpenUrl.getString("configValue"); +// if (baseUrl.endsWith("/")) { +// baseUrl = baseUrl.substring(0, baseUrl.length() - 1); +// } +// //身份证正面 +// { +// if (StringUtils.isNotBlank(idCardPositive)) { +// if (StringUtils.isNotBlank(idCardPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); +// String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setIdCardPositive(idCardPositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //身份证反面 +// { +// if (StringUtils.isNotBlank(idCardNegative)) { +// if (StringUtils.isNotBlank(idCardNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); +// String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setIdCardNegative(idCardNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证正面 +// { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); +// String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setHealthCertificatePositive(healthCertificatePositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificatePositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证反面 +// { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); +// String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setHealthCertificateNegative(healthCertificateNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificateNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡正面 +// { +// if (StringUtils.isNotBlank(bankPositive)) { +// if (StringUtils.isNotBlank(bankPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); +// String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setBankPositive(bankPositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡反面 +// { +// if (StringUtils.isNotBlank(bankNegative)) { +// if (StringUtils.isNotBlank(bankNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); +// String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setBankNegative(bankNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //资质证(多张使用逗号分隔) +// { +// if (StringUtils.isNotBlank(qualification)) { +// List list = Arrays.asList(qualification.split(",")); +// for (int i = 0; i < list.size(); i++) { +// String qua = list.get(i); +// if (StringUtils.isNotBlank(qua)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = qua.substring(0, qua.lastIndexOf("/")); +// String fileName = qua.substring(qua.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(qualification); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); +// } +// } +// } +// mediaData.setQualification(qualification); +// } +// } +// //无犯罪证明 +// { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); +// String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setNoCrimeCertificate(noCrimeCertificate); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(noCrimeCertificate); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// employeesApplyService.updateById(mediaData); +// } } /** @@ -691,242 +691,242 @@ public class EmployeesMQListener { String qualification = employeesInfo.getQualification(); String noCrimeCertificate = employeesInfo.getNoCrimeCertificate(); { - employeesInfo.setIdCardPositive(null);//身份证正面 - employeesInfo.setIdCardNegative(null);//身份证反面 - employeesInfo.setHealthCertificatePositive(null);//健康证正面 - employeesInfo.setHealthCertificateNegative(null);//健康证反面 - employeesInfo.setBankPositive(null);//银行卡正面 - employeesInfo.setBankNegative(null);//银行卡反面 - employeesInfo.setQualification(null);//资质证 - employeesInfo.setNoCrimeCertificate(null);//无犯罪证明 +// employeesInfo.setIdCardPositive(null);//身份证正面 +// employeesInfo.setIdCardNegative(null);//身份证反面 +// employeesInfo.setHealthCertificatePositive(null);//健康证正面 +// employeesInfo.setHealthCertificateNegative(null);//健康证反面 +// employeesInfo.setBankPositive(null);//银行卡正面 +// employeesInfo.setBankNegative(null);//银行卡反面 +// employeesInfo.setQualification(null);//资质证 +// employeesInfo.setNoCrimeCertificate(null);//无犯罪证明 } employeesInfoService.save(employeesInfo); //去管理平台拉取资源 - { - BizEmployeesInfo mediaData = new BizEmployeesInfo(); - mediaData.setId(employeesInfo.getId()); - - JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); - String baseUrl = opeOpenUrl.getString("configValue"); - if (baseUrl.endsWith("/")) { - baseUrl = baseUrl.substring(0, baseUrl.length() - 1); - } - //身份证正面 - { - if (StringUtils.isNotBlank(idCardPositive)) { - if (StringUtils.isNotBlank(idCardPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); - String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setIdCardPositive(idCardPositive); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //身份证反面 - { - if (StringUtils.isNotBlank(idCardNegative)) { - if (StringUtils.isNotBlank(idCardNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); - String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setIdCardNegative(idCardNegative); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //健康证正面 - { - if (StringUtils.isNotBlank(healthCertificatePositive)) { - if (StringUtils.isNotBlank(healthCertificatePositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); - String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setHealthCertificatePositive(healthCertificatePositive); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(healthCertificatePositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //健康证反面 - { - if (StringUtils.isNotBlank(healthCertificateNegative)) { - if (StringUtils.isNotBlank(healthCertificateNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); - String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setHealthCertificateNegative(healthCertificateNegative); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(healthCertificateNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //银行卡正面 - { - if (StringUtils.isNotBlank(bankPositive)) { - if (StringUtils.isNotBlank(bankPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); - String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setBankPositive(bankPositive); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(bankPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //银行卡反面 - { - if (StringUtils.isNotBlank(bankNegative)) { - if (StringUtils.isNotBlank(bankNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); - String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setBankNegative(bankNegative); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(bankNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //资质证(多张使用逗号分隔) - { - if (StringUtils.isNotBlank(qualification)) { - List list = Arrays.asList(qualification.split(",")); - for (int i = 0; i < list.size(); i++) { - String qua = list.get(i); - if (StringUtils.isNotBlank(qua)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = qua.substring(0, qua.lastIndexOf("/")); - String fileName = qua.substring(qua.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(qualification); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); - } - } - } - mediaData.setQualification(qualification); - } - } - //无犯罪证明 - { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); - String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - mediaData.setNoCrimeCertificate(noCrimeCertificate); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(noCrimeCertificate); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - employeesInfoService.updateById(mediaData); - } +// { +// BizEmployeesInfo mediaData = new BizEmployeesInfo(); +// mediaData.setId(employeesInfo.getId()); +// +// JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); +// String baseUrl = opeOpenUrl.getString("configValue"); +// if (baseUrl.endsWith("/")) { +// baseUrl = baseUrl.substring(0, baseUrl.length() - 1); +// } +// //身份证正面 +// { +// if (StringUtils.isNotBlank(idCardPositive)) { +// if (StringUtils.isNotBlank(idCardPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); +// String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setIdCardPositive(idCardPositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //身份证反面 +// { +// if (StringUtils.isNotBlank(idCardNegative)) { +// if (StringUtils.isNotBlank(idCardNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); +// String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setIdCardNegative(idCardNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证正面 +// { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); +// String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setHealthCertificatePositive(healthCertificatePositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificatePositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证反面 +// { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); +// String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setHealthCertificateNegative(healthCertificateNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificateNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡正面 +// { +// if (StringUtils.isNotBlank(bankPositive)) { +// if (StringUtils.isNotBlank(bankPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); +// String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setBankPositive(bankPositive); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡反面 +// { +// if (StringUtils.isNotBlank(bankNegative)) { +// if (StringUtils.isNotBlank(bankNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); +// String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setBankNegative(bankNegative); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //资质证(多张使用逗号分隔) +// { +// if (StringUtils.isNotBlank(qualification)) { +// List list = Arrays.asList(qualification.split(",")); +// for (int i = 0; i < list.size(); i++) { +// String qua = list.get(i); +// if (StringUtils.isNotBlank(qua)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = qua.substring(0, qua.lastIndexOf("/")); +// String fileName = qua.substring(qua.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(qualification); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); +// } +// } +// } +// mediaData.setQualification(qualification); +// } +// } +// //无犯罪证明 +// { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); +// String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// mediaData.setNoCrimeCertificate(noCrimeCertificate); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(noCrimeCertificate); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// employeesInfoService.updateById(mediaData); +// } } JSONObject deptInfo = sysBaseAPI.getDeptInfo(); String orgCode = deptInfo.getString("code"); @@ -973,14 +973,14 @@ public class EmployeesMQListener { empInfo.setModifyStatus(null); empInfo.setIzInvited(null); { - empInfo.setIdCardPositive(null);//身份证正面 - empInfo.setIdCardNegative(null);//身份证反面 - empInfo.setHealthCertificatePositive(null);//健康证正面 - empInfo.setHealthCertificateNegative(null);//健康证反面 - empInfo.setBankPositive(null);//银行卡正面 - empInfo.setBankNegative(null);//银行卡反面 - empInfo.setQualification(null);//资质证 - empInfo.setNoCrimeCertificate(null);//无犯罪证明 +// empInfo.setIdCardPositive(null);//身份证正面 +// empInfo.setIdCardNegative(null);//身份证反面 +// empInfo.setHealthCertificatePositive(null);//健康证正面 +// empInfo.setHealthCertificateNegative(null);//健康证反面 +// empInfo.setBankPositive(null);//银行卡正面 +// empInfo.setBankNegative(null);//银行卡反面 +// empInfo.setQualification(null);//资质证 +// empInfo.setNoCrimeCertificate(null);//无犯罪证明 } employeesInfoService.updateById(empInfo); infoMediaData.setId(empInfo.getId()); @@ -1003,14 +1003,14 @@ public class EmployeesMQListener { empApply.setAuditContent(null); empApply.setDelFlag(null); { - empApply.setIdCardPositive(null);//身份证正面 - empApply.setIdCardNegative(null);//身份证反面 - empApply.setHealthCertificatePositive(null);//健康证正面 - empApply.setHealthCertificateNegative(null);//健康证反面 - empApply.setBankPositive(null);//银行卡正面 - empApply.setBankNegative(null);//银行卡反面 - empApply.setQualification(null);//资质证 - empApply.setNoCrimeCertificate(null);//无犯罪证明 +// empApply.setIdCardPositive(null);//身份证正面 +// empApply.setIdCardNegative(null);//身份证反面 +// empApply.setHealthCertificatePositive(null);//健康证正面 +// empApply.setHealthCertificateNegative(null);//健康证反面 +// empApply.setBankPositive(null);//银行卡正面 +// empApply.setBankNegative(null);//银行卡反面 +// empApply.setQualification(null);//资质证 +// empApply.setNoCrimeCertificate(null);//无犯罪证明 } employeesApplyService.updateById(empApply); appMediaData.setId(empApply.getId()); @@ -1018,274 +1018,274 @@ public class EmployeesMQListener { } //如果需要拉取全部资源则开始拉取 不需要进行条件三 if (downMedia) { - new Thread(() -> { - //去管理平台拉取资源 - { - JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); - String baseUrl = opeOpenUrl.getString("configValue"); - if (baseUrl.endsWith("/")) { - baseUrl = baseUrl.substring(0, baseUrl.length() - 1); - } - //身份证正面 - { - if (StringUtils.isNotBlank(idCardPositive)) { - if (StringUtils.isNotBlank(idCardPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); - String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setIdCardPositive(idCardPositive); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setIdCardPositive(idCardPositive); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //身份证反面 - { - if (StringUtils.isNotBlank(idCardNegative)) { - if (StringUtils.isNotBlank(idCardNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); - String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setIdCardNegative(idCardNegative); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setIdCardNegative(idCardNegative); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //健康证正面 - { - if (StringUtils.isNotBlank(healthCertificatePositive)) { - if (StringUtils.isNotBlank(healthCertificatePositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); - String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setHealthCertificatePositive(healthCertificatePositive); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setHealthCertificatePositive(healthCertificatePositive); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(healthCertificatePositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //健康证反面 - { - if (StringUtils.isNotBlank(healthCertificateNegative)) { - if (StringUtils.isNotBlank(healthCertificateNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); - String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setHealthCertificateNegative(healthCertificateNegative); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setHealthCertificateNegative(healthCertificateNegative); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(healthCertificateNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //银行卡正面 - { - if (StringUtils.isNotBlank(bankPositive)) { - if (StringUtils.isNotBlank(bankPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); - String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setBankPositive(bankPositive); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setBankPositive(bankPositive); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(bankPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //银行卡反面 - { - if (StringUtils.isNotBlank(bankNegative)) { - if (StringUtils.isNotBlank(bankNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); - String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setBankNegative(bankNegative); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setBankNegative(bankNegative); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(bankNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - //资质证(多张使用逗号分隔) - { - if (StringUtils.isNotBlank(qualification)) { - List list = Arrays.asList(qualification.split(",")); - for (int i = 0; i < list.size(); i++) { - String qua = list.get(i); - if (StringUtils.isNotBlank(qua)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = qua.substring(0, qua.lastIndexOf("/")); - String fileName = qua.substring(qua.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(qualification); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); - } - } - } - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setQualification(qualification); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setQualification(qualification); - } - } - } - //无犯罪证明 - { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - if (StringUtils.isNotBlank(noCrimeCertificate)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); - String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - if (StringUtils.isNotBlank(infoMediaData.getId())) { - infoMediaData.setNoCrimeCertificate(noCrimeCertificate); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - appMediaData.setNoCrimeCertificate(noCrimeCertificate); - } - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(noCrimeCertificate); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } - if (StringUtils.isNotBlank(infoMediaData.getId())) { - employeesInfoService.updateById(infoMediaData); - } - if (StringUtils.isNotBlank(appMediaData.getId())) { - employeesApplyService.updateById(appMediaData); - } - } - }).start(); +// new Thread(() -> { +// //去管理平台拉取资源 +// { +// JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); +// String baseUrl = opeOpenUrl.getString("configValue"); +// if (baseUrl.endsWith("/")) { +// baseUrl = baseUrl.substring(0, baseUrl.length() - 1); +// } +// //身份证正面 +// { +// if (StringUtils.isNotBlank(idCardPositive)) { +// if (StringUtils.isNotBlank(idCardPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); +// String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setIdCardPositive(idCardPositive); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setIdCardPositive(idCardPositive); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //身份证反面 +// { +// if (StringUtils.isNotBlank(idCardNegative)) { +// if (StringUtils.isNotBlank(idCardNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); +// String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setIdCardNegative(idCardNegative); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setIdCardNegative(idCardNegative); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证正面 +// { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// if (StringUtils.isNotBlank(healthCertificatePositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/")); +// String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setHealthCertificatePositive(healthCertificatePositive); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setHealthCertificatePositive(healthCertificatePositive); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificatePositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-健康证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //健康证反面 +// { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// if (StringUtils.isNotBlank(healthCertificateNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/")); +// String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setHealthCertificateNegative(healthCertificateNegative); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setHealthCertificateNegative(healthCertificateNegative); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(healthCertificateNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-健康证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡正面 +// { +// if (StringUtils.isNotBlank(bankPositive)) { +// if (StringUtils.isNotBlank(bankPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/")); +// String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setBankPositive(bankPositive); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setBankPositive(bankPositive); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //银行卡反面 +// { +// if (StringUtils.isNotBlank(bankNegative)) { +// if (StringUtils.isNotBlank(bankNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/")); +// String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setBankNegative(bankNegative); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setBankNegative(bankNegative); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(bankNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// //资质证(多张使用逗号分隔) +// { +// if (StringUtils.isNotBlank(qualification)) { +// List list = Arrays.asList(qualification.split(",")); +// for (int i = 0; i < list.size(); i++) { +// String qua = list.get(i); +// if (StringUtils.isNotBlank(qua)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = qua.substring(0, qua.lastIndexOf("/")); +// String fileName = qua.substring(qua.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(qualification); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua); +// } +// } +// } +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setQualification(qualification); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setQualification(qualification); +// } +// } +// } +// //无犯罪证明 +// { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// if (StringUtils.isNotBlank(noCrimeCertificate)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/")); +// String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// infoMediaData.setNoCrimeCertificate(noCrimeCertificate); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// appMediaData.setNoCrimeCertificate(noCrimeCertificate); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(noCrimeCertificate); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } +// if (StringUtils.isNotBlank(infoMediaData.getId())) { +// employeesInfoService.updateById(infoMediaData); +// } +// if (StringUtils.isNotBlank(appMediaData.getId())) { +// employeesApplyService.updateById(appMediaData); +// } +// } +// }).start(); return; } //条件三 如果不满足条件一、二 否则判断是否获取过身份证 - 只更新身份证字段和资源 @@ -1301,72 +1301,72 @@ public class EmployeesMQListener { bizEmployeesMedia.setCardZmPath("2"); bizEmployeesMedia.setCardFmPath("2"); employeesMediaService.update(bizEmployeesMedia, mqw); - new Thread(() -> { +// new Thread(() -> { //去管理平台拉取资源 { - JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); - String baseUrl = opeOpenUrl.getString("configValue"); - if (baseUrl.endsWith("/")) { - baseUrl = baseUrl.substring(0, baseUrl.length() - 1); - } +// JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); +// String baseUrl = opeOpenUrl.getString("configValue"); +// if (baseUrl.endsWith("/")) { +// baseUrl = baseUrl.substring(0, baseUrl.length() - 1); +// } //身份证正面 - { - if (StringUtils.isNotBlank(idCardPositive)) { - if (StringUtils.isNotBlank(idCardPositive)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); - String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - employeesApply2.setIdCardPositive(idCardPositive); - bizEmployeesMedia.setCardZmPath("2"); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardPositive); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } +// { +// if (StringUtils.isNotBlank(idCardPositive)) { +// if (StringUtils.isNotBlank(idCardPositive)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/")); +// String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); + employeesApply2.setIdCardPositive(idCardPositive); +// bizEmployeesMedia.setCardZmPath("2"); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardPositive); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证正面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } //身份证反面 - { - if (StringUtils.isNotBlank(idCardNegative)) { - if (StringUtils.isNotBlank(idCardNegative)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); - String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); - employeesApply2.setIdCardNegative(idCardNegative); - bizEmployeesMedia.setCardFmPath("2"); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(idCardNegative); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); - } - } - } - } +// { +// if (StringUtils.isNotBlank(idCardNegative)) { +// if (StringUtils.isNotBlank(idCardNegative)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/")); +// String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); + employeesApply2.setIdCardNegative(idCardNegative); +// bizEmployeesMedia.setCardFmPath("2"); +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(idCardNegative); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("其它机构审核员工信息通过后通知本机构修改员工信息-身份证反面文件拉取错误,员工id" + dto.getEmployeeId()); +// } +// } +// } +// } employeesApplyService.updateById(employeesApply2); - employeesMediaService.update(bizEmployeesMedia, mqw); +// employeesMediaService.update(bizEmployeesMedia, mqw); } - }).start(); +// }).start(); } } } diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java index 7d3bec8c..17cd813a 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/servicedirective/controller/ConfigServiceDirectiveController.java @@ -269,7 +269,7 @@ public class ConfigServiceDirectiveController extends JeecgController bodyTagList = record.getBodyTagList(); - record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(","))); - - List emotionTagList = record.getEmotionTagList(); - record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(","))); +// List bodyTagList = record.getBodyTagList(); +// record.setBodyTags(bodyTagList.stream().map(DirectiveBodyTag::getId).collect(Collectors.joining(","))); +// +// List emotionTagList = record.getEmotionTagList(); +// record.setEmotionTags(emotionTagList.stream().map(DirectiveEmotionTag::getId).collect(Collectors.joining(","))); }); } directiveMQDto.setDirectiveList(BeanUtil.copyToList(directives, DirectiveAsyncMQDto.class)); @@ -541,35 +541,35 @@ public class ConfigServiceDirectiveServiceImpl extends ServiceImpl existedIds = Lists.newArrayList(); - //获取到已经存在的体型标签数据 - if (dto.isIzInc()) { - List list = bodyTagService.list(); - existedIds = list.stream().map(DirectiveBodyTag::getId).collect(Collectors.toList()); - } - //传过来的全部体型标签主表数据 - List allData = BeanUtil.copyToList(dto.getBodyTagList(), DirectiveBodyTag.class); - //需要新增的体型标签字典表数据 - List needAddBodyList = new ArrayList<>(); - //获取到需要新增的体型标签字典表数据 - for (DirectiveBodyTag body : allData) { - if (!existedIds.contains(body.getId())) { - needAddBodyList.add(body); - } - } - if (needAddBodyList != null && !needAddBodyList.isEmpty()) { - bodyTagService.insertAll(needAddBodyList); - } - } - //中间关系表 - { - List bodyRelations = Lists.newArrayList();//关系表 - needAddDirectiveList.stream().forEach(d -> { - String bodyTags = d.getBodyTags(); - if (StringUtils.isNotBlank(bodyTags)) { - Arrays.stream(bodyTags.split(",")).forEach(bi -> { - DirectiveBodyTagRelation r = new DirectiveBodyTagRelation(); - r.setDirectiveId(d.getId()); - r.setTagId(bi); - bodyRelations.add(r); - }); - } - }); - bodyTagService.insertAllRelation(bodyRelations); - } - } +// { +// //处理体型标签字典主表 +// if (dto.getBodyTagList() != null) { +// //已经存在的体型标签id +// List existedIds = Lists.newArrayList(); +// //获取到已经存在的体型标签数据 +// if (dto.isIzInc()) { +// List list = bodyTagService.list(); +// existedIds = list.stream().map(DirectiveBodyTag::getId).collect(Collectors.toList()); +// } +// //传过来的全部体型标签主表数据 +// List allData = BeanUtil.copyToList(dto.getBodyTagList(), DirectiveBodyTag.class); +// //需要新增的体型标签字典表数据 +// List needAddBodyList = new ArrayList<>(); +// //获取到需要新增的体型标签字典表数据 +// for (DirectiveBodyTag body : allData) { +// if (!existedIds.contains(body.getId())) { +// needAddBodyList.add(body); +// } +// } +// if (needAddBodyList != null && !needAddBodyList.isEmpty()) { +// bodyTagService.insertAll(needAddBodyList); +// } +// } +// //中间关系表 +// { +// List bodyRelations = Lists.newArrayList();//关系表 +// needAddDirectiveList.stream().forEach(d -> { +// String bodyTags = d.getBodyTags(); +// if (StringUtils.isNotBlank(bodyTags)) { +// Arrays.stream(bodyTags.split(",")).forEach(bi -> { +// DirectiveBodyTagRelation r = new DirectiveBodyTagRelation(); +// r.setDirectiveId(d.getId()); +// r.setTagId(bi); +// bodyRelations.add(r); +// }); +// } +// }); +// bodyTagService.insertAllRelation(bodyRelations); +// } +// } //情绪标签 - { - if (dto.getEmotionTagList() != null) { - //需要排除的情绪标签id - List existedIds = Lists.newArrayList(); - if (dto.isIzInc()) { - List list = emotionTagService.list(); - existedIds = list.stream().map(DirectiveEmotionTag::getId).collect(Collectors.toList()); - } - //传来的所有数据 - List allData = BeanUtil.copyToList(dto.getEmotionTagList(), DirectiveEmotionTag.class); - - //需要新增的数据 - List needAddData = new ArrayList<>();//字典表 - for (DirectiveEmotionTag emotion : allData) { - if (!existedIds.contains(emotion.getId())) { - needAddData.add(emotion); // 如果不在排除列表里,就加入结果 - } - } - if (needAddData != null && !needAddData.isEmpty()) { - emotionTagService.insertAll(needAddData); - } - } - //中间关系表 - { - List emotionRelations = Lists.newArrayList();//关系表 - needAddDirectiveList.stream().forEach(d -> { - String emotionTags = d.getEmotionTags(); - if (StringUtils.isNotBlank(emotionTags)) { - Arrays.stream(emotionTags.split(",")).forEach(bi -> { - DirectiveEmotionTagRelation r = new DirectiveEmotionTagRelation(); - r.setDirectiveId(d.getId()); - r.setTagId(bi); - emotionRelations.add(r); - }); - } - }); - emotionTagService.insertAllRelation(emotionRelations); - } - } +// { +// if (dto.getEmotionTagList() != null) { +// //需要排除的情绪标签id +// List existedIds = Lists.newArrayList(); +// if (dto.isIzInc()) { +// List list = emotionTagService.list(); +// existedIds = list.stream().map(DirectiveEmotionTag::getId).collect(Collectors.toList()); +// } +// //传来的所有数据 +// List allData = BeanUtil.copyToList(dto.getEmotionTagList(), DirectiveEmotionTag.class); +// +// //需要新增的数据 +// List needAddData = new ArrayList<>();//字典表 +// for (DirectiveEmotionTag emotion : allData) { +// if (!existedIds.contains(emotion.getId())) { +// needAddData.add(emotion); // 如果不在排除列表里,就加入结果 +// } +// } +// if (needAddData != null && !needAddData.isEmpty()) { +// emotionTagService.insertAll(needAddData); +// } +// } +// //中间关系表 +// { +// List emotionRelations = Lists.newArrayList();//关系表 +// needAddDirectiveList.stream().forEach(d -> { +// String emotionTags = d.getEmotionTags(); +// if (StringUtils.isNotBlank(emotionTags)) { +// Arrays.stream(emotionTags.split(",")).forEach(bi -> { +// DirectiveEmotionTagRelation r = new DirectiveEmotionTagRelation(); +// r.setDirectiveId(d.getId()); +// r.setTagId(bi); +// emotionRelations.add(r); +// }); +// } +// }); +// emotionTagService.insertAllRelation(emotionRelations); +// } +// } //分类标签 if (dto.getInstructionList() != null) { //需要排除的分类标签id @@ -935,161 +935,161 @@ public class DirectiveMQListener { String baseUrl = apiAddress; //处理服务指令图片大图 - if (StringUtils.isNotBlank(dto.getPreviewFileMd5()) && !dto.getPreviewFileMd5().equals(currentDirective.getPreviewFileMd5())) { - String previewFile = dto.getPreviewFile(); - if (StringUtils.isNotBlank(previewFile)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = previewFile.substring(0, previewFile.lastIndexOf("/")); - String fileName = previewFile.substring(previewFile.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getPreviewFileMd5()) && !dto.getPreviewFileMd5().equals(currentDirective.getPreviewFileMd5())) { +// String previewFile = dto.getPreviewFile(); +// if (StringUtils.isNotBlank(previewFile)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = previewFile.substring(0, previewFile.lastIndexOf("/")); +// String fileName = previewFile.substring(previewFile.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); configServiceDirective.setPreviewFile(dto.getPreviewFile());//服务指令图片大图 configServiceDirective.setPreviewFileMd5(dto.getPreviewFileMd5()); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(previewFile); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("服务指令图片大图文件拉取错误,指令id" + dto.getId()); - } - } - } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(previewFile); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("服务指令图片大图文件拉取错误,指令id" + dto.getId()); +// } +// } +// } //处理服务指令图片小图 - if (StringUtils.isNotBlank(dto.getPreviewFileSmallMd5()) && !dto.getPreviewFileSmallMd5().equals(currentDirective.getPreviewFileSmallMd5())) { - String previewFileSmall = dto.getPreviewFileSmall(); - if (StringUtils.isNotBlank(previewFileSmall)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFileSmall, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = previewFileSmall.substring(0, previewFileSmall.lastIndexOf("/")); - String fileName = previewFileSmall.substring(previewFileSmall.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getPreviewFileSmallMd5()) && !dto.getPreviewFileSmallMd5().equals(currentDirective.getPreviewFileSmallMd5())) { +// String previewFileSmall = dto.getPreviewFileSmall(); +// if (StringUtils.isNotBlank(previewFileSmall)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(previewFileSmall, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = previewFileSmall.substring(0, previewFileSmall.lastIndexOf("/")); +// String fileName = previewFileSmall.substring(previewFileSmall.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); configServiceDirective.setPreviewFileSmall(dto.getPreviewFileSmall());//服务指令图片小图 configServiceDirective.setPreviewFileSmallMd5(dto.getPreviewFileSmallMd5()); - } catch (Exception e) { - e.printStackTrace(); - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(previewFileSmall); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - throw new RuntimeException("服务指令图片小图文件拉取错误,指令id" + dto.getId()); - } - } - } +// } catch (Exception e) { +// e.printStackTrace(); +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(previewFileSmall); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// throw new RuntimeException("服务指令图片小图文件拉取错误,指令id" + dto.getId()); +// } +// } +// } //处理即时指令图标 - if (StringUtils.isNotBlank(dto.getImmediateFileMd5()) && !dto.getImmediateFileMd5().equals(currentDirective.getImmediateFileMd5())) { - String immediateFile = dto.getImmediateFile(); - if (StringUtils.isNotBlank(immediateFile)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(immediateFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = immediateFile.substring(0, immediateFile.lastIndexOf("/")); - String fileName = immediateFile.substring(immediateFile.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getImmediateFileMd5()) && !dto.getImmediateFileMd5().equals(currentDirective.getImmediateFileMd5())) { +// String immediateFile = dto.getImmediateFile(); +// if (StringUtils.isNotBlank(immediateFile)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(immediateFile, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = immediateFile.substring(0, immediateFile.lastIndexOf("/")); +// String fileName = immediateFile.substring(immediateFile.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); configServiceDirective.setImmediateFile(dto.getImmediateFile());//即时指令图标 configServiceDirective.setImmediateFileMd5(dto.getImmediateFileMd5()); - } catch (Exception e) { - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(immediateFile); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - e.printStackTrace(); - throw new RuntimeException("即时指令图标文件拉取错误,指令id" + dto.getId()); - } - } - } +// } catch (Exception e) { +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(immediateFile); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// e.printStackTrace(); +// throw new RuntimeException("即时指令图标文件拉取错误,指令id" + dto.getId()); +// } +// } +// } //处理即时指令焦点图标 - if (StringUtils.isNotBlank(dto.getImmediateFileFocusMd5()) && !dto.getImmediateFileFocusMd5().equals(currentDirective.getImmediateFileFocusMd5())) { - String immediateFileFocus = dto.getImmediateFileFocus(); - if (StringUtils.isNotBlank(immediateFileFocus)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(immediateFileFocus, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = immediateFileFocus.substring(0, immediateFileFocus.lastIndexOf("/")); - String fileName = immediateFileFocus.substring(immediateFileFocus.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getImmediateFileFocusMd5()) && !dto.getImmediateFileFocusMd5().equals(currentDirective.getImmediateFileFocusMd5())) { +// String immediateFileFocus = dto.getImmediateFileFocus(); +// if (StringUtils.isNotBlank(immediateFileFocus)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(immediateFileFocus, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = immediateFileFocus.substring(0, immediateFileFocus.lastIndexOf("/")); +// String fileName = immediateFileFocus.substring(immediateFileFocus.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); configServiceDirective.setImmediateFileFocus(dto.getImmediateFileFocus());//即时指令图标 configServiceDirective.setImmediateFileFocusMd5(dto.getImmediateFileFocusMd5()); - } catch (Exception e) { - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(immediateFileFocus); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - e.printStackTrace(); - throw new RuntimeException("即时指令图标文件拉取错误,指令id" + dto.getId()); - } - } - } +// } catch (Exception e) { +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(immediateFileFocus); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// e.printStackTrace(); +// throw new RuntimeException("即时指令图标文件拉取错误,指令id" + dto.getId()); +// } +// } +// } //处理指令音频文件 - if (StringUtils.isNotBlank(dto.getMp3FileMd5()) && !dto.getMp3FileMd5().equals(currentDirective.getMp3FileMd5())) { - String mp3File = dto.getMp3File(); - if (StringUtils.isNotBlank(mp3File)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp3File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = mp3File.substring(0, mp3File.lastIndexOf("/")); - String fileName = mp3File.substring(mp3File.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getMp3FileMd5()) && !dto.getMp3FileMd5().equals(currentDirective.getMp3FileMd5())) { +// String mp3File = dto.getMp3File(); +// if (StringUtils.isNotBlank(mp3File)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp3File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = mp3File.substring(0, mp3File.lastIndexOf("/")); +// String fileName = mp3File.substring(mp3File.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); configServiceDirective.setMp3File(dto.getMp3File());//指令音频文件 configServiceDirective.setMp3FileMd5(dto.getMp3FileMd5()); - } catch (Exception e) { - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(mp3File); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - e.printStackTrace(); - throw new RuntimeException("指令音频文件拉取错误,指令id" + dto.getId()); - } - } - } +// } catch (Exception e) { +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(mp3File); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// e.printStackTrace(); +// throw new RuntimeException("指令音频文件拉取错误,指令id" + dto.getId()); +// } +// } +// } //处理指令视频文件 - if (StringUtils.isNotBlank(dto.getMp4FileMd5()) && !dto.getMp4FileMd5().equals(currentDirective.getMp4FileMd5())) { - String mp4File = dto.getMp4File(); - if (StringUtils.isNotBlank(mp4File)) { - String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp4File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); - if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { - upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); - } - String filePath = mp4File.substring(0, mp4File.lastIndexOf("/")); - String fileName = mp4File.substring(mp4File.lastIndexOf("/") + 1); - if (filePath.startsWith("/") || filePath.startsWith("\\")) { - filePath = filePath.substring(1); - } - try { - FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); +// if (StringUtils.isNotBlank(dto.getMp4FileMd5()) && !dto.getMp4FileMd5().equals(currentDirective.getMp4FileMd5())) { +// String mp4File = dto.getMp4File(); +// if (StringUtils.isNotBlank(mp4File)) { +// String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(mp4File, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey(); +// if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) { +// upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1); +// } +// String filePath = mp4File.substring(0, mp4File.lastIndexOf("/")); +// String fileName = mp4File.substring(mp4File.lastIndexOf("/") + 1); +// if (filePath.startsWith("/") || filePath.startsWith("\\")) { +// filePath = filePath.substring(1); +// } +// try { +// FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName); configServiceDirective.setMp4File(dto.getMp4File());//指令视频文件 configServiceDirective.setMp4FileMd5(dto.getMp4FileMd5()); - } catch (Exception e) { - MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); - mediaAsyncErrorLog.setMediaid(mp4File); - mediaAsyncErrorLogService.save(mediaAsyncErrorLog); - e.printStackTrace(); - throw new RuntimeException("指令视频文件拉取错误,指令id" + dto.getId()); - } - } - } +// } catch (Exception e) { +// MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog(); +// mediaAsyncErrorLog.setMediaid(mp4File); +// mediaAsyncErrorLogService.save(mediaAsyncErrorLog); +// e.printStackTrace(); +// throw new RuntimeException("指令视频文件拉取错误,指令id" + dto.getId()); +// } +// } +// } directiveService.updateById(configServiceDirective); } }); diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java index e0d706e7..53d155bb 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/system/controller/CommonController.java @@ -1,17 +1,21 @@ package org.jeecg.modules.system.controller; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.nu.modules.sysconfig.ISysConfigApi; +import com.nu.utils.HttpRequestUtil; import com.nu.utils.SafetyUtil; import lombok.extern.slf4j.Slf4j; import org.jeecg.common.api.vo.Result; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.constant.SymbolConstant; -import org.jeecg.common.constant.enums.FileTypeEnum; import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.util.CommonUtils; import org.jeecg.common.util.filter.SsrfFileTypeFilter; import org.jeecg.common.util.oConvertUtils; +import com.nu.entity.SysUploadPreEntity; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Lazy; import org.springframework.util.AntPathMatcher; import org.springframework.util.FileCopyUtils; import org.springframework.web.bind.annotation.*; @@ -23,10 +27,7 @@ import org.springframework.web.servlet.ModelAndView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; +import java.util.Map; /** *

@@ -50,6 +51,9 @@ public class CommonController { @Value(value = "${jeecg.uploadType}") private String uploadType; + @Autowired + private ISysConfigApi sysConfigApi; + /** * @return * @Author 政辉 @@ -427,4 +431,47 @@ public class CommonController { return new AntPathMatcher().extractPathWithinPattern(bestMatchPattern, path); } + /** + * 需要上传至管理平台调用的前置接口 + * + * @param dto + * @return + */ + @PostMapping("/upload/pre") + public Result uploadPre(@RequestBody SysUploadPreEntity dto) { + try { + // 1. 获取管理平台 API 地址 + JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); + String opeApiAddress = opeOpenUrl.getString("configValue"); + if (opeApiAddress.endsWith("/")) { + opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1); + } + String bizApiAddress = opeApiAddress + "/api/common/saveFileType"; + + // 2. 构造请求头(使用你工具类提供的默认头) + Map headers = HttpRequestUtil.createDefaultHeaders(); + + // 3. 将 dto 对象转为 JSON 字符串(假设你项目中有 fastjson / jackson) + // 这里以 fastjson 为例(Jeecg 默认用 fastjson) + String body = JSON.toJSONString(dto); + + // 4. 发送 POST 请求 + String response = HttpRequestUtil.doPost(bizApiAddress, headers, body); + // 5. (可选)解析响应,确认是否成功 + // 解析 JSON + JSONObject jsonResponse = JSON.parseObject(response); + + // 判断 result 是否为 200 + Object resultObj = jsonResponse.get("result"); + if (resultObj != null && "200".equals(resultObj.toString())) { + return Result.ok(SafetyUtil.getSecureKey()); + } else { + return Result.ok(500); + } + + } catch (Exception e) { + return Result.ok(500); + } + } + }