Просмотр исходного кода

Merge branch 'dev' of http://git.xayunmei.com/SH-Arbitrate/Arbitrate-Backend into qtz3

qitz 2 лет назад
Родитель
Сommit
121ea7c7ae

+ 372
- 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/TestPOIController.java Просмотреть файл

1
+package com.ruoyi.web.controller.wisdomarbitrate;
2
+
3
+import cn.hutool.core.io.resource.ClassPathResource;
4
+import com.deepoove.poi.XWPFTemplate;
5
+import com.deepoove.poi.data.PictureRenderData;
6
+import com.ruoyi.common.constant.CaseApplicationConstants;
7
+import com.ruoyi.common.core.domain.AjaxResult;
8
+import com.ruoyi.common.core.redis.RedisCache;
9
+import com.ruoyi.common.utils.EmailOutUtil;
10
+import com.ruoyi.common.utils.WordUtil;
11
+import com.ruoyi.wisdomarbitrate.domain.ArbitrateRecord;
12
+import com.ruoyi.wisdomarbitrate.domain.CaseAffiliate;
13
+import com.ruoyi.wisdomarbitrate.domain.CaseApplication;
14
+import com.ruoyi.wisdomarbitrate.domain.CaseAttach;
15
+import com.ruoyi.wisdomarbitrate.mapper.*;
16
+import com.ruoyi.wisdomarbitrate.service.ICaseApplicationService;
17
+import com.ruoyi.wisdomarbitrate.service.ICaseLogRecordService;
18
+import org.apache.poi.util.Units;
19
+import org.apache.poi.xwpf.usermodel.Document;
20
+import org.apache.poi.xwpf.usermodel.XWPFDocument;
21
+import org.apache.poi.xwpf.usermodel.XWPFParagraph;
22
+import org.apache.poi.xwpf.usermodel.XWPFRun;
23
+import org.springframework.beans.factory.annotation.Autowired;
24
+import org.springframework.web.bind.annotation.GetMapping;
25
+import org.springframework.web.bind.annotation.RequestBody;
26
+import org.springframework.web.bind.annotation.RequestMapping;
27
+import org.springframework.web.bind.annotation.RestController;
28
+
29
+import javax.imageio.ImageIO;
30
+import java.awt.image.BufferedImage;
31
+import java.io.*;
32
+import java.nio.file.Files;
33
+import java.nio.file.Path;
34
+import java.nio.file.StandardCopyOption;
35
+import java.text.SimpleDateFormat;
36
+import java.time.LocalDate;
37
+import java.util.*;
38
+
39
+@RestController
40
+@RequestMapping
41
+public class TestPOIController {
42
+
43
+    @Autowired
44
+    private CaseApplicationMapper caseApplicationMapper;
45
+    @Autowired
46
+    private CaseAffiliateMapper caseAffiliateMapper;
47
+    @Autowired
48
+    private ArbitrateRecordMapper arbitrateRecordMapper;
49
+    @Autowired
50
+    private CaseAttachMapper caseAttachMapper;
51
+    @Autowired
52
+    private RedisCache redisCache;
53
+    @Autowired
54
+    private SendMailRecordMapper sendMailRecordMapper;
55
+
56
+    @GetMapping("/test")
57
+    public AjaxResult createDocument(@RequestBody CaseApplication caseApplication) {
58
+        try {
59
+            Map<String, Object> datas = new HashMap<>();
60
+            Long id = caseApplication.getId();
61
+            if (id == null) {
62
+                return null;
63
+            }
64
+            //获取案件详细信息
65
+            CaseApplication caseApplication1 = caseApplicationMapper.selectCaseApplication(caseApplication);
66
+            //生成编码
67
+            String equipmentNo = getNewEquipmentNo();
68
+            datas.put("num", equipmentNo);
69
+            //获取仲裁记录表里的相关信息
70
+            ArbitrateRecord arbitrateRecord = new ArbitrateRecord();
71
+            arbitrateRecord.setCaseAppliId(id);
72
+            ArbitrateRecord arbitrateRecord1 = arbitrateRecordMapper.selectArbitrateRecord(arbitrateRecord);
73
+            //获取案件关联人信息
74
+            CaseAffiliate caseAffiliate = new CaseAffiliate();
75
+            caseAffiliate.setCaseAppliId(id);
76
+            List<CaseAffiliate> caseAffiliates = caseAffiliateMapper.selectCaseAffiliate(caseAffiliate);
77
+            List<String> nameAgentList = new ArrayList<>();
78
+            if (caseAffiliates != null && caseAffiliates.size() > 0) {
79
+                for (CaseAffiliate affiliate : caseAffiliates) {
80
+                    //获取身份类型
81
+                    int identityType = affiliate.getIdentityType();
82
+                    if (identityType == 1) {    //申请人
83
+                        datas.put("appName", affiliate.getName());
84
+                        datas.put("appAddress", affiliate.getResidenAffili());
85
+                        datas.put("appContactAddress", affiliate.getContactAddress());
86
+                        datas.put("appLegalPerson", affiliate.getCompLegalPerson());
87
+                        datas.put("appLegalPersonTitle", affiliate.getCompLegalperPost());
88
+                        datas.put("appAgentName", affiliate.getNameAgent());
89
+                        datas.put("appAgentTitle", affiliate.getAppliAgentTitle());
90
+                        nameAgentList.add(affiliate.getNameAgent());
91
+                    } else if (identityType == 2) {  //被申请人
92
+                        datas.put("resName", affiliate.getName());
93
+                        datas.put("resAddress", affiliate.getResidenAffili());
94
+                        String responSex = affiliate.getResponSex();
95
+                        if (responSex.equals("0")){
96
+                            datas.put("resSex","男");
97
+                        }else{
98
+                            datas.put("resSex","女");
99
+                        }
100
+                        Date responBirth = affiliate.getResponBirth();
101
+                        if (responBirth != null) {
102
+                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
103
+                            String responBirthStr = sdf.format(responBirth);
104
+                            datas.put("resDateOfBirth", responBirthStr);
105
+
106
+                        }
107
+                        datas.put("resContactAddress", affiliate.getContactAddress());
108
+                        nameAgentList.add(affiliate.getNameAgent());
109
+                    }
110
+                }
111
+            }
112
+            Date createTime = caseApplication1.getCreateTime();
113
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
114
+            // 将日期格式化为字符串
115
+            String createTimeStr = sdf.format(createTime);
116
+            datas.put("submissionDate", createTimeStr);
117
+            Date registerDate = caseApplication1.getRegisterDate();
118
+            String registerDateStr = sdf.format(registerDate);
119
+            datas.put("acceptDate", registerDateStr);
120
+            //反请求
121
+            Integer adjudicaCounter = caseApplication1.getAdjudicaCounter();
122
+            String counterclaim = "在《2022年版仲裁规则》第十八条第(一)项规定的期限内,被申请人向秘书处提交了" +
123
+                    "《仲裁反请求申请书》及证据材料。仲裁委依据《2022年版仲裁规则》第十八条的规定受理了该仲裁反请求案申请。" +
124
+                    "仲裁反请求案件受理后,秘书处向被申请人发送了仲裁反请求通知书及附件,向申请人发送了仲裁反请求通知书及附件、仲裁反请求申请书及附件。";
125
+            if (adjudicaCounter == null) {
126
+                datas.put("counterclaim", null);
127
+            } else if (adjudicaCounter == 1) {
128
+                datas.put("counterclaim", counterclaim);
129
+            } else {
130
+                datas.put("counterclaim", null);
131
+            }
132
+            //财产保全
133
+            Integer properPreser = caseApplication1.getProperPreser();
134
+            String preservation = "本案受理后,申请人向仲裁委提交了财产保全申请,仲裁委根据《中华人民共和国仲裁法》" +
135
+                    "第二十八条之规定,将该申请提交至法院。";
136
+            if (properPreser == null) {
137
+                datas.put("preservation", null);
138
+            } else if (properPreser == 1) {
139
+                datas.put("preservation", preservation);
140
+            } else {
141
+                datas.put("preservation", null);
142
+            }
143
+            //管辖权异议
144
+            Integer objectiJuris = caseApplication1.getObjectiJuris();
145
+            String jurisdictionalObjection = "本案受理后,被申请人向仲裁委提交了《XX管辖异议申请书》,认为XXXXXX" +
146
+                    ",仲裁委经审理,当庭驳回了被申请人的管辖异议申请,并告知被申请人具体的事实和理由将在裁决书中一并列明。";
147
+            if (objectiJuris == null) {
148
+                datas.put("jurisdictionalObjection", null);
149
+            } else if (objectiJuris == 1) {
150
+                datas.put("jurisdictionalObjection", jurisdictionalObjection);
151
+            } else {
152
+                datas.put("jurisdictionalObjection", null);
153
+            }
154
+            String arbitratorName = caseApplication1.getArbitratorName();
155
+            datas.put("arbitratorName", arbitratorName);
156
+            Integer arbitratMethod = caseApplication1.getArbitratMethod();
157
+            Date hearDate = caseApplication1.getHearDate();
158
+            if (hearDate != null) {
159
+                String hearDateStr = sdf.format(hearDate);
160
+                //线上开庭时
161
+                if (arbitratMethod == 1) {
162
+                    String onLine1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
163
+                    String onLine2 = "通过仲裁委智慧仲裁平台开庭审理了本案。";
164
+                    datas.put("onLine1", onLine1);
165
+                    datas.put("hearDate", hearDateStr);
166
+                    datas.put("onLine2", onLine2);
167
+                } else {
168
+                    //书面仲裁时
169
+                    String written1 = "仲裁庭审阅了申请人提交的仲裁申请书、证据材料后,于";
170
+                    String written2 = "在仲裁委所在地开庭审理了本案。";
171
+                    datas.put("written1", written1);
172
+                    datas.put("hearDate1", hearDateStr);
173
+                    datas.put("written2", written2);
174
+                }
175
+            }
176
+            Integer isAbsence = caseApplication1.getIsAbsence();
177
+            if (isAbsence == null) {
178
+                datas.put("absent1", null);
179
+                datas.put("absent2", null);
180
+                datas.put("absent3", null);
181
+                datas.put("absent4", null);
182
+                datas.put("absent5", null);
183
+                datas.put("attend1", null);
184
+                datas.put("attend2", null);
185
+                datas.put("attend3", null);
186
+                datas.put("attend4", null);
187
+                datas.put("attend5", null);
188
+                datas.put("attend6", null);
189
+                datas.put("attend7", null);
190
+                datas.put("appAgentName1", null);
191
+                datas.put("appAgentName2", null);
192
+                datas.put("resAgentName", null);
193
+            } else if (isAbsence == 1) {
194
+                //缺席审理
195
+                String absent1 = "申请人的特别授权委托代理人";
196
+                String absent2 = "出席了庭审。被申请人经依法送达开庭通知,无正当理由未出席庭审,故仲裁庭依据" +
197
+                        "《2022年版仲裁规则》第四十条第(二)项的规定,对本案进行了缺席审理。";
198
+                String absent3 = "庭审中,申请人陈述了仲裁请求事项及事实与理由,出示了证据材料并进行了说明," +
199
+                        "发表了意见,回答了仲裁庭的提问,并作了最后陈述。因被申请人缺席庭审,故仲裁庭无法组织调解。";
200
+                String absent4 = "(二/三)当事人提供的证据材料\n" +
201
+                        "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
202
+                String absent5 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
203
+                        "第四十条第(二)项、第五十一条的规定,缺席裁决如下:";
204
+                datas.put("absent1", absent1);
205
+                datas.put("absent2", absent2);
206
+                datas.put("absent3", absent3);
207
+                datas.put("absent4", absent4);
208
+                datas.put("absent5", absent5);
209
+                datas.put("appAgentName1", nameAgentList.get(0));
210
+            } else {
211
+                //出席审理
212
+                String attend1 = "申请人的特别授权委托代理人";
213
+                String attend2 = "和被申请人本人/的特别授权委托代理人";
214
+                String attend3 = "出席了庭审。";
215
+                String attend4 = "庭审中,申请人陈述了仲裁请求事项及所依据的事实与理由,被申请人进行了答辩;" +
216
+                        "双方当事人均出示了证据材料并对对方的证据材料进行了质证;申请人出示了证据材料," +
217
+                        "被申请人对对方的证据材料进行了质证;双方当事人均回答了仲裁庭的提问,进行了辩论," +
218
+                        "并分别作了最后陈述。双方当事人在仲裁庭的主持下进行了调解,但未能达成调解协议。";
219
+                String attend5 = "(二)被申请人的答辩意见";
220
+                String attend6 = "(二/三)当事人提供的证据材料及对方的质证意见\n" +
221
+                        "申请人为证明其主张的事实和理由,向仲裁庭提交了如下证据材料:";
222
+                String attend7 = "被申请人对上述材料的质证意见为:";
223
+                datas.put("attend1", attend1);
224
+                datas.put("attend2", attend2);
225
+                datas.put("attend3", attend3);
226
+                datas.put("attend4", attend4);
227
+                datas.put("attend5", attend5);
228
+                datas.put("attend6", attend6);
229
+                datas.put("attend7", attend7);
230
+                datas.put("responCrossOpin", caseApplication1.getResponCrossOpin());
231
+                datas.put("appAgentName2", nameAgentList.get(0));
232
+                datas.put("resAgentName", nameAgentList.get(1));
233
+                if (arbitratMethod == 1) {
234
+                    //被申出席+开庭
235
+                    String attend8 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
236
+                            "第五十一条的规定,裁决如下:";
237
+                    datas.put("attend8", attend8);
238
+                } else {
239
+                    //被申出席+书面
240
+                    String attend9 = "综上,仲裁庭依据《上海仲裁委员会仲裁规则》(2022年7月1日起施行的版本)" +
241
+                            "第五十一条、第五十八条的规定,裁决如下:";
242
+                    datas.put("attend9", attend9);
243
+                }
244
+            }
245
+            datas.put("claims", caseApplication1.getArbitratClaims());
246
+            datas.put("request", caseApplication1.getRequestRule());
247
+            //申请人证据材料
248
+            datas.put("appEvidenceMaterial", null);
249
+            //被申请人证据材料
250
+
251
+            PictureRenderData pictureRenderData = WordUtil.rebuildImageContent(100, 100, null, "D:\\develop\\Snipaste_2023-10-27_09-59-23.jpg");
252
+            datas.put("resEvidenceMaterial", "证据详情可查询附件");
253
+            datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
254
+            if (arbitrateRecord1 != null) {
255
+                datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
256
+                datas.put("arbitrateThink", arbitrateRecord1.getArbitrateThink());
257
+                datas.put("rulingFollows", arbitrateRecord1.getRulingFollows());
258
+            }
259
+            LocalDate now = LocalDate.now();
260
+            String year = Integer.toString(now.getYear());
261
+            datas.put("year", year);
262
+            String month = String.format("%02d", now.getMonthValue());
263
+            String day = String.format("%02d", now.getDayOfMonth());
264
+            //String modalFilePath = "/data/arbitrate-document/template/新裁决书模板.docx";
265
+            String modalFilePath = "D:/develop/新裁决书模板.docx";
266
+            //String saveFolderPath = "/home/ruoyi/uploadPath/upload/" + year + "/" + month + "/" + day;
267
+            String saveFolderPath = "D:/data/" + year + "/" + month + "/" + day;
268
+            String fileName = UUID.randomUUID().toString().replace("-", "") + ".docx";
269
+            String saveName = "/profile/upload/" + year + "/" + month + "/" + day + "/" + fileName;
270
+            String resultFilePath = saveFolderPath + "/" + fileName;
271
+            // 创建日期目录
272
+            File saveFolder = new File(saveFolderPath);
273
+            if (!saveFolder.exists()) {
274
+                saveFolder.mkdirs();
275
+            }
276
+            Path sourcePath = new File(modalFilePath).toPath();
277
+            Path destinationPath = new File(resultFilePath).toPath();
278
+            Files.copy(sourcePath, destinationPath, StandardCopyOption.REPLACE_EXISTING);
279
+            String docFilePath = WordUtil.getDocFilePath(datas, modalFilePath, resultFilePath);
280
+            File file = new File(docFilePath);
281
+            if (file.exists()) {
282
+                InputStream in = new FileInputStream(file);
283
+                XWPFDocument xwpfDocument = new XWPFDocument(in);
284
+                WordUtil.changeText(xwpfDocument);
285
+            }
286
+            String savePath = docFilePath.substring(0, docFilePath.indexOf("/upload/") + 8);
287
+            CaseAttach caseAttach = CaseAttach.builder()
288
+                    .caseAppliId(id)
289
+                    .annexName(saveName)
290
+                    .annexPath(savePath)
291
+                    .annexType(3)
292
+                    .build();
293
+            //保存到附件表里,先判断之前有没有,有的话更新,没有的话新增
294
+            List<CaseAttach> caseAttachList = caseAttachMapper.getCaseAttachByCaseIdAndType(caseAttach);
295
+            if (caseAttachList != null && caseAttachList.size() > 0) {
296
+                //之前已经生成过了,更新
297
+                int i = caseAttachMapper.updateCaseAttachBycaseid(caseAttach);
298
+            } else {
299
+                //之前没生成过,新增
300
+                int i = caseAttachMapper.save(caseAttach);
301
+                if (i > 0) {
302
+                    if (arbitrateRecord1 != null) {
303
+                        Integer annexId = caseAttach.getAnnexId();
304
+                        //将附件id保存到仲裁记录表里面
305
+                        arbitrateRecord1.setAnnexId(annexId);
306
+                        arbitrateRecordMapper.updataArbitrateRecord(arbitrateRecord1);
307
+                    }
308
+                }
309
+            }
310
+            //修改案件状态
311
+            caseApplication1.setCaseStatus(CaseApplicationConstants.VERPRIF_ARBITRATION);
312
+            caseApplicationMapper.submitCaseApplication(caseApplication1);
313
+            return AjaxResult.success("裁决书已生成");
314
+        } catch (IOException e) {
315
+            return AjaxResult.error(e + "请检查文件路径是否有误");
316
+        }
317
+    }
318
+
319
+    public String getNewEquipmentNo() {
320
+        Object awardNum = redisCache.getCacheObject("awardNum");
321
+        if (awardNum == null) {
322
+            redisCache.setCacheObject("awardNum", "00001");
323
+            String s = redisCache.getCacheObject("awardNum").toString();
324
+            // 字符串数字解析为整数
325
+            int no = Integer.parseInt(s);
326
+            // 最新设备编号自增1
327
+            int newEquipment = ++no;
328
+            // 将整数格式化为5位数字
329
+            s = String.format("%05d", newEquipment);
330
+            redisCache.setCacheObject("awardNum", s);
331
+            return s;
332
+        } else {
333
+            String s = awardNum.toString();
334
+            // 字符串数字解析为整数
335
+            int no = Integer.parseInt(s);
336
+            // 最新设备编号自增1
337
+            int newEquipment = ++no;
338
+            // 将整数格式化为5位数字
339
+            s = String.format("%05d", newEquipment);
340
+            redisCache.setCacheObject("awardNum", s);
341
+            return s;
342
+        }
343
+    }
344
+
345
+    public static void main(String[] args) throws Exception {
346
+        // 创建一个新的Word文档
347
+        XWPFDocument document = new XWPFDocument();
348
+
349
+        // 创建一个段落
350
+        XWPFParagraph paragraph = document.createParagraph();
351
+
352
+        // 创建一个文本区域
353
+        XWPFRun run = paragraph.createRun();
354
+
355
+        // 加载图片文件
356
+        File imageFile = new File("D:\\develop\\Snipaste_2023-10-27_09-59-23.jpg");
357
+        FileInputStream fis = new FileInputStream(imageFile);
358
+
359
+        // 将图片插入到文档中
360
+        run.addPicture(fis, Document.PICTURE_TYPE_JPEG, "image.jpg", Units.toEMU(100), Units.toEMU(100));
361
+
362
+        // 关闭输入流
363
+        fis.close();
364
+
365
+        // 保存文档
366
+        String filePath= "D:\\develop\\"+UUID.randomUUID()+"document.docx";
367
+        FileOutputStream fos = new FileOutputStream(filePath);
368
+        document.write(fos);
369
+        fos.close();
370
+    }
371
+
372
+    }

