hejinbo hace 2 años
padre
commit
607da65dc4

+ 1
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java Ver fichero

@@ -254,4 +254,5 @@ public class SysUserController extends BaseController
254 254
     public AjaxResult selectUserById(@RequestParam(required = true) Long userId){
255 255
         return AjaxResult.success(userService.selectUserById(userId));
256 256
     }
257
+
257 258
 }

+ 14
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java Ver fichero

@@ -163,4 +163,18 @@ public class DeptIdentifyController extends BaseController {
163 163
         List<TemplateManage> sealList = deptIdentifyService.getTemplateList(deptIdentify);
164 164
         return getDataTable(sealList);
165 165
     }
166
+    /**
167
+     * 根据部门id查询岗位用户信息
168
+     */
169
+    @GetMapping("selectPostUserByDeptId")
170
+    public AjaxResult selectPostUserByDeptId(DeptIdentify deptIdentify){
171
+        return AjaxResult.success(deptIdentifyService.selectPostUserByDeptId(deptIdentify));
172
+    }
173
+    /**
174
+     * 给机构绑定经办人
175
+     */
176
+    @GetMapping("bindHandler")
177
+    public AjaxResult bindHandler(DeptIdentify deptIdentify){
178
+        return deptIdentifyService.bindHandler(deptIdentify);
179
+    }
166 180
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java Ver fichero

@@ -156,4 +156,6 @@ public interface SysUserMapper
156 156
      * @return
157 157
      */
158 158
     List<SysUser> selectByDeptIdAndRole(@Param("deptId")String applicationOrganId, @Param("roleName")String roleName);
159
+
160
+    List<SysUser>  selectRoleUserByDeptId(@Param("deptId")Long deptId,@Param("roleId") Long roleId );
159 161
 }

+ 1
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java Ver fichero

@@ -207,4 +207,5 @@ public interface ISysUserService
207 207
      * @return 结果
208 208
      */
209 209
     public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
210
+
210 211
 }

+ 2
- 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java Ver fichero

@@ -537,4 +537,6 @@ public class SysUserServiceImpl implements ISysUserService {
537 537
         }
538 538
         return successMsg.toString();
539 539
     }
540
+
541
+
540 542
 }

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java Ver fichero

