hejinbo 2 лет назад
Родитель
Сommit
2557d57508

+ 22
- 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java Просмотреть файл

29
         return deptIdentifyService.insertDeptIdentify(deptIdentify);
29
         return deptIdentifyService.insertDeptIdentify(deptIdentify);
30
     }
30
     }
31
 
31
 
32
+    /**
33
+     * 删除机构
34
+     * @param id
35
+     * @return
36
+     */
37
+    @DeleteMapping("/delete")
38
+    public AjaxResult deleteDeptIdentify(Long id){
39
+        return deptIdentifyService.deleteDeptIdentify(id);
40
+    }
41
+
42
+    /**
43
+     * 修改机构信息
44
+     * @param deptIdentify
45
+     * @return
46
+     */
47
+    @PutMapping("/update")
48
+    public AjaxResult updateDeptIdentify(@RequestBody DeptIdentify deptIdentify){
49
+        return deptIdentifyService.updateDeptIdentify(deptIdentify);
50
+    }
51
+
32
     /**
52
     /**
33
      * 查询机构信息
53
      * 查询机构信息
34
      */
54
      */
64
      * @return
84
      * @return
65
      */
85
      */
66
     @PostMapping("/sealUpload")
86
     @PostMapping("/sealUpload")
67
-    public AjaxResult sealUpload(Long id, @RequestParam("file") MultipartFile file) {
68
-        return deptIdentifyService.sealUpload(id, file);
87
+    public AjaxResult sealUpload(Long id, String sealName , @RequestParam("file") MultipartFile file) {
88
+        return deptIdentifyService.sealUpload(id, sealName ,file);
69
     }
89
     }
70
 
90
 
71
     /**
91
     /**

+ 3
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java Просмотреть файл

37
     private Integer identifyType;
37
     private Integer identifyType;
38
 
38
 
39
 
39
 
40
+    /** 删除标志(0代表存在 2代表删除) */
41
+    private Integer delFlag;
42
+
40
 }
43
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/vo/SealListVO.java Просмотреть файл

4
 
4
 
5
 @Data
5
 @Data
6
 public class SealListVO {
6
 public class SealListVO {
7
+    /** 主键 */
8
+    private Long id;
7
     /** 印章id */
9
     /** 印章id */
8
     private String sealId;
10
     private String sealId;
9
     /** 印章名称 */
11
     /** 印章名称 */

+ 4
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java Просмотреть файл

19
 
19
 
20
     AjaxResult enableDept(DeptIdentify deptIdentify);
20
     AjaxResult enableDept(DeptIdentify deptIdentify);
21
 
21
 
22
-    AjaxResult sealUpload(Long id,MultipartFile file);
22
+    AjaxResult sealUpload(Long id,String sealName ,MultipartFile file);
23
 
23
 
24
 
24
 
25
     AjaxResult receiveNotify(String body);
25
     AjaxResult receiveNotify(String body);
31
 
31
 
32
     AjaxResult insertDeptIdentify(DeptIdentify deptIdentify);
32
     AjaxResult insertDeptIdentify(DeptIdentify deptIdentify);
33
 
33
 
34
+    AjaxResult deleteDeptIdentify(Long id);
35
+
36
+    AjaxResult updateDeptIdentify(DeptIdentify deptIdentify);
34
 }
37
 }

+ 5
- 3
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Просмотреть файл

