|
@@ -3,10 +3,14 @@ package com.rongwei.bscommon.sys.service.impl;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import cn.hutool.core.io.FileUtil;
|
|
|
import cn.hutool.core.util.ArrayUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
import com.aspose.cells.*;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -26,6 +30,7 @@ import com.rongwei.bsentity.vo.ZhcxProjectRectifyMachineVo;
|
|
|
import com.rongwei.bsentity.vo.ZhcxProjectRectifyVo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
+import com.rongwei.rwcommon.utils.JSONUtils;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
import com.rongwei.rwcommoncomponent.excel.aspose.ExcelUtils;
|
|
@@ -35,6 +40,7 @@ import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
import org.springframework.core.io.Resource;
|
|
@@ -91,6 +97,9 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
@Autowired
|
|
|
private ZhcxProjectRectifySnapService zhcxProjectRectifySnapService;
|
|
|
|
|
|
+ @Value("${file.writeRootPath}")
|
|
|
+ private String writeRootPath;
|
|
|
+
|
|
|
|
|
|
private static final Color[] COLORS = {Color.fromArgb(255, 255, 204),
|
|
|
Color.fromArgb(210, 242, 210),
|
|
@@ -206,6 +215,10 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
|
|
|
ZhcxProjectManageRectifyBatchDo batchDo = projectManageRectifyBatchService.getById(batchId);
|
|
|
|
|
|
+// String fileName = batchId.concat(".json");
|
|
|
+// String jsonString = FileUtil.readUtf8String(writeRootPath.concat(File.separator).concat(fileName));
|
|
|
+// List<JSONObject> sheetList = new ArrayList<>();
|
|
|
+// sheetList.add(JSON.parseObject(jsonString));
|
|
|
List<JSONObject> sheetList = luckySheetFeignService.getExcelJson(batchDo.getSummaryfiles());
|
|
|
|
|
|
SavePorjectSummaryDto summaryDto = SavePorjectSummaryDto.builder()
|
|
@@ -217,6 +230,31 @@ public class ZhcxProjectManageServiceImpl extends ServiceImpl<ZhcxProjectManageD
|
|
|
saveSummaryData(summaryDto);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 保存汇总数据
|
|
|
+ *
|
|
|
+ * @param dto
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void saveSummaryDataByDto(SavePorjectSummaryDto dto) {
|
|
|
+ ZhcxProjectManageRectifyBatchDo batchDo = projectManageRectifyBatchService.getById(dto.getBatchId());
|
|
|
+
|
|
|
+ String fileName = dto.getListId().concat(".json");
|
|
|
+
|
|
|
+ String jsonString = FileUtil.readUtf8String(writeRootPath.concat(File.separator).concat(fileName));
|
|
|
+ List<JSONObject> sheetList = new ArrayList<>();
|
|
|
+ sheetList.add(JSON.parseObject(jsonString));
|
|
|
+// List<JSONObject> sheetList = luckySheetFeignService.getExcelJson(batchDo.getSummaryfiles());
|
|
|
+
|
|
|
+ SavePorjectSummaryDto summaryDto = SavePorjectSummaryDto.builder()
|
|
|
+ .batchId(dto.getBatchId())
|
|
|
+ .projectId(batchDo.getProjectid())
|
|
|
+ .sheetList(sheetList)
|
|
|
+ .build();
|
|
|
+
|
|
|
+ saveSummaryData(summaryDto);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public R getRectifyReportData(Map<String, Object> map) {
|
|
|
Object projectIdObj = map.get("projectId");
|