@@ -11,6 +11,10 @@ public class DeptIdentify  extends BaseEntity {
11 11
 
12 12
     /** ID */
13 13
     private Long id;
14
+    /** 部门id */
15
+    private Long deptId;
16
+    /** 用户id */
17
+    private Long userId;
14 18
     /** 机构名称 */
15 19
     private String identifyName;
16 20
     /** 认证状态 */

+ 2
- 2
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java Ver fichero

@@ -12,10 +12,10 @@ import java.util.List;
12 12
 @Data
13 13
 public class CaseConfirmPayDTO {
14 14
     /**
15
-     * 案件id
15
+     * 案件ids
16 16
      */
17 17
     @NotNull(message = "案件id不能为空")
18
-    private Long caseId;
18
+    private List<Long> caseIds;
19 19
 
20 20
     /**
21 21
      * 支付方式 0线上支付,1线下支付

+ 7
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java Ver fichero

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.wisdomarbitrate.service;
2 2
 
3 3
 import com.ruoyi.common.core.domain.AjaxResult;
4
+import com.ruoyi.common.core.domain.entity.SysUser;
4 5
 import com.ruoyi.common.exception.EsignDemoException;
5 6
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
6 7
 import com.ruoyi.wisdomarbitrate.domain.SealManage;
@@ -44,4 +45,10 @@ public interface IDeptIdentifyService {
44 45
 
45 46
     List<TemplateManage> getTemplateList(DeptIdentify deptIdentify);
46 47
 
48
+
49
+    List<SysUser> selectPostUserByDeptId(DeptIdentify deptIdentify);
50
+
51
+
52
+    AjaxResult bindHandler(DeptIdentify deptIdentify);
53
+
47 54
 }

+ 37
- 29
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java Ver fichero

@@ -47,12 +47,13 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
47 47
             , CaseApplicationMapper caseApplicationMapper
48 48
             , CasePaymentRecordMapper casePaymentRecordMapper
49 49
             , CaseAffiliateMapper caseAffiliateMapper
50
-            ) {
50
+    ) {
51 51
         this.elegentPay = elegentPay;
52 52
         this.caseApplicationMapper = caseApplicationMapper;
53 53
         this.casePaymentRecordMapper = casePaymentRecordMapper;
54 54
         this.caseAffiliateMapper = caseAffiliateMapper;
55 55
     }
56
+
56 57
     @Autowired
57 58
     private ICaseApplicationService caseApplicationService;
58 59
 
@@ -190,38 +191,45 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
190 191
     @Transactional
191 192
     @Override
192 193
     public AjaxResult confirmPay(CaseConfirmPayDTO payDTO) {
193
-        if (payDTO.getCaseId() != null && payDTO.getPayType() != null) {
194
+        List<Long> caseIds = payDTO.getCaseIds();
195
+        if (caseIds == null || caseIds.size() == 0) {
196
+            return AjaxResult.error("案件id参数有误");
197
+        }
198
+        if (payDTO.getPayType() != null) {
194 199
             // 修改支付方式
195
-
196 200
             caseApplicationMapper.updatePayType(payDTO);
197 201
         }
198
-        if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) {
199
-            for (CaseAttach caseAttach : payDTO.getPayOrderList()) {
200
-                caseAttach.setCaseAppliId(payDTO.getCaseId());
201
-                caseAttachMapper.updateCaseAttach(caseAttach);
202
+        for (Long caseId : caseIds) {
203
+            if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) {
204
+                for (CaseAttach caseAttach : payDTO.getPayOrderList()) {
205
+                    caseAttach.setCaseAppliId(caseId);
206
+                    caseAttachMapper.updateCaseAttach(caseAttach);
207
+                }
208
+            }
209
+            // 修改节点状态
210
+            //根据案件id查询案件信息
211
+            CaseApplication caseApplication = new CaseApplication();
212
+            caseApplication.setId(caseId);
213
+            CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
214
+            caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
215
+            //修改案件状态
216
+            int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
217
+            if (i > 0) {
218
+                // 修改支付状态
219
+                CasePaymentRecord paymentRecord = new CasePaymentRecord();
220
+                paymentRecord.setPayType(payDTO.getPayType());
221
+                paymentRecord.setCaseId(caseId);
222
+                paymentRecord.setPaymentStatus(1);
223
+                casePaymentRecordMapper.saveRecord(paymentRecord);
224
+                // 新增日志
225
+                CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "");
226
+
227
+                return AjaxResult.success("确认缴费成功");
202 228
             }
203
-        }
204
-        // 修改节点状态
205
-        //根据案件id查询案件信息
206
-        CaseApplication caseApplication = new CaseApplication();
207
-        caseApplication.setId(payDTO.getCaseId());
208
-        CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
209
-        caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM);
210
-        //修改案件状态
211
-        int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
212
-        if (i > 0) {
213
-            // 修改支付状态
214
-            CasePaymentRecord paymentRecord = new CasePaymentRecord();
215
-            paymentRecord.setPayType(payDTO.getPayType());
216
-            paymentRecord.setCaseId(payDTO.getCaseId());
217
-            paymentRecord.setPaymentStatus(1);
218
-            casePaymentRecordMapper.saveRecord(paymentRecord);
219
-            // 新增日志
220
-            CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, "");
221 229
 
222
-            return AjaxResult.success("确认缴费成功");
223 230
         }
224 231
         return AjaxResult.success("确认缴费失败");
232
+
225 233
     }
226 234
 
227 235
     @Override
@@ -231,11 +239,11 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
231 239
         if (caseIds == null || caseIds.size() == 0) {
232 240
             return null;
233 241
         }
234
-        BigDecimal totalCost  = new BigDecimal(0);
235
-        BigDecimal sum =totalCost;
242
+        BigDecimal totalCost = new BigDecimal(0);
243
+        BigDecimal sum = totalCost;
236 244
         CasePayListVO listVO = new CasePayListVO();
237 245
         listVO.setCaseTotal(caseIds.size());
238
-        List<CaseApplicationPay> caseApplicationList =new ArrayList<>();
246
+        List<CaseApplicationPay> caseApplicationList = new ArrayList<>();
239 247
         for (Long caseId : caseIds) {
240 248
             CaseApplication caseApplication = new CaseApplication();
241 249
             CaseApplicationPay caseApplicationPay = new CaseApplicationPay();

+ 78
- 29
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java Ver fichero

@@ -14,8 +14,10 @@ import com.ruoyi.common.core.domain.entity.SysUser;
14 14
 import com.ruoyi.common.exception.EsignDemoException;
15 15
 import com.ruoyi.common.utils.SealUtil;
16 16
 import com.ruoyi.common.utils.file.FileUploadUtils;
17
+import com.ruoyi.system.domain.SysUserPost;
17 18
 import com.ruoyi.system.mapper.SysDeptMapper;
18 19
 import com.ruoyi.system.mapper.SysUserMapper;
20
+import com.ruoyi.system.mapper.SysUserPostMapper;
19 21
 import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
20 22
 import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
21 23
 import com.ruoyi.wisdomarbitrate.domain.SealManage;
@@ -56,6 +58,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
56 58
     private SysUserMapper sysUserMapper;
57 59
     @Autowired
58 60
     private TemplateManageMapper templateManageMapper;
61
+    @Autowired
62
+    private SysUserPostMapper sysUserPostMapper;
59 63
 
60 64
 
61 65
     @Override
@@ -299,45 +303,48 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
299 303
     public AjaxResult insertDeptIdentify(DeptIdentify deptIdentify) {
300 304
         //参数校验
301 305
         String identifyName = deptIdentify.getIdentifyName();
302
-        String operName = deptIdentify.getOperName();
303
-        String operPhone = deptIdentify.getOperPhone();
304
-        if (identifyName == null || operName == null || operPhone == null) {
306
+        if (identifyName == null) {
305 307
             AjaxResult.error("请检查参数是否完整");
306 308
         }
307 309
         Integer identifyType = deptIdentify.getIdentifyType();
308 310
         if (identifyType == null) {
309 311
             deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构
310 312
         }
311
-        //先查询看数据库里有没有相同的机构经办人
312
-        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
313
-        if (deptIdentifies != null && deptIdentifies.size() > 0) {
314
-            //说明之前新增过
315
-            return AjaxResult.error("信息重复");
316
-        }
317 313
         deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证
318 314
         deptIdentify.setIsUse(0); //设置机构默认为未启用
319
-        int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify);
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(deptIdentify.getOperUserName());
333
-                sysUser.setNickName(operName);
334
-                sysUser.setPhonenumber(operPhone);
335
-                SysUser sysUser1 = sysUserMapper.selectUserByUserName(deptIdentify.getOperUserName());
336
-                if (sysUser1== null) {
337
-                    sysUserMapper.insertUser(sysUser);
338
-                }
315
+        //将机构名称保存到部门表里
316
+        SysDept sysDept = new SysDept();
317
+        sysDept.setDeptName(identifyName);
318
+        sysDept.setParentId(0L);
319
+        sysDept.setDeptType(1);
320
+        int i1 = sysDeptMapper.insertDept(sysDept);
321
+        if (i1 > 0) {
322
+           /* //将经办人信息存入到用户表里
323
+            Long deptId = sysDept.getDeptId();
324
+            SysUser sysUser = new SysUser();
325
+            sysUser.setDeptId(deptId);
326
+            sysUser.setUserName(deptIdentify.getOperUserName());
327
+            sysUser.setNickName(operName);
328
+            sysUser.setPhonenumber(operPhone);
329
+            SysUser sysUser1 = sysUserMapper.selectUserByUserName(deptIdentify.getOperUserName());
330
+            if (sysUser1== null) {
331
+                sysUserMapper.insertUser(sysUser);
339 332
             }
333
+            Long userId = sysUser.getUserId();
334
+            deptIdentify.setDeptId(deptId);
335
+            deptIdentify.setUserId(userId);
336
+            List<SysUserPost> sysUserPosts = new ArrayList<>();
337
+            SysUserPost sysUserPost = new SysUserPost();
338
+            sysUserPost.setUserId(userId);
339
+            sysUserPost.setPostId(5L);
340
+            sysUserPosts.add(sysUserPost);
341
+            sysUserPostMapper.batchUserPost(sysUserPosts);*/
342
+            Long deptId = sysDept.getDeptId();
343
+            deptIdentify.setDeptId(deptId);
344
+        }
340 345
 
346
+        int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify);
347
+        if (i > 0) {
341 348
             return AjaxResult.success("新增成功");
342 349
         }
