调解bug修复

This commit is contained in:
18792927508
2024-05-16 16:08:37 +08:00
parent 6acf5e3bcc
commit 8f9f16254a
4 changed files with 68 additions and 37 deletions
@@ -57,15 +57,17 @@ public interface MsCaseApplicationService {
* @param affiliate
* @param groupOrder 组别
* @param operatorCount 操作人数量
* @param updateFlag 是否修改案件
*/
public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount);
public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag);
/**
* 新增案件相关人员信息
* @param affiliate 相关人员信息
* @param roleId 角色id
* @param roleIdList 角色id
* @param updateFlag 是否修改案件
*/
public void insertAfficateUser(MsCaseAffiliate affiliate, List<Long> roleIdList);
public void insertAfficateUser(MsCaseAffiliate affiliate, List<Long> roleIdList,boolean updateFlag);
/**
* 新增案件
@@ -701,17 +701,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(CollectionUtil.isNotEmpty(applicant)){
for (int i = 0; i < applicant.size(); i++) {
// 申请人
appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,false);
// 申请人代理人
appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,false);
}
}
if(CollectionUtil.isNotEmpty(res)){
for (int i = 0; i < res.size(); i++) {
// 申请人
resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,false);
// 申请人代理人
resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
resOperatorCount= setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,false);
}
}
if (appOperatorCount < 1 && resOperatorCount < 1) {
@@ -769,9 +769,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
* 设置案件相关信息
* @param caseApplication
* @param affiliate
* @param groupOrder 组别
* @param operatorCount 操作人数量
* @param updateFlag 是否修改案件
*/
@Transactional
public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount) {
public int setCaseAfflicate(MsCaseApplicationVO caseApplication, MsCaseAffiliate affiliate,int groupOrder,int operatorCount,boolean updateFlag) {
if(affiliate==null){
return operatorCount;
}
@@ -793,8 +796,6 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
affiliate.setCaseAppliId(caseApplication.getId());
List<Long> roleIdList = new ArrayList<>();
// Long roleId = null;
switch (affiliate.getRoleType()) {
case 1:
roleIdList.add((Long) applicantObj);
@@ -827,19 +828,28 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
break;
default:
break;
}
// 如果是申请人,则和用户表关联
if (affiliate.getOrganizeFlag() == 0) {
caseApplicationService.insertAfficateUser(affiliate, roleIdList);
caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
} else {
// 申请机构
if (affiliate.getRoleType() == 1 || affiliate.getRoleType()==3) {
affiliate.setOperatorFlag(0);
// 申请人,从缓存中判断部门是否存在
// Object deptCache = redisCache.getCacheObject(CacheConstants.DEPT_KEY + affiliate.getName());
SysDept dept = sysDeptMapper.selectDeptByName(affiliate.getName());
SysDept dept = null;
if(!updateFlag) {
// 新增则根据部门名称查
dept = sysDeptMapper.selectDeptByName(affiliate.getName());
}else {
if(affiliate.getApplicantDeptId()!=null){
// 修改根据部门id查
dept = sysDeptMapper.selectDeptById(affiliate.getApplicantDeptId());
}else {
dept = sysDeptMapper.selectDeptByName(affiliate.getName());
}
}
if (dept==null) {
// 不存在该部门,新增
dept = new SysDept();
@@ -872,7 +882,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
}
affiliate.setApplicantDeptId(dept.getDeptId());
} else {
caseApplicationService.insertAfficateUser(affiliate, roleIdList);
caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
}
}
// 保存人员
@@ -887,15 +897,27 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
* 新增案件相关人员信息
* @param affiliate 相关人员信息
* @param roleIdList 角色id
* @param updateFlag 是否修改案件
*/
@Transactional
public void insertAfficateUser(MsCaseAffiliate affiliate, List<Long> roleIdList) {
public void insertAfficateUser(MsCaseAffiliate affiliate, List<Long> roleIdList,boolean updateFlag) {
if(StrUtil.isEmpty(affiliate.getEmail())){
return;
}
SysUser user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
SysUser user=null;
if(!updateFlag) {
// 新增案件则根据邮箱查用户
user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
}else {
// 修改案件则根据userId查用户
if(affiliate.getUserId()!=null) {
user = sysUserMapper.selectUserById(affiliate.getUserId());
}else {
user = sysUserMapper.selectUserByEmail(affiliate.getEmail());
}
}
// 判断该用户是否存在
if(user==null){
// 不存在,则新增
@@ -1079,17 +1101,17 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
if(CollectionUtil.isNotEmpty(applicant)){
for (int i = 0; i < applicant.size(); i++) {
// 申请人
appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount);
appOperatorCount=setCaseAfflicate(caseApplication, applicant.get(i).getApplicant(),i,appOperatorCount,true);
// 申请人代理人
appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount);
appOperatorCount= setCaseAfflicate(caseApplication, applicant.get(i).getApplicantAgent(),i,appOperatorCount,true);
}
}
if(CollectionUtil.isNotEmpty(res)){
for (int i = 0; i < res.size(); i++) {
// 申请人
resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount);
resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getRes(),i,resOperatorCount,true);
// 申请人代理人
resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount);
resOperatorCount=setCaseAfflicate(caseApplication, res.get(i).getResAgent(),i,resOperatorCount,true);
}
}
if (appOperatorCount < 1 && resOperatorCount < 1) {
@@ -317,23 +317,30 @@ public class MsSignSealServiceImpl implements MsSignSealService {
if (record.getCreateTime() != null) {
caseNodeTime = DateUtil.format(record.getCreateTime(), DatePattern.NORM_DATETIME_FORMATTER);
}
Integer caseNode = record.getCaseNode();
String createBy = record.getCreateBy();
if (StrUtil.isNotEmpty(createBy)) {
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
} else {
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
}
if (StrUtil.isNotEmpty(record.getContent())) {
contentBuilder.append(record.getContent());
} else if (caseNode.intValue() == 0) {
contentBuilder.append(record.getCaseStatusName());
Integer caseNode = record.getCaseNode();
if(caseNode!=null) {
if(caseNode.equals(17)){
contentBuilder.append("调解案件于").append(caseNodeTime).append("结束");
}else {
String createBy = record.getCreateBy();
if (StrUtil.isNotEmpty(createBy)) {
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("(").append(record.getCreateBy()).append(")").append("于").append(caseNodeTime);
} else {
contentBuilder.append(Optional.ofNullable(record.getCreateNickName()).orElse("")).append("于").append(caseNodeTime);
}
if (StrUtil.isNotEmpty(record.getContent())) {
contentBuilder.append(record.getContent());
} else if (caseNode.intValue() == 0) {
contentBuilder.append(record.getCaseStatusName());
}
if (StrUtil.isNotEmpty(record.getNotes())) {
contentBuilder.append(",").append(record.getNotes());
}
}
record.setContent(contentBuilder.toString());
}
if (StrUtil.isNotEmpty(record.getNotes())) {
contentBuilder.append(",").append(record.getNotes());
}
record.setContent(contentBuilder.toString());
});
}
@@ -40,7 +40,7 @@
</select>
<select id="selectByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.entity.mscase.MsCaseAffiliate">
select c.id caseAppliId,r.role_id roleId,a.id,a.role_type roleType,a.group_order groupOrder,a.operator_flag operatorFlag,d.code,d.comp_legal_person compLegalPerson,u.id_card idCard,u.phonenumber phone,
u.email,u.user_name userName,
u.email,u.user_name userName,a.applicant_dept_id applicantDeptId,
(case when a.user_id is null then d.dept_name else u.nick_name end) name,
(case when a.user_id is null then d.home else u.home end) home,
(case when a.user_id is null then d.address else u.address end) address,