From 2300df715cc1db68a9ae11532b692ef127fd4aa5 Mon Sep 17 00:00:00 2001 From: 18792927508 <1322446236@qq.com> Date: Sun, 15 Oct 2023 15:51:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=88=E4=BB=B6=E5=88=97=E8=A1=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E7=BC=B4=E8=B4=B9=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CasePaymentController.java | 11 ++ .../common/core/domain/entity/SysUser.java | 14 +++ .../common/utils/WxAppletNotifyUtils.java | 12 +- .../ruoyi/system/mapper/SysDeptMapper.java | 2 + .../wisdomarbitrate/domain/CaseAffiliate.java | 24 ++++ .../domain/CaseApplication.java | 69 ++++++++++++ .../wisdomarbitrate/domain/CaseAttach.java | 2 +- .../domain/CasePaymentRecord.java | 4 + .../domain/dto/CaseConfirmPayDTO.java | 28 +++++ .../domain/dto/CasePayDTO.java | 12 ++ .../mapper/CaseApplicationMapper.java | 14 +++ .../mapper/CaseAttachMapper.java | 4 +- .../mapper/CasePaymentRecordMapper.java | 2 + .../service/ICasePaymentService.java | 8 ++ .../impl/CaseApplicationServiceImpl.java | 105 +++++++++++------- .../service/impl/CasePaymentServiceImpl.java | 40 +++++-- .../resources/mapper/system/SysDeptMapper.xml | 8 +- .../resources/mapper/system/SysUserMapper.xml | 17 ++- .../wisdomarbitrate/CaseAffiliateMapper.xml | 12 +- .../wisdomarbitrate/CaseApplicationMapper.xml | 99 ++++++++++++++--- .../wisdomarbitrate/CaseAttachMapper.xml | 1 + .../CasePaymentRecordMapper.xml | 2 + 22 files changed, 403 insertions(+), 87 deletions(-) create mode 100644 ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java index 4c73eed..92d1abf 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/CasePaymentController.java @@ -2,6 +2,7 @@ package com.ruoyi.web.controller.wisdomarbitrate; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.service.ICasePaymentService; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,16 @@ public class CasePaymentController { public AjaxResult casePay(@Validated @RequestBody CasePayDTO casePayDTO) { return paymentService.casePay(casePayDTO); } + /** + * 确认缴费 + * @param payDTO 缴费传入参数 + * @return 统一响应结果 + */ +// @PreAuthorize("@ss.hasPermi('caseManagement:list:pay')") + @PostMapping("/confirmPay") + public AjaxResult confirmPay(@Validated @RequestBody CaseConfirmPayDTO payDTO) { + return paymentService.confirmPay(payDTO); + } /** * 缴费确认 diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java index 53ad695..fd3106c 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java @@ -33,9 +33,14 @@ public class SysUser extends BaseEntity @Excel(name = "登录名称") private String userName; + + /** 用户昵称 */ @Excel(name = "用户名称") private String nickName; + /** 用户身份证号 */ + @Excel(name = "身份证号") + private String idCard; /** 用户邮箱 */ @Excel(name = "用户邮箱") @@ -297,12 +302,21 @@ public class SysUser extends BaseEntity this.roleId = roleId; } + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("userId", getUserId()) .append("deptId", getDeptId()) .append("userName", getUserName()) + .append("idCard", getIdCard()) .append("nickName", getNickName()) .append("email", getEmail()) .append("phonenumber", getPhonenumber()) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java index d8b07fc..f7a0fc7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WxAppletNotifyUtils.java @@ -2,22 +2,14 @@ package com.ruoyi.common.utils; /** * @author wangqiong - * @description + * @description 获取微信小程序url scheme * @date 2023-10-13 10:16 */ -import cn.hutool.core.util.StrUtil; + import cn.hutool.http.HttpUtil; import cn.hutool.json.JSONObject; import cn.hutool.json.JSONUtil; -import lombok.RequiredArgsConstructor; -import org.springframework.stereotype.Component; - -/** - * @Author: Tenk - */ -@RequiredArgsConstructor -@Component public class WxAppletNotifyUtils { /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java index 384a9b6..6ca6af8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java @@ -115,4 +115,6 @@ public interface SysDeptMapper * @return 结果 */ public int deleteDeptById(Long deptId); + + List selectUserDeptListByRoleId(@Param("roleId")Long roleId); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java index e7721e9..d93e8cf 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAffiliate.java @@ -15,6 +15,14 @@ public class CaseAffiliate extends BaseEntity { /** 姓名 */ @Excel(name = "姓名") private String name; + /** + * 申请机构id + */ + private String applicationOrganId; + /** + * 申请机构名称 + */ + private String applicationOrganName; /** 身份证号 */ @Excel(name = "身份证号") private String identityNum; @@ -49,6 +57,22 @@ public class CaseAffiliate extends BaseEntity { /** 快递单号 */ private String trackNum; + public String getApplicationOrganId() { + return applicationOrganId; + } + + public void setApplicationOrganId(String applicationOrganId) { + this.applicationOrganId = applicationOrganId; + } + + public String getApplicationOrganName() { + return applicationOrganName; + } + + public void setApplicationOrganName(String applicationOrganName) { + this.applicationOrganName = applicationOrganName; + } + public String getSendEmail() { return sendEmail; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index ac77efe..07a34f7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -114,9 +114,45 @@ public class CaseApplication extends BaseEntity { private Integer paymentStatus; /** 支付状态描述 */ private String paymentStatusName; + /** + * 支付方式code,0线上支付,1线下支付 + */ + private Integer payTypeCode; + /** + * 支付方式name,0线上支付,1线下支付 + */ + private String payTypeName; + /** + * 缴费凭证 + */ + private List payOrderList; // 导入校验失败信息 private StringBuilder errorMsg; + public Integer getPayTypeCode() { + return payTypeCode; + } + + public void setPayTypeCode(Integer payTypeCode) { + this.payTypeCode = payTypeCode; + } + + public String getPayTypeName() { + return payTypeName; + } + + public void setPayTypeName(String payTypeName) { + this.payTypeName = payTypeName; + } + + public List getPayOrderList() { + return payOrderList; + } + + public void setPayOrderList(List payOrderList) { + this.payOrderList = payOrderList; + } + public StringBuilder getErrorMsg() { return errorMsg; } @@ -190,6 +226,39 @@ public class CaseApplication extends BaseEntity { private String applicantName; /** 被申请人名称 */ private String respondentName; + /** + * 用户身份证号 + */ + private String idCard; + /** + * 用户id + */ + private String userId; + private List deptIds; + + public List getDeptIds() { + return deptIds; + } + + public void setDeptIds(List deptIds) { + this.deptIds = deptIds; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } public String getApplicantName() { return applicantName; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java index 9827fc7..235d502 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseAttach.java @@ -27,7 +27,7 @@ public class CaseAttach { */ private String annexPath; /** - * 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5) + * 附件类型,立案申请书(1)、申请人证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)、被申请人证据材料 (6)、庭审笔录(7)、缴费凭证(8)' */ private Integer annexType; /** diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java index 4bae1db..74f1f77 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CasePaymentRecord.java @@ -38,4 +38,8 @@ public class CasePaymentRecord { /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; + /** + * 支付方式 0线上支付,1线下支付 + */ + private Integer payType; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java new file mode 100644 index 0000000..146f2f2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CaseConfirmPayDTO.java @@ -0,0 +1,28 @@ +package com.ruoyi.wisdomarbitrate.domain.dto; + +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.util.List; + +/** + * 案件确认缴费传入对象 + */ +@Data +public class CaseConfirmPayDTO { + /** + * 案件id + */ + @NotNull(message = "案件id不能为空") + private Long caseId; + + /** + * 支付方式 0线上支付,1线下支付 + */ + private Integer payType; + /** + * 缴费凭证 + */ + private List payOrderList; +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java index b440235..40007f0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/dto/CasePayDTO.java @@ -1,6 +1,10 @@ package com.ruoyi.wisdomarbitrate.domain.dto; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import lombok.Data; + +import java.util.List; + /** * 案件缴费传入对象 */ @@ -23,4 +27,12 @@ public class CasePayDTO { * 支付方式 wxpay(微信) alipay(支付宝) */ private String platform; + /** + * 支付方式 0线上支付,1线下支付 + */ + private Integer payType; + /** + * 缴费凭证 + */ + private List payOrderList; } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java index 200c92d..e24d2a5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseApplicationMapper.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.Arbitrator; import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -12,6 +13,13 @@ public interface CaseApplicationMapper { int selectCaseApplicationCount(CaseApplication caseApplication); + /** + * 查询超级管理员案件 + * @param caseApplication + * @return + */ + List selectAdminCaseApplicationList(CaseApplication caseApplication); + int insertCaseApplication(CaseApplication caseApplication); @@ -39,4 +47,10 @@ public interface CaseApplicationMapper { * @return */ String selectArbitratorList(@Param("id") String id); + + /** + * 修改支付方式 + * @param payDTO + */ + void updatePayType(CaseConfirmPayDTO payDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java index 0be609e..28e9a26 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CaseAttachMapper.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.mapper; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -14,4 +15,5 @@ public interface CaseAttachMapper { int updateCaseAttach(CaseAttach caseAttach); -} + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java index 596abf5..d5d4616 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/mapper/CasePaymentRecordMapper.java @@ -8,4 +8,6 @@ public interface CasePaymentRecordMapper { CasePaymentRecord queryRecord(String orderNumber); void update(CasePaymentRecord casePaymentRecord); + + CasePaymentRecord selectRecordByCaseId(Long id); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java index fc2e24a..1731259 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/ICasePaymentService.java @@ -3,6 +3,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.dto.PayRequest; import com.ruoyi.wisdomarbitrate.domain.CaseApplication; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; import com.ruoyi.wisdomarbitrate.domain.dto.CasePayDTO; public interface ICasePaymentService { @@ -12,4 +13,11 @@ public interface ICasePaymentService { AjaxResult casePay(CasePayDTO casePayDTO); AjaxResult confirmPayment(CaseApplication caseApplication); + + /** + * 确认缴费 + * @param payDTO + * @return + */ + AjaxResult confirmPay(CaseConfirmPayDTO payDTO); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index 189787e..c3cec8f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -14,10 +14,9 @@ import com.google.gson.JsonObject; import com.ruoyi.common.annotation.DataScope; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.EsignHttpResponse; -import com.ruoyi.common.core.domain.entity.SysDept; +import com.ruoyi.common.core.domain.entity.*; -import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.file.SaaSAPIFileUtils; @@ -50,6 +49,7 @@ import java.util.*; import java.util.regex.Pattern; import java.util.stream.Collectors; +import static com.ruoyi.common.utils.SecurityUtils.getLoginUser; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -62,7 +62,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private CaseAffiliateMapper caseAffiliateMapper; @Autowired - private ArbitratorMapper arbitratorMapper; + private CasePaymentRecordMapper casePaymentRecordMapper; @Autowired private ArbitrateRecordMapper arbitrateRecordMapper; @Autowired @@ -79,9 +79,45 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$"); - + /** + * 数据权限:1.每个人不同的角色,而每个角色可以操作不同的案件状态 + * 2.申请人:金融机构下,可以看到改机构的所有的案件 + * 3.被申请人:可以看到自己相关的案件(案件有被申请人相关的信息) + * 4.仲裁员:案件选定了某个仲裁员后,该仲裁员就可以查看该案件 + * 5.仲裁委(部门长):可以查看所有的案件 + * 6.法律顾问秘书:可以属于多个机构,可以查看相关机构的所有案件 + * 7.超级管理员:可以查看所有的信息和数据 + * @param caseApplication + * @return + */ @Override public List selectCaseApplicationList(CaseApplication caseApplication) { + // 获取登录用户 + LoginUser loginUser = getLoginUser(); + SysUser user = loginUser.getUser(); + Long userId = user.getUserId(); + Long deptId = user.getDeptId(); + List roles = user.getRoles(); + // 查询登录人身份证号 + SysUser sysUser = sysUserMapper.selectUserById(userId); + caseApplication.setIdCard(sysUser.getIdCard()); + caseApplication.setUserId(String.valueOf(userId)); + for (SysRole role : roles) { + // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √ + if(role.getRoleName().equals("超级管理员") + ||role.getRoleName().equals("仲裁委") + ||role.getRoleName().equals("部门长")){ + return caseApplicationMapper.selectAdminCaseApplicationList(caseApplication); + } + if(role.getRoleName().equals("法律顾问")){ + // 查询角色有关的用户部门 + List deptIds = sysDeptMapper.selectUserDeptListByRoleId(role.getRoleId()); + caseApplication.setDeptIds(deptIds); + } + } + + + // 根据条件查询申请人,被申请人,仲裁员,法律顾问案件 return caseApplicationMapper.selectCaseApplicationList(caseApplication); } @@ -99,6 +135,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 获取自动编码 String caseNum = generateCaseNum(); caseApplication.setCaseNum(caseNum); + caseApplication.setCreateBy(getUsername()); int rows = caseApplicationMapper.insertCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); @@ -116,7 +153,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); } else { // 如果不存在则新增 SysDept dept = new SysDept(); @@ -130,7 +168,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); } } @@ -184,6 +223,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { BigDecimal feeRate = new BigDecimal(0.01); BigDecimal feePayable = caseApplication.getCaseSubjectAmount().multiply(feeRate).setScale(2,BigDecimal.ROUND_HALF_UP); caseApplication.setFeePayable(feePayable); + caseApplication.setUpdateBy(getUsername()); int rows = caseApplicationMapper.updataCaseApplication(caseApplication); List caseAffiliates = caseApplication.getCaseAffiliates(); @@ -199,7 +239,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { if(caseAffiliate.getIdentityType()==1&&StrUtil.isNotEmpty(caseAffiliate.getName())) { // 将组织机构id设为申请人名称 if (deptMap.containsKey(caseAffiliate.getName())) { - caseAffiliate.setName(String.valueOf(deptMap.get(caseAffiliate.getName()))); + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseAffiliate.getName()))); } else { // 如果不存在则新增 SysDept dept = new SysDept(); @@ -213,7 +254,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); deptMap.put(dept.getDeptName(), dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + + caseAffiliate.setApplicationOrganName(caseAffiliate.getName()); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); } } @@ -400,7 +443,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { CaseApplication caseApplicationItera = caseApplicationNewList.get(k); // 新增立案信息 caseApplicationItera.setCaseStatus(CaseApplicationConstants.CASE_APPLICATION); - + caseApplicationItera.setCreateBy(getUsername()); int rows = caseApplicationMapper.insertCaseApplication(caseApplicationItera); List caseAffiliates = caseApplicationItera.getCaseAffiliates(); if(caseAffiliates!=null&&caseAffiliates.size()>0){ @@ -879,29 +922,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null){ - // 查询组织机构 - List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ - for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); - } - } - StringBuffer applicantName = new StringBuffer(); + for (int i = 0; i < caseAffiliatListeselect.size(); i++){ CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(i); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ - caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); - } - applicantName.append(caseAffiliateselect.getName()).append(",");; + + caseApplicationselect.setApplicantName(caseAffiliateselect.getApplicationOrganName()); } } - caseApplicationselect.setApplicantName(applicantName.toString()); - } + caseApplication.setAnnexType(8); + // 查询缴费凭证 + List payOrderList = caseAttachMapper.queryCaseAttachList(caseApplication); + caseApplicationselect.setPayOrderList(payOrderList); + return caseApplicationselect; } @@ -1012,21 +1048,12 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { caseAffiliate.setCaseAppliId(caseApplication.getId()); List caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); if(caseAffiliatListeselect!=null) { - // 查询组织机构 - List sysDepts = sysDeptMapper.selectDeptList(new SysDept()); - Map deptMap=new HashMap<>(); - if(CollectionUtil.isNotEmpty(sysDepts)){ - for (SysDept sysDept : sysDepts) { - deptMap.put(String.valueOf(sysDept.getDeptId()),sysDept.getDeptName()); - } - } + for (int j = 0; j < caseAffiliatListeselect.size(); j++) { CaseAffiliate caseAffiliateselect = caseAffiliatListeselect.get(j); int identityType = caseAffiliateselect.getIdentityType(); if(identityType==1){ - if(StrUtil.isNotEmpty(caseAffiliateselect.getName())&&deptMap.containsKey(caseAffiliateselect.getName())){ - caseAffiliateselect.setName(deptMap.get(caseAffiliateselect.getName())); - } + caseAffiliateselect.setName(caseAffiliateselect.getApplicationOrganName()); } //给申请人、被申请人发送短信通知 @@ -1108,7 +1135,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { // 将组织机构id设为申请人名称 if(deptMap.containsKey(caseApplication.getName())){ - caseAffiliate.setName(String.valueOf(deptMap.get(caseApplication.getName()))); + caseAffiliate.setApplicationOrganId(String.valueOf(deptMap.get(caseApplication.getName()))); + caseAffiliate.setApplicationOrganName(caseApplication.getName()); }else { // 如果不存在则新增 SysDept dept = new SysDept(); @@ -1122,7 +1150,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { dept.setUpdateBy(getUsername()); sysDeptMapper.insertDept(dept); deptMap.put(dept.getDeptName(),dept.getDeptId()); - caseAffiliate.setName(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganId(String.valueOf(dept.getDeptId())); + caseAffiliate.setApplicationOrganName(caseApplication.getName()); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 3841ec8..b1e465a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -1,9 +1,15 @@ package com.ruoyi.wisdomarbitrate.service.impl; +import cn.hutool.core.collection.CollectionUtil; import com.ruoyi.ElegentPay; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.model.LoginUser; +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.wisdomarbitrate.domain.CaseAttach; +import com.ruoyi.wisdomarbitrate.domain.dto.CaseConfirmPayDTO; +import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper; import com.ruoyi.wisdomarbitrate.utils.CaseLogUtils; import com.ruoyi.common.utils.SmsUtils; import com.ruoyi.dto.PayRequest; @@ -29,6 +35,8 @@ public class CasePaymentServiceImpl implements ICasePaymentService { private final CaseApplicationMapper caseApplicationMapper; private final CasePaymentRecordMapper casePaymentRecordMapper; private final CaseAffiliateMapper caseAffiliateMapper; + @Autowired + private CaseAttachMapper caseAttachMapper; @Autowired public CasePaymentServiceImpl(ElegentPay elegentPay @@ -78,13 +86,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { casePaymentRecord.setPaymentTime(new Date()); casePaymentRecord.setUpdateTime(new Date()); casePaymentRecordMapper.update(casePaymentRecord); - //根据案件id查询案件信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(caseId); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - //修改案件状态 - caseApplicationMapper.submitCaseApplication(caseApplication1); + return AjaxResult.success("支付成功"); } @@ -135,4 +137,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService { } return AjaxResult.error("暂无需要确认的缴费清单"); } + @Transactional + @Override + public AjaxResult confirmPay(CaseConfirmPayDTO payDTO) { + if(payDTO.getCaseId()!=null&&payDTO.getPayType()!=null){ + // 修改支付方式 + + caseApplicationMapper.updatePayType(payDTO); + } + if(CollectionUtil.isNotEmpty(payDTO.getPayOrderList())){ + for (CaseAttach caseAttach : payDTO.getPayOrderList()) { + caseAttach.setCaseAppliId(payDTO.getCaseId()); + caseAttachMapper.updateCaseAttach(caseAttach); + } + } + // 修改节点状态 + //根据案件id查询案件信息 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(payDTO.getCaseId()); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); + //修改案件状态 + caseApplicationMapper.submitCaseApplication(caseApplication1); + return AjaxResult.success("确认缴费成功"); + } } diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml index 3e0f228..2fafdc1 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -86,8 +86,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 - - + + + insert into sys_dept( dept_id, parent_id, diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 83487c2..c0c16a8 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -9,6 +9,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -49,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status + r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status,u.id_card from sys_user u left join sys_dept d on u.dept_id = d.dept_id left join sys_user_role ur on u.user_id = ur.user_id @@ -57,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select c.id ,c.case_appli_id ,c.identity_type ,c.name ,c.identity_num ,c.contact_telphone ,c.contact_address , c.work_address ,c.work_telphone ,c.name_agent, c.identity_num_agent ,c.contact_telphone_agent ,c.contact_address_agent, - c.track_num + c.track_num,c.application_organ_id,c.application_organ_name from case_affiliate c @@ -36,7 +38,7 @@ + select t.* from( + select c.id ,c.case_num ,c.case_subject_amount ,c.register_date ,c.arbitrat_method , CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' - ELSE '无审理方式' - END arbitratMethodName, + ELSE '无审理方式' + END arbitratMethodName, c.case_status , CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' - when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' - when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' - when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' - when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' - when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' - ELSE '无案件状态' - END caseStatusName, + when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' + when 6 then '待组庭确定' when 7 then '待审核仲裁方式' when 8 then '待开庭审理' + when 9 then '待书面审理' when 10 then '待生成仲裁文书' when 11 then '待核验仲裁文书' + when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印' + when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档' + ELSE '无案件状态' + END caseStatusName, c.hear_date ,c.arbitrat_claims , c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag ,c.fee_payable , c.begin_video_date ,c.online_video_person ,c.contract_number ,c.create_by ,c.create_time , - c.update_by ,c.update_time , c.arbitrator_name,d.dept_name as applicantName,c.register_date + c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id applicationOrganId ,ca.application_organ_name as applicantName,c.arbitrator_id,ca.identity_num , ca.identity_type from case_application c - LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id and ca.identity_type=1 - LEFT JOIN sys_dept d ON ca.NAME = d.dept_id and ca.name=d.dept_id + LEFT JOIN case_affiliate ca ON ca.case_appli_id = c.id + + + AND c.case_status = #{caseStatus} + + + AND c.case_num = #{caseNum} + + + and c.case_status in + + #{caseStatus} + + + + ) t + + + or ( t.application_organ_id = #{nameId} AND t.identity_type=1 ) + + + + or (t.identity_num=#{idCard} AND t.identity_type=2) + + + + or instr (t.arbitrator_id,#{userId})>0 + + + + or t.name + in + + #{item} + + + + order by t.create_time desc,t.case_num desc + + + select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account from case_attach diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml index a50bb99..fab2bd0 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CasePaymentRecordMapper.xml @@ -11,6 +11,7 @@ + INSERT INTO case_payment_record (case_id, order_number, payment_status , create_time) @@ -24,6 +25,7 @@ payment_time = #{paymentTime}, payment_status = #{paymentStatus}, update_time = #{updateTime}, + pay_type = #{payType}, where id = #{id}