+ 9
- 5
ruoyi-common/src/main/java/com/ruoyi/common/utils/WordUtil.java Просмотреть файл

1
 package com.ruoyi.common.utils;
1
 package com.ruoyi.common.utils;
2
 
2
 
3
 
3
 
4
+import cn.hutool.core.io.resource.ClassPathResource;
4
 import com.deepoove.poi.XWPFTemplate;
5
 import com.deepoove.poi.XWPFTemplate;
5
 import com.deepoove.poi.config.Configure;
6
 import com.deepoove.poi.config.Configure;
6
 import com.deepoove.poi.data.*;
7
 import com.deepoove.poi.data.*;
7
 import com.deepoove.poi.data.style.ParagraphStyle;
8
 import com.deepoove.poi.data.style.ParagraphStyle;
8
 import com.deepoove.poi.data.style.Style;
9
 import com.deepoove.poi.data.style.Style;
10
+import com.deepoove.poi.policy.PictureRenderPolicy;
9
 import com.deepoove.poi.util.PoitlIOUtils;
11
 import com.deepoove.poi.util.PoitlIOUtils;
12
+import org.apache.commons.io.FileUtils;
10
 import org.apache.poi.ss.usermodel.Cell;
13
 import org.apache.poi.ss.usermodel.Cell;
