Merge branch 'hjb' of SH-Arbitrate/Arbitrate-Backend into dev
This commit was merged in pull request #207.
This commit is contained in:
+5
-4
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseIds;
|
||||
import com.ruoyi.wisdomarbitrate.service.ICaseArbitrateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -35,12 +36,12 @@ public class CaseArbitrateController extends BaseController {
|
||||
|
||||
/**
|
||||
* 书面审理
|
||||
* @param arbitrateRecord
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/writtenHear")
|
||||
public AjaxResult writtenHear(@Validated @RequestBody ArbitrateRecord arbitrateRecord){
|
||||
arbitrateRecord.setCreateBy(getUsername());
|
||||
return caseArbitrateService.writtenHear(arbitrateRecord);
|
||||
public AjaxResult writtenHear(@RequestBody CaseIds caseIds){
|
||||
return caseArbitrateService.writtenHear(caseIds);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.ruoyi.web.controller.wisdomarbitrate;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.ruoyi.common.core.domain.entity.EsignHttpResponse;
|
||||
import com.ruoyi.common.exception.EsignDemoException;
|
||||
import com.ruoyi.wisdomarbitrate.domain.DeptIdentify;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAttachMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.DeptIdentifyMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.SealSignRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.utils.SignAward;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping
|
||||
public class MyTest {
|
||||
@Autowired
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private SealSignRecordMapper sealSignRecordMapper;
|
||||
@Autowired
|
||||
private CaseAttachMapper caseAttachMapper;
|
||||
@Autowired
|
||||
private DeptIdentifyMapper deptIdentifyMapper;
|
||||
@GetMapping("/test")
|
||||
public void myTest() throws EsignDemoException {
|
||||
Gson gson = new Gson();
|
||||
DeptIdentify deptIdentify = new DeptIdentify();
|
||||
deptIdentify.setIdentifyStatus(0);
|
||||
List<DeptIdentify> deptIdentifysnew = deptIdentifyMapper.selectDeptIdentifylist(deptIdentify);
|
||||
if (deptIdentifysnew != null && deptIdentifysnew.size() > 0) {
|
||||
for (int i = 0; i < deptIdentifysnew.size(); i++) {
|
||||
EsignHttpResponse identifyInfo = SignAward.getDeptIdentifyInfo(deptIdentifysnew.get(i));
|
||||
JsonObject identifyInfoJsonObject = gson.fromJson(identifyInfo.getBody(), JsonObject.class);
|
||||
JsonObject identifyInfoData = identifyInfoJsonObject.getAsJsonObject("data");
|
||||
int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
|
||||
if (realnameStatus == 1) {
|
||||
String orgId = identifyInfoData.get("orgId").getAsString();
|
||||
System.out.println("这是orgId"+orgId+"=======================");
|
||||
EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
|
||||
//将orgId保存到数据库里
|
||||
DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
|
||||
deptIdentifynew.setOrgId(orgId);
|
||||
JsonObject identifyInfoJsonObject1 = gson.fromJson(identifyInfo1.getBody(), JsonObject.class);
|
||||
JsonObject identifyInfoData1 = identifyInfoJsonObject1.getAsJsonObject("data");
|
||||
JsonArray sealArray = identifyInfoData1.get("seals").getAsJsonArray();
|
||||
String sealNames = "";
|
||||
if (sealArray.size() > 0) {
|
||||
for (int j = 0; j < sealArray.size(); j++) {
|
||||
JsonObject sealObject = (JsonObject) sealArray.get(j);
|
||||
String sealName = sealObject.get("sealName").toString();
|
||||
String sealNamenew = sealName.substring(1, sealName.length() - 1);
|
||||
sealNames += sealNamenew + ",";
|
||||
}
|
||||
}
|
||||
String sealName = sealNames.substring(0, sealNames.length() - 1);
|
||||
deptIdentifynew.setIdentifyStatus(1);
|
||||
deptIdentifynew.setSealName(sealName);
|
||||
int row = deptIdentifyMapper.updateDeptIdentify(deptIdentifynew);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://121.40.189.20:3306/test_smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
url: jdbc:mysql://121.40.189.20:3306/smart_arbitration?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
password: YMzc157#
|
||||
# 从库数据源
|
||||
|
||||
@@ -18,7 +18,7 @@ ruoyi:
|
||||
# 开发环境配置
|
||||
server:
|
||||
# 服务器的HTTP端口,默认为8080
|
||||
port: 8001
|
||||
port: 9001
|
||||
servlet:
|
||||
# 应用的访问路径
|
||||
context-path: /
|
||||
@@ -176,6 +176,6 @@ identityAuthentication:
|
||||
# 腾讯云即时通信相关配置
|
||||
imConfig:
|
||||
# sdkAppId
|
||||
sdkAppId: 1600012141
|
||||
sdkAppId: 1600011167
|
||||
# 密钥
|
||||
secretKey: 6075dc0ad9ae26d4186bfdffc192c649f2826140c84974f2e2b882997fcc8a54
|
||||
secretKey: 17d136d9327576a247f991bdfed3a6d14cebc7d540a52245086829c3a1421a86
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.ruoyi.wisdomarbitrate.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class CaseIds {
|
||||
private List<Long> ids;
|
||||
}
|
||||
+2
-1
@@ -4,13 +4,14 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.BatchCaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseIds;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICaseArbitrateService {
|
||||
|
||||
|
||||
AjaxResult writtenHear(ArbitrateRecord arbitrateRecord);
|
||||
AjaxResult writtenHear(CaseIds caseIds);
|
||||
|
||||
AjaxResult examineArbitrateMethod(CaseApplication caseApplication, Integer opinion);
|
||||
}
|
||||
|
||||
+18
-130
@@ -147,14 +147,17 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public AjaxResult writtenHear(ArbitrateRecord arbitrateRecord) {
|
||||
public AjaxResult writtenHear(CaseIds caseIds) {
|
||||
if (caseIds!=null){
|
||||
List<Long> ids = caseIds.getIds();
|
||||
for (Long caseId : ids) {
|
||||
//查询案件详情
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(arbitrateRecord.getCaseAppliId());
|
||||
caseApplication.setId(caseId);
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
String createBy = arbitrateRecord.getCreateBy();
|
||||
|
||||
//先判断案件是否已经提交过仲裁结果
|
||||
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
||||
arbitrateRecord.setCaseAppliId(caseId);
|
||||
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
||||
if (arbitrateRecord1 != null) {
|
||||
int i = arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord);
|
||||
@@ -163,9 +166,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
CaseLogRecord caseLogRecord = new CaseLogRecord();
|
||||
caseLogRecord.setCaseAppliId(caseApplication1.getId());
|
||||
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
|
||||
if (createBy != null) {
|
||||
caseLogRecord.setCreateBy(createBy);
|
||||
}
|
||||
caseLogRecord.setCreateBy(getUsername());
|
||||
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
||||
@@ -179,145 +180,30 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
CaseLogRecord caseLogRecord = new CaseLogRecord();
|
||||
caseLogRecord.setCaseAppliId(caseApplication1.getId());
|
||||
caseLogRecord.setCaseNode(caseApplication1.getCaseStatus());
|
||||
if (createBy != null) {
|
||||
caseLogRecord.setCreateBy(createBy);
|
||||
}
|
||||
caseLogRecord.setCreateBy(getUsername());
|
||||
caseLogRecordMapper.insertCaseLogRecord(caseLogRecord);
|
||||
// 新增日志
|
||||
CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.GENERATED_ARBITRATION, "");
|
||||
}
|
||||
}
|
||||
Boolean aBoolean1 = generateAward(arbitrateRecord);
|
||||
Boolean aBoolean1 = generateAward(caseId);
|
||||
if (aBoolean1) {
|
||||
//修改案件状态
|
||||
caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
|
||||
int i = caseApplicationMapper.submitCaseApplication(caseApplication1);
|
||||
if (i > 0) {
|
||||
}else {
|
||||
return AjaxResult.error("裁决书生成失败");
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("审理成功");
|
||||
}
|
||||
}
|
||||
return AjaxResult.error("裁决书生成有误");
|
||||
}
|
||||
|
||||
|
||||
//生成庭审笔录
|
||||
private Boolean generateTrialTranscripts(ArbitrateRecord arbitrateRecord) {
|
||||
try {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
Long id = arbitrateRecord.getCaseAppliId();
|
||||
CaseApplication caseApplication = new CaseApplication();
|
||||
caseApplication.setId(id);
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
//获取案件关联人信息
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
caseAffiliate.setCaseAppliId(id);
|
||||
List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
|
||||
if (caseAffiliates != null && caseAffiliates.size() > 0) {
|
||||
for (CaseAffiliate affiliate : caseAffiliates) {
|
||||
//获取身份类型
|
||||
int identityType = affiliate.getIdentityType();
|
||||
if (identityType == 1) { //申请人
|
||||
datas.put("appName", affiliate.getName());
|
||||
datas.put("appIDNo", affiliate.getIdentityNum());
|
||||
datas.put("appAddress", affiliate.getContactAddress());
|
||||
datas.put("appAgentName", affiliate.getNameAgent());
|
||||
datas.put("appAgentIDNo", affiliate.getIdentityNumAgent());
|
||||
} else if (identityType == 2) { //被申请人
|
||||
datas.put("resName", affiliate.getName());
|
||||
datas.put("resIDNo", affiliate.getIdentityNum());
|
||||
datas.put("resAddress", affiliate.getContactAddress());
|
||||
datas.put("resAgentName", affiliate.getNameAgent());
|
||||
datas.put("resAgentIDNo", affiliate.getIdentityNumAgent());
|
||||
}
|
||||
}
|
||||
}
|
||||
String arbitratorName = caseApplication1.getArbitratorName();
|
||||
datas.put("caseName", caseApplication1.getCaseName());
|
||||
datas.put("arbitratorName", arbitratorName);
|
||||
Date hearDate = caseApplication1.getHearDate();
|
||||
if (hearDate != null) {
|
||||
LocalDate localDate = hearDate.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
datas.put("hearYear", localDate.getYear());
|
||||
datas.put("hearMonths", localDate.getMonthValue());
|
||||
datas.put("hearDay", localDate.getDayOfMonth());
|
||||
} else {
|
||||
datas.put("hearYear", null);
|
||||
datas.put("hearMonths", null);
|
||||
datas.put("hearDay", null);
|
||||
}
|
||||
datas.put("appArbitrationClaims", caseApplication1.getArbitratClaims());
|
||||
datas.put("evidenDetermi", arbitrateRecord.getEvidenDetermi());
|
||||
datas.put("factDetermi", arbitrateRecord.getFactDetermi());
|
||||
datas.put("caseSketch", arbitrateRecord.getCaseSketch());
|
||||
datas.put("arbitrateThink", arbitrateRecord.getArbitrateThink());
|
||||
datas.put("rulingFollows", arbitrateRecord.getRulingFollows());
|
||||
datas.put("legalProvisions", "仲裁法");
|
||||
LocalDate now = LocalDate.now();
|
||||
String year = Integer.toString(now.getYear());
|
||||
String month = String.format("%02d", now.getMonthValue());
|
||||
String day = String.format("%02d", now.getDayOfMonth());
|
||||
datas.put("year", year);
|
||||
datas.put("months", month);
|
||||
datas.put("day", day);
|
||||
String modalFilePath = "/data/arbitrate-document/template/仲裁裁决书模板.docx";
|
||||
//String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
||||
String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
|
||||
//String saveFolderPath = "D:/data/" + now.getYear() + "/" + now.getMonthValue() + "/" + now.getDayOfMonth();
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
||||
String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
|
||||
String resultFilePath = saveFolderPath + "/" + fileName;
|
||||
// 创建日期目录
|
||||
File saveFolder = new File(saveFolderPath);
|
||||
if (!saveFolder.exists()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
Path sourcePath = new File(modalFilePath).toPath();
|
||||
Path destinationPath = new File(resultFilePath).toPath();
|
||||
Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
|
||||
String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
||||
String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
|
||||
CaseAttach caseAttach = CaseAttach.builder()
|
||||
.caseAppliId(id)
|
||||
.annexName(saveName)
|
||||
.annexPath(savePath)
|
||||
.annexType(7)
|
||||
.build();
|
||||
//保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
|
||||
CaseAttach caseAttach1 = new CaseAttach();
|
||||
caseAttach1.setAnnexType(7);
|
||||
caseAttach1.setCaseAppliId(id);
|
||||
List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach1);
|
||||
if (caseAttachList != null && caseAttachList.size() > 0) {
|
||||
//之前已经生成过了,更新
|
||||
caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
|
||||
} else {
|
||||
//之前没生成过,新增
|
||||
int i = caseAttachMapper.save(caseAttach);
|
||||
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
||||
if (i > 0) {
|
||||
if (arbitrateRecord1 != null) {
|
||||
Integer annexId = caseAttach.getAnnexId();
|
||||
//将附件id保存到仲裁记录表里面
|
||||
arbitrateRecord1.setAnnexId(annexId);
|
||||
arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
return AjaxResult.error("请检查参数");
|
||||
}
|
||||
|
||||
//生成仲裁文书
|
||||
private Boolean generateAward(ArbitrateRecord arbitrateRecord) {
|
||||
private Boolean generateAward(Long id) {
|
||||
try {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
Long id = arbitrateRecord.getCaseAppliId();
|
||||
if (id == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -329,6 +215,8 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService {
|
||||
String equipmentNo = getNewEquipmentNo();
|
||||
datas.put("num", equipmentNo);
|
||||
//获取仲裁记录表里的相关信息
|
||||
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
||||
arbitrateRecord.setCaseAppliId(id);
|
||||
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
||||
//获取案件关联人信息
|
||||
CaseAffiliate caseAffiliate = new CaseAffiliate();
|
||||
|
||||
+2
@@ -186,6 +186,7 @@ public class FixSelectFlowDetailUtils {
|
||||
int realnameStatus = identifyInfoData.get("realnameStatus").getAsInt();
|
||||
if (realnameStatus == 1) {
|
||||
String orgId = identifyInfoData.get("orgId").getAsString();
|
||||
System.out.println("这是orgId"+orgId+"=======================");
|
||||
EsignHttpResponse identifyInfo1 = SignAward.deptIdentifySealList(orgId);
|
||||
//将orgId保存到数据库里
|
||||
DeptIdentify deptIdentifynew = deptIdentifysnew.get(i);
|
||||
@@ -355,6 +356,7 @@ public class FixSelectFlowDetailUtils {
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -101,12 +101,13 @@
|
||||
<if test="isUse != null">is_use = #{isUse},</if>
|
||||
<if test="identifyStatus != null ">identify_status = #{identifyStatus},</if>
|
||||
<if test="sealName != null and sealName != ''">seal_name = #{sealName},</if>
|
||||
<if test="orgId != null and orgId != ''">org_id = #{orgId},</if>
|
||||
<if test="sealId != null and sealId != ''">seal_id = #{sealId},</if>
|
||||
<if test="sealStatus != null ">seal_status = #{sealStatus},</if>
|
||||
</set>
|
||||
<where>
|
||||
<if test="id != null">
|
||||
AND d.id = #{id}
|
||||
AND id = #{id}
|
||||
</if>
|
||||
<if test="sealId != null">
|
||||
AND seal_id = #{sealId}
|
||||
|
||||
Reference in New Issue
Block a user