Showing
6 changed files
with
62 additions
and
47 deletions
1 | package com.ash.controller; | 1 | package com.ash.controller; |
2 | 2 | ||
3 | import com.alibaba.excel.EasyExcel; | 3 | import com.alibaba.excel.EasyExcel; |
4 | -import com.alibaba.excel.exception.ExcelDataConvertException; | ||
5 | import com.ash.base.AshErrorCode; | 4 | import com.ash.base.AshErrorCode; |
6 | import com.ash.base.BaseController; | 5 | import com.ash.base.BaseController; |
7 | import com.ash.base.JsonResult; | 6 | import com.ash.base.JsonResult; |
@@ -23,7 +22,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | @@ -23,7 +22,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||
23 | import lombok.extern.slf4j.Slf4j; | 22 | import lombok.extern.slf4j.Slf4j; |
24 | import org.apache.commons.collections.CollectionUtils; | 23 | import org.apache.commons.collections.CollectionUtils; |
25 | import org.apache.commons.lang3.StringUtils; | 24 | import org.apache.commons.lang3.StringUtils; |
26 | -import org.apache.ibatis.annotations.Param; | ||
27 | import org.springframework.beans.BeanUtils; | 25 | import org.springframework.beans.BeanUtils; |
28 | import org.springframework.web.bind.annotation.*; | 26 | import org.springframework.web.bind.annotation.*; |
29 | import org.springframework.web.multipart.MultipartFile; | 27 | import org.springframework.web.multipart.MultipartFile; |
@@ -218,6 +216,7 @@ public class CaseController extends BaseController { | @@ -218,6 +216,7 @@ public class CaseController extends BaseController { | ||
218 | ed.setTrackingNumber(analysis.getTrackingNumber()); | 216 | ed.setTrackingNumber(analysis.getTrackingNumber()); |
219 | ed.setExpressCompany(analysis.getExpressCompany()); | 217 | ed.setExpressCompany(analysis.getExpressCompany()); |
220 | ed.setDeliverWealth(analysis.getDeliverWealth()); | 218 | ed.setDeliverWealth(analysis.getDeliverWealth()); |
219 | + ed.setIdCard(analysis.getIdCard()); | ||
221 | } | 220 | } |
222 | 221 | ||
223 | return ed; | 222 | return ed; |
@@ -236,25 +235,29 @@ public class CaseController extends BaseController { | @@ -236,25 +235,29 @@ public class CaseController extends BaseController { | ||
236 | 235 | ||
237 | @GetMapping(value = "/reAnalysis") | 236 | @GetMapping(value = "/reAnalysis") |
238 | public JsonResult reAnalysis(@RequestParam(value = "id", required = false) String id) throws IOException { | 237 | public JsonResult reAnalysis(@RequestParam(value = "id", required = false) String id) throws IOException { |
238 | + List<Case> reAnaLysisList = new ArrayList<>(); | ||
239 | + if (StringUtils.isNotBlank(id)) { | ||
240 | + Case data = caseService.load(id); | ||
241 | + data.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
242 | + caseService.update(data); | ||
243 | + reAnaLysisList.add(data); | ||
244 | + } else { | ||
245 | + List<Case> dataList = caseService.listUnAnalysis(); | ||
246 | + if (CollectionUtils.isNotEmpty(dataList)) { | ||
247 | + dataList.forEach(e -> { | ||
248 | + e.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
249 | + caseService.update(e); | ||
250 | + }); | ||
251 | + reAnaLysisList.addAll(dataList); | ||
252 | + } | ||
253 | + | ||
254 | + } | ||
255 | + if (CollectionUtils.isEmpty(reAnaLysisList)) { | ||
256 | + return JsonResult.ok("没有需要重新解析的数据!"); | ||
257 | + } | ||
239 | executorService.execute(() -> { | 258 | executorService.execute(() -> { |
240 | try { | 259 | try { |
241 | - if (StringUtils.isNotBlank(id)) { | ||
242 | - Case data = caseService.load(id); | ||
243 | - data.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
244 | - caseService.update(data); | ||
245 | - caseService.analysis(Collections.singletonList(data)); | ||
246 | - } else { | ||
247 | - List<Case> dataList = caseService.listUnAnalysis(); | ||
248 | - if (CollectionUtils.isNotEmpty(dataList)) { | ||
249 | - dataList.forEach(e -> { | ||
250 | - e.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
251 | - caseService.update(e); | ||
252 | - }); | ||
253 | - caseService.analysis(dataList); | ||
254 | - } | ||
255 | - | ||
256 | - } | ||
257 | - | 260 | + caseService.analysis(reAnaLysisList); |
258 | } catch (Exception ex) { | 261 | } catch (Exception ex) { |
259 | log.error(ex.getMessage()); | 262 | log.error(ex.getMessage()); |
260 | } | 263 | } |
@@ -497,7 +497,7 @@ public class StatisticsController extends BaseController { | @@ -497,7 +497,7 @@ public class StatisticsController extends BaseController { | ||
497 | String fileName = UUIDGenerator.uuid() + ".docx"; | 497 | String fileName = UUIDGenerator.uuid() + ".docx"; |
498 | String filePath = JFChartUtils.OUTPUT_DIR + fileName; | 498 | String filePath = JFChartUtils.OUTPUT_DIR + fileName; |
499 | 499 | ||
500 | - String dataRange = "【" + (startTime.equals(endTime) ? startTime : startTime + "~" + endTime) + "】"; | 500 | + String dataRange = (startTime.equals(endTime) ? startTime : startTime + "~" + endTime); |
501 | List<String> tempFilePath = new ArrayList<>(); | 501 | List<String> tempFilePath = new ArrayList<>(); |
502 | buildWord(dataMap, dataRange, filePath, tempFilePath); | 502 | buildWord(dataMap, dataRange, filePath, tempFilePath); |
503 | try { | 503 | try { |
@@ -238,28 +238,31 @@ public class WarningInstanceController extends BaseController { | @@ -238,28 +238,31 @@ public class WarningInstanceController extends BaseController { | ||
238 | 238 | ||
239 | @GetMapping(value = "/reAnalysis") | 239 | @GetMapping(value = "/reAnalysis") |
240 | public JsonResult reAnalysis(@RequestParam(value = "id", required = false) String id) throws IOException { | 240 | public JsonResult reAnalysis(@RequestParam(value = "id", required = false) String id) throws IOException { |
241 | + List<WarningInstance> reAnaLysisList=new ArrayList<>(); | ||
242 | + if (StringUtils.isNotBlank(id)) { | ||
243 | + WarningInstance data = warningInstanceService.load(id); | ||
244 | + if (data != null) { | ||
245 | + data.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
246 | + warningInstanceService.update(data); | ||
247 | + reAnaLysisList.add(data); | ||
248 | + } | ||
249 | + | ||
250 | + } else { | ||
251 | + List<WarningInstance> dataList = warningInstanceService.listUnAnalysis(); | ||
252 | + if (CollectionUtils.isNotEmpty(dataList)) { | ||
253 | + dataList.forEach(e -> { | ||
254 | + e.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
255 | + warningInstanceService.update(e); | ||
256 | + }); | ||
257 | + reAnaLysisList.addAll(dataList); | ||
258 | + } | ||
259 | + } | ||
260 | + if(CollectionUtils.isEmpty(reAnaLysisList)){ | ||
261 | + return JsonResult.ok("没有需要重新解析的数据!"); | ||
262 | + } | ||
241 | executorService.execute(() -> { | 263 | executorService.execute(() -> { |
242 | try { | 264 | try { |
243 | - if (StringUtils.isNotBlank(id)) { | ||
244 | - WarningInstance data = warningInstanceService.load(id); | ||
245 | - if (data != null) { | ||
246 | - data.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
247 | - warningInstanceService.update(data); | ||
248 | - warningInstanceService.analysis(Collections.singletonList(data)); | ||
249 | - } | ||
250 | - | ||
251 | - } else { | ||
252 | - List<WarningInstance> dataList = warningInstanceService.listUnAnalysis(); | ||
253 | - if (CollectionUtils.isNotEmpty(dataList)) { | ||
254 | - dataList.forEach(e -> { | ||
255 | - e.setAnalysisStatus(AnalysisStatusEnum.analysis); | ||
256 | - warningInstanceService.update(e); | ||
257 | - }); | ||
258 | - warningInstanceService.analysis(dataList); | ||
259 | - } | ||
260 | - | ||
261 | - } | ||
262 | - | 265 | + warningInstanceService.analysis(reAnaLysisList); |
263 | } catch (Exception ex) { | 266 | } catch (Exception ex) { |
264 | log.error(ex.getMessage()); | 267 | log.error(ex.getMessage()); |
265 | 268 |
@@ -97,44 +97,52 @@ public class CaseExportExcelData implements Serializable { | @@ -97,44 +97,52 @@ public class CaseExportExcelData implements Serializable { | ||
97 | @ColumnWidth(25) | 97 | @ColumnWidth(25) |
98 | private String career; | 98 | private String career; |
99 | 99 | ||
100 | + | ||
101 | + @ExcelCheck(canEmpty = false) | ||
102 | + @ExcelProperty(value = "身份证号码", index = 12) | ||
103 | + @ContentStyle(dataFormat = 49) | ||
104 | + @ColumnWidth(25) | ||
105 | + private String idCard; | ||
106 | + | ||
107 | + | ||
100 | @ExcelCheck(canEmpty = false) | 108 | @ExcelCheck(canEmpty = false) |
101 | - @ExcelProperty(value = "诈骗类型", index = 12) | 109 | + @ExcelProperty(value = "诈骗类型", index = 13) |
102 | @ContentStyle(dataFormat = 49) | 110 | @ContentStyle(dataFormat = 49) |
103 | @ColumnWidth(25) | 111 | @ColumnWidth(25) |
104 | private String fraudType; | 112 | private String fraudType; |
105 | 113 | ||
106 | @ExcelCheck(canEmpty = false) | 114 | @ExcelCheck(canEmpty = false) |
107 | - @ExcelProperty(value = "引流方式", index = 13) | 115 | + @ExcelProperty(value = "引流方式", index = 14) |
108 | @ContentStyle(dataFormat = 49) | 116 | @ContentStyle(dataFormat = 49) |
109 | @ColumnWidth(25) | 117 | @ColumnWidth(25) |
110 | private String rainageMethod; | 118 | private String rainageMethod; |
111 | 119 | ||
112 | @ExcelCheck(canEmpty = false) | 120 | @ExcelCheck(canEmpty = false) |
113 | - @ExcelProperty(value = "支付方式", index = 14) | 121 | + @ExcelProperty(value = "支付方式", index = 15) |
114 | @ContentStyle(dataFormat = 49) | 122 | @ContentStyle(dataFormat = 49) |
115 | @ColumnWidth(25) | 123 | @ColumnWidth(25) |
116 | private String payMethod; | 124 | private String payMethod; |
117 | 125 | ||
118 | @ExcelCheck(canEmpty = false) | 126 | @ExcelCheck(canEmpty = false) |
119 | - @ExcelProperty(value = "引流电话", index = 15) | 127 | + @ExcelProperty(value = "引流电话", index = 16) |
120 | @ContentStyle(dataFormat = 49) | 128 | @ContentStyle(dataFormat = 49) |
121 | @ColumnWidth(25) | 129 | @ColumnWidth(25) |
122 | private String rainagePhone; | 130 | private String rainagePhone; |
123 | 131 | ||
124 | @ExcelCheck(canEmpty = false) | 132 | @ExcelCheck(canEmpty = false) |
125 | - @ExcelProperty(value = "快递单号", index = 16) | 133 | + @ExcelProperty(value = "快递单号", index = 17) |
126 | @ContentStyle(dataFormat = 49) | 134 | @ContentStyle(dataFormat = 49) |
127 | @ColumnWidth(25) | 135 | @ColumnWidth(25) |
128 | private String trackingNumber; | 136 | private String trackingNumber; |
129 | 137 | ||
130 | @ExcelCheck(canEmpty = false) | 138 | @ExcelCheck(canEmpty = false) |
131 | - @ExcelProperty(value = "快递公司", index = 17) | 139 | + @ExcelProperty(value = "快递公司", index = 18) |
132 | @ContentStyle(dataFormat = 49) | 140 | @ContentStyle(dataFormat = 49) |
133 | @ColumnWidth(25) | 141 | @ColumnWidth(25) |
134 | private String expressCompany; | 142 | private String expressCompany; |
135 | 143 | ||
136 | @ExcelCheck(canEmpty = false) | 144 | @ExcelCheck(canEmpty = false) |
137 | - @ExcelProperty(value = "受害人是否寄递黄金、现金", index = 18) | 145 | + @ExcelProperty(value = "受害人是否寄递黄金、现金", index = 19) |
138 | @ContentStyle(dataFormat = 49) | 146 | @ContentStyle(dataFormat = 49) |
139 | @ColumnWidth(25) | 147 | @ColumnWidth(25) |
140 | private String deliverWealth; | 148 | private String deliverWealth; |
@@ -127,6 +127,7 @@ public class CaseAnalysisService { | @@ -127,6 +127,7 @@ public class CaseAnalysisService { | ||
127 | update(data); | 127 | update(data); |
128 | Case caseInfo = caseService.load(data.getCaseId()); | 128 | Case caseInfo = caseService.load(data.getCaseId()); |
129 | caseInfo.setReviewStatus(ReviewStatusEnum.AUDITED); | 129 | caseInfo.setReviewStatus(ReviewStatusEnum.AUDITED); |
130 | + caseInfo.setTotalAmount(data.getTotalAmount()); | ||
130 | caseService.update(caseInfo); | 131 | caseService.update(caseInfo); |
131 | return result; | 132 | return result; |
132 | } | 133 | } |
No preview for this file type