11
 import org.apache.poi.ss.usermodel.CellType;
14
 import org.apache.poi.ss.usermodel.CellType;
12
 import org.apache.poi.ss.usermodel.Row;
15
 import org.apache.poi.ss.usermodel.Row;
15
 import org.apache.poi.xwpf.usermodel.*;
18
 import org.apache.poi.xwpf.usermodel.*;
16
 
19
 
17
 import javax.print.Doc;
20
 import javax.print.Doc;
21
+import javax.servlet.http.HttpServletRequest;
18
 import javax.servlet.http.HttpServletResponse;
22
 import javax.servlet.http.HttpServletResponse;
19
-import java.io.BufferedOutputStream;
20
-import java.io.FileOutputStream;
21
-import java.io.IOException;
22
-import java.io.OutputStream;
23
+import java.io.*;
23
 import java.util.ArrayList;
24
 import java.util.ArrayList;
24
 import java.util.List;
25
 import java.util.List;
25
 import java.util.Map;
26
 import java.util.Map;
142
     /**
143
     /**
143
      * 构建图片内容
144
      * 构建图片内容
144
      */
145
      */
145
-    public static PictureRenderData rebuildImageContent(Integer with, Integer height, String imageUrl, String relatedPath, Byte[] imageBytes) {
146
+    public static PictureRenderData rebuildImageContent(Integer with, Integer height, String imageUrl, String relatedPath) {
146
         PictureRenderData pictureRenderData = null;
147
         PictureRenderData pictureRenderData = null;
147
         if (!StringUtils.isBlank(imageUrl)) {
148
         if (!StringUtils.isBlank(imageUrl)) {
148
             // pictureRenderData = Pictures.of(imageUrl).size(with, height).create();
149
             // pictureRenderData = Pictures.of(imageUrl).size(with, height).create();
152
 //            Pictures.PictureBuilder pictureBuilder = Pictures.of("https://res.wx.qq.com/a/wx_fed/weixin_portal/res/static/img/1EtCRvm.png");
153
 //            Pictures.PictureBuilder pictureBuilder = Pictures.of("https://res.wx.qq.com/a/wx_fed/weixin_portal/res/static/img/1EtCRvm.png");
153
         }
154
         }
154
         return pictureRenderData;
155
         return pictureRenderData;
156
+
155
     }
157
     }
