Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into hjb
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+23
-6
@@ -188,6 +188,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseApplication.setDeptIds(deptIds);
|
caseApplication.setDeptIds(deptIds);
|
||||||
}
|
}
|
||||||
if ("申请人".equals(role.getRoleName())) {
|
if ("申请人".equals(role.getRoleName())) {
|
||||||
|
caseApplication.setIsOtherRole(1);
|
||||||
// 查询有关的用户部门
|
// 查询有关的用户部门
|
||||||
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
||||||
}
|
}
|
||||||
@@ -263,6 +264,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
caseApplication.setDeptIds(deptIds);
|
caseApplication.setDeptIds(deptIds);
|
||||||
}
|
}
|
||||||
if ("申请人".equals(role.getRoleName())) {
|
if ("申请人".equals(role.getRoleName())) {
|
||||||
|
caseApplication.setIsOtherRole(1);
|
||||||
// 查询角色有关的用户部门
|
// 查询角色有关的用户部门
|
||||||
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
caseApplication.setApplicationOrganId(String.valueOf(sysUser.getDeptId()));
|
||||||
}
|
}
|
||||||
@@ -1084,7 +1086,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());
|
||||||
|
|
||||||
@@ -1233,7 +1235,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CaseApplication selectCaseApplication(CaseApplication caseApplication) {
|
public CaseApplication selectCaseApplication(CaseApplication caseApplication) {
|
||||||
CaseApplication caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion());
|
CaseApplication caseApplicationselect=new CaseApplication();
|
||||||
|
if(caseApplication.getVersion()!=null) {
|
||||||
|
caseApplicationselect=caseApplicationLogMapper.selectByCaseIdAndVersion(caseApplication.getId(),caseApplication.getVersion());
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
caseApplicationselect.setId(caseApplication.getId());
|
caseApplicationselect.setId(caseApplication.getId());
|
||||||
|
|
||||||
|
|
||||||
@@ -1264,9 +1275,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
caseApplicationselect.setCaseAttachList(caseAttachList);
|
caseApplicationselect.setCaseAttachList(caseAttachList);
|
||||||
CaseAffiliate caseAffiliateLog = new CaseAffiliate();
|
List<CaseAffiliate> caseAffiliatListeselect;
|
||||||
caseAffiliateLog.setCaseAppliLogId(caseApplicationselect.getCaseLogId());
|
if(caseApplication.getVersion()!=null) {
|
||||||
List<CaseAffiliate> caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseAffiliateLog);
|
caseAffiliatListeselect = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationselect.getCaseLogId());
|
||||||
|
|
||||||
|
}else {
|
||||||
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||||
|
caseAffiliate.setCaseAppliId(caseApplication.getId());
|
||||||
|
caseAffiliatListeselect = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||||
|
}
|
||||||
|
|
||||||
if (caseAffiliatListeselect != null) {
|
if (caseAffiliatListeselect != null) {
|
||||||
// 查询组织机构
|
// 查询组织机构
|
||||||
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(new SysDept());
|
||||||
@@ -1289,7 +1307,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
;
|
;
|
||||||
} else if (identityType == 2) {
|
} else if (identityType == 2) {
|
||||||
respondentName.append(caseAffiliateselect.getName()).append(",");
|
respondentName.append(caseAffiliateselect.getName()).append(",");
|
||||||
;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
caseApplicationselect.setApplicantName(applicantName.toString());
|
caseApplicationselect.setApplicantName(applicantName.toString());
|
||||||
|
|||||||
@@ -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},
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
|
t1.filearbitra_url,t1.lock_status,t1.version,t1.updateSubmitStatus
|
||||||
from(
|
from(
|
||||||
<trim suffixOverrides="union">
|
<trim suffixOverrides="union">
|
||||||
<!--被申请人,仲裁员,部门长,财务,代理人案件-->
|
<!--申请人,被申请人,仲裁员,部门长,财务,代理人案件-->
|
||||||
<if test="isOtherRole!=null and isOtherRole==1">
|
<if test="isOtherRole!=null and isOtherRole==1">
|
||||||
|
|
||||||
select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
|
select t.id,t.caseLogId,t.case_num ,t.case_subject_amount ,t.register_date ,t.arbitrat_method,
|
||||||
@@ -125,7 +125,13 @@
|
|||||||
and
|
and
|
||||||
instr (t.arbitrator_id,#{userId})>0)
|
instr (t.arbitrator_id,#{userId})>0)
|
||||||
</if>
|
</if>
|
||||||
|
<!--申请人-->
|
||||||
|
<if test="applicationOrganId != null and applicationOrganId != ''">
|
||||||
|
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
|
||||||
|
<!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
|
||||||
|
and (t.case_status <= 10 or t.case_status=31))
|
||||||
|
|
||||||
|
</if>
|
||||||
<!--部门长-->
|
<!--部门长-->
|
||||||
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
||||||
or (t.identity_type=1 and t.case_status in
|
or (t.identity_type=1 and t.case_status in
|
||||||
@@ -152,61 +158,61 @@
|
|||||||
</where>
|
</where>
|
||||||
union
|
union
|
||||||
</if>
|
</if>
|
||||||
<if test="applicationOrganId != null and applicationOrganId != ''">
|
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
||||||
|
|
||||||
|
|
||||||
<!--申请人案件-->
|
<!-- <!–申请人案件–>-->
|
||||||
select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,
|
<!-- select c.id ,l.id AS caseLogId,c.case_num ,l.case_subject_amount ,c.register_date ,c.arbitrat_method ,-->
|
||||||
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
|
<!-- CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'-->
|
||||||
ELSE '无审理方式'
|
<!-- ELSE '无审理方式'-->
|
||||||
END arbitratMethodName,
|
<!-- END arbitratMethodName,-->
|
||||||
c.case_status ,
|
<!-- c.case_status ,-->
|
||||||
CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费'
|
<!-- CASE c.case_status 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 '待核验仲裁文书'-->
|
||||||
when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'
|
<!-- when 12 then '待审核仲裁文书' when 13 then '待仲裁文书签名' when 14 then '待仲裁文书用印'-->
|
||||||
when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'
|
<!-- when 15 then '待仲裁文书送达' when 16 then '待案件归档' when 17 then '已归档'-->
|
||||||
when 31 then '待修改开庭时间'
|
<!-- when 31 then '待修改开庭时间'-->
|
||||||
ELSE '无案件状态'
|
<!-- ELSE '无案件状态'-->
|
||||||
END caseStatusName,
|
<!-- END caseStatusName,-->
|
||||||
c.hear_date ,l.arbitrat_claims ,
|
<!-- c.hear_date ,l.arbitrat_claims ,-->
|
||||||
l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag
|
<!-- l.loan_start_date ,l.loan_end_date ,l.claim_princi_owed ,l.claim_interest_owed ,l.claim_liquid_damag-->
|
||||||
,l.fee_payable ,
|
<!-- ,l.fee_payable ,-->
|
||||||
c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,
|
<!-- c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,-->
|
||||||
c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name
|
<!-- c.update_by ,c.update_time , c.arbitrator_name,ca.name,ca.application_organ_id,ca.application_organ_name-->
|
||||||
as
|
<!-- as-->
|
||||||
applicantName,
|
<!-- applicantName,-->
|
||||||
c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus
|
<!-- c.arbitrator_id,ca.identity_num , ca.identity_type,c.filearbitra_url,c.lock_status,l.version,l.update_submit_status as updateSubmitStatus-->
|
||||||
from case_application c
|
<!-- from case_application c-->
|
||||||
JOIN case_application_log l ON c.id = l.case_appli_id
|
<!-- JOIN case_application_log l ON c.id = l.case_appli_id-->
|
||||||
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
|
<!-- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1-->
|
||||||
|
|
||||||
<where>
|
<!-- <where>-->
|
||||||
(c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1
|
<!-- (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1-->
|
||||||
and l.version=(SELECT
|
<!-- and l.version=(SELECT-->
|
||||||
max( version ) version
|
<!-- max( version ) version-->
|
||||||
FROM
|
<!-- FROM-->
|
||||||
case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
|
<!-- case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))-->
|
||||||
<if test="applicationOrganId != null and applicationOrganId != ''">
|
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
||||||
AND ca.application_organ_id = #{applicationOrganId}
|
<!-- AND ca.application_organ_id = #{applicationOrganId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="caseStatus != null">
|
<!-- <if test="caseStatus != null">-->
|
||||||
AND c.case_status = #{caseStatus}
|
<!-- AND c.case_status = #{caseStatus}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="caseNum != null and caseNum != ''">
|
<!-- <if test="caseNum != null and caseNum != ''">-->
|
||||||
AND c.case_num = #{caseNum}
|
<!-- AND c.case_num = #{caseNum}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="nameId != null and nameId != ''">
|
<!-- <if test="nameId != null and nameId != ''">-->
|
||||||
AND ca.application_organ_id=#{nameId}
|
<!-- AND ca.application_organ_id=#{nameId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="lockStatus != null">
|
<!-- <if test="lockStatus != null">-->
|
||||||
AND c.lock_status = #{lockStatus}
|
<!-- AND c.lock_status = #{lockStatus}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
</where>
|
<!-- </where>-->
|
||||||
union
|
<!-- union-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<!--秘书案件-->
|
<!--秘书案件-->
|
||||||
<if test="deptIds != null and deptIds.size() > 0">
|
<if test="deptIds != null and deptIds.size() > 0">
|
||||||
|
|
||||||
@@ -300,9 +306,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 +447,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
|
||||||
@@ -667,13 +679,13 @@
|
|||||||
<!-- </foreach> )-->
|
<!-- </foreach> )-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
<!--申请人-->
|
<!--申请人-->
|
||||||
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
<if test="applicationOrganId != null and applicationOrganId != ''">
|
||||||
<!-- or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1-->
|
or ( t.application_organ_id = #{applicationOrganId} AND t.identity_type=1
|
||||||
<!-- <!–暂时改为可以查询到生成裁决书之前所有的案件状态–>-->
|
<!--暂时改为可以查询到生成裁决书之前所有的案件状态-->
|
||||||
<!-- and (t.case_status <= 10 or t.case_status=31))-->
|
and (t.case_status <= 10 or t.case_status=31))
|
||||||
<!-- <!– and t.case_status in (0,2,17))–>-->
|
<!-- and t.case_status in (0,2,17))-->
|
||||||
|
|
||||||
<!-- </if>-->
|
</if>
|
||||||
<!--部门长-->
|
<!--部门长-->
|
||||||
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
<if test="deptHeadStatus != null and deptHeadStatus.size() > 0">
|
||||||
or (t.identity_type=1 and t.case_status in
|
or (t.identity_type=1 and t.case_status in
|
||||||
@@ -699,40 +711,40 @@
|
|||||||
</where>
|
</where>
|
||||||
union
|
union
|
||||||
</if>
|
</if>
|
||||||
<if test="applicationOrganId != null and applicationOrganId != ''">
|
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
||||||
<!--申请人案件-->
|
<!-- <!–申请人案件–>-->
|
||||||
|
|
||||||
select l.case_appli_id id ,
|
<!-- select l.case_appli_id id ,-->
|
||||||
c.case_status,ca.application_organ_id,
|
<!-- c.case_status,ca.application_organ_id,-->
|
||||||
c.arbitrator_id,ca.identity_num , ca.identity_type
|
<!-- c.arbitrator_id,ca.identity_num , ca.identity_type-->
|
||||||
from case_application c
|
<!-- from case_application c-->
|
||||||
JOIN case_application_log l ON c.id = l.case_appli_id
|
<!-- JOIN case_application_log l ON c.id = l.case_appli_id-->
|
||||||
JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1
|
<!-- JOIN case_affiliate_log ca ON ca.case_appli_log_id = l.id AND ca.identity_type = 1-->
|
||||||
<where>
|
<!-- <where>-->
|
||||||
(c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1
|
<!-- (c.case_status <= 10 or c.case_status=31) AND ca.identity_type=1-->
|
||||||
and l.version=(SELECT
|
<!-- and l.version=(SELECT-->
|
||||||
max( version ) version
|
<!-- max( version ) version-->
|
||||||
FROM
|
<!-- FROM-->
|
||||||
case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))
|
<!-- case_application_log where case_appli_id = c.id and update_submit_status not in(4,5))-->
|
||||||
<if test="applicationOrganId != null and applicationOrganId != ''">
|
<!-- <if test="applicationOrganId != null and applicationOrganId != ''">-->
|
||||||
AND ca.application_organ_id = #{applicationOrganId}
|
<!-- AND ca.application_organ_id = #{applicationOrganId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="caseStatus != null">
|
<!-- <if test="caseStatus != null">-->
|
||||||
AND c.case_status = #{caseStatus}
|
<!-- AND c.case_status = #{caseStatus}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="caseNum != null and caseNum != ''">
|
<!-- <if test="caseNum != null and caseNum != ''">-->
|
||||||
AND c.case_num = #{caseNum}
|
<!-- AND c.case_num = #{caseNum}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<if test="nameId != null and nameId != ''">
|
<!-- <if test="nameId != null and nameId != ''">-->
|
||||||
AND ca.application_organ_id=#{nameId}
|
<!-- AND ca.application_organ_id=#{nameId}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
|
|
||||||
<if test="lockStatus != null">
|
<!-- <if test="lockStatus != null">-->
|
||||||
AND c.lock_status = #{lockStatus}
|
<!-- AND c.lock_status = #{lockStatus}-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
</where>
|
<!-- </where>-->
|
||||||
union
|
<!-- union-->
|
||||||
</if>
|
<!-- </if>-->
|
||||||
<!--秘书案件-->
|
<!--秘书案件-->
|
||||||
<if test="deptIds != null and deptIds.size() > 0">
|
<if test="deptIds != null and deptIds.size() > 0">
|
||||||
|
|
||||||
@@ -742,14 +754,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 +819,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