仲裁问题修复 #362
+2
-2
@@ -197,9 +197,9 @@ public interface ICaseApplicationService {
|
||||
* @param updateFlag 是否修改案件
|
||||
|
||||
*/
|
||||
public void insertAfficateUser(CaseAffiliateEntity affiliate, List<Long> roleIdList,boolean updateFlag);
|
||||
public void insertAfficateUser(CaseAffiliateEntity affiliate, List<Long> roleIdList,boolean updateFlag,List<CaseAffiliateEntity> affiliateEntities);
|
||||
|
||||
void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List<CaseAffiliateEntity> affliates,CaseApplicationDTO caseApplication);
|
||||
void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List<CaseAffiliateEntity> affliates,CaseApplicationDTO caseApplicationm,boolean updateFlag);
|
||||
|
||||
/**
|
||||
* 根据案件id查询相关人员
|
||||
|
||||
+1
-1
@@ -873,7 +873,7 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
boolean appEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum);
|
||||
|
||||
// 被申请人发送邮件
|
||||
boolean resEmailFlag = sendCaseEmail(caseApplication1, appEmail, caseAttachList,caseNum);
|
||||
boolean resEmailFlag = sendCaseEmail(caseApplication1, resEmail, caseAttachList,caseNum);
|
||||
if (!appEmailFlag && !resEmailFlag) {
|
||||
throw new ServiceException("裁决书发送失败");
|
||||
}
|
||||
|
||||
+60
-56
@@ -1200,49 +1200,49 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 必填校验
|
||||
CaseApplication caseApplication = applicationMap.get(id);
|
||||
// 基本字段校验
|
||||
if (caseApplication != null) {
|
||||
for (String baseColumn : baseColumns) {
|
||||
if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseApplication, baseColumn))) {
|
||||
errorMsg.append(baseColumn).append("不能为空,");
|
||||
throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
}
|
||||
}
|
||||
// 校验人员
|
||||
if (CollectionUtil.isNotEmpty(caseAffiliates)) {
|
||||
List<CaseAffiliateEntity> affiliateList = caseAffiliateMap.get(id);
|
||||
if (CollectionUtil.isNotEmpty(affiliateList)) {
|
||||
int appCount = 0;
|
||||
int resCount = 0;
|
||||
for (CaseAffiliateEntity caseAffiliate : affiliateList) {
|
||||
if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(1) || caseAffiliate.getRoleType().equals(2))) {
|
||||
appCount++;
|
||||
// 校验申请人
|
||||
for (String applicAffiliateColumn : applicAffiliateColumns) {
|
||||
if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) {
|
||||
errorMsg.append(applicAffiliateColumn).append("不能为空,");
|
||||
throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
}
|
||||
}
|
||||
} else if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(3) || caseAffiliate.getRoleType().equals(4))) {
|
||||
resCount++;
|
||||
// 校验被申请人
|
||||
// 校验申请人
|
||||
for (String applicAffiliateColumn : dectborAffiliateColumns) {
|
||||
if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) {
|
||||
errorMsg.append(applicAffiliateColumn).append("不能为空,");
|
||||
throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (appCount == 0 || resCount == 0) {
|
||||
throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
}
|
||||
// if (caseApplication != null) {
|
||||
// for (String baseColumn : baseColumns) {
|
||||
// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseApplication, baseColumn))) {
|
||||
// errorMsg.append(baseColumn).append("不能为空,");
|
||||
// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
// }
|
||||
// }
|
||||
// // 校验人员
|
||||
// if (CollectionUtil.isNotEmpty(caseAffiliates)) {
|
||||
// List<CaseAffiliateEntity> affiliateList = caseAffiliateMap.get(id);
|
||||
// if (CollectionUtil.isNotEmpty(affiliateList)) {
|
||||
// int appCount = 0;
|
||||
// int resCount = 0;
|
||||
// for (CaseAffiliateEntity caseAffiliate : affiliateList) {
|
||||
// if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(1) || caseAffiliate.getRoleType().equals(2))) {
|
||||
// appCount++;
|
||||
// // 校验申请人
|
||||
// for (String applicAffiliateColumn : applicAffiliateColumns) {
|
||||
// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) {
|
||||
// errorMsg.append(applicAffiliateColumn).append("不能为空,");
|
||||
// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
// }
|
||||
// }
|
||||
// } else if (caseAffiliate.getOperatorFlag() != null && caseAffiliate.getOperatorFlag().equals(1) && caseAffiliate.getRoleType() != null && (caseAffiliate.getRoleType().equals(3) || caseAffiliate.getRoleType().equals(4))) {
|
||||
// resCount++;
|
||||
// // 校验被申请人
|
||||
// // 校验申请人
|
||||
// for (String applicAffiliateColumn : dectborAffiliateColumns) {
|
||||
// if (StrUtil.isEmpty(ObjectFieldUtils.getValue(caseAffiliate, applicAffiliateColumn))) {
|
||||
// errorMsg.append(applicAffiliateColumn).append("不能为空,");
|
||||
// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (appCount == 0 || resCount == 0) {
|
||||
// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// throw new ServiceException("必填字段未填写,请完善案件信息!");
|
||||
// }
|
||||
|
||||
CaseApplication application = new CaseApplication();
|
||||
application.setId(id);
|
||||
@@ -3276,7 +3276,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
List<CaseAffiliateEntity> affliates = new ArrayList<>();
|
||||
// 新增案件相关人员
|
||||
caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication);
|
||||
caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication,false);
|
||||
|
||||
|
||||
// 保存附件
|
||||
@@ -3414,7 +3414,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
// 如果是申请人,则和用户表关联
|
||||
if (affiliate.getOrganizeFlag() == 0) {
|
||||
caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
|
||||
caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag,affliates);
|
||||
} else {
|
||||
// 申请机构
|
||||
if (affiliate.getRoleType() == 1 || affiliate.getRoleType() == 3) {
|
||||
@@ -3451,6 +3451,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
sysDeptMapper.insertDept(dept);
|
||||
} else {
|
||||
// 更新部门
|
||||
dept.setDeptName(affiliate.getName());
|
||||
dept.setCode(affiliate.getCode());
|
||||
dept.setCompLegalPerson(affiliate.getCompLegalPerson());
|
||||
dept.setUpdateBy(getUsername());
|
||||
@@ -3461,13 +3462,13 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
sysDeptMapper.updateDept(dept);
|
||||
}
|
||||
affiliate.setApplicantDeptId(dept.getDeptId());
|
||||
affliates.add(affiliate);
|
||||
caseAffiliateMapper.insert(affiliate);
|
||||
} else {
|
||||
caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag);
|
||||
caseApplicationService.insertAfficateUser(affiliate, roleIdList, updateFlag,affliates);
|
||||
}
|
||||
}
|
||||
affliates.add(affiliate);
|
||||
// 保存人员
|
||||
caseAffiliateMapper.insert(affiliate);
|
||||
|
||||
if (affiliate.getOperatorFlag() != null && affiliate.getOperatorFlag() == 1) {
|
||||
operatorCount++;
|
||||
}
|
||||
@@ -3482,7 +3483,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
* @param updateFlag 是否修改案件
|
||||
*/
|
||||
@Transactional
|
||||
public void insertAfficateUser(CaseAffiliateEntity affiliate, List<Long> roleIdList, boolean updateFlag) {
|
||||
public void insertAfficateUser(CaseAffiliateEntity affiliate, List<Long> roleIdList, boolean updateFlag,List<CaseAffiliateEntity> affiliateEntities) {
|
||||
|
||||
if (StrUtil.isEmpty(affiliate.getEmail()) && StrUtil.isEmpty(affiliate.getPhone())) {
|
||||
return;
|
||||
@@ -3566,11 +3567,14 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
}
|
||||
|
||||
}
|
||||
affiliateEntities.add(affiliate);
|
||||
// 保存人员
|
||||
caseAffiliateMapper.insert(affiliate);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List<CaseAffiliateEntity> affliates, CaseApplicationDTO caseApplication) {
|
||||
public void insertCaseAfflicate(CaseAffiliateVO caseAffiliateVO, List<CaseAffiliateEntity> affliates, CaseApplicationDTO caseApplication,boolean updateFlag) {
|
||||
// 组装案件相关人员
|
||||
int appOperatorCount = 0;
|
||||
int resOperatorCount = 0;
|
||||
@@ -3581,17 +3585,17 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
if (CollectionUtil.isNotEmpty(applicant)) {
|
||||
for (int i = 0; i < applicant.size(); i++) {
|
||||
// 申请人
|
||||
appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicant(), i, appOperatorCount, false);
|
||||
appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicant(), i, appOperatorCount, updateFlag);
|
||||
// 申请人代理人
|
||||
appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicantAgent(), i, appOperatorCount, false);
|
||||
appOperatorCount = setCaseAfflicate(affliates, caseApplication, applicant.get(i).getApplicantAgent(), i, appOperatorCount, updateFlag);
|
||||
}
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(res)) {
|
||||
for (int i = 0; i < res.size(); i++) {
|
||||
// 被申请人
|
||||
resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, false);
|
||||
resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getRes(), i, resOperatorCount, updateFlag);
|
||||
// 被申请人代理人
|
||||
resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, false);
|
||||
resOperatorCount = setCaseAfflicate(affliates, caseApplication, res.get(i).getResAgent(), i, resOperatorCount, updateFlag);
|
||||
}
|
||||
}
|
||||
if (appOperatorCount < 1 && resOperatorCount < 1) {
|
||||
@@ -3696,7 +3700,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
||||
// 删除已存在的人员
|
||||
caseAffiliateMapper.deleteByCaseId(caseApplication.getId());
|
||||
// 新增案件相关人员
|
||||
caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication);
|
||||
caseApplicationService.insertCaseAfflicate(caseAffiliateVO, affliates, caseApplication,true);
|
||||
// 保存附件
|
||||
if (CollectionUtil.isNotEmpty(caseApplication.getCaseAttachList())) {
|
||||
for (CaseAttach caseAttach : caseApplication.getCaseAttachList()) {
|
||||
|
||||
Reference in New Issue
Block a user