Pārlūkot izejas kodu

Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

wangqiong123 2 gadus atpakaļ
vecāks
revīzija
0c6b0a2bae

+ 2
- 4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CaseApplicationController.java Parādīt failu

@@ -1,5 +1,6 @@
1 1
 package com.ruoyi.web.controller.wisdomarbitrate;
2 2
 
3
+import cn.hutool.core.util.StrUtil;
3 4
 import com.ruoyi.common.annotation.Anonymous;
4 5
 import com.ruoyi.common.annotation.Log;
5 6
 import com.ruoyi.common.core.controller.BaseController;
@@ -47,10 +48,7 @@ public class CaseApplicationController  extends BaseController {
47 48
     @PostMapping("/addCaseApplication")
48 49
     public AjaxResult addCaseApplication(@Validated @RequestBody CaseApplication caseApplication)
49 50
     {
50
-        int caseApplicationCount = caseApplicationService.selectCaseApplicationCount(caseApplication);
51
-        if(caseApplicationCount>0){
52
-            return error("新增立案申请'" + caseApplication.getCaseNum() + "'案件编号已存在");
53
-        }
51
+
54 52
         caseApplication.setCreateBy(getUsername());
55 53
         return toAjax(caseApplicationService.insertcaseApplication(caseApplication));
56 54
     }

+ 17
- 7
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Parādīt failu

@@ -72,25 +72,24 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
72 72
         List<CaseAffiliate> caseAffiliates = caseApplication.getCaseAffiliates();
73 73
         Map<String, Long> deptMap =new HashMap<>();
74 74
         if (caseAffiliates != null && caseAffiliates.size() > 0) {
75
-            if(StrUtil.isNotEmpty(caseApplication.getName())) {
76 75
                 // 查询所有的组织机构,组装成map
77 76
                 List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
78 77
                 if (CollectionUtil.isEmpty(deptList)) {
79 78
                     deptList = new ArrayList<>();
80 79
                 }
81
-                 deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
82
-            }
80
+                 deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
81
+
83 82
             for (CaseAffiliate caseAffiliate : caseAffiliates) {
84 83
                 caseAffiliate.setCaseAppliId(caseApplication.getId());
85
-                if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseApplication.getName())) {
84
+                if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) {
86 85
                     // 将组织机构id设为申请人名称
87 86
                     if (deptMap.containsKey(caseApplication.getName())) {
88
-                        caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName())));
87
+                        caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName())));
89 88
                     } else {
90 89
                         // 如果不存在则新增
91 90
                         SysDept dept = new SysDept();
92 91
                         dept.setParentId(0L);
93
-                        dept.setDeptName(caseApplication.getName());
92
+                        dept.setDeptName(caseAffiliate.getName());
94 93
                         dept.setAncestors("0");
95 94
                         dept.setOrderNum(1);
96 95
                         dept.setStatus("0");
@@ -227,12 +226,23 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
227 226
 
228 227
         List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
229 228
         if(caseAffiliatListeselect!=null){
229
+            // 查询组织机构
230
+            List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
231
+            Map<String,String> deptMap=new HashMap<>();
232
+            if(CollectionUtil.isNotEmpty(sysDepts)){
233
+                for (SysDept sysDept : sysDepts) {
234
+                    deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName());
235
+                }
236
+            }
230 237
             StringBuffer applicantName = new StringBuffer();
231 238
             StringBuffer respondentName = new StringBuffer();
232 239
             for (int i = 0; i < caseAffiliatListeselect.size(); i++){
233 240
                 CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i);
234 241
                 int identityType = caseAffiliateselect.getIdentityType();
235 242
                 if(identityType==1){
243
+                    if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){
244
+                        caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName()));
245
+                    }
236 246
                     applicantName.append(caseAffiliateselect.getName()).append(",");;
237 247
                 }else if(identityType==2){
238 248
                     respondentName.append(caseAffiliateselect.getName()).append(",");;
@@ -258,7 +268,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
258 268
             List<SysDept> deptList = sysDeptMapper.selectDeptList(new SysDept());
259 269
             Map<String, Long> deptMap =new HashMap<>();
260 270
             if(CollectionUtil.isNotEmpty(deptList)) {
261
-                deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId));
271
+                deptMap = deptList.stream().collect(Collectors.toMap(SysDept::getDeptName, SysDept::getDeptId,(oldV,newV)->newV));
262 272
             }
263 273
             List<CaseApplication> caseApplicationListinsert = new ArrayList<>();
264 274
             for (int i = 0; i < caseApplicationList.size(); i++){

+ 8
- 4
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Parādīt failu

@@ -55,10 +55,10 @@
55 55
         c.hear_date ,c.arbitrat_claims ,
56 56
         c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
57 57
         c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
58
-        c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as name
58
+        c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName
59 59
         from case_application c
60 60
         LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
61
-        LEFT JOIN sys_dept d ON ca.NAME = d.dept_id
61
+        LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
62 62
         <where>
63 63
             <if test="caseStatus != null">
64 64
                 AND c.case_status = #{caseStatus}
@@ -206,8 +206,10 @@
206 206
         c.hear_date ,c.arbitrat_claims ,
207 207
         c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable ,
208 208
         c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time ,
209
-        c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name
209
+        c.update_by ,c.update_time,c.arbitrator_id,c.arbitrator_name,d.dept_name as applicantName
210 210
         from case_application c
211
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
212
+        LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
211 213
         <where>
212 214
             <if test="id != null ">
213 215
                 AND c.id = #{id}
@@ -236,8 +238,10 @@
236 238
         p.payment_status ,
237 239
         CASE p.payment_status when 1 then '已支付' when 0 then '未支付'
238 240
         ELSE '无支付状态'
239
-        END paymentStatusName
241
+        END paymentStatusName,d.dept_name as applicantName
240 242
         from case_application c left join case_payment_record p on c.id  = p.case_id
243
+        LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1
244
+        LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id
241 245
         where c.case_status  = 3 and p.payment_status  = 1
242 246
             AND c.id = #{id}
243 247