1725
                     for (CaseAttach caseAttach : caseAttachList) {
1725
                     for (CaseAttach caseAttach : caseAttachList) {
1726
                         if (caseAttach.getAnnexType() == 3) {
1726
                         if (caseAttach.getAnnexType() == 3) {
1727
                             String annexPath = caseAttach.getAnnexPath();
1727
                             String annexPath = caseAttach.getAnnexPath();
1728
-                            //String path = "/home/ruoyi" + annexPath;
1728
+                            String path = "/home/ruoyi" + annexPath;
1729
                             // System.out.println("这是查询到的裁决书路径" + path);
1729
                             // System.out.println("这是查询到的裁决书路径" + path);
1730
-                            String path = "D:\\home\\仲裁裁决书模板.docx";
1730
+                            //String path = "D:\\home\\仲裁裁决书模板.docx";
1731
                             //获取文件上传地址
1731
                             //获取文件上传地址
1732
                             EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
1732
                             EsignHttpResponse response = SaaSAPIFileUtils.getUploadUrl(path);
1733
                             String body = response.getBody();
1733
                             String body = response.getBody();
1873
                                                     } else {
1873
                                                     } else {
1874
                                                         throw new ServiceException("发起签署流程失败,请检查参数是否有误");
1874
                                                         throw new ServiceException("发起签署流程失败,请检查参数是否有误");
1875
                                                     }
1875
                                                     }
1876
+                                                }else {
1877
+                                                    return AjaxResult.error();
1876
                                                 }
1878
                                                 }
1877
-                                                  return AjaxResult.error();
1879
+
1878
                                             }
1880
                                             }
1879
 
1881
 
1880
 
1882
 

+ 92
- 17
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java Просмотреть файл

7
 import com.ruoyi.common.constant.FileTransformation;
7
 import com.ruoyi.common.constant.FileTransformation;
8
 import com.ruoyi.common.core.domain.AjaxResult;
8
 import com.ruoyi.common.core.domain.AjaxResult;
9
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
9
 import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
10
+import com.ruoyi.common.core.domain.entity.SysDept;
11
+import com.ruoyi.common.core.domain.entity.SysUser;
10
 import com.ruoyi.common.exception.EsignDemoException;
12
 import com.ruoyi.common.exception.EsignDemoException;
11
 import com.ruoyi.common.utils.SealUtil;
13
 import com.ruoyi.common.utils.SealUtil;
12
 import com.ruoyi.common.utils.file.FileUploadUtils;
14
 import com.ruoyi.common.utils.file.FileUploadUtils;
15
+import com.ruoyi.system.mapper.SysDeptMapper;
16
+import com.ruoyi.system.mapper.SysUserMapper;
13
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
17
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
14
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
18
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
15
 import com.ruoyi.wisdomarbitrate.domain.SealManage;
19
 import com.ruoyi.wisdomarbitrate.domain.SealManage;
27
 import java.io.File;
31
 import java.io.File;
28
 import java.io.IOException;
32
 import java.io.IOException;
29
 import java.time.LocalDate;
33
 import java.time.LocalDate;
30
-import java.util.ArrayList;
31
-import java.util.Date;
32
-import java.util.List;
33
-import java.util.UUID;
34
+import java.util.*;
34
 
35
 
35
 @Service
36
 @Service
36
 public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
37
 public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
41
     private CaseAttachMapper caseAttachMapper;
42
     private CaseAttachMapper caseAttachMapper;
42
     @Autowired
43
     @Autowired
43
     private SealManageMapper sealManageMapper;
44
     private SealManageMapper sealManageMapper;
45
+    @Autowired
46
+    private SysDeptMapper sysDeptMapper;
47
+    @Autowired
48
+    private SysUserMapper sysUserMapper;
44
 
49
 
45
 
50
 
46
     @Override
51
     @Override
106
     }
111
     }
107
 
112
 
108
     @Override
113
     @Override
