hejinbo 2 лет назад
Родитель
Сommit
0b94672e58

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

6
 import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
6
 import com.ruoyi.wisdomarbitrate.service.ICasePaymentService;
7
 import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
7
 import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO;
8
 import org.springframework.beans.factory.annotation.Autowired;
8
 import org.springframework.beans.factory.annotation.Autowired;
9
-import org.springframework.security.access.prepost.PreAuthorize;
10
 import org.springframework.validation.annotation.Validated;
9
 import org.springframework.validation.annotation.Validated;
11
 import org.springframework.web.bind.annotation.*;
10
 import org.springframework.web.bind.annotation.*;
12
 
11
 
52
     public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) {
51
     public AjaxResult confirmPayment(@Validated @RequestBody CaseApplication caseApplication) {
53
         return paymentService.confirmPayment(caseApplication);
52
         return paymentService.confirmPayment(caseApplication);
54
     }
53
     }
54
+    /**
55
+     * 缴费列表查询
56
+     * @param casePayDTO
57
+     * @return
58
+     */
59
+    @GetMapping("/list")
60
+    public AjaxResult casePayList(CasePayDTO casePayDTO) {
61
+        return paymentService.casePayList(casePayDTO);
62
+    }
55
 }
63
 }

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

1
+package com.ruoyi.wisdomarbitrate.domain;
2
+
3
+import com.ruoyi.common.annotation.Excel;
4
+import lombok.Data;
5
+
6
+import java.math.BigDecimal;
7
+
8
+@Data
9
+public class CaseApplicationPay {
10
+    /** 案件编号 */
11
+    private String caseNum;
12
+    /** 案件标的 */
13
+    private BigDecimal caseSubjectAmount;
14
+    /** 仲裁应缴费用 */
15
+    private BigDecimal feePayable;
16
+    /** 案件状态 */
17
+    private Integer caseStatus;
18
+    /**申请人 */
19
+    private String caseAppName;
20
+    /**被申请人 */
21
+    private String caseResName;
22
+
23
+}

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

13
     /**
13
     /**
14
      * 案件id
14
      * 案件id
15
      */
15
      */
16
-    private Long caseId;
16
+    private List<Long> caseIds;
17
 
17
 
18
     /**
18
     /**
19
      * 订单金额 单位:分
19
      * 订单金额 单位:分

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

1
+package com.ruoyi.wisdomarbitrate.domain.vo;
2
+
3
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
4
+import com.ruoyi.wisdomarbitrate.domain.CaseApplicationPay;
5
+import lombok.Data;
6
+
7
+import java.util.List;
8
+
9
+@Data
10
+public class CasePayListVO {
11
+    /**
12
+     * 订单总金额 单位:分
13
+     */
14
+    private int totalFee;
15
+
16
+    /**
17
+     * 案件总条数
18
+     */
19
+    private int CaseTotal;
20
+
21
+    /**
22
+     * 案件订单列表
23
+     */
24
+    private List<CaseApplicationPay> caseApplicationList;
25
+}

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

20
      * @return
20
      * @return
21
      */
21
      */
22
     AjaxResult confirmPay(CaseConfirmPayDTO payDTO);
22
     AjaxResult confirmPay(CaseConfirmPayDTO payDTO);
23
+
24
+
25
+    AjaxResult casePayList(CasePayDTO casePayDTO);
26
+
23
 }
27
 }

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

11
 import com.ruoyi.common.utils.SecurityUtils;
11
 import com.ruoyi.common.utils.SecurityUtils;
12
 import com.ruoyi.wisdomarbitrate.domain.*;
12
 import com.ruoyi.wisdomarbitrate.domain.*;
13
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
13
 import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO;
14
+import com.ruoyi.wisdomarbitrate.domain.vo.CasePayListVO;
14
 import com.ruoyi.wisdomarbitrate.mapper.*;
15
 import com.ruoyi.wisdomarbitrate.mapper.*;