343 350
         return AjaxResult.error();
@@ -350,6 +357,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
350 357
         deptIdentify.setDelFlag(2);
351 358
         int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
352 359
         if (i > 0) {
360
+            //删除部门表数据
361
+            sysDeptMapper.deleteDeptById(id);
353 362
             return AjaxResult.success("删除成功");
354 363
         }
355 364
         return AjaxResult.error();
@@ -371,9 +380,15 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
371 380
             }
372 381
             int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
373 382
             if (i > 0) {
383
+                //修改部门表数据
384
+                SysDept sysDept = new SysDept();
385
+                sysDept.setDeptId(deptIdentify1.getDeptId());
386
+                sysDept.setDeptName(deptIdentify.getIdentifyName());
387
+                sysDeptMapper.updateDept(sysDept);
374 388
                 return AjaxResult.success("修改成功");
375 389
             }
376 390
         }
391
+
377 392
         return null;
378 393
     }
379 394
 
@@ -475,7 +490,41 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
475 490
         return templateManages;
476 491
     }
477 492
 
493
+    @Override
494
+    public  List<SysUser> selectPostUserByDeptId(DeptIdentify deptIdentify) {
495
+        List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
496
+        if (deptIdentifies!= null && deptIdentifies.size() > 0) {
497
+            deptIdentify = deptIdentifies.get(0);
498
+            if (deptIdentify.getDeptId()!= null) {
499
+                //默认查询经办人的
500
+                Long roleId = 106L;
501
+                List<SysUser> sysUserList = sysUserMapper.selectRoleUserByDeptId(deptIdentify.getDeptId(),roleId);
502
+                return sysUserList;
503
+            }
478 504
 
505
+        }
506
+        return null;
507
+    }
508
+
509
+    @Override
510
+    public AjaxResult bindHandler(DeptIdentify deptIdentify) {
511
+        if (deptIdentify.getId()== null||deptIdentify.getUserId()==null) {
512
+            return AjaxResult.error("请检查参数是否完整");
513
+        }
514
+        //根据userid查询用户信息
515
+        SysUser sysUser = sysUserMapper.selectUserById(deptIdentify.getUserId());
516
+        if (sysUser!= null) {
517
+            deptIdentify.setOperName(sysUser.getNickName());
518
+            deptIdentify.setOperPhone(sysUser.getPhonenumber());
519
+            deptIdentify.setOperUserName(sysUser.getUserName());
520
+            //更新
521
+            int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify);
522
+            if (i > 0) {
523
+                return AjaxResult.success("绑定成功");
524
+            }
525
+        }
526
+        return null;
527
+    }
479 528
 