109
-    public AjaxResult sealUpload(Long id, MultipartFile file) {
114
+    public AjaxResult sealUpload(Long id, String sealName, MultipartFile file) {
110
         try {
115
         try {
111
             if (file.isEmpty()) {
116
             if (file.isEmpty()) {
112
                 return AjaxResult.error("请选择要上传的文件");
117
                 return AjaxResult.error("请选择要上传的文件");
133
                         startIndex += prefix.length();
138
                         startIndex += prefix.length();
134
                         String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
139
                         String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
135
                         //创建机构图片印章
140
                         //创建机构图片印章
136
-                        // String annexPath = "D:\\develop\\2.jpg";
137
-                        String sealName = "自定义" + UUID.randomUUID() + "";  //自定义印章印章名称不能重复,所以用UUID确保唯一性
141
+                        //String annexPath = "D:\\develop\\2.jpg";
142
+
138
                         EsignHttpResponse response = SignAward.createOrgByImage(identify, sealName, annexPath);
143
                         EsignHttpResponse response = SignAward.createOrgByImage(identify, sealName, annexPath);
139
                         JSONObject jsonObject = JSONObject.parseObject(response.getBody());
144
                         JSONObject jsonObject = JSONObject.parseObject(response.getBody());
140
                         int code = jsonObject.getIntValue("code");
145
                         int code = jsonObject.getIntValue("code");
152
                                 return AjaxResult.success("上传成功");
157
                                 return AjaxResult.success("上传成功");
153
                             }
158
                             }
154
                         }
159
                         }
155
-                        return AjaxResult.error("公章上传失败,请检查参数");
160
+                        return AjaxResult.error(jsonObject.getString("message"));
156
                     }
161
                     }
157
                     return AjaxResult.error("企业用户未授予资源管理权限");
162
                     return AjaxResult.error("企业用户未授予资源管理权限");
158
                 }
163
                 }
257
         List<SealListVO> sealListVOS = new ArrayList<>();
262
         List<SealListVO> sealListVOS = new ArrayList<>();
258
         if (selectSealList != null && selectSealList.size() > 0) {
263
         if (selectSealList != null && selectSealList.size() > 0) {
259
             for (SealManage sealManage1 : selectSealList) {
264
             for (SealManage sealManage1 : selectSealList) {
260
-                Integer sealStatus = sealManage1.getSealStatus();
261
-                if (sealStatus == 1) {   //审核状态为启用
262
-                    SealListVO sealListVO = new SealListVO();
263
-                    sealListVO.setSealId(sealManage1.getSealId());
264
-                    sealListVO.setSealName(sealManage1.getSealName());
265
-                    sealListVO.setSealStatus(sealManage1.getSealStatus());
265
+                SealListVO sealListVO = new SealListVO();
266
+                sealListVO.setId(sealManage1.getId());
267
+                sealListVO.setSealId(sealManage1.getSealId());
268
+                sealListVO.setSealName(sealManage1.getSealName());
269
+                sealListVO.setSealStatus(sealManage1.getSealStatus());
270
+                Integer annexId = sealManage1.getAnnexId();
271
+                if (annexId != null) {
266
                     //根据附件id查询路径
272
                     //根据附件id查询路径
267
-                    CaseAttach caseAttach = caseAttachMapper.queryAnnexById(sealManage1.getAnnexId());
273
+                    CaseAttach caseAttach = caseAttachMapper.queryAnnexById(annexId);
268
                     String annexName = caseAttach.getAnnexName();
274
                     String annexName = caseAttach.getAnnexName();
269
                     String prefix = "/profile";
275
                     String prefix = "/profile";
270
                     int startIndex = annexName.indexOf(prefix);
276
                     int startIndex = annexName.indexOf(prefix);
272
                     String annexPath = "/uploadPath" + annexName.substring(startIndex);
278
                     String annexPath = "/uploadPath" + annexName.substring(startIndex);
273
                     sealListVO.setAnnexPath(annexPath);
279
                     sealListVO.setAnnexPath(annexPath);
274
                     sealListVO.setAnnexType(caseAttach.getAnnexType());
280
                     sealListVO.setAnnexType(caseAttach.getAnnexType());
275
-                    sealListVO.setIsUse(sealManage1.getIsUse());
276
-                    sealListVOS.add(sealListVO);
281
+                } else {
282
+                    sealListVO.setAnnexPath(null);
283
+                    sealListVO.setAnnexType(null);
277
                 }
284
                 }
285
+                sealListVO.setIsUse(sealManage1.getIsUse());
286
+                sealListVOS.add(sealListVO);
278
             }
287
             }
279
         }
288
         }
280
         return sealListVOS;
289
         return sealListVOS;
309
         deptIdentify.setIsUse(0); //设置机构默认为未启用