156
 
158
 
157
     public static String getResultFilePath(Map<String, Object> datas, Configure config, String modalFilePath, String resultFilePath) throws IOException {
159
     public static String getResultFilePath(Map<String, Object> datas, Configure config, String modalFilePath, String resultFilePath) throws IOException {
203
         }
205
         }
204
     }
206
     }
205
 
207
 
208
+
209
+
206
 }
210
 }

+ 1
- 1
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/CaseApplication.java Просмотреть файл

680
     @Excel(name = "被申请人主体信息-身份证号",width = 26)
680
     @Excel(name = "被申请人主体信息-身份证号",width = 26)
681
     private String debtorIdentityNum;
681
     private String debtorIdentityNum;
682
     /** 被申请人主体信息-性别 */
682
     /** 被申请人主体信息-性别 */
683
-    @Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,女=1")
683
+    @Excel(name = "被申请人主体信息-性别",width = 26,combo= {"男","女"},readConverterExp = "0=男,1=女")
684
     private String responSex;
684
     private String responSex;
685
 
685
 
686
     public Date getResponBirth() {
686
     public Date getResponBirth() {

+ 14
- 5
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/AdjudicationServiceImpl.java Просмотреть файл

102
                     } else if (identityType == 2) {  //被申请人
102
                     } else if (identityType == 2) {  //被申请人
103
                         datas.put("resName", affiliate.getName());
103
                         datas.put("resName", affiliate.getName());
104
                         datas.put("resAddress", affiliate.getResidenAffili());
104
                         datas.put("resAddress", affiliate.getResidenAffili());
105
-                        datas.put("resSex", affiliate.getResponSex());
105
+                        String responSex = affiliate.getResponSex();
106
+                        if (responSex.equals("0")){
107
+                            datas.put("resSex","男");
108
+                        }else{
109
+                            datas.put("resSex","女");
110
+                        }
106
                         Date responBirth = affiliate.getResponBirth();
111
                         Date responBirth = affiliate.getResponBirth();
107
                         if (responBirth != null) {
112
                         if (responBirth != null) {
108
                             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
113
                             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
109
                             String responBirthStr = sdf.format(responBirth);
114
                             String responBirthStr = sdf.format(responBirth);
110
                             datas.put("resDateOfBirth", responBirthStr);
115
                             datas.put("resDateOfBirth", responBirthStr);
111
-
112
                         }
116
                         }
113
                         datas.put("resContactAddress", affiliate.getContactAddress());
117
                         datas.put("resContactAddress", affiliate.getContactAddress());
114
                         nameAgentList.add(affiliate.getNameAgent());
118
                         nameAgentList.add(affiliate.getNameAgent());
253
             //申请人证据材料
257
             //申请人证据材料
254
             datas.put("appEvidenceMaterial", null);
258
             datas.put("appEvidenceMaterial", null);
255
             //被申请人证据材料
259
             //被申请人证据材料
256
-            datas.put("resEvidenceMaterial", null);
260
+            datas.put("resEvidenceMaterial","(详见附件列表)");
257
             datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
261
             datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
258
             if (arbitrateRecord1 != null) {
262
             if (arbitrateRecord1 != null) {
259
                 datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
263
                 datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
647
                     } else if (identityType == 2) {  //被申请人
651
                     } else if (identityType == 2) {  //被申请人
648
                         datas.put("resName", affiliate.getName());
652
                         datas.put("resName", affiliate.getName());
649
                         datas.put("resAddress", affiliate.getResidenAffili());
653
                         datas.put("resAddress", affiliate.getResidenAffili());
650
-                        datas.put("resSex", affiliate.getResponSex());
654
+                        String responSex = affiliate.getResponSex();
655
+                        if (responSex.equals("0")){
656
+                            datas.put("resSex","男");
657
+                        }else{
658
+                            datas.put("resSex","女");
659
+                        }
651
                         Date responBirth = affiliate.getResponBirth();
660
                         Date responBirth = affiliate.getResponBirth();
652
                         if (responBirth != null) {
661
                         if (responBirth != null) {
653
                             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
662
                             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
798
             //申请人证据材料
807
             //申请人证据材料
799
             datas.put("appEvidenceMaterial", null);
808
             datas.put("appEvidenceMaterial", null);
800
             //被申请人证据材料
809
             //被申请人证据材料
801
-            datas.put("resEvidenceMaterial", null);
810
+            datas.put("resEvidenceMaterial","(详见附件列表)");
802
             datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
811
             datas.put("applicaCrossOpin", caseApplication1.getApplicaCrossOpin());
803
             if (arbitrateRecord1 != null) {
812
             if (arbitrateRecord1 != null) {
804
                 datas.put("factDetermi", arbitrateRecord1.getFactDetermi());
813
                 datas.put("factDetermi", arbitrateRecord1.getFactDetermi());

+ 31
- 12
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/CaseApplicationServiceImpl.java Просмотреть файл

115
         Long userId = user.getUserId();
115
         Long userId = user.getUserId();
116
         // 查询登录人身份证号
116
         // 查询登录人身份证号
117
         SysUser sysUser = sysUserMapper.selectUserById(userId);
117
         SysUser sysUser = sysUserMapper.selectUserById(userId);
118
+        startPage();
118
         // 已办案件
119
         // 已办案件
119
         if(caseApplication.getSelectCaseStatus().equals("1")){
120
         if(caseApplication.getSelectCaseStatus().equals("1")){
120
             caseApplication.setLoginUserName(sysUser.getUserName());
121
             caseApplication.setLoginUserName(sysUser.getUserName());
125
             if (CollectionUtil.isEmpty(roles)) {
126
             if (CollectionUtil.isEmpty(roles)) {
126
                 throw new ServiceException("该用户没有角色权限");
127
                 throw new ServiceException("该用户没有角色权限");
127
             }
128
             }
128
-            startPage();
129
+
129
             for (SysRole role : roles) {
130
             for (SysRole role : roles) {
130
                 // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
131
                 // 超级管理员和仲裁委(部门长)案件,可查看所有案件 √
131
                 if (role.getRoleName().equals("超级管理员")
132
                 if (role.getRoleName().equals("超级管理员")
136
                         || role.getRoleName().equals("部门长")) {
137
                         || role.getRoleName().equals("部门长")) {
137
                     List<Integer> caseStatusList = new ArrayList<>();
138
                     List<Integer> caseStatusList = new ArrayList<>();
138
                     caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
139
                     caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
139
-                    caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
140
                     caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
140
                     caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
141
                     caseApplication.setDeptHeadStatus(caseStatusList);
141
                     caseApplication.setDeptHeadStatus(caseStatusList);
142
                 }
142
                 }
196
                     ||role.getRoleName().equals("部门长")){
196
                     ||role.getRoleName().equals("部门长")){
197
 
197
 
198
                 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
198
                 caseStatusList.add(CaseApplicationConstants.CONFIRMDED_PENDING_TRIAL);
199
-                caseStatusList.add(CaseApplicationConstants.SIGN_ARBITRATION);
200
                 caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
199
                 caseStatusList.add(CaseApplicationConstants.ARBITRATED_SEAL);
201
                 caseApplication.setDeptHeadStatus(caseStatusList);
200
                 caseApplication.setDeptHeadStatus(caseStatusList);
202
             }
201
             }
258
 //        caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
257
 //        caseApplication.setCaseStatus(CaseApplicationConstants.PENDING_OPENCOURT_HEAR);
259
         caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
258
         caseApplication.setCaseStatus(CaseApplicationConstants.CHECK_ARBITRATION_METHOD);
260
         int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
259
         int rows = caseApplicationMapper.submitCaseApplication(caseApplication);
260
+       //1975139	修改开庭时间通知 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已改为{3},请知晓,如非本人操作,请忽略本短信
261
+        //发送短信通知
262
+        SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
263
+        request.setTemplateId("1975139");
261
 
264
 
265
+        // 发送开庭日期通知短信
266
+        sendHearDateMessage(caseApplication,request,"1975139");
262
         // 新增日志
267
         // 新增日志
263
         CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,"");
268
         CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.CHECK_ARBITRATION_METHOD,"");
264
         return rows;
269
         return rows;
2136
             }
2141
             }
2137
         }
2142
         }
2138
 
2143
 
2139
-        //发送短信通知
2144
+        //发送短信通知 1947342 尊敬的{1}用户,您的{2}仲裁案件,开庭日期已确定为{3},请知晓,如非本人操作,请忽略本短信。
2140
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
2145
         SmsUtils.SendSmsRequest request = new SmsUtils.SendSmsRequest();
2141
         request.setTemplateId("1947342");
2146
         request.setTemplateId("1947342");
2147
+        // 发送开庭日期通知短信
2148
+        sendHearDateMessage(caseApplication,request,"1947342");
2149
+        // 新增日志
2150
+        CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.MODIFY_HEARDATE,"");
2142
 
2151
 
2152
+        return rows;
2153
+
2154
+    }
2155
+
2156
+    /**
2157
+     * 发送开庭日期通知短信
2158
+     * @param caseApplication
2159
+     * @param request
2160
+     */
2161
+    private void sendHearDateMessage(CaseApplication caseApplication, SmsUtils.SendSmsRequest request,String templateId) {
2143
         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
2162
         CaseApplication caseApplicationselect = caseApplicationMapper.selectCaseApplication(caseApplication);
2163
+
2144
         String caseNum = caseApplicationselect.getCaseNum();
2164
         String caseNum = caseApplicationselect.getCaseNum();
2145
         Date hearDate = caseApplicationselect.getHearDate();
2165
         Date hearDate = caseApplicationselect.getHearDate();
2146
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2166
         SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
2147
         String hearDatestr = dateFormat.format(hearDate);
2167
         String hearDatestr = dateFormat.format(hearDate);
2148
-
2149
         String arbitratorId = caseApplicationselect.getArbitratorId();
2168
         String arbitratorId = caseApplicationselect.getArbitratorId();
2150
 //        List<Arbitrator> arbitratorList = new ArrayList<>();
2169
 //        List<Arbitrator> arbitratorList = new ArrayList<>();
2151
         if(StringUtils.isNotEmpty(arbitratorId)){
2170
         if(StringUtils.isNotEmpty(arbitratorId)){
2170
                         smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
2189
                         smsSendRecord.setCaseNum(caseApplicationselect.getCaseNum());
2171
                         smsSendRecord.setPhone(request.getPhone());
2190
                         smsSendRecord.setPhone(request.getPhone());
2172
                         smsSendRecord.setSendTime(new Date());
2191
                         smsSendRecord.setSendTime(new Date());
2173
-                        String content="尊敬的"+name+"用户,您的"+caseNum+"仲裁案件,开庭日期已确定为"+hearDatestr+",请知晓,如非本人操作,请忽略本短信。";
2192
+                        String content="";
2193
+                        if(templateId.equals("1947342")) {
2194
+                             content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已确定为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
2195
+                        }
2196
+                        if(templateId.equals("1975139")) {
2197
+                            content = "尊敬的" + name + "用户,您的" + caseNum + "仲裁案件,开庭日期已改为" + hearDatestr + ",请知晓,如非本人操作,请忽略本短信。";
2198
+                        }
2174
                         smsSendRecord.setSendContent(content);
2199
                         smsSendRecord.setSendContent(content);
2175
                         smsSendRecord.setCreateBy(getUsername());
2200
                         smsSendRecord.setCreateBy(getUsername());
2176
                         smsRecordMapper.saveSmsSendRecord(smsSendRecord);
2201
                         smsRecordMapper.saveSmsSendRecord(smsSendRecord);
2212
                 }
2237
                 }
2213
             }
2238
             }
2214
         }