480 529
     private String getFileExtension(String fileName) {
481 530
         int lastDotIndex = fileName.lastIndexOf(".");

+ 6
- 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml Ver fichero

@@ -281,5 +281,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
281 281
  			#{userId}
282 282
         </foreach> 
283 283
  	</delete>
284
+	<select id="selectRoleUserByDeptId" parameterType="long" resultMap="SysUserResult">
285
+		SELECT u.* FROM sys_user u
286
+		INNER JOIN sys_user_role ur ON u.user_id = ur.user_id
287
+		INNER JOIN sys_dept d ON u.dept_id = d.dept_id
288
+		WHERE upr.role_id = #{roleId} AND d.dept_id = #{deptId};
289
+	</select>
284 290
 	
285 291
 </mapper> 

+ 4
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Ver fichero

@@ -1453,7 +1453,10 @@
1453 1453
         where id = #{id}
1454 1454
     </update>
1455 1455
     <update id="updatePayType">
1456
-        update case_application set pay_type=#{payType} where id = #{caseId}
1456
+        update case_application set pay_type=#{payDTO.payType} where id in
1457
+        <foreach item="caseId" collection="caseIds" open="(" separator="," close=")">
1458
+            #{caseId}
1459
+        </foreach>
1457 1460
     </update>
1458 1461
     <update id="updateCaseLockStatus">
1459 1462
         update case_application set lock_status=#{lockStatus} where id = #{id}

+ 8
- 1
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml Ver fichero

@@ -19,13 +19,16 @@
19 19
         <result property="legalPerName"     column="legal_per_name"     />
20 20
         <result property="legalPerPhone"     column="legal_per_phone"     />
21 21
         <result property="identifyEmail"     column="identify_email"     />
22
+        <result property="deptId"     column="dept_id"     />
23
+        <result property="userId"     column="user_id"     />
22 24
 
23 25
     </resultMap>
24 26
 
25 27
 
26 28
     <select id="selectDeptIdentify" parameterType="DeptIdentify" resultMap="DeptIdentifyResult">
27 29
         SELECT  id, identify_name ,identify_status , identify_date,is_use,org_id,auth_flow_id,
28
-                oper_name,oper_phone,identify_type,credit_code,legal_per_name,legal_per_phone,identify_email
30
+                oper_name,oper_phone,identify_type,credit_code,legal_per_name,legal_per_phone
31
+               ,identify_email,dept_id ,user_id
29 32
         FROM  dept_identify
30 33
         <where>
31 34
             <if test="id != null">
@@ -67,6 +70,8 @@
67 70
         <if test="legalPerName != null and legalPerName != ''">legal_per_name,</if>
68 71
         <if test="legalPerPhone != null and legalPerPhone != ''">legal_per_phone,</if>
69 72
         <if test="identifyEmail != null and identifyEmail != ''">identify_email,</if>
73
+        <if test="deptId != null ">dept_id,</if>
74
+        <if test="userId != null ">user_id,</if>
70 75
         del_flag
71 76
         )values(
72 77
         <if test="identifyName != null and identifyName != ''">#{identifyName},</if>
@@ -82,6 +87,8 @@
82 87
         <if test="legalPerName != null and legalPerName != '' ">#{legalPerName},</if>
83 88
         <if test="legalPerPhone != null and legalPerPhone != '' ">#{legalPerPhone},</if>
84 89
         <if test="identifyEmail != null and identifyEmail != '' ">#{identifyEmail},</if>
90
+        <if test="deptId != null  ">#{deptId},</if>
91
+        <if test="userId != null  ">#{userId},</if>
85 92
         0
86 93
         )
87 94
     </insert>