16
+import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
15
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
17
 import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils;
16
 import com.ruoyi.common.utils.SmsUtils;
18
 import com.ruoyi.common.utils.SmsUtils;
17
 import com.ruoyi.dto.PayRequest;
19
 import com.ruoyi.dto.PayRequest;
22
 import org.springframework.stereotype.Service;
24
 import org.springframework.stereotype.Service;
23
 import org.springframework.transaction.annotation.Transactional;
25
 import org.springframework.transaction.annotation.Transactional;
24
 
26
 
27
+import java.math.BigDecimal;
28
+import java.util.ArrayList;
25
 import java.util.Date;
29
 import java.util.Date;
26
 import java.util.List;
30
 import java.util.List;
27
 
31
 
42
     public CasePaymentServiceImpl(ElegentPay elegentPay
46
     public CasePaymentServiceImpl(ElegentPay elegentPay
43
             , CaseApplicationMapper caseApplicationMapper
47
             , CaseApplicationMapper caseApplicationMapper
44
             , CasePaymentRecordMapper casePaymentRecordMapper
48
             , CasePaymentRecordMapper casePaymentRecordMapper
45
-            , CaseAffiliateMapper caseAffiliateMapper) {
49
+            , CaseAffiliateMapper caseAffiliateMapper
50
+            ) {
46
         this.elegentPay = elegentPay;
51
         this.elegentPay = elegentPay;
47
         this.caseApplicationMapper = caseApplicationMapper;
52
         this.caseApplicationMapper = caseApplicationMapper;
48
         this.casePaymentRecordMapper = casePaymentRecordMapper;
53
         this.casePaymentRecordMapper = casePaymentRecordMapper;
49
         this.caseAffiliateMapper = caseAffiliateMapper;
54
         this.caseAffiliateMapper = caseAffiliateMapper;
50
     }
55
     }
56
+    @Autowired
57
+    private ICaseApplicationService caseApplicationService;
51
 
58
 
52
     @Override
59
     @Override
53
     @Transactional
60
     @Transactional
60
         if (response.getCode_url() == null) {
67
         if (response.getCode_url() == null) {
61
             return AjaxResult.error();
68
             return AjaxResult.error();
62
         }
69
         }
63
-        //缴费记录表里新增数据
64
-        CasePaymentRecord casePaymentRecord = new CasePaymentRecord();
65
-        casePaymentRecord.setCaseId(casePayDTO.getCaseId());
66
-        casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
67
-        casePaymentRecord.setPaymentStatus(0);
68
-        casePaymentRecord.setCreateTime(new Date());
69
-        int count = casePaymentRecordMapper.saveRecord(casePaymentRecord);
70
-        if (count < 1) {
70
+        List<Long> caseIds = casePayDTO.getCaseIds();
71
+        if (CollectionUtil.isEmpty(caseIds)) {
71
             return AjaxResult.error("请检查参数是否有误");
72
             return AjaxResult.error("请检查参数是否有误");
72
         }
73
         }
74
+        for (Long caseId : caseIds) {
75
+            //缴费记录表里新增数据
76
+            CasePaymentRecord casePaymentRecord = new CasePaymentRecord();
77
+            casePaymentRecord.setCaseId(caseId);
78
+            casePaymentRecord.setOrderNumber(payRequest.getOrderSn());
79
+            casePaymentRecord.setPaymentStatus(0);
80
+            casePaymentRecord.setCreateTime(new Date());
81
+            int count = casePaymentRecordMapper.saveRecord(casePaymentRecord);
82
+            if (count < 1) {
83
+                return AjaxResult.error("请检查参数是否有误");
84
+            }
85
+        }
73
         return AjaxResult.success(response);
86
         return AjaxResult.success(response);
74
     }
87
     }
75
 
88
 
151
                         String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信";
