Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #228.
This commit is contained in:
+14
@@ -1,5 +1,6 @@
|
|||||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
||||||
@@ -89,5 +90,18 @@ public class CaseApplicationLogController {
|
|||||||
}
|
}
|
||||||
return caseApplicationLogService.updateAudit(vo);
|
return caseApplicationLogService.updateAudit(vo);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 查询该版本及之前版本案件进行对比
|
||||||
|
* @author wangqiong
|
||||||
|
* @date 2023/11/17
|
||||||
|
**/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/selectCompareCase")
|
||||||
|
public AjaxResult selectCompareCase(@RequestBody UpdateSubmitVO vo){
|
||||||
|
if(vo.getCaseId()==null || vo.getVersion()==null ){
|
||||||
|
return AjaxResult.error("参数校验错误");
|
||||||
|
}
|
||||||
|
return caseApplicationLogService.selectCompareCase(vo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.ruoyi.common.utils;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 反射工具类
|
||||||
|
*/
|
||||||
|
public class ObjectFieldUtils {
|
||||||
|
public static String getValue(Object obj,String fieldName){
|
||||||
|
Field field=null;
|
||||||
|
try{
|
||||||
|
field=obj.getClass().getDeclaredField(fieldName);
|
||||||
|
field.setAccessible(true);
|
||||||
|
return String.valueOf(field.get(obj)==null?"":field.get(obj));
|
||||||
|
}catch (Exception e){
|
||||||
|
if(obj.getClass().getSuperclass()!=Object.class){
|
||||||
|
try{
|
||||||
|
field=obj.getClass().getSuperclass().getDeclaredField(fieldName);
|
||||||
|
field.setAccessible(true);
|
||||||
|
return String.valueOf(field.get(obj)==null?"":field.get(obj));
|
||||||
|
}catch (Exception e1){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setValue(Object obj,String fieldName,Object value){
|
||||||
|
Field field=null;
|
||||||
|
try{
|
||||||
|
field=obj.getClass().getDeclaredField(fieldName);
|
||||||
|
field.setAccessible(true);
|
||||||
|
field.set(obj,value);
|
||||||
|
}catch (Exception e){
|
||||||
|
if(obj.getClass().getSuperclass()!=Object.class){
|
||||||
|
try{
|
||||||
|
field=obj.getClass().getSuperclass().getDeclaredField(fieldName);
|
||||||
|
field.setAccessible(true);
|
||||||
|
field.set(obj,value);
|
||||||
|
}catch (Exception e1){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -56,6 +56,18 @@ public class CaseAffiliate extends BaseEntity {
|
|||||||
* 版本号
|
* 版本号
|
||||||
*/
|
*/
|
||||||
private Integer version;
|
private Integer version;
|
||||||
|
/**
|
||||||
|
* 改变的字段
|
||||||
|
*/
|
||||||
|
private String changeColumn;
|
||||||
|
|
||||||
|
public String getChangeColumn() {
|
||||||
|
return changeColumn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChangeColumn(String changeColumn) {
|
||||||
|
this.changeColumn = changeColumn;
|
||||||
|
}
|
||||||
|
|
||||||
public Long getCaseAppliLogId() {
|
public Long getCaseAppliLogId() {
|
||||||
return caseAppliLogId;
|
return caseAppliLogId;
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案件前后对比
|
||||||
|
* @author wangqiong
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CompareCaseVO {
|
||||||
|
/**
|
||||||
|
* 该版本前的案件
|
||||||
|
*/
|
||||||
|
private CaseApplication beforeCase;
|
||||||
|
/**
|
||||||
|
* 该版本后的案件
|
||||||
|
*/
|
||||||
|
private CaseApplication afterCase;
|
||||||
|
/**
|
||||||
|
* 变化字段,多个用,拼接
|
||||||
|
*/
|
||||||
|
private String changeColumn;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -17,7 +17,7 @@ public interface CaseAffiliateLogMapper {
|
|||||||
void batchDeletecaseAffiliate(@Param("ids") List<Long> ids);
|
void batchDeletecaseAffiliate(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
|
||||||
List<CaseAffiliate> selectCaseAffiliate(CaseAffiliate caseAffiliate);
|
List<CaseAffiliate> selectCaseAffiliate(@Param("caseAppliLogId") Long caseAppliLogId);
|
||||||
CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliLogId") Long caseAppliLogId, @Param("identityType")int identityType);
|
CaseAffiliate selectCaseAffiliateByIdentityType(@Param("caseAppliLogId") Long caseAppliLogId, @Param("identityType")int identityType);
|
||||||
|
|
||||||
int updataCaseAffiliate(CaseAffiliate caseAffiliate);
|
int updataCaseAffiliate(CaseAffiliate caseAffiliate);
|
||||||
|
|||||||
+1
-1
@@ -34,5 +34,5 @@ public interface CaseAffiliateMapper {
|
|||||||
* 批量修改
|
* 批量修改
|
||||||
* @param affiliateLogList
|
* @param affiliateLogList
|
||||||
*/
|
*/
|
||||||
void updataCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
|
void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -54,4 +54,5 @@ public interface CaseApplicationLogService {
|
|||||||
AjaxResult updateAudit(UpdateSubmitVO vo);
|
AjaxResult updateAudit(UpdateSubmitVO vo);
|
||||||
|
|
||||||
|
|
||||||
|
AjaxResult selectCompareCase(UpdateSubmitVO vo);
|
||||||
}
|
}
|
||||||
|
|||||||
+177
-14
@@ -1,22 +1,30 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.enums.UpdateSubmitStatus;
|
import com.ruoyi.common.enums.UpdateSubmitStatus;
|
||||||
import com.ruoyi.common.enums.YesOrNoEnum;
|
import com.ruoyi.common.enums.YesOrNoEnum;
|
||||||
|
import com.ruoyi.common.utils.ObjectFieldUtils;
|
||||||
|
import com.ruoyi.common.utils.SmsUtils;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateLogMapper;
|
import com.ruoyi.wisdomarbitrate.mapper.*;
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationLogMapper;
|
|
||||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
|
||||||
import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService;
|
import com.ruoyi.wisdomarbitrate.service.CaseApplicationLogService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.ruoyi.common.utils.SecurityUtils.getUsername;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author wangqiong
|
* @author wangqiong
|
||||||
@@ -33,6 +41,8 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
private CaseAffiliateLogMapper caseAffiliateLogMapper;
|
private CaseAffiliateLogMapper caseAffiliateLogMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CaseAffiliateMapper caseAffiliateMapper;
|
private CaseAffiliateMapper caseAffiliateMapper;
|
||||||
|
@Autowired
|
||||||
|
private SmsRecordMapper smsRecordMapper;
|
||||||
@Override
|
@Override
|
||||||
public int insert(CaseApplication caseApplicationLog) {
|
public int insert(CaseApplication caseApplicationLog) {
|
||||||
return caseApplicationLogMapper.insert(caseApplicationLog);
|
return caseApplicationLogMapper.insert(caseApplicationLog);
|
||||||
@@ -70,7 +80,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
return AjaxResult.error("案件不存在");
|
return AjaxResult.error("案件不存在");
|
||||||
}
|
}
|
||||||
// 如果秘书没有审核,将撤销状态改为同意撤销,否则改为撤销
|
// 如果秘书没有审核,将撤销状态改为同意撤销,否则改为撤销
|
||||||
if(caseApplication.getUpdateSubmitStatus()!=null && caseApplication.getUpdateSubmitStatus()>UpdateSubmitStatus.REVOKE.getCode()){
|
if(caseApplication.getUpdateSubmitStatus()!=null && !caseApplication.getUpdateSubmitStatus().equals(UpdateSubmitStatus.AGREE.getCode())){
|
||||||
agreeRevoke(vo);
|
agreeRevoke(vo);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
@@ -106,20 +116,25 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
|
vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE.getCode());
|
||||||
caseApplicationLogMapper.updateStatus(vo);
|
caseApplicationLogMapper.updateStatus(vo);
|
||||||
// 根据caseLogId查询相关人员表
|
// 根据caseLogId查询相关人员表
|
||||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
|
||||||
caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId());
|
|
||||||
List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate);
|
|
||||||
caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
|
caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
|
||||||
// 更新案件主表
|
// 更新案件主表
|
||||||
caseApplicationMapper.updataCaseApplication(caseApplicationLog);
|
caseApplicationMapper.updataCaseApplication(caseApplicationLog);
|
||||||
|
|
||||||
// 更新相关人员主表
|
// 更新相关人员主表
|
||||||
caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
if(CollectionUtil.isNotEmpty(affiliateLogList)){
|
||||||
|
for (CaseAffiliate caseAffiliate : affiliateLogList) {
|
||||||
|
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
||||||
} else {
|
} else {
|
||||||
// 拒绝,将日志表改版本的状态改为拒绝
|
// 拒绝,将日志表改版本的状态改为拒绝
|
||||||
vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
|
vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE.getCode());
|
||||||
caseApplicationLogMapper.updateStatus(vo);
|
caseApplicationLogMapper.updateStatus(vo);
|
||||||
// todo 给申请人发送短信
|
return sendAuditMessage(vo);
|
||||||
|
|
||||||
|
|
||||||
// 修改案件表的版本号
|
// 修改案件表的版本号
|
||||||
// caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
|
// caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
|
||||||
|
|
||||||
@@ -139,6 +154,7 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
// 拒绝撤销,将日志表改版本的状态改为拒绝撤销
|
// 拒绝撤销,将日志表改版本的状态改为拒绝撤销
|
||||||
vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode());
|
vo.setUpdateSubmitStatus(UpdateSubmitStatus.REFUSE_REVOKE.getCode());
|
||||||
caseApplicationLogMapper.updateStatus(vo);
|
caseApplicationLogMapper.updateStatus(vo);
|
||||||
|
return sendAuditMessage(vo);
|
||||||
// 修改案件表的版本号
|
// 修改案件表的版本号
|
||||||
// caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
|
// caseApplicationMapper.updateVersionById(vo.getCaseId(),vo.getVersion());
|
||||||
}
|
}
|
||||||
@@ -147,6 +163,150 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给申请人发送短信
|
||||||
|
* @param vo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private AjaxResult sendAuditMessage(UpdateSubmitVO vo) {
|
||||||
|
// 查询申请人
|
||||||
|
CaseApplication logCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion());
|
||||||
|
if(logCase == null){
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
CaseAffiliate caseAffiliate = caseAffiliateLogMapper.selectCaseAffiliateByIdentityType(logCase.getCaseLogId(), 1);
|
||||||
|
if(caseAffiliate == null){
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo 给申请人发送短信
|
||||||
|
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
|
||||||
|
request.setTemplateId("1996949");
|
||||||
|
request.setPhone(caseAffiliate.getContactTelphone());
|
||||||
|
request.setTemplateParamSet(new String[]{caseAffiliate.getName(), logCase.getCaseNum(),vo.getReason()});
|
||||||
|
Boolean aBoolean = SmsUtils.sendSms(request);
|
||||||
|
//保存短信发送记录
|
||||||
|
SmsSendRecord smsSendRecord = new SmsSendRecord();
|
||||||
|
smsSendRecord.setCaseId(caseAffiliate.getCaseAppliId());
|
||||||
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
|
caseApplication.setId(caseAffiliate.getCaseAppliId());
|
||||||
|
caseApplication = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
|
smsSendRecord.setCaseNum(caseApplication.getCaseNum());
|
||||||
|
smsSendRecord.setPhone(request.getPhone());
|
||||||
|
smsSendRecord.setSendTime(new Date());
|
||||||
|
// 1996949 审核案件结果通知 尊敬的{1}用户,您的{2}仲裁案件,审核未通过,理由为{3},请知晓,如非本人操作,请忽略本短信
|
||||||
|
String content = "尊敬的" + caseAffiliate.getName() + ",您的"+logCase.getCaseNum()+"仲裁案件,审核未通过,理由为"+vo.getReason()+",请知晓,如非本人操作,请忽略本短信。";
|
||||||
|
smsSendRecord.setSendContent(content);
|
||||||
|
smsSendRecord.setCreateBy(getUsername());
|
||||||
|
if (aBoolean) {
|
||||||
|
smsSendRecord.setSendStatus(1);
|
||||||
|
} else {
|
||||||
|
smsSendRecord.setSendStatus(0);
|
||||||
|
}
|
||||||
|
smsRecordMapper.saveSmsSendRecord(smsSendRecord);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AjaxResult selectCompareCase(UpdateSubmitVO vo) {
|
||||||
|
// 查询当前版本号和上一个版本号的案件
|
||||||
|
CaseApplication afterCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion());
|
||||||
|
CaseApplication beforeCase = caseApplicationLogMapper.selectByCaseIdAndVersion(vo.getCaseId(), vo.getVersion() - 1);
|
||||||
|
// 查询案件关联人员
|
||||||
|
beforeCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(beforeCase.getCaseLogId()));
|
||||||
|
afterCase.setCaseAffiliates(caseAffiliateLogMapper.selectCaseAffiliate(afterCase.getCaseLogId()));
|
||||||
|
CompareCaseVO compareCaseVO = new CompareCaseVO();
|
||||||
|
compareCaseVO.setBeforeCase(beforeCase);
|
||||||
|
compareCaseVO.setAfterCase(afterCase);
|
||||||
|
// 对比两个版本修改的字段
|
||||||
|
String[] columns = {"caseLogId","caseSubjectAmount", "caseName"};
|
||||||
|
String[] affiliateColumns = {"identityNum", "workAddress"};
|
||||||
|
StringBuilder changeColumn = new StringBuilder();
|
||||||
|
for (String column : columns) {
|
||||||
|
String beforeValue = ObjectFieldUtils.getValue(beforeCase, column);
|
||||||
|
String afterValue = ObjectFieldUtils.getValue(afterCase, column);
|
||||||
|
if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) {
|
||||||
|
changeColumn.append(column).append(",");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) {
|
||||||
|
changeColumn.append(column).append(",");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) {
|
||||||
|
changeColumn.append(column).append(",");
|
||||||
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
List<CaseAffiliate> beforeCaseCaseAffiliates = beforeCase.getCaseAffiliates();
|
||||||
|
List<CaseAffiliate> afterCaseCaseAffiliates = afterCase.getCaseAffiliates();
|
||||||
|
Map<Integer, CaseAffiliate> beforeCaseCaseAffiliateMap = null;
|
||||||
|
if (CollectionUtil.isNotEmpty(beforeCaseCaseAffiliates)) {
|
||||||
|
// 转为map
|
||||||
|
beforeCaseCaseAffiliateMap = beforeCaseCaseAffiliates.stream().collect(Collectors.toMap(CaseAffiliate::getIdentityType, v -> v, (n1, n2) -> n2));
|
||||||
|
}
|
||||||
|
StringBuilder affiliateChangeColumn;
|
||||||
|
// 如果上一个版本和现版本有一个为空,那么所有字段都修改
|
||||||
|
if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates == null) {
|
||||||
|
affiliateChangeColumn = new StringBuilder();
|
||||||
|
for (String column : affiliateColumns) {
|
||||||
|
|
||||||
|
affiliateChangeColumn.append(column).append(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (beforeCaseCaseAffiliates == null && afterCaseCaseAffiliates != null) {
|
||||||
|
affiliateChangeColumn = new StringBuilder();
|
||||||
|
for (String column : affiliateColumns) {
|
||||||
|
|
||||||
|
affiliateChangeColumn.append(column).append(",");
|
||||||
|
}
|
||||||
|
} else if (beforeCaseCaseAffiliates != null && afterCaseCaseAffiliates != null) {
|
||||||
|
for (CaseAffiliate afterCaseCaseAffiliate : afterCaseCaseAffiliates) {
|
||||||
|
// 找到相同身份类型的数据,进行对比
|
||||||
|
affiliateChangeColumn = new StringBuilder();
|
||||||
|
int identityType = afterCaseCaseAffiliate.getIdentityType();
|
||||||
|
if (beforeCaseCaseAffiliateMap != null && beforeCaseCaseAffiliateMap.containsKey(identityType)) {
|
||||||
|
CaseAffiliate beforeCaseCaseAffiliate = beforeCaseCaseAffiliateMap.get(identityType);
|
||||||
|
for (String column : affiliateColumns) {
|
||||||
|
String beforeValue = ObjectFieldUtils.getValue(beforeCaseCaseAffiliate, column);
|
||||||
|
String afterValue = ObjectFieldUtils.getValue(afterCaseCaseAffiliate, column);
|
||||||
|
if (StrUtil.isEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue)) {
|
||||||
|
affiliateChangeColumn.append(column).append(",");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isEmpty(afterValue)) {
|
||||||
|
affiliateChangeColumn.append(column).append(",");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (StrUtil.isNotEmpty(beforeValue) && StrUtil.isNotEmpty(afterValue) && !Objects.equals(beforeValue, afterValue)) {
|
||||||
|
affiliateChangeColumn.append(column).append(",");
|
||||||
|
continue;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for (String column : affiliateColumns) {
|
||||||
|
|
||||||
|
affiliateChangeColumn.append(column).append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
afterCaseCaseAffiliate.setChangeColumn(affiliateChangeColumn.toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
compareCaseVO.setChangeColumn(changeColumn.toString());
|
||||||
|
|
||||||
|
return AjaxResult.success(compareCaseVO);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同意撤销
|
* 同意撤销
|
||||||
* @param vo
|
* @param vo
|
||||||
@@ -161,14 +321,17 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode());
|
vo.setUpdateSubmitStatus(UpdateSubmitStatus.AGREE_REVOKE.getCode());
|
||||||
caseApplicationLogMapper.updateStatus(vo);
|
caseApplicationLogMapper.updateStatus(vo);
|
||||||
// 根据caseLogId查询相关人员表
|
// 根据caseLogId查询相关人员表
|
||||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
|
||||||
caseAffiliate.setCaseAppliLogId(caseApplicationLog.getCaseLogId());
|
|
||||||
List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliate);
|
|
||||||
caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
|
caseApplicationLog.setId(caseApplicationLog.getCaseAppliId());
|
||||||
// 更新案件主表
|
// 更新案件主表
|
||||||
caseApplicationMapper.updataCaseApplication(caseApplicationLog);
|
caseApplicationMapper.updataCaseApplication(caseApplicationLog);
|
||||||
|
|
||||||
// 更新相关人员主表
|
// 更新相关人员主表
|
||||||
caseAffiliateMapper.updataCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
if(CollectionUtil.isNotEmpty(affiliateLogList)){
|
||||||
|
for (CaseAffiliate caseAffiliate : affiliateLogList) {
|
||||||
|
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-4
@@ -1084,7 +1084,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
caseApplication.setVersion(maxVersion+1);
|
caseApplication.setVersion(maxVersion+1);
|
||||||
// 将修改提交状态改为未提交
|
// 将修改提交状态改为未提交
|
||||||
caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
// caseApplication.setUpdateSubmitStatus(UpdateSubmitStatus.UNCOMMITTED.getCode());
|
||||||
// 修改案件表的版本号
|
// 修改案件表的版本号
|
||||||
// caseApplicationMapper.updateVersionById(caseApplication.getId(),caseApplication.getVersion());
|
// caseApplicationMapper.updateVersionById(caseApplication.getId(),caseApplication.getVersion());
|
||||||
|
|
||||||
@@ -1264,9 +1264,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
caseApplicationselect.setCaseAttachList(caseAttachList);
|
caseApplicationselect.setCaseAttachList(caseAttachList);
|
||||||
CaseAffiliate caseAffiliateLog = new CaseAffiliate();
|
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationselect.getCaseLogId());
|
||||||
caseAffiliateLog.setCaseAppliLogId(caseApplicationselect.getCaseLogId());
|
|
||||||
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
|
|
||||||
if (caseAffiliatListeselect != null) {
|
if (caseAffiliatListeselect != null) {
|
||||||
// 查询组织机构
|
// 查询组织机构
|
||||||
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
|
|||||||
@@ -120,7 +120,7 @@
|
|||||||
|
|
||||||
application_organ_id= #{item.applicationOrganId},
|
application_organ_id= #{item.applicationOrganId},
|
||||||
application_organ_name= #{item.applicationOrganName},
|
application_organ_name= #{item.applicationOrganName},
|
||||||
name = #{name},
|
name = #{item.name},
|
||||||
identity_num = #{item.identityNum},
|
identity_num = #{item.identityNum},
|
||||||
contact_telphone = #{item.contactTelphone},
|
contact_telphone = #{item.contactTelphone},
|
||||||
contact_address = #{item.contactAddress},
|
contact_address = #{item.contactAddress},
|
||||||
|
|||||||
@@ -300,9 +300,15 @@
|
|||||||
FROM
|
FROM
|
||||||
case_application_log
|
case_application_log
|
||||||
WHERE case_appli_id = c.id
|
WHERE case_appli_id = c.id
|
||||||
and update_submit_status not IN ( 1, 2 ))
|
)
|
||||||
WHERE
|
WHERE
|
||||||
ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
|
ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
|
||||||
|
<if test="caseStatusList != null and caseStatusList.size() > 0">
|
||||||
|
and c.case_status in
|
||||||
|
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
||||||
|
#{caseStatus}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
<if test="deptIds != null and deptIds.size() > 0">
|
<if test="deptIds != null and deptIds.size() > 0">
|
||||||
and ca.application_organ_id in
|
and ca.application_organ_id in
|
||||||
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
<foreach item="item" collection="deptIds" open="(" separator="," close=")">
|
||||||
@@ -435,7 +441,7 @@
|
|||||||
FROM
|
FROM
|
||||||
case_application_log
|
case_application_log
|
||||||
WHERE
|
WHERE
|
||||||
update_submit_status IN ( 1, 2 ) and c.id = l.case_appli_id)
|
update_submit_status IN ( 1, 2 ) and c.id = case_appli_id)
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
) t1
|
) t1
|
||||||
@@ -742,14 +748,14 @@
|
|||||||
FROM
|
FROM
|
||||||
case_application c
|
case_application c
|
||||||
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
|
JOIN case_affiliate ca ON ca.case_appli_id = c.id AND ca.identity_type = 1
|
||||||
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,4) and l.version
|
JOIN case_application_log l on l.case_appli_id=c.id and l.update_submit_status not in(1,2) and l.version
|
||||||
= (
|
= (
|
||||||
SELECT
|
SELECT
|
||||||
max( version ) version
|
max( version ) version
|
||||||
FROM
|
FROM
|
||||||
case_application_log
|
case_application_log
|
||||||
WHERE case_appli_id = c.id
|
WHERE case_appli_id = c.id
|
||||||
and update_submit_status not IN ( 1, 4 ))
|
)
|
||||||
WHERE
|
WHERE
|
||||||
ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
|
ca.identity_type=1 and c.case_status in (1,5,11,15,16,17,31)
|
||||||
<if test="deptIds != null and deptIds.size() > 0">
|
<if test="deptIds != null and deptIds.size() > 0">
|
||||||
@@ -807,7 +813,7 @@
|
|||||||
FROM
|
FROM
|
||||||
case_application_log
|
case_application_log
|
||||||
WHERE
|
WHERE
|
||||||
update_submit_status IN ( 1, 4 ) and c.id = l.case_appli_id)
|
update_submit_status IN ( 1, 4 ) and c.id = case_appli_id)
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
|
|||||||
Reference in New Issue
Block a user