Merge branch 'wq1' of SH-Arbitrate/Mediation-Backend into dev

This commit was merged in pull request #46.
This commit is contained in:
2024-01-26 16:17:53 +08:00
committed by Gitea
5 changed files with 46 additions and 18 deletions
@@ -72,11 +72,11 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
"union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," + "union select c.id id,c.room_id roomId,c.mediation_method mediationMethod,1 AS pendingStatus,c.case_flow_id caseFlowId,c.batch_number batchNumber,c.case_num caseNum,c.case_subject_amount caseSubjectAmount," +
"a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," + "a.application_organ_name applicationOrganName,a.respondent_name respondentName,c.mediator_name mediatorName," +
"c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " + "c.hear_date hearDate,c.case_status_name caseStatusName,c.create_time createTime from ms_case_log_record r " +
"join ms_case_application c on r.case_appli_id=c.id and r.case_status_name!=c.case_status_name " + "join ms_case_application c on r.case_appli_id=c.id " +
"join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" + "join ms_case_affiliate a on c.id=a.case_appli_id <where> r.create_by=#{req.userName} and c.id not in (" +
"select c1.id from ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id" "select c1.id from ms_case_application c1 JOIN ms_case_affiliate a1 ON a1.case_appli_id = c1.id"
+ +
"<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c.case_status_name in" + "<if test='caseStatusNames != null and caseStatusNames.size() > 0 '> and c1.case_status_name in" +
"<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" + "<foreach item='caseStatus' index='index' collection='caseStatusNames' open='(' separator=',' close=')'>" +
"#{caseStatus}" + "#{caseStatus}" +
"</foreach>" + "</foreach>" +
@@ -95,11 +95,11 @@ public interface MsCaseApplicationMapper extends Mapper<MsCaseApplication> {
" AND a1.application_organ_id = #{req.applicationOrganId} " + " AND a1.application_organ_id = #{req.applicationOrganId} " +
"</if> " "</if> "
+ "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" + + "<if test=\"req.respondentIdentityNum != null and req.respondentIdentityNum != ''\">" +
" AND a.respondent_identity_num = #{req.respondentIdentityNum} " + " AND a1.respondent_identity_num = #{req.respondentIdentityNum} " +
"</if> " "</if> "
+ +
"<if test=\"req.hearDateFlag != null \">" + "<if test=\"req.hearDateFlag != null \">" +
" AND c.mediation_method = '1'" + " AND c1.mediation_method = '1'" +
"</if> " "</if> "
+ +
@@ -18,7 +18,8 @@ public interface MsCaseLogRecordMapper extends Mapper<MsCaseLogRecord> {
@Select("<script> select cl.case_node caseNode ,cl.case_node_time caseNodeTime ,cl.notes ,cl.id ,cl.case_appli_id caseAppliId," + @Select("<script> select cl.case_node caseNode ,cl.case_node_time caseNodeTime ,cl.notes ,cl.id ,cl.case_appli_id caseAppliId," +
" cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime, " + " cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime, " +
" CASE cl.case_node when 1 then '提交案件' when 2 then '缴费' " + " CASE cl.case_node when 0 then '新增案件' " +
"when 1 then '提交案件' when 2 then '缴费' " +
" when 3 then '确认缴费' when 4 then '受理分配' when 5 then '选择调解员' " + " when 3 then '确认缴费' when 4 then '受理分配' when 5 then '选择调解员' " +
" when 6 then '核实调解员' when 7 then '确认调解员' when 8 then '确定调解时间' " + " when 6 then '核实调解员' when 7 then '确认调解员' when 8 then '确定调解时间' " +
" when 9 then '调解' when 10 then '确认调解书' when 11 then '签名' " + " when 9 then '调解' when 10 then '确认调解书' when 11 then '签名' " +
@@ -344,7 +344,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
columnValueMapper.batchSave(columnValueList); columnValueMapper.batchSave(columnValueList);
} }
// todo 发送短信 // todo 发送短信
CaseLogUtils.insertCaseLog(caseApplication.getId(), caseFlow.getNodeId(), caseFlow.getCaseStatusName(), ""); CaseLogUtils.insertCaseLog(caseApplication.getId(), 0, "新增案件", "");
return 1; return 1;
} }
@@ -786,6 +786,9 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
* @param affiliateMap * @param affiliateMap
*/ */
private void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) { private void accept(MsCaseApplication application, MsCaseApplication req, Map<Long, MsCaseAffiliate> affiliateMap) {
application.setPaperFlag(req.getPaperFlag());
application.setArbitrateConfirm(req.getArbitrateConfirm());
application.setMediationMethod(req.getMediationMethod());
application.setUpdateBy(SecurityUtils.getUsername()); application.setUpdateBy(SecurityUtils.getUsername());
application.setUpdateTime(new Date()); application.setUpdateTime(new Date());
application.setBatchNumber(null); application.setBatchNumber(null);
@@ -879,8 +882,10 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
mediatorVO.setMediatorId(user.getUserId()); mediatorVO.setMediatorId(user.getUserId());
mediatorVO.setMediatorName(user.getNickName()); mediatorVO.setMediatorName(user.getNickName());
mediatorVO.setSpecialty(user.getSpecialty()); mediatorVO.setSpecialty(user.getSpecialty());
if(caseMap==null){
if(caseMap!=null&&caseMap.containsKey(String.valueOf(user.getUserId()))) { mediatorVO.setTodoAmount(0L);
mediatorVO.setCompleteAmount(0L);
} else if(caseMap.containsKey(String.valueOf(user.getUserId()))) {
List<MsCaseApplication> applications = caseMap.get(String.valueOf(user.getUserId())); List<MsCaseApplication> applications = caseMap.get(String.valueOf(user.getUserId()));
// 已办案件 // 已办案件
long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count(); long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
@@ -1077,8 +1082,12 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
mediatorVO.setMediatorId(user.getUserId()); mediatorVO.setMediatorId(user.getUserId());
mediatorVO.setMediatorName(user.getNickName()); mediatorVO.setMediatorName(user.getNickName());
mediatorVO.setSpecialty(user.getSpecialty()); mediatorVO.setSpecialty(user.getSpecialty());
if(caseMap==null){
mediatorVO.setTodoAmount(0L);
mediatorVO.setCompleteAmount(0L);
}
if(caseMap!=null&&caseMap.containsKey(String.valueOf(user.getUserId()))) { else if(caseMap.containsKey(String.valueOf(user.getUserId()))) {
List<MsCaseApplication> applications = caseMap.get(String.valueOf(user.getUserId())); List<MsCaseApplication> applications = caseMap.get(String.valueOf(user.getUserId()));
// 已办案件 // 已办案件
long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count(); long count = applications.stream().filter(caseApplication -> !caseApplication.getCaseStatusName().equals("结束")).count();
@@ -1739,6 +1748,11 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
*/ */
@Override @Override
public MsCaseFlow nextFlow(Long caseId,Integer caseFlowId,Integer lockStatus) { public MsCaseFlow nextFlow(Long caseId,Integer caseFlowId,Integer lockStatus) {
// 查询当前流程节点
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(caseFlowId);
if (currentFlow == null) {
throw new ServiceException("未找到当前流程节点");
}
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseFlowId); MsCaseFlow nextFlow = caseFlowMapper.nextFlow(caseFlowId);
if (nextFlow == null) { if (nextFlow == null) {
throw new ServiceException("未找到下一个流程节点"); throw new ServiceException("未找到下一个流程节点");
@@ -1752,7 +1766,7 @@ public class MsCaseApplicationServiceImpl implements MsCaseApplicationService {
application.setLockStatus(lockStatus); application.setLockStatus(lockStatus);
msCaseApplicationMapper.updateByPrimaryKeySelective(application); msCaseApplicationMapper.updateByPrimaryKeySelective(application);
// 新增日志 // 新增日志
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),""); CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"");
return nextFlow; return nextFlow;
} }
@@ -143,6 +143,11 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
@Transactional @Transactional
@Override @Override
public AjaxResult confirmPayment(CaseConfirmPayDTO dto) { public AjaxResult confirmPayment(CaseConfirmPayDTO dto) {
// 根据流程id查找当前流程节点
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(dto.getCaseFlowId());
if (currentFlow == null) {
return AjaxResult.error("未找到当前流程节点");
}
// 根据流程id查找下一个流程节点 // 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId()); MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
if (nextFlow == null) { if (nextFlow == null) {
@@ -156,7 +161,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
return AjaxResult.error("该批号下未找到案件"); return AjaxResult.error("该批号下未找到案件");
} }
for (MsCaseApplication application : applicationList) { for (MsCaseApplication application : applicationList) {
confirmPayment(nextFlow, application, dto); confirmPayment(currentFlow,nextFlow, application, dto);
} }
} else { } else {
@@ -164,7 +169,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
MsCaseApplication application = new MsCaseApplication(); MsCaseApplication application = new MsCaseApplication();
application.setId(dto.getCaseId()); application.setId(dto.getCaseId());
application.setLockStatus(YesOrNoEnum.YES.getCode()); application.setLockStatus(YesOrNoEnum.YES.getCode());
confirmPayment(nextFlow, application, dto); confirmPayment(currentFlow,nextFlow, application, dto);
} }
return AjaxResult.success("确认缴费成功"); return AjaxResult.success("确认缴费成功");
@@ -253,6 +258,12 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
@Transactional @Transactional
@Override @Override
public AjaxResult confirmPaid(CaseConfirmPayDTO dto) { public AjaxResult confirmPaid(CaseConfirmPayDTO dto) {
// 根据流程id查找当前流程节点
MsCaseFlow currentFlow = caseFlowMapper.selectByPrimaryKey(dto.getCaseFlowId());
if (currentFlow == null) {
return AjaxResult.error("未找到当前流程节点");
}
// 根据流程id查找下一个流程节点 // 根据流程id查找下一个流程节点
MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId()); MsCaseFlow nextFlow = caseFlowMapper.nextFlow(dto.getCaseFlowId());
if (nextFlow == null) { if (nextFlow == null) {
@@ -266,13 +277,13 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
return AjaxResult.error("该批号下未找到案件"); return AjaxResult.error("该批号下未找到案件");
} }
for (MsCaseApplication application : applicationList) { for (MsCaseApplication application : applicationList) {
confirmPaid(nextFlow, application); confirmPaid(currentFlow,nextFlow, application);
} }
}else { }else {
MsCaseApplication caseApplication=new MsCaseApplication(); MsCaseApplication caseApplication=new MsCaseApplication();
caseApplication.setId(dto.getCaseId()); caseApplication.setId(dto.getCaseId());
caseApplication.setLockStatus(YesOrNoEnum.YES.getCode()); caseApplication.setLockStatus(YesOrNoEnum.YES.getCode());
confirmPaid(nextFlow,caseApplication ); confirmPaid(currentFlow,nextFlow,caseApplication );
} }
@@ -285,7 +296,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
* @param application * @param application
* @param * @param
*/ */
private void confirmPaid(MsCaseFlow nextFlow, MsCaseApplication application) { private void confirmPaid(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application) {
//更改记录表里的支付状态和支付时间 //更改记录表里的支付状态和支付时间
MsCasePaymentRecord casePaymentRecord = new MsCasePaymentRecord(); MsCasePaymentRecord casePaymentRecord = new MsCasePaymentRecord();
casePaymentRecord.setPaymentStatus(1); casePaymentRecord.setPaymentStatus(1);
@@ -300,7 +311,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
application.setCaseStatusName(nextFlow.getCaseStatusName()); application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application); caseApplicationMapper.updateByPrimaryKeySelective(application);
// 新增日志 // 新增日志
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认已缴费"); CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认已缴费");
// todo 发送短信 // todo 发送短信
@@ -314,7 +325,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
* @param dto * @param dto
*/ */
private void confirmPayment(MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto) { private void confirmPayment(MsCaseFlow currentFlow,MsCaseFlow nextFlow, MsCaseApplication application, CaseConfirmPayDTO dto) {
application.setPayType(dto.getPayType()); application.setPayType(dto.getPayType());
// 修改缴费附件 // 修改缴费附件
if (CollectionUtil.isNotEmpty(dto.getPayOrderList())) { if (CollectionUtil.isNotEmpty(dto.getPayOrderList())) {
@@ -327,7 +338,7 @@ public class MsCasePaymentServiceImpl implements MsCasePaymentService {
application.setCaseFlowId(nextFlow.getId()); application.setCaseFlowId(nextFlow.getId());
application.setCaseStatusName(nextFlow.getCaseStatusName()); application.setCaseStatusName(nextFlow.getCaseStatusName());
caseApplicationMapper.updateByPrimaryKeySelective(application); caseApplicationMapper.updateByPrimaryKeySelective(application);
CaseLogUtils.insertCaseLog(application.getId(), nextFlow.getNodeId(), nextFlow.getCaseStatusName(),"确认缴费"); CaseLogUtils.insertCaseLog(application.getId(), currentFlow.getNodeId(), currentFlow.getCaseStatusName(),"确认缴费");
} }
@@ -186,6 +186,8 @@ public class VideoConferenceServiceImpl implements VideoConferenceService {
null, null); null, null);
// 先删除之前的会议 // 先删除之前的会议
reservedConferenceMapper.deletByCaseId(caseId); reservedConferenceMapper.deletByCaseId(caseId);
// 新增会议
reservedConferenceMapper.insert(conference);
return String.valueOf(roomId); return String.valueOf(roomId);
} }