Merge branch 'wq' of SH-Arbitrate/Arbitrate-Backend into dev

This commit was merged in pull request #239.
This commit is contained in:
2023-11-24 19:23:06 +08:00
committed by Gitea
10 changed files with 116 additions and 38 deletions
@@ -50,5 +50,9 @@ public class CaseAttach {
* 印章状态(0未启用,1已启用)
*/
private Integer sealStatus;
/**
* 是否是证据上传,0-否,1-是
*/
private Integer isBatchUpload;
}
@@ -39,6 +39,10 @@ public class ReservedConference {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scheduleEndTime;
/**
* 是否超过5分钟
*/
private Boolean isBeforeFiveMinutes;
public ReservedConference() {
@@ -27,9 +27,9 @@ public interface CaseAttachMapper {
CaseAttach queryAnnexById(Integer annexId);
/**
* 根据案件id和附件类型删除
* 根据案件id和附件类型删除和上传类型
* @param caseAppliId
* @param annexType
*/
void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType);
void deleteByCasedIdAndType(@Param("caseAppliId")Long caseAppliId,@Param("annexType") int annexType,@Param("isBatchUpload") int isBatchUpload);
}
@@ -146,10 +146,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
// 更新记录附件表
if(CollectionUtil.isNotEmpty(attachLogList)){
caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
// caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
for (CaseAttach caseAttach : attachLogList) {
caseAttach.setCaseAppliId(vo.getCaseId());
caseAttachMapper.save(caseAttach);
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
@@ -202,7 +202,6 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
return AjaxResult.success();
}
// todo 给申请人发送短信
SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
request.setTemplateId("1996949");
request.setPhone(caseAffiliate.getContactTelphone());
@@ -337,12 +336,12 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
}
boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(beforeCase.getCaseAttachList());
boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList());
boolean notEmptyFlag = CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isEmpty(afterCase.getCaseAttachList());
boolean emptyFlag = CollectionUtil.isEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList());
// 对比附件
if(notEmptyFlag || emptyFlag){
changeColumn.append("fileColumn");
}else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList())){
}else if(CollectionUtil.isNotEmpty(beforeCase.getCaseAttachList()) && CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
if(beforeCase.getCaseAttachList().size()!=afterCase.getCaseAttachList().size()){
changeColumn.append("fileColumn");
}else {
@@ -360,6 +359,25 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
}
compareCaseVO.setChangeColumn(changeColumn.toString());
if(CollectionUtil.isNotEmpty(afterCase.getCaseAttachList())){
List<CaseAttach> caseAttachList = afterCase.getCaseAttachList();
for (CaseAttach attach : caseAttachList) {
String annexName = attach.getAnnexName();
String prefix = "/profile";
int startIndex = annexName.indexOf(prefix);
startIndex += prefix.length();
String annexPath = "/uploadPath" + annexName.substring(startIndex);
attach.setAnnexPath(annexPath);
int startIndexnew = annexName.lastIndexOf("/");
if (startIndexnew != -1) {
String annexNamenew = annexName.substring(startIndexnew + 1);
attach.setAnnexName(annexNamenew);
}
}
afterCase.setCaseAttachList(caseAttachList);
}
return AjaxResult.success(compareCaseVO);
}
@@ -406,10 +424,10 @@ public class CaseApplicationLogServiceImpl implements CaseApplicationLogService
List<CaseAttach> attachLogList = caseAttachLogMapper.queryCaseAttachList(caseApplication);
// 更新记录附件表
if(CollectionUtil.isNotEmpty(attachLogList)){
caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2);
// caseAttachMapper.deleteByCasedIdAndType(vo.getCaseId(), 2,0);
for (CaseAttach caseAttach : attachLogList) {
caseAttach.setCaseAppliId(vo.getCaseId());
caseAttachMapper.save(caseAttach);
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
// caseAffiliateMapper.updateCaseAffiliateByCaseId(caseApplicationLog.getCaseAppliId(), affiliateLogList);
@@ -969,7 +969,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
if (insertRow != 0 && CollectionUtil.isNotEmpty(caseAffiliates)) {
caseAffiliates.forEach(caseAffiliate -> caseAffiliate.setCaseAppliLogId(caseApplication.getId()));
// 插入案件日志人员相关表
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
if(CollectionUtil.isNotEmpty(caseAttachList)) {
List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
// 插入日志附件表
if(CollectionUtil.isNotEmpty(filterList)) {
for (CaseAttach caseAttach : filterList) {
// 查询附件表
CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
attach.setCaseAppliLogId(caseApplication.getId());
caseAttachLogMapper.save(attach);
}
}
} caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
}
});
@@ -1077,11 +1089,22 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
// 立案申请状态直接修改主表信息
if (caseAttachList != null && caseAttachList.size() > 0
&& caseApplication.getCaseStatus()!=null && caseApplication.getCaseStatus().equals(CaseApplicationConstants.CASE_APPLICATION)) {
for (CaseAttach caseAttach : caseAttachList) {
caseAttach.setCaseAppliId(caseApplication.getId());
caseAttachMapper.updateCaseAttach(caseAttach);
List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(filterList)){
// 先删除2的附件在新增
// caseAttachMapper.deleteByCasedIdAndType(caseApplication.getId(),2,0);
// for (CaseAttach caseAttach : filterList) {
// caseAttach.setCaseAppliId(caseApplication.getId());
// caseAttachMapper.save(caseAttach);
// }
for (CaseAttach caseAttach : caseAttachList) {
caseAttach.setCaseAppliId(caseApplication.getId());
caseAttachMapper.updateCaseAttach(caseAttach);
}
}
}
// 根据案件id查询最新版本号
Integer maxVersion = caseApplicationLogMapper.selectMaxVersionByCaseId(caseApplication.getId());
@@ -1106,13 +1129,16 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
caseAffiliateLogMapper.batchCaseAffiliate(caseAffiliates);
}
if(CollectionUtil.isNotEmpty(caseAttachList)) {
List<CaseAttach> filterList = caseAttachList.stream().filter(c -> c.getAnnexType().equals(2)).collect(Collectors.toList());
// 插入日志附件表
for (CaseAttach caseAttach : caseAttachList) {
// 查询附件表
CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
attach.setCaseAppliLogId(caseApplication.getId());
caseAttachLogMapper.save(attach);
}
if(CollectionUtil.isNotEmpty(filterList)) {
for (CaseAttach caseAttach : filterList) {
// 查询附件表
CaseAttach attach = caseAttachMapper.queryAnnexById(caseAttach.getAnnexId());
attach.setCaseAppliLogId(caseApplication.getId());
caseAttachLogMapper.save(attach);
}
}
}
}
@@ -2731,8 +2757,8 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
public long createRoomId(Long caseId) {
long roomId = generateRoomId();
// 新增预约会议表
// ReservedConference conference = new ReservedConference(caseId, roomId,
// null, null,0);
// ReservedConference conference = new ReservedConference(caseId, SecurityUtils.getUserId(),roomId,
// null, null);
// reservedConferenceMapper.insert(conference);
// 绑定案件与房间号
caseApplicationMapper.bindCaseId(caseId, String.valueOf(roomId));
@@ -2766,6 +2792,19 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
@Transactional
public List<ReservedConference> reserveConferenceList(Long caseId) {
List<ReservedConference> reservedConferences = reservedConferenceMapper.selectListByCaseId(caseId);
if(CollectionUtil.isNotEmpty(reservedConferences)){
for (ReservedConference reservedConference : reservedConferences) {
Date startTime = reservedConference.getScheduleStartTime();
if(null != startTime){
long beforeMinutes = startTime.getTime() - 1000 * 60 * 5;
if(System.currentTimeMillis()<beforeMinutes ){
reservedConference.setIsBeforeFiveMinutes(true);
}else {
reservedConference.setIsBeforeFiveMinutes(false);
}
}
}
}
return reservedConferences;
}
@@ -2782,7 +2821,6 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService {
return success( reservedConferenceMapper.deleteByRoomId(roomId));
}
}
@@ -125,7 +125,14 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
}
CaseAttach caseAttachselect = new CaseAttach();
caseAttachselect.setAnnexId(caseAttach.getAnnexId());
caseAttachselect.setAnnexName(caseAttach.getAnnexName());
String annexName = caseAttach.getAnnexName();
if(StrUtil.isNotEmpty(annexName)) {
int startIndexnew = annexName.lastIndexOf("/");
if (startIndexnew != -1) {
String annexNamenew = annexName.substring(startIndexnew + 1);
caseAttach.setAnnexName(annexNamenew);
}
}
caseAttachselect.setAnnexType(caseAttach.getAnnexType());
return AjaxResult.success("上传成功", caseAttachselect);
} catch (IOException e) {
@@ -246,6 +253,7 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
.annexType(annexType)
.userId(userId)
.userName(userName)
.isBatchUpload(1)
.build();
int count = caseAttachMapper.save(caseAttach);
if (count > 0 && annexType != null && annexType != 8) {
@@ -365,7 +365,9 @@ public class VideoServiceImpl implements VideoService {
staticAndMksDir = Paths.get(absPath).toFile().toString();
long downloadFile = HttpUtil.downloadFile(fileUrl, staticAndMksDir);
if(downloadFile>0) {
log.info("下载成功roomId"+roomId);
Long caseId = caseApplicationMapper.selectCaseIdByRoomId(roomId);
log.info("下载成功caseId"+caseId);
String annexName = getPathFileName(RuoYiConfig.getVideoUploadPath(), fileName);
// 存入数据库
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(caseId)
@@ -374,6 +376,7 @@ public class VideoServiceImpl implements VideoService {
.annexType(9)
.build();
caseAttachMapper.save(caseAttach);
log.info("保存附件号成功");
return annexName;
}
}
@@ -162,7 +162,7 @@
<!--申请人案件-->
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 ,c.case_subject_amount ,c.register_date ,c.arbitrat_method ,
CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理'
ELSE '无审理方式'
END arbitratMethodName,
@@ -176,10 +176,10 @@
when 31 then '待修改开庭时间'
ELSE '无案件状态'
END caseStatusName,
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.fee_payable ,
c.begin_video_date ,c.online_video_person ,l.contract_number ,c.create_by ,c.create_time ,
c.hear_date ,c.arbitrat_claims ,
c.loan_start_date ,c.loan_end_date ,c.claim_princi_owed ,c.claim_interest_owed ,c.claim_liquid_damag
,c.fee_payable ,
c.begin_video_date ,c.online_video_person ,c.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
as
applicantName,
@@ -1468,9 +1468,9 @@
update case_application set lock_status=#{lockStatus} where id = #{id}
</update>
<update id="bindCaseId">
<!-- update case_application set room_id=#{roomId} where id = #{caseId} -->
update case_application set room_id=#{roomId} where id = #{caseId}
update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId}
<!-- update case_application set room_id= CONCAT(room_id,',',#{roomId}) where id =#{caseId} -->
</update>
<update id="updateVersionById">
update case_application set version = #{version} where id = #{id}
@@ -1585,7 +1585,7 @@ order by c.create_time desc limit 1
</select>
<select id="selectCaseIdByRoomId" resultType="java.lang.Long">
select id
from case_application where room_id like concat('%', #{roomId}, '%') limit 1
from case_application where room_id=#{roomId} limit 1
</select>
<select id="selectMaxRoomId" resultType="java.lang.Long">
@@ -16,8 +16,8 @@
<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 INTO case_attach_log (case_appli_log_id, annex_id,annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
VALUES (#{caseAppliLogId},#{annexId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
</insert>
<delete id="deleteByFileIds">
delete from case_attach_log
@@ -28,7 +28,7 @@
</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
select *
from case_attach_log
where case_appli_log_id =#{id}
</select>
@@ -65,7 +65,7 @@
</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
select *
from case_attach_log
<where>
<if test="annexId != null ">
@@ -15,8 +15,8 @@
<result property="sealStatus" column="seal_status" />
</resultMap>
<insert id="save" useGeneratedKeys="true" keyProperty="annexId">
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status)
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus})
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account,seal_status,is_batch_upload)
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName},#{sealStatus},#{isBatchUpload})
</insert>
<delete id="deleteByFileIds">
delete from case_attach
@@ -29,6 +29,9 @@
delete from case_attach
where case_appli_id = #{caseAppliId}
and annex_type = #{annexType}
<if test="isBatchUpload != null ">
AND is_batch_upload = #{isBatchUpload}
</if>
</delete>
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">