318
         deptIdentify.setIsUse(0); //设置机构默认为未启用
310
         int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify);
319
         int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify);
311
         if (i > 0) {
320
         if (i > 0) {
321
+            //将机构名称保存到部门表里
322
+            SysDept sysDept = new SysDept();
323
+            sysDept.setDeptName(identifyName);
324
+            sysDept.setParentId(0L);
325
+            sysDept.setDeptType(1);
326
+            int i1 = sysDeptMapper.insertDept(sysDept);
327
+            if (i1 > 0) {
328
+                //将经办人信息存入到用户表里
329
+                Long deptId = sysDept.getDeptId();
330
+                SysUser sysUser = new SysUser();
331
+                sysUser.setDeptId(deptId);
332
+                sysUser.setUserName(generateUniqueUsername());//设置默认的用户名
333
+                sysUser.setNickName(operName);
334
+                sysUser.setPhonenumber(operPhone);
335
+                sysUserMapper.insertUser(sysUser);
336
+            }
337
+
312
             return AjaxResult.success("新增成功");
338
             return AjaxResult.success("新增成功");
313
         }
339
         }
314
         return AjaxResult.error();
340
         return AjaxResult.error();
315
     }
341
     }
342
+
343
+    @Override
344
+    public AjaxResult deleteDeptIdentify(Long id) {
345
+        DeptIdentify deptIdentify = new DeptIdentify();
346
+        deptIdentify.setId(id);
347
+        deptIdentify.setDelFlag(2);
348
+        int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
349
+        if (i > 0) {
350
+            return AjaxResult.success("删除成功");
351
+        }
352
+        return AjaxResult.error();
353
+    }
354
+
355
+    @Override
356
+    public AjaxResult updateDeptIdentify(DeptIdentify deptIdentify) {
357
+        Long id = deptIdentify.getId();
358
+        if (id == null) {
359
+            return AjaxResult.error();
360
+        }
361
+        DeptIdentify deptIdentifyNew = new DeptIdentify();
362
+        deptIdentifyNew.setId(id);
363
+        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentifyNew);
364
+        if (deptIdentifies != null && deptIdentifies.size() > 0) {
365
+            DeptIdentify deptIdentify1 = deptIdentifies.get(0);
366
+            if (deptIdentify1.getIdentifyStatus() == 1) {
367
+                return AjaxResult.error("已认证的机构不允许修改");
368
+            }
369
+            int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
370
+            if (i > 0) {
371
+                return AjaxResult.success("修改成功");
372
+            }
373
+        }
374
+        return null;
375
+    }
376
+
377
+    private String generateUniqueUsername() {
378
+        final Random random = new Random();
379
+        final Set<String> generatedUsernames = new HashSet<>();
380
+        while (true) {
381
+            int min = 000000; // 最小的六位数
382
+            int max = 999999; // 最大的六位数
383
+            int randomNum = random.nextInt(max - min + 1) + min;
384
+            if (!generatedUsernames.contains(randomNum)) {
385
+                generatedUsernames.add(String.valueOf(randomNum));
386
+                return String.valueOf(randomNum);
387
+            }
388
+        }
389
+    }
390
+
316
 }
391
 }

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/utils/FixSelectFlowDetailUtils.java Просмотреть файл

43
     /*
43
     /*
44
     定时查询签署流程详情
44
     定时查询签署流程详情
45
      */
45
      */
46
-    //@Scheduled(cron = "0/10 * * * * ?")
46
+    @Scheduled(cron = "0/10 * * * * ?")
47
     @Transactional
47
     @Transactional
