From 80523e71d1e1e773fba7264d84bc28e42c9c20f0 Mon Sep 17 00:00:00 2001 From: hejinbo Date: Wed, 22 Nov 2023 11:51:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E6=9E=84=E3=80=81=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BC=98=E5=8C=96=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wisdomarbitrate/domain/DeptIdentify.java | 11 ++++++++ .../domain/TemplateManage.java | 5 +++- .../service/impl/DeptIdentifyServiceImpl.java | 25 ++++++++----------- .../utils/FixSelectFlowDetailUtils.java | 3 +++ .../wisdomarbitrate/DeptIdentifyMapper.xml | 14 ++++++++++- .../wisdomarbitrate/TemplateManageMapper.xml | 6 ++++- 6 files changed, 46 insertions(+), 18 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java index 815bcb3..436be98 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java @@ -22,6 +22,8 @@ public class DeptIdentify extends BaseEntity { private Integer isUse; /** 经办人姓名 */ private String operName; + /** 经办人用户名 */ + private String operUserName; /** 经办人手机号 */ private String operPhone; @@ -33,6 +35,15 @@ public class DeptIdentify extends BaseEntity { /** 部门认证链接 */ private String identifyUrl; + /** 机构信用代码 */ + private String creditCode; + + /** 法人姓名 */ + private String legalPerName; + + /** 法人手机号 */ + private String legalPerPhone; + /** 机构类型(1 仲裁机构) */ private Integer identifyType; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/TemplateManage.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/TemplateManage.java index 0fa8152..730582d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/TemplateManage.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/TemplateManage.java @@ -29,7 +29,10 @@ public class TemplateManage extends BaseEntity { * 模板格式 */ private String temFormat; - + /** + * 文件名 + */ + private String fileName; /** * 原模板路径 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java index 3bd957a..aecc092 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java @@ -329,10 +329,13 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { Long deptId = sysDept.getDeptId(); SysUser sysUser = new SysUser(); sysUser.setDeptId(deptId); - sysUser.setUserName(generateUniqueUsername());//设置默认的用户名 + sysUser.setUserName(deptIdentify.getOperUserName()); sysUser.setNickName(operName); sysUser.setPhonenumber(operPhone); - sysUserMapper.insertUser(sysUser); + SysUser sysUser1 = sysUserMapper.selectUserByUserName(deptIdentify.getOperUserName()); + if (sysUser1== null) { + sysUserMapper.insertUser(sysUser); + } } return AjaxResult.success("新增成功"); @@ -394,6 +397,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { templateManage.setTemOrigPath(annexPath); String format = getFileExtension(fileName); templateManage.setTemFormat(format); + String subFileName = fileName.substring(fileName.lastIndexOf("/")+1); + templateManage.setFileName(subFileName); templateManage.setCreateBy(getUsername()); int i = templateManageMapper.insertTemplateManage(templateManage); if (i > 0) { @@ -421,6 +426,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { startIndex += prefix.length(); String annexPath = "uploadPath" + fileName.substring(startIndex); templateManage.setTemOrigPath(annexPath); + String subFileName = fileName.substring(fileName.lastIndexOf("/")+1); + templateManage.setFileName(subFileName); String format = getFileExtension(fileName); templateManage.setTemFormat(format); } @@ -468,19 +475,7 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { return templateManages; } - private String generateUniqueUsername() { - final Random random = new Random(); - final Set generatedUsernames = new HashSet<>(); - while (true) { - int min = 000000; // 最小的六位数 - int max = 999999; // 最大的六位数 - int randomNum = random.nextInt(max - min + 1) + min; - if (!generatedUsernames.contains(randomNum)) { - generatedUsernames.add(String.valueOf(randomNum)); - return String.valueOf(randomNum); - } - } - } + private String getFileExtension(String fileName) { int lastDotIndex = fileName.lastIndexOf("."); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java index 4824820..01bdc19 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java @@ -262,6 +262,9 @@ public class FixSelectFlowDetailUtils { deptIdentify1.setIsUse(0); //默认机构为未启用 int row = deptIdentifyMapper.updateDeptIdentify(deptIdentify1); } + }else { + deptIdentify1.setIdentifyStatus(2); + deptIdentifyMapper.updateDeptIdentify(deptIdentify1); } } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml index a98d019..860d1d6 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml @@ -15,13 +15,16 @@ + + + - SELECT id, identify_id ,tem_name , tem_type,tem_format,tem_orig_path,tem_revis_path + SELECT id, identify_id ,tem_name , tem_type,tem_format,tem_orig_path,tem_revis_path ,file_name FROM template_manage