暂时保存
This commit is contained in:
+89
-8
@@ -3,8 +3,11 @@ package com.ruoyi.wisdomarbitrate.service.impl;
|
||||
import com.deepoove.poi.config.Configure;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.WordUtil;
|
||||
import com.ruoyi.wisdomarbitrate.domain.Adjudication;
|
||||
import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
|
||||
import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.ArbitrateRecordMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseAffiliateMapper;
|
||||
import com.ruoyi.wisdomarbitrate.mapper.CaseApplicationMapper;
|
||||
import com.ruoyi.wisdomarbitrate.service.IAdjudicationService;
|
||||
@@ -16,9 +19,9 @@ import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
@@ -26,18 +29,96 @@ public class AdjudicationServiceImpl implements IAdjudicationService {
|
||||
private CaseApplicationMapper caseApplicationMapper;
|
||||
@Autowired
|
||||
private CaseAffiliateMapper caseAffiliateMapper;
|
||||
@Autowired
|
||||
private ArbitrateRecordMapper arbitrateRecordMapper;
|
||||
|
||||
@Override
|
||||
public AjaxResult createDocument(CaseApplication caseApplication) {
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
|
||||
try {
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("1", "张三");
|
||||
String modalFilePath = "D:/develop/ceshi.docx";
|
||||
Adjudication adjudication = new Adjudication();
|
||||
Long id = caseApplication.getId();
|
||||
if (id == null){
|
||||
return null;
|
||||
}
|
||||
//获取案件详细信息
|
||||
CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
|
||||
//获取仲裁记录表里的相关信息
|
||||
ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
|
||||
arbitrateRecord.setCaseAppliId(id);
|
||||
ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
|
||||
|
||||
//获取案件关联人信息
|
||||
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(adjudication.getAppName(), affiliate.getName());
|
||||
datas.put(adjudication.getAppSex(), null);
|
||||
datas.put(adjudication.getAppIDNo(), affiliate.getIdentityNum());
|
||||
datas.put(adjudication.getAppAddress(), affiliate.getContactAddress());
|
||||
datas.put(adjudication.getAppAgentName(), affiliate.getNameAgent());
|
||||
datas.put(adjudication.getAppAgentIDNo(),affiliate.getIdentityNumAgent());
|
||||
}else if (identityType == 2){ //被申请人
|
||||
datas.put(adjudication.getResName(), affiliate.getName());
|
||||
datas.put(adjudication.getResSex(), null);
|
||||
datas.put(adjudication.getResIDNo(), affiliate.getIdentityNum());
|
||||
datas.put(adjudication.getResAddress(), affiliate.getContactAddress());
|
||||
datas.put(adjudication.getResAgentName(), affiliate.getNameAgent());
|
||||
datas.put(adjudication.getResAgentName(),affiliate.getIdentityNumAgent());
|
||||
}
|
||||
}
|
||||
}
|
||||
String arbitratorName = caseApplication1.getArbitratorName();
|
||||
datas.put(adjudication.getCaseName(),caseApplication1.getCaseName());
|
||||
datas.put(adjudication.getArbitratorName(),arbitratorName);
|
||||
LocalDate localDate = caseApplication1.getHearDate()
|
||||
.toInstant()
|
||||
.atZone(ZoneId.systemDefault())
|
||||
.toLocalDate();
|
||||
datas.put(adjudication.getHearYear(), localDate.getYear());
|
||||
datas.put(adjudication.getHearMonths(), localDate.getMonthValue());
|
||||
datas.put(adjudication.getHearDay(), localDate.getDayOfMonth());
|
||||
datas.put(adjudication.getAppArbitrationClaims(), null);
|
||||
datas.put(adjudication.getAppEvidenceName(), null);
|
||||
datas.put(adjudication.getAppProveFacts(), null);
|
||||
datas.put(adjudication.getResDefenseContentToApp(), null);
|
||||
datas.put(adjudication.getResArbitrationClaims(), null);
|
||||
datas.put(adjudication.getResEvidenceName(), null);
|
||||
datas.put(adjudication.getResProveFacts(), null);
|
||||
datas.put(adjudication.getAppDefenseContentToRes(), null);
|
||||
datas.put(adjudication.getEvidenDetermi(), arbitrateRecord1.getEvidenDetermi());
|
||||
datas.put(adjudication.getFactDetermi(), arbitrateRecord1.getFactDetermi());
|
||||
datas.put(adjudication.getCaseSketch(), arbitrateRecord1.getCaseSketch());
|
||||
datas.put(adjudication.getArbitrateThink(), arbitrateRecord1.getArbitrateThink());
|
||||
datas.put(adjudication.getLegalProvisions(), null);
|
||||
datas.put(adjudication.getRulingFollows(), arbitrateRecord1.getRulingFollows());
|
||||
datas.put(adjudication.getUmpire(), null);
|
||||
if (arbitratorName.contains(",")){
|
||||
String[] nameArray = arbitratorName.split(",");
|
||||
String firstName = nameArray[0];
|
||||
String secondName = nameArray[1];
|
||||
datas.put(adjudication.getArbitratorName1(), firstName);
|
||||
datas.put(adjudication.getArbitratorName2(), secondName);
|
||||
}else {
|
||||
String secondName = "";
|
||||
datas.put(adjudication.getArbitratorName1(), arbitratorName);
|
||||
datas.put(adjudication.getArbitratorName2(), secondName);
|
||||
}
|
||||
LocalDate now = LocalDate.now();
|
||||
datas.put(adjudication.getYear(), now.getYear());
|
||||
datas.put(adjudication.getMonths(), now.getMonthValue());
|
||||
datas.put(adjudication.getDay(), now.getDayOfMonth());
|
||||
datas.put(adjudication.getClerk(), null);
|
||||
String modalFilePath = "D:/develop/仲裁裁决书模板 (2).docx";
|
||||
String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
|
||||
String resultFilePath = "D:/data/" + fileName;
|
||||
String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
|
||||
return AjaxResult.success("裁决书保存路径为"+docFilePath);
|
||||
return AjaxResult.success("裁决书保存路径为" + docFilePath);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
+1
@@ -13,6 +13,7 @@ import org.springframework.stereotype.Component;
|
||||
public class CallBackHandleServiceImpl implements CallBackService {
|
||||
@Autowired
|
||||
private CasePaymentServiceImpl casePaymentService;
|
||||
|
||||
@Override
|
||||
public void successPay(String orderSn) {
|
||||
casePaymentService.callback(orderSn);
|
||||
|
||||
Reference in New Issue
Block a user