|
@@ -110,6 +110,40 @@ public class AitagTagLogController {
|
|
|
return ResultDto.success(taggingDetailsResDTO);
|
|
return ResultDto.success(taggingDetailsResDTO);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// /**
|
|
|
|
|
+// * 导出数据
|
|
|
|
|
+// *
|
|
|
|
|
+// * @param transactionReqVo
|
|
|
|
|
+// * @return ResultDto
|
|
|
|
|
+// */
|
|
|
|
|
+// @ApiOperation("导出数据")
|
|
|
|
|
+// @PostMapping("/exportData")
|
|
|
|
|
+// public void exportData(@RequestBody TaggingTransactionReqVo transactionReqVo,HttpServletResponse response) throws IOException {
|
|
|
|
|
+// List<AitagTagLogEntity> aitagTagLogEntities = aitagTagLogService.queryList(transactionReqVo);
|
|
|
|
|
+// List<ExportDataVo> exportDataVos = new ArrayList<>();
|
|
|
|
|
+// for (AitagTagLogEntity aitagTagLog:aitagTagLogEntities) {
|
|
|
|
|
+// ExportDataVo exportDataVo = JSONObject.parseObject(JSONObject.toJSONString(aitagTagLog), ExportDataVo.class);
|
|
|
|
|
+// if(FEEDBACK_RESULT_REJECT.equals(aitagTagLog.getFeedback())){
|
|
|
|
|
+// String feedbackResult = aitagTagLog.getFeedbackResult();
|
|
|
|
|
+// exportDataVo.setResult(getTags(feedbackResult));
|
|
|
|
|
+// }else{
|
|
|
|
|
+// String result = aitagTagLog.getResult();
|
|
|
|
|
+// exportDataVo.setResult(getTags(result));
|
|
|
|
|
+// }
|
|
|
|
|
+// exportDataVos.add(exportDataVo);
|
|
|
|
|
+// }
|
|
|
|
|
+// // 2. 设置响应头(防止中文乱码)
|
|
|
|
|
+// response.reset();
|
|
|
|
|
+// response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
|
|
+// response.setCharacterEncoding("utf-8");
|
|
|
|
|
+// String fileName = URLEncoder.encode("导出标签", "UTF-8").replaceAll("\\+", "%20");
|
|
|
|
|
+// response.setHeader("Content-Disposition", "attachment; filename*=utf-8''" + fileName + ".xlsx");
|
|
|
|
|
+// EasyExcel.write(response.getOutputStream(), ExportDataVo.class)
|
|
|
|
|
+// .sheet("标签数据")
|
|
|
|
|
+// .doWrite(exportDataVos);
|
|
|
|
|
+// }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 导出数据
|
|
* 导出数据
|
|
|
*
|
|
*
|
|
@@ -117,8 +151,8 @@ public class AitagTagLogController {
|
|
|
* @return ResultDto
|
|
* @return ResultDto
|
|
|
*/
|
|
*/
|
|
|
@ApiOperationType("导出数据")
|
|
@ApiOperationType("导出数据")
|
|
|
- @PostMapping("/exportData")
|
|
|
|
|
- public void exportData(@RequestBody TaggingTransactionReqVo transactionReqVo,HttpServletResponse response) throws IOException {
|
|
|
|
|
|
|
+ @GetMapping("/exportData")
|
|
|
|
|
+ public void exportData(TaggingTransactionReqVo transactionReqVo,HttpServletResponse response) throws IOException {
|
|
|
List<AitagTagLogEntity> aitagTagLogEntities = aitagTagLogService.queryList(transactionReqVo);
|
|
List<AitagTagLogEntity> aitagTagLogEntities = aitagTagLogService.queryList(transactionReqVo);
|
|
|
List<ExportDataVo> exportDataVos = new ArrayList<>();
|
|
List<ExportDataVo> exportDataVos = new ArrayList<>();
|
|
|
for (AitagTagLogEntity aitagTagLog:aitagTagLogEntities) {
|
|
for (AitagTagLogEntity aitagTagLog:aitagTagLogEntities) {
|
|
@@ -143,11 +177,11 @@ public class AitagTagLogController {
|
|
|
.doWrite(exportDataVos);
|
|
.doWrite(exportDataVos);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
private String getTags(String result) {
|
|
private String getTags(String result) {
|
|
|
if(StringUtils.isBlank(result)){
|
|
if(StringUtils.isBlank(result)){
|
|
|
return "";
|
|
return "";
|
|
|
}
|
|
}
|
|
|
|
|
+ result = result.replace("\\", "");
|
|
|
List<Map> results = JSONArray.parseArray(result, Map.class);
|
|
List<Map> results = JSONArray.parseArray(result, Map.class);
|
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
StringBuilder stringBuilder = new StringBuilder();
|
|
|
for (int i = 0 ;i<results.size();i++){
|
|
for (int i = 0 ;i<results.size();i++){
|