diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java index 9740131..e68e0f0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java @@ -254,4 +254,5 @@ public class SysUserController extends BaseController public AjaxResult selectUserById(@RequestParam(required = true) Long userId){ return AjaxResult.success(userService.selectUserById(userId)); } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java index 7ba798e..ff8482a 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java @@ -163,4 +163,18 @@ public class DeptIdentifyController extends BaseController { List sealList = deptIdentifyService.getTemplateList(deptIdentify); return getDataTable(sealList); } + /** + * 根据部门id查询岗位用户信息 + */ + @GetMapping("selectPostUserByDeptId") + public AjaxResult selectPostUserByDeptId(DeptIdentify deptIdentify){ + return AjaxResult.success(deptIdentifyService.selectPostUserByDeptId(deptIdentify)); + } + /** + * 给机构绑定经办人 + */ + @GetMapping("bindHandler") + public AjaxResult bindHandler(DeptIdentify deptIdentify){ + return deptIdentifyService.bindHandler(deptIdentify); + } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index 9c1402b..cd5b168 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -156,4 +156,6 @@ public interface SysUserMapper * @return */ List selectByDeptIdAndRole(@Param("deptId")String applicationOrganId, @Param("roleName")String roleName); + + List selectRoleUserByDeptId(@Param("deptId")Long deptId,@Param("roleId") Long roleId ); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index 58efaf0..8830025 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -207,4 +207,5 @@ public interface ISysUserService * @return 结果 */ public String importUser(List userList, Boolean isUpdateSupport, String operName); + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 1024793..cb02cfa 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -537,4 +537,6 @@ public class SysUserServiceImpl implements ISysUserService { } return successMsg.toString(); } + + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java index 651c53f..3f5df95 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/DeptIdentify.java @@ -11,6 +11,10 @@ public class DeptIdentify extends BaseEntity { /** ID */ private Long id; + /** 部门id */ + private Long deptId; + /** 用户id */ + private Long userId; /** 机构名称 */ private String identifyName; /** 认证状态 */ 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 index 146f2f2..596759f 100644 --- 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 @@ -12,10 +12,10 @@ import java.util.List; @Data public class CaseConfirmPayDTO { /** - * 案件id + * 案件ids */ @NotNull(message = "案件id不能为空") - private Long caseId; + private List caseIds; /** * 支付方式 0线上支付,1线下支付 diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java index 3a66b94..10493c0 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/IDeptIdentifyService.java @@ -1,6 +1,7 @@ package com.ruoyi.wisdomarbitrate.service; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.SealManage; @@ -44,4 +45,10 @@ public interface IDeptIdentifyService { List getTemplateList(DeptIdentify deptIdentify); + + List selectPostUserByDeptId(DeptIdentify deptIdentify); + + + AjaxResult bindHandler(DeptIdentify deptIdentify); + } 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 da17661..30a7e4f 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 @@ -47,12 +47,13 @@ public class CasePaymentServiceImpl implements ICasePaymentService { , CaseApplicationMapper caseApplicationMapper , CasePaymentRecordMapper casePaymentRecordMapper , CaseAffiliateMapper caseAffiliateMapper - ) { + ) { this.elegentPay = elegentPay; this.caseApplicationMapper = caseApplicationMapper; this.casePaymentRecordMapper = casePaymentRecordMapper; this.caseAffiliateMapper = caseAffiliateMapper; } + @Autowired private ICaseApplicationService caseApplicationService; @@ -190,38 +191,45 @@ public class CasePaymentServiceImpl implements ICasePaymentService { @Transactional @Override public AjaxResult confirmPay(CaseConfirmPayDTO payDTO) { - if (payDTO.getCaseId() != null && payDTO.getPayType() != null) { + List caseIds = payDTO.getCaseIds(); + if (caseIds == null || caseIds.size() == 0) { + return AjaxResult.error("案件id参数有误"); + } + if (payDTO.getPayType() != null) { // 修改支付方式 - caseApplicationMapper.updatePayType(payDTO); } - if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { - for (CaseAttach caseAttach : payDTO.getPayOrderList()) { - caseAttach.setCaseAppliId(payDTO.getCaseId()); - caseAttachMapper.updateCaseAttach(caseAttach); + for (Long caseId : caseIds) { + if (CollectionUtil.isNotEmpty(payDTO.getPayOrderList())) { + for (CaseAttach caseAttach : payDTO.getPayOrderList()) { + caseAttach.setCaseAppliId(caseId); + caseAttachMapper.updateCaseAttach(caseAttach); + } + } + // 修改节点状态 + //根据案件id查询案件信息 + CaseApplication caseApplication = new CaseApplication(); + caseApplication.setId(caseId); + CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); + caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); + //修改案件状态 + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); + if (i > 0) { + // 修改支付状态 + CasePaymentRecord paymentRecord = new CasePaymentRecord(); + paymentRecord.setPayType(payDTO.getPayType()); + paymentRecord.setCaseId(caseId); + paymentRecord.setPaymentStatus(1); + casePaymentRecordMapper.saveRecord(paymentRecord); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); + + return AjaxResult.success("确认缴费成功"); } - } - // 修改节点状态 - //根据案件id查询案件信息 - CaseApplication caseApplication = new CaseApplication(); - caseApplication.setId(payDTO.getCaseId()); - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); - //修改案件状态 - int i = caseApplicationMapper.submitCaseApplication(caseApplication1); - if (i > 0) { - // 修改支付状态 - CasePaymentRecord paymentRecord = new CasePaymentRecord(); - paymentRecord.setPayType(payDTO.getPayType()); - paymentRecord.setCaseId(payDTO.getCaseId()); - paymentRecord.setPaymentStatus(1); - casePaymentRecordMapper.saveRecord(paymentRecord); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); - return AjaxResult.success("确认缴费成功"); } return AjaxResult.success("确认缴费失败"); + } @Override @@ -231,11 +239,11 @@ public class CasePaymentServiceImpl implements ICasePaymentService { if (caseIds == null || caseIds.size() == 0) { return null; } - BigDecimal totalCost = new BigDecimal(0); - BigDecimal sum =totalCost; + BigDecimal totalCost = new BigDecimal(0); + BigDecimal sum = totalCost; CasePayListVO listVO = new CasePayListVO(); listVO.setCaseTotal(caseIds.size()); - List caseApplicationList =new ArrayList<>(); + List caseApplicationList = new ArrayList<>(); for (Long caseId : caseIds) { CaseApplication caseApplication = new CaseApplication(); CaseApplicationPay caseApplicationPay = new CaseApplicationPay(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java index aecc092..a277bf6 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java @@ -14,8 +14,10 @@ import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.exception.EsignDemoException; import com.ruoyi.common.utils.SealUtil; import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.system.domain.SysUserPost; import com.ruoyi.system.mapper.SysDeptMapper; import com.ruoyi.system.mapper.SysUserMapper; +import com.ruoyi.system.mapper.SysUserPostMapper; import com.ruoyi.wisdomarbitrate.domain.CaseAttach; import com.ruoyi.wisdomarbitrate.domain.DeptIdentify; import com.ruoyi.wisdomarbitrate.domain.SealManage; @@ -56,6 +58,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { private SysUserMapper sysUserMapper; @Autowired private TemplateManageMapper templateManageMapper; + @Autowired + private SysUserPostMapper sysUserPostMapper; @Override @@ -299,45 +303,48 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { public AjaxResult insertDeptIdentify(DeptIdentify deptIdentify) { //参数校验 String identifyName = deptIdentify.getIdentifyName(); - String operName = deptIdentify.getOperName(); - String operPhone = deptIdentify.getOperPhone(); - if (identifyName == null || operName == null || operPhone == null) { + if (identifyName == null) { AjaxResult.error("请检查参数是否完整"); } Integer identifyType = deptIdentify.getIdentifyType(); if (identifyType == null) { deptIdentify.setIdentifyType(1); // 设置机构默认为仲裁机构 } - //先查询看数据库里有没有相同的机构经办人 - List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify); - if (deptIdentifies != null && deptIdentifies.size() > 0) { - //说明之前新增过 - return AjaxResult.error("信息重复"); - } deptIdentify.setIdentifyStatus(0); //设置认证状态默认为未认证 deptIdentify.setIsUse(0); //设置机构默认为未启用 + //将机构名称保存到部门表里 + SysDept sysDept = new SysDept(); + sysDept.setDeptName(identifyName); + sysDept.setParentId(0L); + sysDept.setDeptType(1); + int i1 = sysDeptMapper.insertDept(sysDept); + if (i1 > 0) { + /* //将经办人信息存入到用户表里 + Long deptId = sysDept.getDeptId(); + SysUser sysUser = new SysUser(); + sysUser.setDeptId(deptId); + sysUser.setUserName(deptIdentify.getOperUserName()); + sysUser.setNickName(operName); + sysUser.setPhonenumber(operPhone); + SysUser sysUser1 = sysUserMapper.selectUserByUserName(deptIdentify.getOperUserName()); + if (sysUser1== null) { + sysUserMapper.insertUser(sysUser); + } + Long userId = sysUser.getUserId(); + deptIdentify.setDeptId(deptId); + deptIdentify.setUserId(userId); + List sysUserPosts = new ArrayList<>(); + SysUserPost sysUserPost = new SysUserPost(); + sysUserPost.setUserId(userId); + sysUserPost.setPostId(5L); + sysUserPosts.add(sysUserPost); + sysUserPostMapper.batchUserPost(sysUserPosts);*/ + Long deptId = sysDept.getDeptId(); + deptIdentify.setDeptId(deptId); + } + int i = deptIdentifyMapper.insertDeptIdentify(deptIdentify); if (i > 0) { - //将机构名称保存到部门表里 - SysDept sysDept = new SysDept(); - sysDept.setDeptName(identifyName); - sysDept.setParentId(0L); - sysDept.setDeptType(1); - int i1 = sysDeptMapper.insertDept(sysDept); - if (i1 > 0) { - //将经办人信息存入到用户表里 - Long deptId = sysDept.getDeptId(); - SysUser sysUser = new SysUser(); - sysUser.setDeptId(deptId); - sysUser.setUserName(deptIdentify.getOperUserName()); - sysUser.setNickName(operName); - sysUser.setPhonenumber(operPhone); - SysUser sysUser1 = sysUserMapper.selectUserByUserName(deptIdentify.getOperUserName()); - if (sysUser1== null) { - sysUserMapper.insertUser(sysUser); - } - } - return AjaxResult.success("新增成功"); } return AjaxResult.error(); @@ -350,6 +357,8 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { deptIdentify.setDelFlag(2); int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify); if (i > 0) { + //删除部门表数据 + sysDeptMapper.deleteDeptById(id); return AjaxResult.success("删除成功"); } return AjaxResult.error(); @@ -371,9 +380,15 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { } int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify); if (i > 0) { + //修改部门表数据 + SysDept sysDept = new SysDept(); + sysDept.setDeptId(deptIdentify1.getDeptId()); + sysDept.setDeptName(deptIdentify.getIdentifyName()); + sysDeptMapper.updateDept(sysDept); return AjaxResult.success("修改成功"); } } + return null; } @@ -475,7 +490,41 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService { return templateManages; } + @Override + public List selectPostUserByDeptId(DeptIdentify deptIdentify) { + List deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify); + if (deptIdentifies!= null && deptIdentifies.size() > 0) { + deptIdentify = deptIdentifies.get(0); + if (deptIdentify.getDeptId()!= null) { + //默认查询经办人的 + Long roleId = 106L; + List sysUserList = sysUserMapper.selectRoleUserByDeptId(deptIdentify.getDeptId(),roleId); + return sysUserList; + } + } + return null; + } + + @Override + public AjaxResult bindHandler(DeptIdentify deptIdentify) { + if (deptIdentify.getId()== null||deptIdentify.getUserId()==null) { + return AjaxResult.error("请检查参数是否完整"); + } + //根据userid查询用户信息 + SysUser sysUser = sysUserMapper.selectUserById(deptIdentify.getUserId()); + if (sysUser!= null) { + deptIdentify.setOperName(sysUser.getNickName()); + deptIdentify.setOperPhone(sysUser.getPhonenumber()); + deptIdentify.setOperUserName(sysUser.getUserName()); + //更新 + int i = deptIdentifyMapper.updateDeptIdentify(deptIdentify); + if (i > 0) { + return AjaxResult.success("绑定成功"); + } + } + return null; + } private String getFileExtension(String fileName) { int lastDotIndex = fileName.lastIndexOf("."); diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 4fa0070..b34d094 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -281,5 +281,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{userId} + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index fc202ce..b1e7188 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -1465,7 +1465,10 @@ where id = #{id} - update case_application set pay_type=#{payType} where id = #{caseId} + update case_application set pay_type=#{payDTO.payType} where id in + + #{caseId} + update case_application set lock_status=#{lockStatus} where id = #{id} diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml index 1644406..c1f1eb9 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/DeptIdentifyMapper.xml @@ -19,13 +19,16 @@ + +