48
     public void fixExecuteSelectFlowDetailUtils() {
48
     public void fixExecuteSelectFlowDetailUtils() {
49
         Gson gson = new Gson();
49
         Gson gson = new Gson();
177
      *
177
      *
178
      * @throws Exception
178
      * @throws Exception
179
      */
179
      */
180
-    //@Scheduled(cron = "*/30 * * * * *")
180
+    @Scheduled(cron = "*/30 * * * * *")
181
     @Transactional
181
     @Transactional
182
     public void fixExecuteSelectDeptIndentifyUtils() throws Exception {
182
     public void fixExecuteSelectDeptIndentifyUtils() throws Exception {
183
         Gson gson = new Gson();
183
         Gson gson = new Gson();

+ 11
- 5
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml Просмотреть файл

14
         <result property="operName"     column="oper_name"     />
14
         <result property="operName"     column="oper_name"     />
15
         <result property="operPhone"     column="oper_phone"     />
15
         <result property="operPhone"     column="oper_phone"     />
16
         <result property="identifyType"     column="identify_type"     />
16
         <result property="identifyType"     column="identify_type"     />
17
+        <result property="delFlag"     column="del_flag"     />
17
 
18
 
18
     </resultMap>
19
     </resultMap>
19
 
20
 
42
                 AND oper_phone = #{operPhone}
43
                 AND oper_phone = #{operPhone}
43
             </if>
44
             </if>
44
             AND identify_type = 1
45
             AND identify_type = 1
46
+            AND  del_flag =0
45
         </where>
47
         </where>
46
     </select>
48
     </select>
47
 
49
 
55
         <if test="orgId != null and orgId != ''">org_id,</if>
57
         <if test="orgId != null and orgId != ''">org_id,</if>
56
         <if test="operName != null and operName != ''">oper_name,</if>
58
         <if test="operName != null and operName != ''">oper_name,</if>
57
         <if test="operPhone != null and operPhone != ''">oper_phone,</if>
59
         <if test="operPhone != null and operPhone != ''">oper_phone,</if>
58
-        <if test="identifyType != null">identify_type</if>
59
-        <if test="authFlowId != null and authFlowId != ''">auth_flow_id</if>
60
-
60
+        <if test="identifyType != null">identify_type,</if>
61
+        <if test="authFlowId != null and authFlowId != ''">auth_flow_id,</if>
62
+        del_flag
61
         )values(
63
         )values(
62
         <if test="identifyName != null and identifyName != ''">#{identifyName},</if>
64
         <if test="identifyName != null and identifyName != ''">#{identifyName},</if>
63
         <if test="identifyStatus != null">#{identifyStatus},</if>
65
         <if test="identifyStatus != null">#{identifyStatus},</if>
66
         <if test="orgId != null and orgId != ''">#{orgId},</if>
68
         <if test="orgId != null and orgId != ''">#{orgId},</if>
67
         <if test="operName != null and operName != ''">#{operName},</if>
69
         <if test="operName != null and operName != ''">#{operName},</if>
68
         <if test="operPhone != null and operPhone != ''">#{operPhone},</if>
70
         <if test="operPhone != null and operPhone != ''">#{operPhone},</if>
69
-        <if test="identifyType != null ">#{identifyType}</if>
70
-        <if test="authFlowId != null and authFlowId != '' ">#{authFlowId}</if>
71
+        <if test="identifyType != null ">#{identifyType},</if>
72
+        <if test="authFlowId != null and authFlowId != '' ">#{authFlowId},</if>
73
+        0
71
         )
74
         )
72
     </insert>
75
     </insert>
73
 
76
 
83
             <if test="isUse != null">is_use = #{isUse},</if>
86
             <if test="isUse != null">is_use = #{isUse},</if>
84
             <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
87
             <if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
85
             <if test="orgId != null  and orgId != ''">org_id = #{orgId},</if>
88
             <if test="orgId != null  and orgId != ''">org_id = #{orgId},</if>
89
+            <if test="delFlag != null ">del_flag = #{delFlag},</if>
90
+            <if test="operName != null ">oper_name = #{operName},</if>
91
+            <if test="operPhone != null ">oper_phone = #{operPhone},</if>
86
             <if test="authFlowId != null  and authFlowId != '' ">auth_flow_id = #{authFlowId}</if>
92
             <if test="authFlowId != null  and authFlowId != '' ">auth_flow_id = #{authFlowId}</if>
87
         </set>
93
         </set>
88
         <where>
94
         <where>