2239
         }
2215
-        // 新增日志
2216
-        CaseLogUtils.insertCaseLog(caseApplication.getId(),CaseApplicationConstants.MODIFY_HEARDATE,"");
2217
-
2218
-        return rows;
2219
-
2220
     }
2240
     }
2221
 
2241
 
2222
 
2242
 
2223
-
2224
     @Override
2243
     @Override
2225
     @Transactional
2244
     @Transactional
2226
     public int pendingAppointArbotrar(CaseApplication caseApplication) {
2245
     public int pendingAppointArbotrar(CaseApplication caseApplication) {

+ 4
- 9
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseApplicationMapper.xml Просмотреть файл

82
             <if test="loginUserName != null and loginUserName != ''">
82
             <if test="loginUserName != null and loginUserName != ''">
83
                 AND r.create_by=#{loginUserName}  AND ca.identity_type=1
83
                 AND r.create_by=#{loginUserName}  AND ca.identity_type=1
84
             </if>
84
             </if>
85
-            <if test="caseStatusList != null and caseStatusList.size() > 0">
86
-                and r.case_node in
87
-                <foreach item="caseStatus" collection="caseStatusList" open="(" separator="," close=")">
88
-                    #{caseStatus}
89
-                </foreach>
90
-            </if>
85
+
91
         </where>
86
         </where>
92
         order by c.create_time desc,c.case_num desc
87
         order by c.create_time desc,c.case_num desc
93
     </select>
88
     </select>
150
             <!--仲裁员-->
145
             <!--仲裁员-->
151
             <if test="userId != null and userId != ''">
146
             <if test="userId != null and userId != ''">
152
                 or ( t.identity_type=1 and
147
                 or ( t.identity_type=1 and
153
-                t.case_status in (7,8,9,12,13,14,17)
148
+                t.case_status in (7,8,9,12,13,17)
154
                 and
149
                 and
155
                 instr (t.arbitrator_id,#{userId})>0)
150
                 instr (t.arbitrator_id,#{userId})>0)
156
             </if>
151
             </if>
238
             <!--仲裁员-->
233
             <!--仲裁员-->
239
             <if test="userId != null and userId != ''">
234
             <if test="userId != null and userId != ''">
240
                 or ( t.identity_type=1 and
235
                 or ( t.identity_type=1 and
241
-                t.case_status in (7,8,9,12,13,14,17)
236
+                t.case_status in (7,8,9,12,13,17)
242
                 and
237
                 and
243
                 instr (t.arbitrator_id,#{userId})>0)
238
                 instr (t.arbitrator_id,#{userId})>0)
244
             </if>
239
             </if>
600
                CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
595
                CASE c.pay_type when 0 then '线上支付' when 0 then '线下支付' else '' end payTypeName
601
         from case_application c left join case_payment_record p on c.id  = p.case_id
596
         from case_application c left join case_payment_record p on c.id  = p.case_id
602
         where c.case_status  = 3
597
         where c.case_status  = 3
603
-          AND c.id = #{id}
598
+          AND c.id = #{id} and p.payment_status=1
604
 
599
 
605
     </select>
600
     </select>
606
     <select id="selectCaseNumLike" resultType="java.lang.Integer">
601
     <select id="selectCaseNumLike" resultType="java.lang.Integer">

+ 2
- 2
ruoyi-system/src/main/resources/mapper/wisdomarbitrate/CaseLogRecordMapper.xml Просмотреть файл

25
             cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime,cl.update_by updateBy,cl.update_time updateTime,
25
             cl.create_by createBy,cl.create_nick_name createNickName,cl.create_time createTime,cl.update_by updateBy,cl.update_time updateTime,
26
         CASE cl.case_node when 0 then '立案申请' when 1 then '提交立案申请' when 2 then '立案审查'
26
         CASE cl.case_node when 0 then '立案申请' when 1 then '提交立案申请' when 2 then '立案审查'
27
         when 3 then '支付成功' when 4 then '缴费确认' when 5 then '案件质证'
27
         when 3 then '支付成功' when 4 then '缴费确认' when 5 then '案件质证'
28
-        when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '审核仲裁方式'
29
-        when 9 then '开庭审理' when 10 then '书面审理' when 11 then '生成裁決书'
28
+        when 6 then '组庭审核' when 7 then '组庭确认' when 8 then '当前仲裁方式为开庭审理'
29
+        when 9 then '当前仲裁方式为书面审理' when 10 then '书面审理' when 11 then '生成裁決书'
30
         when 12 then '核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
30
         when 12 then '核验裁决书' when 13 then '同意裁决书' when 14 then '签名成功'
31
         when 15 then '用印成功' when 16 then '送达仲裁文书' when 17 then '案件归档'
31
         when 15 then '用印成功' when 16 then '送达仲裁文书' when 17 then '案件归档'
32
         when 26 then '证据确认成功'
32
         when 26 then '证据确认成功'