前后端联调

This commit is contained in:
18792927508
2024-01-15 17:48:02 +08:00
parent 8800948317
commit 7bcec78774
31 changed files with 1622 additions and 41 deletions
@@ -106,13 +106,13 @@ public class CommonController
* 保存到案件附件表
* @param
* @param annexType
* @param fileName
* @param path
* @param originalFilename
*/
private Long saveCaseAttach(Integer annexType, String fileName, String originalFilename) {
private Long saveCaseAttach(Integer annexType, String path, String originalFilename) {
MsCaseAttach caseAttach = MsCaseAttach.builder()
.annexName(originalFilename)
.annexPath(fileName)
.annexPath(path)
.annexType(annexType)
.useId(SecurityUtils.getUserId())
.useAccount(SecurityUtils.getUsername())
@@ -1,8 +1,11 @@
package com.ruoyi.web.controller.wisdomarbitrate.mscase;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseApplication;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationReq;
import com.ruoyi.wisdomarbitrate.domain.vo.mscase.MsCaseApplicationVO;
import com.ruoyi.wisdomarbitrate.service.mscase.MsCaseApplicationService;
@@ -80,8 +83,72 @@ public class MsCaseApplicationController extends BaseController {
return caseApplicationService.uploadCaseZipFile(file,templateId);
}
/**
* 生成调解申请书
* @param
* @return
* @throws IOException
*/
@PostMapping("/generateApplication")
public AjaxResult generateApplication(@RequestBody MsCaseApplicationReq req) {
if (req.getTemplateId() == null||req.getCaseFlowId() == null || (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
return error("参数校验失败");
}
return caseApplicationService.generateApplication(req);
}
/**
* 证据上传
* @param file
* @param annexType
* @param id
* @return
*/
@PostMapping("/batchUpload")
public AjaxResult batchUpload(@RequestParam("file") MultipartFile[] file, @RequestParam("annexType")Integer annexType, @RequestParam("id")Long id) {
if(file==null){
return error("请选择要上传的文件");
}
return caseApplicationService.batchUpload(file, annexType, id);
}
/**
* 案件受理
* @param req
* @return
*/
@PostMapping("/accept")
public AjaxResult accept(@RequestBody MsCaseApplication req ) {
if (StrUtil.isEmpty(req.getMediationMethod())
|| req.getPaperFlag() == null
|| req.getCaseFlowId() == null
|| req.getArbitrateConfirm() == null
|| (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
return error("参数校验失败");
}
return caseApplicationService.accept(req);
}
/**
* 案件提交
* @param req
* @return
*/
@PostMapping("/submit")
public AjaxResult submit(@RequestBody MsCaseApplication req ) {
if (req.getCaseFlowId() == null
|| (req.getId() == null && StrUtil.isEmpty(req.getBatchNumber()))) {
return error("参数校验失败");
}
return caseApplicationService.submit(req);
}
/**
* 查询调解员
* @param
* @return
*/
@GetMapping("/listMediator")
public AjaxResult listMediator( ) {
return caseApplicationService.listMediator();
}
}
@@ -0,0 +1,95 @@
package com.ruoyi.web.controller.wisdomarbitrate.mscase;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CaseConfirmPayDTO;
import com.ruoyi.wisdomarbitrate.domain.dto.mscase.CasePayDTO;
import com.ruoyi.wisdomarbitrate.service.mscase.MsCasePaymentService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 案件缴费控制层
* @Author wangqiong
* @Date 2024/01/8
* @Version V1.0
*/
@RestController
@RequestMapping("/pay")
public class MsCaseApplicationPayController extends BaseController {
@Resource
private MsCasePaymentService casePaymentService;
/**
* 根据案件id或者批次号查询申请人及应缴费用
* @param dto 缴费传入参数
* @return 统一响应结果
*/
@PostMapping("/selectTotalFee")
public AjaxResult selectTotalFee(@RequestBody CasePayDTO dto) {
if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
) {
return error("参数校验失败");
}
return casePaymentService.selectTotalFee(dto);
}
/**
* 根据案件id查询缴费单
* @param id
* @return 统一响应结果
*/
@GetMapping("/selectPaymentDetail")
public AjaxResult selectPaymentDetail(@RequestParam(value = "id",required = true) Long id) {
return AjaxResult.success(casePaymentService.selectPaymentDetail(id));
}
/**
* 案件缴费,线上缴费,支持批量(batchNumber不为空,则为批量缴费)
* @param dto 缴费传入参数
* @return 统一响应结果
*/
@PostMapping("/casePay")
public AjaxResult casePay(@Validated @RequestBody CasePayDTO dto) {
if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
|| StrUtil.isEmpty(dto.getPlatform()) ||StrUtil.isEmpty(dto.getTradeType())
) {
return error("参数校验失败");
}
return casePaymentService.casePay(dto);
}
/**
* 确认缴费,支持批量(batchNumber不为空,则为批量)
* @param dto 缴费传入参数
* @return 统一响应结果
*/
@PostMapping("/confirmPayment")
public AjaxResult confirmPayment(@RequestBody CaseConfirmPayDTO dto) {
if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
|| StrUtil.isEmpty(dto.getPayType()) || CollectionUtil.isEmpty(dto.getPayOrderList())
|| dto.getCaseFlowId() == null) {
return error("参数校验失败");
}
return casePaymentService.confirmPayment(dto);
}
/**
* 确认已缴费,支持批量(batchNumber不为空,则为批量)
* @param dto 缴费传入参数
* @return 统一响应结果
*/
@PostMapping("/confirmPaid")
public AjaxResult confirmPaid(@RequestBody CaseConfirmPayDTO dto) {
if ((dto.getCaseId() == null && StrUtil.isEmpty(dto.getBatchNumber()))
|| dto.getCaseFlowId() == null) {
return error("参数校验失败");
}
return casePaymentService.confirmPaid(dto);
}
}