确认证据,短信功能
This commit is contained in:
+16
-30
@@ -7,6 +7,7 @@ import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -26,31 +27,16 @@ public class CaseEvidenceController extends BaseController {
|
||||
this.caseEvidenceService = caseEvidenceService;
|
||||
}
|
||||
|
||||
/* *//**
|
||||
* 查询被申请人案件列表
|
||||
*
|
||||
* @param identityNum 身份证号
|
||||
* @return
|
||||
*//*
|
||||
@GetMapping("/respondent")
|
||||
public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum) {
|
||||
startPage();
|
||||
List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByRespondent(identityNum);
|
||||
if (list != null) {
|
||||
return getDataTable(list);
|
||||
}
|
||||
return getDataTable(new ArrayList<>());
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 被申请人根据案件id查询案件详情
|
||||
* 根据案件id查询案件详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getCaseDetailsById(@PathVariable Long id) {
|
||||
return caseEvidenceService.getCaseDetailsById(id);
|
||||
String username = this.getUsername();
|
||||
return caseEvidenceService.getCaseDetailsById(id,username);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -63,19 +49,11 @@ public class CaseEvidenceController extends BaseController {
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
|
||||
return caseEvidenceService.uploadEvidence(file, annexType, id);
|
||||
String username = this.getUsername();
|
||||
Long userId = this.getUserId();
|
||||
return caseEvidenceService.uploadEvidence(file, annexType, id,username,userId);
|
||||
}
|
||||
|
||||
/* @GetMapping("/applicant")
|
||||
public TableDataInfo getCaseListByApplicant(@RequestParam String identityNum) {
|
||||
startPage();
|
||||
List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByApplicant(identityNum);
|
||||
if (list != null) {
|
||||
return getDataTable(list);
|
||||
}
|
||||
return getDataTable(new ArrayList<>());
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 查询当前用户案件列表
|
||||
* @param identityNum
|
||||
@@ -91,5 +69,13 @@ public class CaseEvidenceController extends BaseController {
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 证据确认
|
||||
* @param caseApplication 案件对象
|
||||
* @return 统一返回结果
|
||||
*/
|
||||
@PutMapping("/confirm")
|
||||
public AjaxResult evidenceConfirmation(@Validated @RequestBody CaseApplication caseApplication){
|
||||
return caseEvidenceService.evidenceConfirmation(caseApplication);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,9 +77,9 @@ public class SmsUtils {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SendSmsRequest sendSmsRequest = new SendSmsRequest();
|
||||
sendSmsRequest.setPhone("15029925289");
|
||||
sendSmsRequest.setTemplateId("1927509");
|
||||
sendSmsRequest.setTemplateParamSet(new String[]{"用户"});
|
||||
sendSmsRequest.setPhone("18792613219");
|
||||
sendSmsRequest.setTemplateId("1928003");
|
||||
sendSmsRequest.setTemplateParamSet(new String[]{"xxx","仲裁","编号"});
|
||||
SmsUtils.sendSms(sendSmsRequest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,5 +34,13 @@ public class CaseAttach {
|
||||
* 备注
|
||||
*/
|
||||
private String note;
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户账户
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
}
|
||||
|
||||
+5
-5
@@ -2,20 +2,20 @@ package com.ruoyi.wisdomarbitrate.service;
|
||||
|
||||
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICaseEvidenceService {
|
||||
// List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
|
||||
|
||||
AjaxResult getCaseDetailsById(Long id);
|
||||
AjaxResult getCaseDetailsById(Long id,String userName);
|
||||
|
||||
AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id);
|
||||
|
||||
//List<CaseEvidenceVO> getCaseListByApplicant(String identityNum);
|
||||
AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId);
|
||||
|
||||
List<CaseEvidenceVO> getCaseListAll(String identityNum);
|
||||
|
||||
AjaxResult evidenceConfirmation(CaseApplication caseApplication);
|
||||
|
||||
}
|
||||
|
||||
+31
-12
@@ -1,6 +1,7 @@
|
||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
|
||||
import com.ruoyi.common.config.RuoYiConfig;
|
||||
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
@@ -19,6 +20,9 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -38,47 +42,52 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public AjaxResult getCaseDetailsById(Long id) {
|
||||
public AjaxResult getCaseDetailsById(Long id,String userName) {
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if (caseApplication1 != null) {
|
||||
CaseDetailVO caseDetailVO = new CaseDetailVO();
|
||||
BeanUtils.copyProperties(caseApplication1, caseDetailVO);
|
||||
//查询案件证据材料
|
||||
// List <CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(id);
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
String name = affiliate.getName();
|
||||
//判断当前登录人和案件关联人姓名是否一致
|
||||
if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人
|
||||
caseDetailVO.setIdentityType(affiliate.getIdentityType());
|
||||
}
|
||||
if (affiliate.getIdentityType() == 1) { //申请人
|
||||
caseDetailVO.setApplicantName(affiliate.getName());
|
||||
} else {
|
||||
caseDetailVO.setRespondentName(affiliate.getName());
|
||||
}
|
||||
//根据案件id查询案件证据材料
|
||||
List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
||||
caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
|
||||
}
|
||||
return AjaxResult.success(caseDetailVO);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult uploadEvidence(MultipartFile file , Integer annexType, Long id) {
|
||||
public AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id, String userName, Long userId) {
|
||||
|
||||
if (file.isEmpty()) {
|
||||
return AjaxResult.error("请选择要上传的文件");
|
||||
}
|
||||
try {
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 获取文件原始名称
|
||||
String fileName = file.getOriginalFilename();
|
||||
String fileSavePath = filePath + "/" + fileName;
|
||||
// 上传并返回新文件名称
|
||||
String fileNewName = FileUploadUtils.upload(filePath,file);
|
||||
// 上传
|
||||
String fileName = FileUploadUtils.upload(filePath, file);
|
||||
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
||||
.annexName(fileNewName)
|
||||
.annexPath(fileSavePath)
|
||||
.annexName(fileName)
|
||||
.annexPath(filePath)
|
||||
.annexType(annexType)
|
||||
.userId(userId)
|
||||
.userName(userName)
|
||||
.build();
|
||||
int count = caseAttachMapper.save(caseAttach);
|
||||
if (count > 0) {
|
||||
@@ -107,6 +116,16 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
return getCaseEvidenceVOList(identityNum, caseStatusList, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult evidenceConfirmation(CaseApplication caseApplication) {
|
||||
caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_APPOINT_ARBOTRATAR);
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
if (i>0){
|
||||
return AjaxResult.success("证据确认成功");
|
||||
}
|
||||
return AjaxResult.error("暂无需要确认的证据");
|
||||
}
|
||||
|
||||
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum, List<Integer> caseStatusList, Integer identityType) {
|
||||
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList, identityType);
|
||||
if (caseListByRespondent != null && caseListByRespondent.size() > 0) {
|
||||
|
||||
+17
-5
@@ -98,16 +98,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
//获取身份类型
|
||||
int identityType = affiliate.getIdentityType();
|
||||
//查询案件详细信息
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
if (caseApplication1 == null){
|
||||
return AjaxResult.error();
|
||||
}
|
||||
String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死
|
||||
String caseNum = caseApplication1.getCaseNum();
|
||||
if (identityType == 1) { //申请人
|
||||
request.setTemplateId("申请人模板id"); //传入申请人模板id
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
request.setTemplateId("1928003"); //传入申请人模板id
|
||||
// 这个值,要看你的模板中是否预留了占位符,如果没有则不需要设置
|
||||
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
||||
// 模板id:1928003 普通短信 案件受理通知 尊敬的{1}用户,您的{2}案件{3}已成功受理。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name,caseName,caseNum});
|
||||
} else { //被申请人
|
||||
request.setTemplateId("被申请人模板id");
|
||||
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
||||
request.setPhone(affiliate.getContactTelphone());
|
||||
request.setTemplateId("1928006");
|
||||
// 模板id1928006 普通短信 案件应诉通知 尊敬的{1}用户,您的{2}案件{3}已成功受理,请点击https://phmapp.xayunmei.com选择是否应诉。
|
||||
String name = affiliate.getName();
|
||||
request.setTemplateParamSet(new String[]{name,caseName,caseNum});
|
||||
}
|
||||
}
|
||||
SmsUtils.sendSms(request);
|
||||
|
||||
@@ -8,16 +8,18 @@
|
||||
<result property="caseAppliId" column="case_appli_id" />
|
||||
<result property="annexName" column="annex_name" />
|
||||
<result property="annexPath" column="annex_path" />
|
||||
<result property="annexPath" column="annex_type" />
|
||||
<result property="annexType" column="annex_type" />
|
||||
<result property="note" column="note" />
|
||||
<result property="userId" column="use_id" />
|
||||
<result property="userName" column="use_account" />
|
||||
</resultMap>
|
||||
<insert id="save">
|
||||
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note)
|
||||
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note})
|
||||
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,note,use_id,use_account)
|
||||
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
|
||||
</insert>
|
||||
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note
|
||||
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||
from case_attach
|
||||
where
|
||||
where case_appli_id =#{id}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user