截止9.18开发提交合并 #9
+49
-12
@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -19,40 +20,76 @@ import java.util.List;
|
||||
@RequestMapping("/evidence")
|
||||
public class CaseEvidenceController extends BaseController {
|
||||
private final ICaseEvidenceService caseEvidenceService;
|
||||
|
||||
@Autowired
|
||||
public CaseEvidenceController(ICaseEvidenceService caseEvidenceService) {
|
||||
this.caseEvidenceService = caseEvidenceService;
|
||||
}
|
||||
/**
|
||||
|
||||
/* *//**
|
||||
* 查询被申请人案件列表
|
||||
*
|
||||
* @param identityNum 身份证号
|
||||
* @return
|
||||
*/
|
||||
*//*
|
||||
@GetMapping("/respondent")
|
||||
public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum
|
||||
,Integer pageNum,Integer pageSize){
|
||||
public TableDataInfo getCaseListByRespondent(@RequestParam String identityNum) {
|
||||
startPage();
|
||||
List<CaseEvidenceVO> list = caseEvidenceService.getCaseListByRespondent(identityNum);
|
||||
return getDataTable(list);
|
||||
}
|
||||
if (list != null) {
|
||||
return getDataTable(list);
|
||||
}
|
||||
return getDataTable(new ArrayList<>());
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 根据案件id查询案件详情
|
||||
* 被申请人根据案件id查询案件详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getCaseDetailsById(@PathVariable Long id ){
|
||||
public AjaxResult getCaseDetailsById(@PathVariable Long id) {
|
||||
return caseEvidenceService.getCaseDetailsById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 案件证据上传
|
||||
* @param file 附件
|
||||
*
|
||||
* @param file 附件
|
||||
* @param annexType 附件类型,立案申请书(1)、证据材料(2)、仲裁文书(3)、案件视频(4)、身份证件(5)
|
||||
* @param id 案件申请id
|
||||
* @param id 案件申请id
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/upload")
|
||||
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file , Integer annexType , Long id){
|
||||
return caseEvidenceService.uploadEvidence(file,annexType,id);
|
||||
public AjaxResult uploadEvidence(@RequestParam("file") MultipartFile file, Integer annexType, Long id) {
|
||||
return caseEvidenceService.uploadEvidence(file, annexType, id);
|
||||
}
|
||||
|
||||
/* @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
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/all")
|
||||
public TableDataInfo getCaseListAll(@RequestParam String identityNum) {
|
||||
startPage();
|
||||
List<CaseEvidenceVO> list = caseEvidenceService.getCaseListAll(identityNum);
|
||||
if (list != null) {
|
||||
return getDataTable(list);
|
||||
}
|
||||
return getDataTable(new ArrayList<>());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
profile: D:/ruoyi/uploadPath
|
||||
profile: /home/ruoyi/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数字计算 char 字符验证
|
||||
@@ -142,5 +142,5 @@ elegent:
|
||||
appId: 2021003141676135
|
||||
callback:
|
||||
domain: http://121.40.189.20:9000/
|
||||
watch: true
|
||||
watch: false
|
||||
cycle: 10
|
||||
@@ -2,8 +2,14 @@ package com.ruoyi.common.utils;
|
||||
|
||||
import com.tencentcloudapi.common.Credential;
|
||||
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
|
||||
import com.tencentcloudapi.common.profile.ClientProfile;
|
||||
import com.tencentcloudapi.common.profile.HttpProfile;
|
||||
import com.tencentcloudapi.cvm.v20170312.CvmClient;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsRequest;
|
||||
import com.tencentcloudapi.cvm.v20170312.models.DescribeRegionsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.SmsClient;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse;
|
||||
import com.tencentcloudapi.sms.v20210111.models.SendStatus;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import lombok.var;
|
||||
@@ -12,21 +18,26 @@ import java.util.Objects;
|
||||
|
||||
@Slf4j
|
||||
public class SmsUtils {
|
||||
private static final String SDK_APP_ID = "应用id";
|
||||
private static final String SECRET_ID = "API的SecretId";
|
||||
private static final String SECRET_KEY = "API的SecretKey";
|
||||
private static final String SIGN_NAME = "签名内容";
|
||||
//应用id
|
||||
private static final String SDK_APP_ID = "1400854852";
|
||||
//API的SecretId
|
||||
private static final String SECRET_ID = "AKIDeEf2A8uX1HSainvvnXAc3X9ZlhtyvkMp";
|
||||
//API的SecretKey
|
||||
private static final String SECRET_KEY = "QjphKo8zkHZigT8j9PVtFPJyfIvO3d6V";
|
||||
//签名内容
|
||||
private static final String SIGN_NAME = "西安云美电子科技有限公司";
|
||||
|
||||
public static Boolean sendSms(SendSmsRequest request) {
|
||||
Credential cred = new Credential(SECRET_ID,SECRET_KEY);
|
||||
Credential cred = new Credential(SECRET_ID, SECRET_KEY );
|
||||
|
||||
SmsClient client = new SmsClient(cred, "ap-guangzhou");
|
||||
|
||||
final var req = new com.tencentcloudapi.sms.v20210111.models.SendSmsRequest();
|
||||
req.setPhoneNumberSet(new String[]{"+86" + request.getPhone()});
|
||||
req.setSmsSdkAppId(SDK_APP_ID);
|
||||
req.setSmsSdkAppId(SDK_APP_ID );
|
||||
req.setSignName(SIGN_NAME);
|
||||
req.setTemplateId(request.getTemplateId());
|
||||
req.setTemplateParamSet(request.getTemplateParamSet());
|
||||
|
||||
SendSmsResponse res = null;
|
||||
try {
|
||||
res = client.SendSms(req);
|
||||
@@ -34,14 +45,14 @@ public class SmsUtils {
|
||||
log.error("发送短信出错:", e);
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
log.error("发送短信结果:", SendSmsResponse.toJsonString(res));
|
||||
SendStatus sendStatus = res.getSendStatusSet()[0];
|
||||
log.info("发送短信结果:Code={}, Message={}", sendStatus.getCode(), sendStatus.getMessage());
|
||||
|
||||
if (Objects.nonNull(res.getSendStatusSet()) && res.getSendStatusSet().length > 0 && "Ok".equals(res.getSendStatusSet()[0].getCode())){
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数对象
|
||||
*/
|
||||
@@ -63,4 +74,12 @@ public class SmsUtils {
|
||||
private String[] templateParamSet;
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
SendSmsRequest sendSmsRequest = new SendSmsRequest();
|
||||
sendSmsRequest.setPhone("15029925289");
|
||||
sendSmsRequest.setTemplateId("1927509");
|
||||
sendSmsRequest.setTemplateParamSet(new String[]{"用户"});
|
||||
SmsUtils.sendSms(sendSmsRequest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain.vo;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -7,6 +8,7 @@ import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@@ -53,4 +55,13 @@ public class CaseDetailVO {
|
||||
* 申请人主张违约金
|
||||
*/
|
||||
private BigDecimal claimLiquidDamag;
|
||||
|
||||
/**
|
||||
* 证据材料
|
||||
*/
|
||||
private List<CaseAttach> evidenceMaterialList;
|
||||
/**
|
||||
* 当前登录人身份类型
|
||||
*/
|
||||
private Integer identityType;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,10 @@ package com.ruoyi.wisdomarbitrate.mapper;
|
||||
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CaseAttachMapper {
|
||||
int save(CaseAttach caseAttach);
|
||||
|
||||
List<CaseAttach> queryAnnexPathByCaseId(Long id);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface CaseEvidenceMapper {
|
||||
List<CaseEvidenceVO> getCaseListByRespondent(@Param(value = "identityNum" ) String identityNum
|
||||
, @Param(value = "caseStatus" ) Integer caseStatus
|
||||
, @Param(value = "caseStatusList") List<Integer> caseStatusList
|
||||
, @Param(value = "identityType" ) Integer identityType);
|
||||
}
|
||||
|
||||
+6
-1
@@ -8,9 +8,14 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
import java.util.List;
|
||||
|
||||
public interface ICaseEvidenceService {
|
||||
List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
|
||||
// List<CaseEvidenceVO> getCaseListByRespondent(String identityNum);
|
||||
|
||||
AjaxResult getCaseDetailsById(Long id);
|
||||
|
||||
AjaxResult uploadEvidence(MultipartFile file, Integer annexType, Long id);
|
||||
|
||||
//List<CaseEvidenceVO> getCaseListByApplicant(String identityNum);
|
||||
|
||||
List<CaseEvidenceVO> getCaseListAll(String identityNum);
|
||||
|
||||
}
|
||||
|
||||
+48
-19
@@ -19,6 +19,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@@ -31,24 +32,10 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private CaseAttachMapper caseAttachMapper;
|
||||
@Override
|
||||
/* @Override
|
||||
public List<CaseEvidenceVO> getCaseListByRespondent(String identityNum) {
|
||||
int caseStatus = 3;
|
||||
int identityType = 2;
|
||||
List<CaseEvidenceVO> caseListByRespondent = caseEvidenceMapper.getCaseListByRespondent(identityNum, caseStatus,identityType);
|
||||
if (caseListByRespondent!= null && caseListByRespondent.size()>0){
|
||||
for (CaseEvidenceVO caseEvidenceVO : caseListByRespondent) {
|
||||
//根据案件id查询申请人姓名
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
||||
caseAffiliate.setIdentityType(1);
|
||||
String name = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate).get(0).getName();
|
||||
caseEvidenceVO.setApplicantName(name);
|
||||
}
|
||||
return caseListByRespondent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return getCaseEvidenceVOList(identityNum,3, 2);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public AjaxResult getCaseDetailsById(Long id) {
|
||||
@@ -58,6 +45,8 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
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);
|
||||
@@ -81,15 +70,23 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
}
|
||||
try {
|
||||
String filePath = RuoYiConfig.getUploadPath();
|
||||
// 获取文件原始名称
|
||||
String fileName = file.getOriginalFilename();
|
||||
String fileSavePath = filePath + "/" + fileName;
|
||||
// 上传并返回新文件名称
|
||||
String fileNewName = FileUploadUtils.upload(filePath, file);
|
||||
String fileNewName = FileUploadUtils.upload(filePath,file);
|
||||
CaseAttach caseAttach = CaseAttach.builder().caseAppliId(id)
|
||||
.annexName(fileNewName)
|
||||
.annexPath(filePath)
|
||||
.annexPath(fileSavePath)
|
||||
.annexType(annexType)
|
||||
.build();
|
||||
int count = caseAttachMapper.save(caseAttach);
|
||||
if (count>0){
|
||||
//修改案件状态
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
caseApplication.setCaseStatus(4);
|
||||
caseApplicationMapper.submitCaseApplication(caseApplication);
|
||||
return AjaxResult.success("上传成功");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
@@ -98,4 +95,36 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService {
|
||||
|
||||
return AjaxResult.error("上传失败");
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public List<CaseEvidenceVO> getCaseListByApplicant(String identityNum) {
|
||||
return getCaseEvidenceVOList(identityNum,4, 1);
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public List<CaseEvidenceVO> getCaseListAll(String identityNum) {
|
||||
List<Integer> caseStatusList = Arrays.asList(3, 4, 5, 9);
|
||||
return getCaseEvidenceVOList(identityNum,caseStatusList,null);
|
||||
}
|
||||
|
||||
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) {
|
||||
//根据案件id查询姓名
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(caseEvidenceVO.getId());
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
if (affiliate.getIdentityType() == 1){ //申请人
|
||||
caseEvidenceVO.setApplicantName(affiliate.getName());
|
||||
}else {
|
||||
caseEvidenceVO.setRespondentName(affiliate.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return caseListByRespondent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService {
|
||||
request.setTemplateParamSet(new String[]{"模板中的参数值,如果没有则为空"});
|
||||
}
|
||||
}
|
||||
//SmsUtils.sendSms(request);
|
||||
SmsUtils.sendSms(request);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,21 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper">
|
||||
<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="annexPath" column="annex_type" />
|
||||
<result property="note" column="note" />
|
||||
</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>
|
||||
<select id="queryAnnexPathByCaseId" resultType="com.ruoyi.wisdomarbitrate.domain.CaseAttach" resultMap="CaseAttachResult">
|
||||
select annex_id,case_appli_id,annex_name,annex_path,annex_type,note
|
||||
from case_attach
|
||||
where
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -3,10 +3,26 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.wisdomarbitrate.mapper.CaseEvidenceMapper">
|
||||
<select id="getCaseListByRespondent" resultType="CaseEvidenceVO">
|
||||
select c.id, c.case_num as caseNum ,c.case_status as caseStatus,d.name as respondentName
|
||||
<resultMap type="CaseEvidenceVO" id="CaseEvidenceVOResult">
|
||||
<id property="id" column="id" />
|
||||
<result property="caseNum" column="case_num" />
|
||||
<result property="caseStatus" column="case_status" />
|
||||
</resultMap>
|
||||
<select id="getCaseListByRespondent" resultType="CaseEvidenceVO" resultMap="CaseEvidenceVOResult">
|
||||
select c.id, c.case_num,c.case_status
|
||||
from case_application as c ,case_affiliate as d
|
||||
where c.id = d.case_appli_id and d.identity_num = #{identityNum} and identity_type = #{identityType}
|
||||
and c.case_status = #{caseStatus}
|
||||
where c.id = d.case_appli_id
|
||||
<if test="identityNum != null and identityNum != ''">
|
||||
and d.identity_num = #{identityNum}
|
||||
</if>
|
||||
<if test="identityType != null ">
|
||||
and identity_type = #{identityType}
|
||||
</if>
|
||||
<if test="caseStatusList != null and caseStatusList.size() > 0">
|
||||
and c.case_status in
|
||||
<foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
|
||||
#{caseStatus}
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user