确认证据,短信功能
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.domain.vo.CaseEvidenceVO;
|
||||||
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
import com.ruoyi.wisdomarbitrate.service.ICaseEvidenceService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
@@ -26,31 +27,16 @@ public class CaseEvidenceController extends BaseController {
|
|||||||
this.caseEvidenceService = caseEvidenceService;
|
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
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public AjaxResult getCaseDetailsById(@PathVariable Long 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")
|
@PostMapping("/upload")
|
||||||
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
|
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
|
* @param identityNum
|
||||||
@@ -91,5 +69,13 @@ public class CaseEvidenceController extends BaseController {
|
|||||||
return getDataTable(new ArrayList<>());
|
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) {
|
public static void main(String[] args) {
|
||||||
SendSmsRequest sendSmsRequest = new SendSmsRequest();
|
SendSmsRequest sendSmsRequest = new SendSmsRequest();
|
||||||
sendSmsRequest.setPhone("15029925289");
|
sendSmsRequest.setPhone("18792613219");
|
||||||
sendSmsRequest.setTemplateId("1927509");
|
sendSmsRequest.setTemplateId("1928003");
|
||||||
sendSmsRequest.setTemplateParamSet(new String[]{"用户"});
|
sendSmsRequest.setTemplateParamSet(new String[]{"xxx","仲裁","编号"});
|
||||||
SmsUtils.sendSms(sendSmsRequest);
|
SmsUtils.sendSms(sendSmsRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,5 +34,13 @@ public class CaseAttach {
|
|||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String note;
|
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.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
import com.ruoyi.wisdomarbitrate.domain.vo.CaseEvidenceVO;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface ICaseEvidenceService {
|
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);
|
AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id,String userName,Long userId);
|
||||||
|
|
||||||
//List<CaseEvidenceVO> getCaseListByApplicant(String identityNum);
|
|
||||||
|
|
||||||
List<CaseEvidenceVO> getCaseListAll(String identityNum);
|
List<CaseEvidenceVO> getCaseListAll(String identityNum);
|
||||||
|
|
||||||
|
AjaxResult evidenceConfirmation(CaseApplication caseApplication);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+43
-24
@@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.wisdomarbitrate.service.impl;
|
package com.ruoyi.wisdomarbitrate.service.impl;
|
||||||
|
|
||||||
import com.ruoyi.common.config.RuoYiConfig;
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import com.ruoyi.common.constant.CaseApplicationConstants;
|
||||||
import com.ruoyi.common.core.domain.AjaxResult;
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
import com.ruoyi.common.utils.file.FileUploadUtils;
|
import com.ruoyi.common.utils.file.FileUploadUtils;
|
||||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||||
@@ -19,6 +20,9 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -38,50 +42,55 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult getCaseDetailsById(Long id) {
|
public AjaxResult getCaseDetailsById(Long id,String userName) {
|
||||||
CaseApplication caseApplication = new CaseApplication();
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
caseApplication.setId(id);
|
caseApplication.setId(id);
|
||||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
if (caseApplication1!=null){
|
if (caseApplication1 != null) {
|
||||||
CaseDetailVO caseDetailVO = new CaseDetailVO();
|
CaseDetailVO caseDetailVO = new CaseDetailVO();
|
||||||
BeanUtils.copyProperties(caseApplication1,caseDetailVO);
|
BeanUtils.copyProperties(caseApplication1, caseDetailVO);
|
||||||
//查询案件证据材料
|
|
||||||
// List <CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
|
||||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||||
caseAffiliate.setCaseAppliId(id);
|
caseAffiliate.setCaseAppliId(id);
|
||||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||||
if (affiliate.getIdentityType() == 1){ //申请人
|
String name = affiliate.getName();
|
||||||
|
//判断当前登录人和案件关联人姓名是否一致
|
||||||
|
if (name.equals(userName)) { //一致,将案件关联人的身份类型赋给当前登录人
|
||||||
|
caseDetailVO.setIdentityType(affiliate.getIdentityType());
|
||||||
|
}
|
||||||
|
if (affiliate.getIdentityType() == 1) { //申请人
|
||||||
caseDetailVO.setApplicantName(affiliate.getName());
|
caseDetailVO.setApplicantName(affiliate.getName());
|
||||||
}else {
|
} else {
|
||||||
caseDetailVO.setRespondentName(affiliate.getName());
|
caseDetailVO.setRespondentName(affiliate.getName());
|
||||||
}
|
}
|
||||||
|
//根据案件id查询案件证据材料
|
||||||
|
List<CaseAttach> evidenceMaterialList = caseAttachMapper.queryAnnexPathByCaseId(id);
|
||||||
|
caseDetailVO.setEvidenceMaterialList(evidenceMaterialList);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(caseDetailVO);
|
return AjaxResult.success(caseDetailVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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()) {
|
if (file.isEmpty()) {
|
||||||
return AjaxResult.error("请选择要上传的文件");
|
return AjaxResult.error("请选择要上传的文件");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
String filePath = RuoYiConfig.getUploadPath();
|
String filePath = RuoYiConfig.getUploadPath();
|
||||||
// 获取文件原始名称
|
// 上传
|
||||||
String fileName = file.getOriginalFilename();
|
String fileName = FileUploadUtils.upload(filePath, file);
|
||||||
String fileSavePath = filePath + "/" + fileName;
|
|
||||||
// 上传并返回新文件名称
|
|
||||||
String fileNewName = FileUploadUtils.upload(filePath,file);
|
|
||||||
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
||||||
.annexName(fileNewName)
|
.annexName(fileName)
|
||||||
.annexPath(fileSavePath)
|
.annexPath(filePath)
|
||||||
.annexType(annexType)
|
.annexType(annexType)
|
||||||
|
.userId(userId)
|
||||||
|
.userName(userName)
|
||||||
.build();
|
.build();
|
||||||
int count = caseAttachMapper.save(caseAttach);
|
int count = caseAttachMapper.save(caseAttach);
|
||||||
if (count>0){
|
if (count > 0) {
|
||||||
//修改案件状态
|
//修改案件状态
|
||||||
CaseApplication caseApplication = new CaseApplication();
|
CaseApplication caseApplication = new CaseApplication();
|
||||||
caseApplication.setId(id);
|
caseApplication.setId(id);
|
||||||
@@ -104,21 +113,31 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
|||||||
@Override
|
@Override
|
||||||
public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
|
public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
|
||||||
List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
|
List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
|
||||||
return getCaseEvidenceVOList(identityNum,caseStatusList,null);
|
return getCaseEvidenceVOList(identityNum, caseStatusList, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<CaseEvidenceVO> getCaseEvidenceVOList(String identityNum ,List<Integer> caseStatusList, Integer identityType){
|
@Override
|
||||||
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatusList,identityType);
|
public AjaxResult evidenceConfirmation(CaseApplication caseApplication) {
|
||||||
if (caseListByRespondent!= null && caseListByRespondent.size()>0){
|
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) {
|
||||||
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
|
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
|
||||||
//根据案件id查询姓名
|
//根据案件id查询姓名
|
||||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||||
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
||||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||||
if (affiliate.getIdentityType() == 1){ //申请人
|
if (affiliate.getIdentityType() == 1) { //申请人
|
||||||
caseEvidenceVO.setApplicantName(affiliate.getName());
|
caseEvidenceVO.setApplicantName(affiliate.getName());
|
||||||
}else {
|
} else {
|
||||||
caseEvidenceVO.setRespondentName(affiliate.getName());
|
caseEvidenceVO.setRespondentName(affiliate.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-5
@@ -98,16 +98,28 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
|||||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); //获取案件关联人信息
|
||||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||||
request.setPhone(affiliate.getContactTelphone());
|
|
||||||
//获取身份类型
|
//获取身份类型
|
||||||
int identityType = affiliate.getIdentityType();
|
int identityType = affiliate.getIdentityType();
|
||||||
|
//查询案件详细信息
|
||||||
|
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||||
|
if (caseApplication1 == null){
|
||||||
|
return AjaxResult.error();
|
||||||
|
}
|
||||||
|
String caseName = "仲裁"; //这里案件名称表里未定义,暂时写死
|
||||||
|
String caseNum = caseApplication1.getCaseNum();
|
||||||
if (identityType == 1) { //申请人
|
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 { //被申请人
|
} else { //被申请人
|
||||||
request.setTemplateId("被申请人模板id");
|
request.setPhone(affiliate.getContactTelphone());
|
||||||
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
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);
|
SmsUtils.sendSms(request);
|
||||||
|
|||||||
@@ -8,16 +8,18 @@
|
|||||||
<result property="caseAppliId" column="case_appli_id" />
|
<result property="caseAppliId" column="case_appli_id" />
|
||||||
<result property="annexName" column="annex_name" />
|
<result property="annexName" column="annex_name" />
|
||||||
<result property="annexPath" column="annex_path" />
|
<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="note" column="note" />
|
||||||
|
<result property="userId" column="use_id" />
|
||||||
|
<result property="userName" column="use_account" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<insert id="save">
|
<insert id="save">
|
||||||
INSERT INTO case_attach (case_appli_id, annex_name, annex_path , annex_type,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})
|
VALUES (#{caseAppliId}, #{annexName}, #{annexPath},#{annexType},#{note},#{userId},#{userName})
|
||||||
</insert>
|
</insert>
|
||||||
<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
|
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note,use_id,use_account
|
||||||
from case_attach
|
from case_attach
|
||||||
where
|
where case_appli_id =#{id}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user