diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/TestPOIController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/TestPOIController.java deleted file mode 100644 index 369d6ce..0000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/TestPOIController.java +++ /dev/null @@ -1,372 +0,0 @@ -package com.ruoyi.web.controller.wisdomarbitrate; - -import cn.hutool.core.io.resource.ClassPathResource; -import com.deepoove.poi.XWPFTemplate; -import com.deepoove.poi.data.PictureRenderData; -import com.ruoyi.common.constant.CaseApplicationConstants; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.redis.RedisCache; -import com.ruoyi.common.utils.EmailOutUtil; -import com.ruoyi.common.utils.WordUtil; -import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord; -import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate; -import com.ruoyi.wisdomarbitrate.domain.CaseApplication; -import com.ruoyi.wisdomarbitrate.domain.CaseAttach; -import com.ruoyi.wisdomarbitrate.mapper.*; -import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService; -import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService; -import org.apache.poi.util.Units; -import org.apache.poi.xwpf.usermodel.Document; -import org.apache.poi.xwpf.usermodel.XWPFDocument; -import org.apache.poi.xwpf.usermodel.XWPFParagraph; -import org.apache.poi.xwpf.usermodel.XWPFRun; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -import javax.imageio.ImageIO; -import java.awt.image.BufferedImage; -import java.io.*; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.StandardCopyOption; -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.util.*; - -@RestController -@RequestMapping -public class TestPOIController { - - @Autowired - private CaseApplicationMapper caseApplicationMapper; - @Autowired - private CaseAffiliateMapper caseAffiliateMapper; - @Autowired - private ArbitrateRecordMapper arbitrateRecordMapper; - @Autowired - private CaseAttachMapper caseAttachMapper; - @Autowired - private RedisCache redisCache; - @Autowired - private SendMailRecordMapper sendMailRecordMapper; - - @GetMapping("/test") - public AjaxResult createDocument(@RequestBody CaseApplication caseApplication) { - try { - Map datas = new HashMap<>(); - Long id = caseApplication.getId(); - if (id == null) { - return null; - } - //获取案件详细信息 - CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); - //生成编码 - String equipmentNo = getNewEquipmentNo(); - datas.put("num", equipmentNo); - //获取仲裁记录表里的相关信息 - ArbitrateRecord arbitrateRecord = new ArbitrateRecord(); - arbitrateRecord.setCaseAppliId(id); - ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord); - //获取案件关联人信息 - CaseAffiliate caseAffiliate = new CaseAffiliate(); - caseAffiliate.setCaseAppliId(id); - List caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate); - List nameAgentList = new ArrayList<>(); - if (caseAffiliates != null && caseAffiliates.size() > 0) { - for (CaseAffiliate affiliate : caseAffiliates) { - //获取身份类型 - int identityType = affiliate.getIdentityType(); - if (identityType == 1) { //申请人 - datas.put("appName", affiliate.getName()); - datas.put("appAddress", affiliate.getResidenAffili()); - datas.put("appContactAddress", affiliate.getContactAddress()); - datas.put("appLegalPerson", affiliate.getCompLegalPerson()); - datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost()); - datas.put("appAgentName", affiliate.getNameAgent()); - datas.put("appAgentTitle", affiliate.getAppliAgentTitle()); - nameAgentList.add(affiliate.getNameAgent()); - } else if (identityType == 2) { //被申请人 - datas.put("resName", affiliate.getName()); - datas.put("resAddress", affiliate.getResidenAffili()); - String responSex = affiliate.getResponSex(); - if (responSex.equals("0")){ - datas.put("resSex","男"); - }else{ - datas.put("resSex","女"); - } - Date responBirth = affiliate.getResponBirth(); - if (responBirth != null) { - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); - String responBirthStr = sdf.format(responBirth); - datas.put("resDateOfBirth", responBirthStr); - - } - datas.put("resContactAddress", affiliate.getContactAddress()); - nameAgentList.add(affiliate.getNameAgent()); - } - } - } - Date createTime = caseApplication1.getCreateTime(); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - // 将日期格式化为字符串 - String createTimeStr = sdf.format(createTime); - datas.put("submissionDate", createTimeStr); - Date registerDate = caseApplication1.getRegisterDate(); - String registerDateStr = sdf.format(registerDate); - datas.put("acceptDate", registerDateStr); - //反请求 - Integer adjudicaCounter = caseApplication1.getAdjudicaCounter(); - String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" + - "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" + - "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。"; - if (adjudicaCounter == null) { - datas.put("counterclaim", null); - } else if (adjudicaCounter == 1) { - datas.put("counterclaim", counterclaim); - } else { - datas.put("counterclaim", null); - } - //财产保全 - Integer properPreser = caseApplication1.getProperPreser(); - String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" + - "第二十八条之规定,将该申请提交至法院。"; - if (properPreser == null) { - datas.put("preservation", null); - } else if (properPreser == 1) { - datas.put("preservation", preservation); - } else { - datas.put("preservation", null); - } - //管辖权异议 - Integer objectiJuris = caseApplication1.getObjectiJuris(); - String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" + - ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。"; - if (objectiJuris == null) { - datas.put("jurisdictionalObjection", null); - } else if (objectiJuris == 1) { - datas.put("jurisdictionalObjection", jurisdictionalObjection); - } else { - datas.put("jurisdictionalObjection", null); - } - String arbitratorName = caseApplication1.getArbitratorName(); - datas.put("arbitratorName", arbitratorName); - Integer arbitratMethod = caseApplication1.getArbitratMethod(); - Date hearDate = caseApplication1.getHearDate(); - if (hearDate != null) { - String hearDateStr = sdf.format(hearDate); - //线上开庭时 - if (arbitratMethod == 1) { - String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。"; - datas.put("onLine1", onLine1); - datas.put("hearDate", hearDateStr); - datas.put("onLine2", onLine2); - } else { - //书面仲裁时 - String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于"; - String written2 = "在仲裁委所在地开庭审理了本案。"; - datas.put("written1", written1); - datas.put("hearDate1", hearDateStr); - datas.put("written2", written2); - } - } - Integer isAbsence = caseApplication1.getIsAbsence(); - if (isAbsence == null) { - datas.put("absent1", null); - datas.put("absent2", null); - datas.put("absent3", null); - datas.put("absent4", null); - datas.put("absent5", null); - datas.put("attend1", null); - datas.put("attend2", null); - datas.put("attend3", null); - datas.put("attend4", null); - datas.put("attend5", null); - datas.put("attend6", null); - datas.put("attend7", null); - datas.put("appAgentName1", null); - datas.put("appAgentName2", null); - datas.put("resAgentName", null); - } else if (isAbsence == 1) { - //缺席审理 - String absent1 = "申请人的特别授权委托代理人"; - String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" + - "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。"; - String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," + - "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。"; - String absent4 = "(二/三)当事人提供的证据材料\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第四十条第(二)项、第五十一条的规定,缺席裁决如下:"; - datas.put("absent1", absent1); - datas.put("absent2", absent2); - datas.put("absent3", absent3); - datas.put("absent4", absent4); - datas.put("absent5", absent5); - datas.put("appAgentName1", nameAgentList.get(0)); - } else { - //出席审理 - String attend1 = "申请人的特别授权委托代理人"; - String attend2 = "和被申请人本人/的特别授权委托代理人"; - String attend3 = "出席了庭审。"; - String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" + - "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," + - "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," + - "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。"; - String attend5 = "(二)被申请人的答辩意见"; - String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" + - "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:"; - String attend7 = "被申请人对上述材料的质证意见为:"; - datas.put("attend1", attend1); - datas.put("attend2", attend2); - datas.put("attend3", attend3); - datas.put("attend4", attend4); - datas.put("attend5", attend5); - datas.put("attend6", attend6); - datas.put("attend7", attend7); - datas.put("responCrossOpin", caseApplication1.getResponCrossOpin()); - datas.put("appAgentName2", nameAgentList.get(0)); - datas.put("resAgentName", nameAgentList.get(1)); - if (arbitratMethod == 1) { - //被申出席+开庭 - String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条的规定,裁决如下:"; - datas.put("attend8", attend8); - } else { - //被申出席+书面 - String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" + - "第五十一条、第五十八条的规定,裁决如下:"; - datas.put("attend9", attend9); - } - } - datas.put("claims", caseApplication1.getArbitratClaims()); - datas.put("request", caseApplication1.getRequestRule()); - //申请人证据材料 - datas.put("appEvidenceMaterial", null); - //被申请人证据材料 - - PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, "D:\\develop\\Snipaste_2023-10-27_09-59-23.jpg"); - datas.put("resEvidenceMaterial", "证据详情可查询附件"); - datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin()); - if (arbitrateRecord1 != null) { - datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); - datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink()); - datas.put("rulingFollows", arbitrateRecord1.getRulingFollows()); - } - LocalDate now = LocalDate.now(); - String year = Integer.toString(now.getYear()); - datas.put("year", year); - String month = String.format("%02d", now.getMonthValue()); - String day = String.format("%02d", now.getDayOfMonth()); - //String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx"; - String modalFilePath = "D:/develop/新裁决书模板.docx"; - //String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day; - String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day; - 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); - File file = new File(docFilePath); - if (file.exists()) { - InputStream in = new FileInputStream(file); - XWPFDocument xwpfDocument = new XWPFDocument(in); - WordUtil.changeText(xwpfDocument); - } - String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8); - CaseAttach caseAttach = CaseAttach.builder() - .caseAppliId(id) - .annexName(saveName) - .annexPath(savePath) - .annexType(3) - .build(); - //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增 - List caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach); - if (caseAttachList != null && caseAttachList.size() > 0) { - //之前已经生成过了,更新 - int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach); - } else { - //之前没生成过,新增 - int i = caseAttachMapper.save(caseAttach); - if (i > 0) { - if (arbitrateRecord1 != null) { - Integer annexId = caseAttach.getAnnexId(); - //将附件id保存到仲裁记录表里面 - arbitrateRecord1.setAnnexId(annexId); - arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1); - } - } - } - //修改案件状态 - caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION); - caseApplicationMapper.submitCaseApplication(caseApplication1); - return AjaxResult.success("裁决书已生成"); - } catch (IOException e) { - return AjaxResult.error(e + "请检查文件路径是否有误"); - } - } - - public String getNewEquipmentNo() { - Object awardNum = redisCache.getCacheObject("awardNum"); - if (awardNum == null) { - redisCache.setCacheObject("awardNum", "00001"); - String s = redisCache.getCacheObject("awardNum").toString(); - // 字符串数字解析为整数 - int no = Integer.parseInt(s); - // 最新设备编号自增1 - int newEquipment = ++no; - // 将整数格式化为5位数字 - s = String.format("%05d", newEquipment); - redisCache.setCacheObject("awardNum", s); - return s; - } else { - String s = awardNum.toString(); - // 字符串数字解析为整数 - int no = Integer.parseInt(s); - // 最新设备编号自增1 - int newEquipment = ++no; - // 将整数格式化为5位数字 - s = String.format("%05d", newEquipment); - redisCache.setCacheObject("awardNum", s); - return s; - } - } - - public static void main(String[] args) throws Exception { - // 创建一个新的Word文档 - XWPFDocument document = new XWPFDocument(); - - // 创建一个段落 - XWPFParagraph paragraph = document.createParagraph(); - - // 创建一个文本区域 - XWPFRun run = paragraph.createRun(); - - // 加载图片文件 - File imageFile = new File("D:\\develop\\Snipaste_2023-10-27_09-59-23.jpg"); - FileInputStream fis = new FileInputStream(imageFile); - - // 将图片插入到文档中 - run.addPicture(fis, Document.PICTURE_TYPE_JPEG, "image.jpg", Units.toEMU(100), Units.toEMU(100)); - - // 关闭输入流 - fis.close(); - - // 保存文档 - String filePath= "D:\\develop\\"+UUID.randomUUID()+"document.docx"; - FileOutputStream fos = new FileOutputStream(filePath); - document.write(fos); - fos.close(); - } - - } diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java index 5cddab0..236fee7 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java @@ -146,7 +146,7 @@ public class WordUtil { public static PictureRenderData rebuildImageContent(Integer with, Integer height, String imageUrl, String relatedPath) { PictureRenderData pictureRenderData = null; if (!StringUtils.isBlank(imageUrl)) { - // pictureRenderData = Pictures.of(imageUrl).size(with, height).create(); + //pictureRenderData = Pictures.of(imageUrl).size(with, height).create(); //Pictures.PictureBuilder pictureBuilder = Pictures.of("https://res.wx.qq.com/a/wx_fed/weixin_portal/res/static/img/1EtCRvm.png"); } else if (!StringUtils.isBlank(relatedPath)) { pictureRenderData = Pictures.ofLocal(relatedPath).size(with, height).create(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java index 355ee58..134caf8 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java @@ -16,6 +16,9 @@ public class CaseApplication extends BaseEntity { /** ID */ private Long id; + /** 案件名称 */ + @Excel(name = "案件名称") + private String caseName; /** 案件编号 */ // @Excel(name = "案件编号") private String caseNum; @@ -127,8 +130,7 @@ public class CaseApplication extends BaseEntity { /** 仲裁员名称 */ private String arbitratorName; - /** 案件名称 */ - private String caseName; + /** 案件描述 */ private String caseDescribe; diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java index 0565dd3..9c36063 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/SmsSendRecord.java @@ -37,4 +37,9 @@ public class SmsSendRecord extends BaseEntity { * 发送内容 */ private String sendContent; + + /** + * 发送状态 + */ + private Integer sendStatus; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java index 66949fa..6d09066 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.wisdomarbitrate.service.impl; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; +import com.deepoove.poi.data.PictureRenderData; import com.ruoyi.common.constant.CaseApplicationConstants; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.redis.RedisCache; @@ -36,6 +37,7 @@ import java.nio.file.StandardCopyOption; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.util.*; +import java.util.regex.Pattern; import static com.ruoyi.common.utils.SecurityUtils.getUsername; @@ -254,10 +256,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } datas.put("claims", caseApplication1.getArbitratClaims()); datas.put("request", caseApplication1.getRequestRule()); - //申请人证据材料 - datas.put("appEvidenceMaterial", null); - //被申请人证据材料 - datas.put("resEvidenceMaterial","(详见附件列表)"); + CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); + List caseAttachList1 = caseApplication2.getCaseAttachList(); + if (caseAttachList1 != null && caseAttachList1.size() > 0) { + for (CaseAttach caseAttach : caseAttachList1) { + if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 + String annexName = caseAttach.getAnnexName(); + boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); + if (isImageFile) { + String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath(); + System.out.println("路径是===========" + annexPath); + PictureRenderData pictureRenderData = WordUtil + .rebuildImageContent(100, 100, null, annexPath); + datas.put("resEvidenceMaterial", pictureRenderData); + } + } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 + String annexName = caseAttach.getAnnexName(); + boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); + if (isImageFile) { + String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath(); + System.out.println("路径是===========" + annexPath); + PictureRenderData pictureRenderData = WordUtil + .rebuildImageContent(100, 100, null, annexPath); + //申请人证据材料 + datas.put("appEvidenceMaterial", pictureRenderData); + } + } + } + } datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin()); if (arbitrateRecord1 != null) { datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); @@ -804,10 +830,34 @@ public class AdjudicationServiceImpl implements IAdjudicationService { } datas.put("claims", caseApplication1.getArbitratClaims()); datas.put("request", caseApplication1.getRequestRule()); - //申请人证据材料 - datas.put("appEvidenceMaterial", null); - //被申请人证据材料 - datas.put("resEvidenceMaterial","(详见附件列表)"); + CaseApplication caseApplication2 = caseApplicationService.selectCaseApplication(caseApplication); + List caseAttachList1 = caseApplication2.getCaseAttachList(); + if (caseAttachList1 != null && caseAttachList1.size() > 0) { + for (CaseAttach caseAttach : caseAttachList1) { + if (caseAttach.getAnnexType() == 6) { //被申请人证据材料 + String annexName = caseAttach.getAnnexName(); + boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); + if (isImageFile) { + String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath(); + System.out.println("路径是===========" + annexPath); + PictureRenderData pictureRenderData = WordUtil + .rebuildImageContent(100, 100, null, annexPath); + datas.put("resEvidenceMaterial", pictureRenderData); + } + } else if (caseAttach.getAnnexType() == 2) { //申请人证据材料 + String annexName = caseAttach.getAnnexName(); + boolean isImageFile = Pattern.matches(".*\\.(jpg|png|gif|bmp)$", annexName); + if (isImageFile) { + String annexPath = "/home/ruoyi"+caseAttach.getAnnexPath(); + System.out.println("路径是===========" + annexPath); + PictureRenderData pictureRenderData = WordUtil + .rebuildImageContent(100, 100, null, annexPath); + //申请人证据材料 + datas.put("appEvidenceMaterial", pictureRenderData); + } + } + } + } datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin()); if (arbitrateRecord1 != null) { datas.put("factDetermi", arbitrateRecord1.getFactDetermi()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java index cad7a7e..6fff4d3 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java @@ -1024,6 +1024,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String content="尊敬的"+agentUser.getNickName()+",您的代理的案件已接入仲裁系统,复制访问https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 进入小程序进行认证注册。如非本人操作,请忽略本短信"; smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); + smsSendRecord.setSendStatus(1); smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } @@ -1472,6 +1473,11 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { * @param failureMsg */ private void validBaseColumn(CaseApplication caseApplication, StringBuilder failureMsg) { + if( StrUtil.isEmpty(caseApplication.getCaseName())){ + failureMsg.append("【案件名称】字段不能为空;"); + }else if(caseApplication.getCaseName().length()>50){ + failureMsg.append("【案件名称】字段超出指定长度,最大长度为50;"); + } BigDecimal caseSubjectAmount = caseApplication.getCaseSubjectAmount(); if(null== caseSubjectAmount){ failureMsg.append("【案件标的】字段不合法;"); @@ -1855,6 +1861,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { smsSendRecord.setSendTime(new Date()); String content="尊敬的"+caseAffiliate.getName()+"用户,您的"+ caseApplicationselect.getCaseNum()+"仲裁案件,开庭审理房间号为"+ messageVO.getRoomNo()+",请在微信内打开https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 请知晓,如非本人操作,请忽略本短信。"; smsSendRecord.setSendContent(content); + smsSendRecord.setSendStatus(1); String userName; try { userName= getUsername(); @@ -2197,6 +2204,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。"; } smsSendRecord.setSendContent(content); + smsSendRecord.setSendStatus(1); smsSendRecord.setCreateBy(getUsername()); smsRecordMapper.saveSmsSendRecord(smsSendRecord); } @@ -2233,6 +2241,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { String content="尊敬的"+name+"用户,您的"+caseNum+"仲裁案件,开庭日期已确定为"+hearDatestr+",请知晓,如非本人操作,请忽略本短信。"; smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); + smsSendRecord.setSendStatus(1); smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } @@ -2391,6 +2400,7 @@ public class CaseApplicationServiceImpl implements ICaseApplicationService { private void copyCaseApplication(CaseApplication caseApplicationinsertDiffer, CaseApplication caseApplicationNew) { caseApplicationNew.setArbitratClaims(caseApplicationinsertDiffer.getArbitratClaims()); caseApplicationNew.setCaseNum(caseApplicationinsertDiffer.getCaseNum()); + caseApplicationNew.setCaseName(caseApplicationinsertDiffer.getCaseName()); caseApplicationNew.setCaseSubjectAmount(caseApplicationinsertDiffer.getCaseSubjectAmount()); caseApplicationNew.setLoanStartDate(caseApplicationinsertDiffer.getLoanStartDate()); caseApplicationNew.setLoanEndDate(caseApplicationinsertDiffer.getLoanEndDate()); diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java index d061255..28b9aec 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseArbitrateServiceImpl.java @@ -126,6 +126,7 @@ public class CaseArbitrateServiceImpl implements ICaseArbitrateService { String content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,仲裁方式已确定为" + arbitratMethodStr + ",请知晓,如非本人操作,请忽略本短信。"; smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); + smsSendRecord.setSendStatus(1); smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java index aa87e90..2c73aab 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseEvidenceServiceImpl.java @@ -119,12 +119,12 @@ public class CaseEvidenceServiceImpl implements ICaseEvidenceService { caseApplication.setCaseStatus(4); caseApplicationMapper.submitCaseApplication(caseApplication); } + } CaseAttach caseAttachselect = new CaseAttach(); caseAttachselect.setAnnexId(caseAttach.getAnnexId()); caseAttachselect.setAnnexName(caseAttach.getAnnexName()); caseAttachselect.setAnnexType(caseAttach.getAnnexType()); return AjaxResult.success("上传成功", caseAttachselect); - } } catch (IOException e) { e.printStackTrace(); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java index 9bb6198..afab07a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CasePaymentServiceImpl.java @@ -128,6 +128,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { String content="尊敬的"+name+"用户,您的"+caseName+"案件"+caseNum+"已成功受理。"; smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); + smsSendRecord.setSendStatus(1); smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } else { //被申请人 @@ -146,6 +147,7 @@ public class CasePaymentServiceImpl implements ICasePaymentService { String content="尊敬的"+name+"用户,您的"+caseName+"案件"+caseNum+"已成功受理,请点击链接:https://miniapp-3gpama6l759911ef-1321289474.tcloudbaseapp.com/jump-mp.html 选择是否应诉。如非本人操作,请忽略本短信"; smsSendRecord.setSendContent(content); smsSendRecord.setCreateBy(getUsername()); + smsSendRecord.setSendStatus(1); smsRecordMapper.saveSmsSendRecord(smsSendRecord); } } @@ -185,11 +187,20 @@ public class CasePaymentServiceImpl implements ICasePaymentService { CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication); caseApplication1.setCaseStatus(CaseApplicationConstants.PENDING_PAYMENT_CONFIRM); //修改案件状态 - caseApplicationMapper.submitCaseApplication(caseApplication1); - // 新增日志 - CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.PENDING_PAYMENT_CONFIRM,""); + int i = caseApplicationMapper.submitCaseApplication(caseApplication1); + if(i>0) { + // 修改支付状态 + CasePaymentRecord paymentRecord = new CasePaymentRecord(); + paymentRecord.setPayType(payDTO.getPayType()); + paymentRecord.setCaseId(payDTO.getCaseId()); + paymentRecord.setPaymentStatus(1); + casePaymentRecordMapper.saveRecord(paymentRecord); + // 新增日志 + CaseLogUtils.insertCaseLog(caseApplication.getId(), CaseApplicationConstants.PENDING_PAYMENT_CONFIRM, ""); - return AjaxResult.success("确认缴费成功"); + return AjaxResult.success("确认缴费成功"); + } + return AjaxResult.success("确认缴费失败"); } diff --git a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml index 7bd95db..d7ef77d 100644 --- a/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml @@ -7,6 +7,7 @@ + @@ -372,7 +373,7 @@ insert into case_application( - + case_name , case_num, case_subject_amount, register_date, @@ -400,6 +401,7 @@ import_flag, create_time )values( + #{caseName}, #{caseNum}, #{caseSubjectAmount}, sysdate(), @@ -515,6 +517,7 @@ CASE c.arbitrat_method when 1 then '开庭审理' when 2 then '书面审理' ELSE '无审理方式' END arbitratMethodName, + c.case_name, c.case_status , CASE c.case_status when 0 then '立案申请' when 1 then '待立案审查' when 2 then '待缴费' when 3 then '待缴费确认' when 4 then '待案件质证' when 5 then '待组庭审核' @@ -595,7 +598,7 @@ order by c.create_time desc limit 1 CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName from case_application c left join case_payment_record p on c.id = p.case_id where c.case_status = 3 - AND c.id = #{id} and p.payment_status=1 + AND c.id = #{id} and p.payment_status=1 limit 1 - select id ,case_appli_id ,case_num ,phone ,send_time ,send_content + select id ,case_appli_id ,case_num ,phone ,send_time ,send_content,send_status from sms_send_record