164
                         String content = "尊敬的" + name + "用户,您的" + caseName + "案件" + caseNum + "已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信";
152
                         smsSendRecord.setSendContent(content);
165
                         smsSendRecord.setSendContent(content);
153
                         smsSendRecord.setCreateBy(getUsername());
166
                         smsSendRecord.setCreateBy(getUsername());
154
-                        if (aBoolean){
167
+                        if (aBoolean) {
155
                             smsSendRecord.setSendStatus(1);
168
                             smsSendRecord.setSendStatus(1);
156
-                        }else {
169
+                        } else {
157
                             smsSendRecord.setSendStatus(0);
170
                             smsSendRecord.setSendStatus(0);
158
                         }
171
                         }
159
                         smsRecordMapper.saveSmsSendRecord(smsSendRecord);
172
                         smsRecordMapper.saveSmsSendRecord(smsSendRecord);
211
         return AjaxResult.success("确认缴费失败");
224
         return AjaxResult.success("确认缴费失败");
212
     }
225
     }
213
 
226
 
227
+    @Override
228
+    public AjaxResult casePayList(CasePayDTO casePayDTO) {
229
+        //参数校验
230
+        List<Long> caseIds = casePayDTO.getCaseIds();
231
+        if (caseIds == null || caseIds.size() == 0) {
232
+            return null;
233
+        }
234
+        BigDecimal totalCost  = new BigDecimal(0);
235
+        BigDecimal sum =totalCost;
236
+        CasePayListVO listVO = new CasePayListVO();
237
+        listVO.setCaseTotal(caseIds.size());
238
+        List<CaseApplicationPay> caseApplicationList =new ArrayList<>();
239
+        for (Long caseId : caseIds) {
240
+            CaseApplication caseApplication = new CaseApplication();
241
+            CaseApplicationPay caseApplicationPay = new CaseApplicationPay();
242
+            caseApplication.setId(caseId);
243
+            CaseApplication caseApplication1 = caseApplicationService.selectCaseApplication(caseApplication);
244
+            BigDecimal feePayable = caseApplication1.getFeePayable();
245
+            feePayable = feePayable.multiply(new BigDecimal(100));
246
+            sum = sum.add(feePayable);
247
+            listVO.setTotalFee(sum.intValue());
248
+            caseApplicationPay.setCaseAppName(caseApplication1.getApplicantName());
249
+            caseApplicationPay.setCaseResName(caseApplication1.getRespondentName());
250
+            caseApplicationPay.setCaseNum(caseApplication1.getCaseNum());
251
+            caseApplicationPay.setCaseStatus(caseApplication1.getCaseStatus());
252
+            caseApplicationPay.setCaseSubjectAmount(caseApplication1.getCaseSubjectAmount());
253
+            caseApplicationPay.setFeePayable(caseApplication1.getFeePayable());
254
+            caseApplicationList.add(caseApplicationPay);
255
+            listVO.setCaseApplicationList(caseApplicationList);
256
+        }
257
+
258
+        if (sum.compareTo(BigDecimal.ZERO) == 0) {
259
+            return AjaxResult.error("没有可支付的费用");
260
+        }
261
+        return AjaxResult.success(listVO);
262
+    }
263
+
214
 
264
 
215
 }
265
 }

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

419
                 String prefix = "/profile";
419
                 String prefix = "/profile";
420
                 int startIndex = fileName.indexOf(prefix);
420
                 int startIndex = fileName.indexOf(prefix);
421
                 startIndex += prefix.length();
421
                 startIndex += prefix.length();
422
-                String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
422
+                String annexPath = "uploadPath" + fileName.substring(startIndex);
423
                 templateManage.setTemOrigPath(annexPath);
423
                 templateManage.setTemOrigPath(annexPath);
424
                 String format = getFileExtension(fileName);
424
                 String format = getFileExtension(fileName);
425
                 templateManage.setTemFormat(format);
425
                 templateManage.setTemFormat(format);