案件记录附件表
This commit is contained in:
@@ -18,6 +18,10 @@ public class CaseAttach {
|
|||||||
* 案件申请id
|
* 案件申请id
|
||||||
*/
|
*/
|
||||||
private Long caseAppliId;
|
private Long caseAppliId;
|
||||||
|
/**
|
||||||
|
* 案件记录id
|
||||||
|
*/
|
||||||
|
private Long caseAppliLogId;
|
||||||
/**
|
/**
|
||||||
* 附件名称
|
* 附件名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -35,4 +35,10 @@ public interface CaseAffiliateMapper {
|
|||||||
* @param affiliateLogList
|
* @param affiliateLogList
|
||||||
*/
|
*/
|
||||||
void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
|
void updateCaseAffiliateByCaseId(@Param("caseAppliId")Long caseAppliId,@Param("list") List<CaseAffiliate> affiliateLogList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件id删除
|
||||||
|
* @param caseId
|
||||||
|
*/
|
||||||
|
void deleteByCaseId(@Param("caseAppliId") Long caseId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.ruoyi.wisdomarbitrate.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface CaseAttachLogMapper {
|
||||||
|
int save(CaseAttach caseAttach);
|
||||||
|
|
||||||
|
List<CaseAttach> queryAnnexPathByCaseId(Long id);
|
||||||
|
|
||||||
|
List<CaseAttach> queryCaseAttachList(CaseApplication caseApplication);
|
||||||
|
|
||||||
|
|
||||||
|
int updateCaseAttach(CaseAttach caseAttach);
|
||||||
|
|
||||||
|
int updateCaseAttachBycaseid(CaseAttach caseAttach);
|
||||||
|
|
||||||
|
int deleteByFileIds(@Param("ids") List<Integer> fileIds);
|
||||||
|
|
||||||
|
List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
|
||||||
|
|
||||||
|
CaseAttach queryAnnexById(Integer annexId);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -25,4 +25,11 @@ public interface CaseAttachMapper {
|
|||||||
List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
|
List<CaseAttach> getCaseAttachByCaseIdAndType(CaseAttach caseAttach);
|
||||||
|
|
||||||
CaseAttach queryAnnexById(Integer annexId);
|
CaseAttach queryAnnexById(Integer annexId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据案件id和附件类型删除
|
||||||
|
* @param caseAppliId
|
||||||
|
* @param annexType
|
||||||
|
*/
|
||||||
|
void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-2
@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.ObjectFieldUtils;
|
|||||||
import com.ruoyi.common.utils.SmsUtils;
|
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.CaseAttach;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
|
import com.ruoyi.wisdomarbitrate.domain.SmsSendRecord;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
|
import com.ruoyi.wisdomarbitrate.domain.vo.CompareCaseVO;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
import com.ruoyi.wisdomarbitrate.domain.vo.UpdateSubmitVO;
|
||||||
@@ -42,6 +43,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CaseAffiliateMapper caseAffiliateMapper;
|
private CaseAffiliateMapper caseAffiliateMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private CaseAttachMapper caseAttachMapper;
|
||||||
|
@Autowired
|
||||||
|
private CaseAttachLogMapper caseAttachLogMapper;
|
||||||
|
@Autowired
|
||||||
private SmsRecordMapper smsRecordMapper;
|
private SmsRecordMapper smsRecordMapper;
|
||||||
@Override
|
@Override
|
||||||
public int insert(CaseApplication caseApplicationLog) {
|
public int insert(CaseApplication caseApplicationLog) {
|
||||||
@@ -123,8 +128,24 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
|
|
||||||
// 更新相关人员主表
|
// 更新相关人员主表
|
||||||
if(CollectionUtil.isNotEmpty(affiliateLogList)){
|
if(CollectionUtil.isNotEmpty(affiliateLogList)){
|
||||||
|
caseAffiliateMapper.deleteByCaseId(vo.getCaseId());
|
||||||
for (CaseAffiliate caseAffiliate : affiliateLogList) {
|
for (CaseAffiliate caseAffiliate : affiliateLogList) {
|
||||||
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
caseAffiliate.setCaseAppliId(vo.getCaseId());
|
||||||
|
|
||||||
|
}
|
||||||
|
caseAffiliateMapper.batchCaseAffiliate(affiliateLogList);
|
||||||
|
}
|
||||||
|
// // 根据caseLogId查询案件记录附件表
|
||||||
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
|
caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId());
|
||||||
|
caseApplication.setAnnexType(2);
|
||||||
|
List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
|
||||||
|
// 更新记录附件表
|
||||||
|
if(CollectionUtil.isNotEmpty(attachLogList)){
|
||||||
|
caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
|
||||||
|
for (CaseAttach caseAttach : attachLogList) {
|
||||||
|
caseAttach.setCaseAppliId(vo.getCaseId());
|
||||||
|
caseAttachMapper.save(caseAttach);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
||||||
@@ -330,13 +351,30 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
|
|||||||
// 根据caseLogId查询相关人员表
|
// 根据caseLogId查询相关人员表
|
||||||
List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
|
List<CaseAffiliate> affiliateLogList = caseAffiliateLogMapper.selectCaseAffiliate(caseApplicationLog.getCaseLogId());
|
||||||
|
|
||||||
|
|
||||||
// 更新案件主表
|
// 更新案件主表
|
||||||
caseApplicationMapper.updataCaseApplication(caseApplicationLog);
|
caseApplicationMapper.updataCaseApplication(caseApplicationLog);
|
||||||
|
|
||||||
// 更新相关人员主表
|
// 更新相关人员主表
|
||||||
if(CollectionUtil.isNotEmpty(affiliateLogList)){
|
if(CollectionUtil.isNotEmpty(affiliateLogList)){
|
||||||
|
caseAffiliateMapper.deleteByCaseId(vo.getCaseId());
|
||||||
for (CaseAffiliate caseAffiliate : affiliateLogList) {
|
for (CaseAffiliate caseAffiliate : affiliateLogList) {
|
||||||
caseAffiliateMapper.updataCaseAffiliate(caseAffiliate);
|
caseAffiliate.setCaseAppliId(vo.getCaseId());
|
||||||
|
|
||||||
|
}
|
||||||
|
caseAffiliateMapper.batchCaseAffiliate(affiliateLogList);
|
||||||
|
}
|
||||||
|
// // 根据caseLogId查询案件记录附件表
|
||||||
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
|
caseApplication.setCaseLogId(caseApplicationLog.getCaseLogId());
|
||||||
|
caseApplication.setAnnexType(2);
|
||||||
|
List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
|
||||||
|
// 更新记录附件表
|
||||||
|
if(CollectionUtil.isNotEmpty(attachLogList)){
|
||||||
|
caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
|
||||||
|
for (CaseAttach caseAttach : attachLogList) {
|
||||||
|
caseAttach.setCaseAppliId(vo.getCaseId());
|
||||||
|
caseAttachMapper.save(caseAttach);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
|
||||||
|
|||||||
+19
-5
@@ -116,6 +116,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
private CaseApplicationLogMapper caseApplicationLogMapper;
|
private CaseApplicationLogMapper caseApplicationLogMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private CaseAffiliateLogMapper caseAffiliateLogMapper;
|
private CaseAffiliateLogMapper caseAffiliateLogMapper;
|
||||||
|
@Autowired
|
||||||
|
private CaseAttachLogMapper caseAttachLogMapper;
|
||||||
|
|
||||||
// 手机号正则
|
// 手机号正则
|
||||||
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
private static final Pattern TELEPHONE_REGX = Pattern.compile("^1(3\\d|4[5-9]|5[0-35-9]|6[2567]|7[0-8]|8\\d|9[0-35-9])\\d{8}$");
|
||||||
@@ -1072,7 +1074,9 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
List<CaseAttach> caseAttachList = caseApplication.getCaseAttachList();
|
||||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
// 立案申请状态直接修改主表信息
|
||||||
|
if (caseAttachList != null && caseAttachList.size() > 0
|
||||||
|
&& caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
|
||||||
for (CaseAttach caseAttach : caseAttachList) {
|
for (CaseAttach caseAttach : caseAttachList) {
|
||||||
caseAttach.setCaseAppliId(caseApplication.getId());
|
caseAttach.setCaseAppliId(caseApplication.getId());
|
||||||
caseAttachMapper.updateCaseAttach(caseAttach);
|
caseAttachMapper.updateCaseAttach(caseAttach);
|
||||||
@@ -1094,10 +1098,20 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
|
|||||||
ThreadPoolUtil.execute(() -> {
|
ThreadPoolUtil.execute(() -> {
|
||||||
caseApplication.setCaseAppliId(caseApplication.getId());
|
caseApplication.setCaseAppliId(caseApplication.getId());
|
||||||
int insertRow = caseApplicationLogMapper.insert(caseApplication);
|
int insertRow = caseApplicationLogMapper.insert(caseApplication);
|
||||||
if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
|
if (insertRow != 0 ) {
|
||||||
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
if( CollectionUtil.isNotEmpty(caseAffiliates)) {
|
||||||
// 插入案件日志人员相关表
|
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
|
||||||
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
// 插入案件日志人员相关表
|
||||||
|
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
|
||||||
|
}
|
||||||
|
if(CollectionUtil.isNotEmpty(caseAttachList)) {
|
||||||
|
// 插入日志附件表
|
||||||
|
for (CaseAttach caseAttach : caseAttachList) {
|
||||||
|
caseAttach.setCaseAppliLogId(caseApplication.getId());
|
||||||
|
caseAttachLogMapper.updateCaseAttach(caseAttach);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -150,6 +150,9 @@
|
|||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteByCaseId">
|
||||||
|
delete from case_affiliate where case_appli_id = #{caseAppliId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAttachLogMapper">
|
||||||
|
<resultMap type="CaseAttach" id="CaseAttachResult">
|
||||||
|
<id property="annexId" column="annex_id" />
|
||||||
|
<result property="caseAppliId" column="case_appli_id" />
|
||||||
|
<result property="annexName" column="annex_name" />
|
||||||
|
<result property="annexPath" column="annex_path" />
|
||||||
|
<result property="annexType" column="annex_type" />
|
||||||
|
<result property="note" column="note" />
|
||||||
|
<result property="userId" column="use_id" />
|
||||||
|
<result property="userName" column="use_account" />
|
||||||
|
<result property="sealStatus" column="seal_status" />
|
||||||
|
<result property="caseAppliLogId" column="case_appli_log_id" />
|
||||||
|
</resultMap>
|
||||||
|
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
|
||||||
|
INSERT INTO case_attach_log (case_appli_log_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
|
||||||
|
VALUES (#{caseAppliLogId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
|
||||||
|
</insert>
|
||||||
|
<delete id="deleteByFileIds">
|
||||||
|
delete from case_attach_log
|
||||||
|
where annex_id in
|
||||||
|
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||||
|
select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||||
|
from case_attach_log
|
||||||
|
where case_appli_log_id =#{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getCaseAttachByCaseIdAndType" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||||
|
select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||||
|
from case_attach_log
|
||||||
|
<where>
|
||||||
|
<if test="caseAppliLogId != null ">
|
||||||
|
AND case_appli_log_id = #{caseAppliLogId}
|
||||||
|
</if>
|
||||||
|
<if test="annexType != null ">
|
||||||
|
AND annex_type = #{annexType}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="queryCaseAttachList" resultMap="CaseAttachResult">
|
||||||
|
select annex_id,case_appli_log_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||||
|
from case_attach_log
|
||||||
|
<where>
|
||||||
|
<if test="caseLogId != null ">
|
||||||
|
AND case_appli_log_id = #{caseLogId}
|
||||||
|
</if>
|
||||||
|
<if test="annexType != null ">
|
||||||
|
AND annex_type = #{annexType}
|
||||||
|
</if>
|
||||||
|
<if test="annexTypeList != null and annexTypeList.size() > 0">
|
||||||
|
and annex_type in
|
||||||
|
<foreach item="annexType" collection="annexTypeList" open="(" separator="," close=")">
|
||||||
|
#{annexType}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="queryAnnexById" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||||
|
select case_appli_log_id caseAppliLogId,annex_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||||
|
from case_attach_log
|
||||||
|
<where>
|
||||||
|
<if test="annexId != null ">
|
||||||
|
AND annex_id = #{annexId}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateCaseAttach" parameterType="CaseAttach">
|
||||||
|
update case_attach_log
|
||||||
|
set
|
||||||
|
case_appli_log_id= #{caseAppliLogId}
|
||||||
|
where annex_id = #{annexId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateCaseAttachBycaseid" parameterType="CaseAttach" >
|
||||||
|
update case_attach_log
|
||||||
|
<set>
|
||||||
|
<if test="annexName != null and annexName != ''">annex_name = #{annexName},</if>
|
||||||
|
<if test="annexPath != null and annexPath != ''">annex_path = #{annexPath}</if>
|
||||||
|
</set>
|
||||||
|
<where>
|
||||||
|
<if test="caseAppliId != null ">
|
||||||
|
AND case_appli_log_id = #{caseAppliLogId}
|
||||||
|
</if>
|
||||||
|
<if test="annexType != null ">
|
||||||
|
AND annex_type = #{annexType}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -25,6 +25,11 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
<delete id="deleteByCasedIdAndType">
|
||||||
|
delete from case_attach
|
||||||
|
where case_appli_id = #{caseAppliId}
|
||||||
|
and annex_type = #{annexType}
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||||
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||||
|
|||||||
Reference in New Issue
Block a user