|
@@ -3,23 +3,20 @@ package com.rongwei.bscommon.sys.service.impl;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
-import com.aspose.cells.*;
|
|
|
|
import com.aspose.cells.BorderType;
|
|
import com.aspose.cells.BorderType;
|
|
import com.aspose.cells.Style;
|
|
import com.aspose.cells.Style;
|
|
-import com.aspose.words.*;
|
|
|
|
|
|
+import com.aspose.cells.*;
|
|
import com.aspose.words.Cell;
|
|
import com.aspose.words.Cell;
|
|
import com.aspose.words.Range;
|
|
import com.aspose.words.Range;
|
|
import com.aspose.words.Row;
|
|
import com.aspose.words.Row;
|
|
-import com.aspose.words.SaveFormat;
|
|
|
|
-import com.aspose.words.SaveOptions;
|
|
|
|
|
|
+import com.aspose.words.*;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.rongwei.bscommon.sys.dao.ZhcxPersistentManageDao;
|
|
import com.rongwei.bscommon.sys.dao.ZhcxPersistentManageDao;
|
|
import com.rongwei.bscommon.sys.service.ZhcxDeptPeopleCountService;
|
|
import com.rongwei.bscommon.sys.service.ZhcxDeptPeopleCountService;
|
|
import com.rongwei.bscommon.sys.service.ZhcxPersistentManageService;
|
|
import com.rongwei.bscommon.sys.service.ZhcxPersistentManageService;
|
|
-import com.rongwei.bsentity.domain.ZhcxDeptPeopleCountDo;
|
|
|
|
-import com.rongwei.bsentity.domain.ZhcxPersistentManageDo;
|
|
|
|
|
|
+import com.rongwei.bsentity.domain.*;
|
|
import com.rongwei.bsentity.dto.ZhcxPersistentManageDto;
|
|
import com.rongwei.bsentity.dto.ZhcxPersistentManageDto;
|
|
import com.rongwei.bsentity.dto.ZhcxPersistentReportDto;
|
|
import com.rongwei.bsentity.dto.ZhcxPersistentReportDto;
|
|
import com.rongwei.bsentity.vo.FormDataVO;
|
|
import com.rongwei.bsentity.vo.FormDataVO;
|
|
@@ -54,8 +51,8 @@ import java.time.DayOfWeek;
|
|
import java.time.LocalDate;
|
|
import java.time.LocalDate;
|
|
import java.time.ZoneId;
|
|
import java.time.ZoneId;
|
|
import java.time.temporal.WeekFields;
|
|
import java.time.temporal.WeekFields;
|
|
-import java.util.*;
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.*;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
@@ -84,43 +81,44 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
private static final String DEPT_CODE = "0900";
|
|
private static final String DEPT_CODE = "0900";
|
|
private static final Color[] COLORS = {Color.fromArgb(205, 223, 242),
|
|
private static final Color[] COLORS = {Color.fromArgb(205, 223, 242),
|
|
Color.fromArgb(249, 214, 194)};
|
|
Color.fromArgb(249, 214, 194)};
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public void wordExport(Map<String, Object> map, HttpServletResponse response) {
|
|
public void wordExport(Map<String, Object> map, HttpServletResponse response) {
|
|
Object periodObj = map.get("period");
|
|
Object periodObj = map.get("period");
|
|
Object yearObj = map.get("year");
|
|
Object yearObj = map.get("year");
|
|
Object paramsObj = map.get("params");
|
|
Object paramsObj = map.get("params");
|
|
- if(ObjectUtil.isEmpty(periodObj)){
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(periodObj)) {
|
|
throw new CustomException("缺少周期参数");
|
|
throw new CustomException("缺少周期参数");
|
|
}
|
|
}
|
|
- if(!ObjectUtil.isEmpty(paramsObj)){
|
|
|
|
|
|
+ if (!ObjectUtil.isEmpty(paramsObj)) {
|
|
String params = (String) map.get("params");
|
|
String params = (String) map.get("params");
|
|
- map.put("params",params.replaceAll("=-=", "and"));
|
|
|
|
- }else{
|
|
|
|
|
|
+ map.put("params", params.replaceAll("=-=", "and"));
|
|
|
|
+ } else {
|
|
map.remove("params");
|
|
map.remove("params");
|
|
}
|
|
}
|
|
String period = (String) periodObj;
|
|
String period = (String) periodObj;
|
|
String year = (String) yearObj;
|
|
String year = (String) yearObj;
|
|
- map.put("period","第"+period+"期");
|
|
|
|
|
|
+ map.put("period", "第" + period + "期");
|
|
List<ZhcxPersistentManageDo> list = zhcxPersistentManageDao.listData(map);
|
|
List<ZhcxPersistentManageDo> list = zhcxPersistentManageDao.listData(map);
|
|
- if(list.size() == 0){
|
|
|
|
|
|
+ if (list.size() == 0) {
|
|
throw new CustomException("当前周期暂无数据");
|
|
throw new CustomException("当前周期暂无数据");
|
|
}
|
|
}
|
|
- if(list.size() > 0){
|
|
|
|
- list.forEach(ev ->{
|
|
|
|
|
|
+ if (list.size() > 0) {
|
|
|
|
+ list.forEach(ev -> {
|
|
String sitepic = ev.getSitepic();
|
|
String sitepic = ev.getSitepic();
|
|
BigDecimal punishconfirmamount = ev.getPunishconfirmamount();
|
|
BigDecimal punishconfirmamount = ev.getPunishconfirmamount();
|
|
String type = ev.getType();
|
|
String type = ev.getType();
|
|
- if(type.contains("处罚") && punishconfirmamount != null){
|
|
|
|
|
|
+ if (type.contains("处罚") && punishconfirmamount != null) {
|
|
ev.setAmount(punishconfirmamount);
|
|
ev.setAmount(punishconfirmamount);
|
|
}
|
|
}
|
|
- if(StringUtils.isNotBlank(sitepic)){
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(sitepic)) {
|
|
String[] splits = sitepic.split("\\^_\\^");
|
|
String[] splits = sitepic.split("\\^_\\^");
|
|
Optional<String> firstId = Arrays.stream(splits)
|
|
Optional<String> firstId = Arrays.stream(splits)
|
|
.filter(s -> s.contains(".jpg")
|
|
.filter(s -> s.contains(".jpg")
|
|
|| s.contains(".jpeg")
|
|
|| s.contains(".jpeg")
|
|
|| s.contains(".png"))
|
|
|| s.contains(".png"))
|
|
.findFirst();
|
|
.findFirst();
|
|
- if(firstId.isPresent()){
|
|
|
|
|
|
+ if (firstId.isPresent()) {
|
|
ev.setSitepic(firstId.get());
|
|
ev.setSitepic(firstId.get());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -138,12 +136,12 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
AtomicInteger i = new AtomicInteger();
|
|
AtomicInteger i = new AtomicInteger();
|
|
groupList.forEach((k, v) -> {
|
|
groupList.forEach((k, v) -> {
|
|
FormData formData = new FormData();
|
|
FormData formData = new FormData();
|
|
- List<Map<String,Object>> mainDataList = new ArrayList<>();
|
|
|
|
- List<List<Map<String,Object>>> slaveTableDataList = new ArrayList<>();
|
|
|
|
- Map<String,Object> mainMap = new HashMap<>(16);
|
|
|
|
- mainMap.put("checkDate",reStartTime+"-"+reEndTime);
|
|
|
|
- mainMap.put("type",k);
|
|
|
|
- mainMap.put("period","第"+period+"期");
|
|
|
|
|
|
+ List<Map<String, Object>> mainDataList = new ArrayList<>();
|
|
|
|
+ List<List<Map<String, Object>>> slaveTableDataList = new ArrayList<>();
|
|
|
|
+ Map<String, Object> mainMap = new HashMap<>(16);
|
|
|
|
+ mainMap.put("checkDate", reStartTime + "-" + reEndTime);
|
|
|
|
+ mainMap.put("type", k);
|
|
|
|
+ mainMap.put("period", "第" + period + "期");
|
|
Map<String, BigDecimal> totalAmountByCategory = v.stream()
|
|
Map<String, BigDecimal> totalAmountByCategory = v.stream()
|
|
.collect(Collectors.groupingBy(
|
|
.collect(Collectors.groupingBy(
|
|
ZhcxPersistentManageDo::getType,
|
|
ZhcxPersistentManageDo::getType,
|
|
@@ -154,20 +152,20 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
List<ZhcxPersistentManageDo> rewardList = new ArrayList<>();
|
|
List<ZhcxPersistentManageDo> rewardList = new ArrayList<>();
|
|
List<ZhcxPersistentManageDo> punishList = new ArrayList<>();
|
|
List<ZhcxPersistentManageDo> punishList = new ArrayList<>();
|
|
subList.forEach((k1, v1) -> {
|
|
subList.forEach((k1, v1) -> {
|
|
- if(k1.contains("奖励")){
|
|
|
|
- mainMap.put("rewardCount",v1.size());
|
|
|
|
|
|
+ if (k1.contains("奖励")) {
|
|
|
|
+ mainMap.put("rewardCount", v1.size());
|
|
rewardList.addAll(v1);
|
|
rewardList.addAll(v1);
|
|
- }else{
|
|
|
|
- mainMap.put("punishCount",v1.size());
|
|
|
|
|
|
+ } else {
|
|
|
|
+ mainMap.put("punishCount", v1.size());
|
|
punishList.addAll(v1);
|
|
punishList.addAll(v1);
|
|
}
|
|
}
|
|
|
|
|
|
});
|
|
});
|
|
totalAmountByCategory.forEach((k1, v1) -> {
|
|
totalAmountByCategory.forEach((k1, v1) -> {
|
|
- if(k1.contains("奖励")){
|
|
|
|
- mainMap.put("rewardAmount",v1);
|
|
|
|
- }else{
|
|
|
|
- mainMap.put("punishAmount",v1);
|
|
|
|
|
|
+ if (k1.contains("奖励")) {
|
|
|
|
+ mainMap.put("rewardAmount", v1);
|
|
|
|
+ } else {
|
|
|
|
+ mainMap.put("punishAmount", v1);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
List<Map<String, Object>> rewardMaps = convertList(rewardList, ZhcxPersistentManageDo.class);
|
|
List<Map<String, Object>> rewardMaps = convertList(rewardList, ZhcxPersistentManageDo.class);
|
|
@@ -180,24 +178,24 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
if (k.contains("焊缝一次成型不打磨奖励报告")) {
|
|
if (k.contains("焊缝一次成型不打磨奖励报告")) {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("b39c12eeb3464596b70f1ce4e96b922f");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("b39c12eeb3464596b70f1ce4e96b922f");
|
|
try {
|
|
try {
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
} else {
|
|
} else {
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
- }else if (k.contains("油漆“零破坏”专项")){
|
|
|
|
|
|
+ } else if (k.contains("油漆“零破坏”专项")) {
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
formDataVo.setMainDataList(mainDataList);
|
|
formDataVo.setMainDataList(mainDataList);
|
|
|
|
|
|
- map.put("type",k);
|
|
|
|
|
|
+ map.put("type", k);
|
|
List<ZhcxPersistentWordVO> zhcxPersistentManageDos = zhcxPersistentManageDao.groupByList(map);
|
|
List<ZhcxPersistentWordVO> zhcxPersistentManageDos = zhcxPersistentManageDao.groupByList(map);
|
|
List<ZhcxPersistentWordVO> listData = new ArrayList<>();
|
|
List<ZhcxPersistentWordVO> listData = new ArrayList<>();
|
|
- zhcxPersistentManageDos.forEach(ev->{
|
|
|
|
- if("处罚".equals(ev.getType())){
|
|
|
|
|
|
+ zhcxPersistentManageDos.forEach(ev -> {
|
|
|
|
+ if ("处罚".equals(ev.getType())) {
|
|
ev.setPunishAmount(ev.getAmount());
|
|
ev.setPunishAmount(ev.getAmount());
|
|
ev.setPunishCount(ev.getCount());
|
|
ev.setPunishCount(ev.getCount());
|
|
listData.add(ev);
|
|
listData.add(ev);
|
|
@@ -209,14 +207,14 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
formDataVo.setSlaveTableDataList(slaveTableDataList);
|
|
formDataVo.setSlaveTableDataList(slaveTableDataList);
|
|
try {
|
|
try {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("9aebb0bd84d8471b8ed954f5557cb775");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("9aebb0bd84d8471b8ed954f5557cb775");
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
doc[0] = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
} else {
|
|
} else {
|
|
Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
Map<String, List<ZhcxPersistentManageDo>> typeList = v.stream()
|
|
Map<String, List<ZhcxPersistentManageDo>> typeList = v.stream()
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getType));
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getType));
|
|
@@ -227,17 +225,17 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (punishListData.size() > 0) {
|
|
if (punishListData.size() > 0) {
|
|
- initWeekWord(doc, punishListData,"692aacdfda804e989cc880bfe2d8b764");
|
|
|
|
|
|
+ initWeekWord(doc, punishListData, "692aacdfda804e989cc880bfe2d8b764");
|
|
}
|
|
}
|
|
- }else if (k.contains("面漆后动火")){
|
|
|
|
|
|
+ } else if (k.contains("面漆后动火")) {
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
formDataVo.setMainDataList(mainDataList);
|
|
formDataVo.setMainDataList(mainDataList);
|
|
|
|
|
|
- map.put("type",k);
|
|
|
|
|
|
+ map.put("type", k);
|
|
List<ZhcxPersistentWordVO> zhcxPersistentManageDos = zhcxPersistentManageDao.groupByList(map);
|
|
List<ZhcxPersistentWordVO> zhcxPersistentManageDos = zhcxPersistentManageDao.groupByList(map);
|
|
List<ZhcxPersistentWordVO> listData = new ArrayList<>();
|
|
List<ZhcxPersistentWordVO> listData = new ArrayList<>();
|
|
- zhcxPersistentManageDos.forEach(ev->{
|
|
|
|
- if("处罚".equals(ev.getType())){
|
|
|
|
|
|
+ zhcxPersistentManageDos.forEach(ev -> {
|
|
|
|
+ if ("处罚".equals(ev.getType())) {
|
|
ev.setPunishAmount(ev.getAmount());
|
|
ev.setPunishAmount(ev.getAmount());
|
|
ev.setPunishCount(ev.getCount());
|
|
ev.setPunishCount(ev.getCount());
|
|
listData.add(ev);
|
|
listData.add(ev);
|
|
@@ -249,14 +247,14 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
formDataVo.setSlaveTableDataList(slaveTableDataList);
|
|
formDataVo.setSlaveTableDataList(slaveTableDataList);
|
|
try {
|
|
try {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("70fc8489a6604473a5b745e3b9e8fffb");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("70fc8489a6604473a5b745e3b9e8fffb");
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
doc[0] = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
} else {
|
|
} else {
|
|
Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
Map<String, List<ZhcxPersistentManageDo>> typeList = v.stream()
|
|
Map<String, List<ZhcxPersistentManageDo>> typeList = v.stream()
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getType));
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getType));
|
|
@@ -267,71 +265,71 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (punishListData.size() > 0) {
|
|
if (punishListData.size() > 0) {
|
|
- initWeekWord(doc, punishListData,"bc5442ad2f924f7fa17f1949ec8ebc8c");
|
|
|
|
|
|
+ initWeekWord(doc, punishListData, "bc5442ad2f924f7fa17f1949ec8ebc8c");
|
|
}
|
|
}
|
|
- }else if (k.contains("构件油漆后损伤专项督查")){
|
|
|
|
|
|
+ } else if (k.contains("构件油漆后损伤专项督查")) {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("427ec6c843914718ad12359c8cf70da7");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("427ec6c843914718ad12359c8cf70da7");
|
|
try {
|
|
try {
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
} else {
|
|
} else {
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
if (rewardList.size() > 0) {
|
|
if (rewardList.size() > 0) {
|
|
- initWeekWord(doc, rewardList,"a808c450f6484ae18baa5afc4a8fc112");
|
|
|
|
|
|
+ initWeekWord(doc, rewardList, "a808c450f6484ae18baa5afc4a8fc112");
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
- }else if (k.contains("构件“不落地”专项督查")){
|
|
|
|
|
|
+ } else if (k.contains("构件“不落地”专项督查")) {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("fe6181ceba7b444299046dfcc5b20a48");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("fe6181ceba7b444299046dfcc5b20a48");
|
|
try {
|
|
try {
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
} else {
|
|
} else {
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
if (rewardList.size() > 0) {
|
|
if (rewardList.size() > 0) {
|
|
- initWeekWord(doc, rewardList,"0291bfa0b2b04293a1e25d42b07b5e33");
|
|
|
|
|
|
+ initWeekWord(doc, rewardList, "0291bfa0b2b04293a1e25d42b07b5e33");
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
- }else if (k.contains("“工完料净场地清”专项督查")){
|
|
|
|
|
|
+ } else if (k.contains("“工完料净场地清”专项督查")) {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("d0f806c658104eeda1f46a592ca824f2");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("d0f806c658104eeda1f46a592ca824f2");
|
|
try {
|
|
try {
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0] = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
} else {
|
|
} else {
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
Document docTemp = ExcelExportUtil.fillWordDataByMap(fileTemp.getFullpath(), formData);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
if (rewardList.size() > 0) {
|
|
if (rewardList.size() > 0) {
|
|
- initWeekWord(doc, rewardList,"5b054a5cb2d84bd4b355eadd668fc6e6");
|
|
|
|
|
|
+ initWeekWord(doc, rewardList, "5b054a5cb2d84bd4b355eadd668fc6e6");
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
- }else if (k.contains("每周质量顽症督查")){
|
|
|
|
|
|
+ } else if (k.contains("每周质量顽症督查")) {
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
FormDataVO formDataVo = new FormDataVO();
|
|
formDataVo.setMainDataList(mainDataList);
|
|
formDataVo.setMainDataList(mainDataList);
|
|
|
|
|
|
- map.put("type","每周质量顽症督查");
|
|
|
|
|
|
+ map.put("type", "每周质量顽症督查");
|
|
List<ZhcxPersistentWordVO> zhcxPersistentManageDos = zhcxPersistentManageDao.groupByList(map);
|
|
List<ZhcxPersistentWordVO> zhcxPersistentManageDos = zhcxPersistentManageDao.groupByList(map);
|
|
List<ZhcxPersistentWordVO> listData = new ArrayList<>();
|
|
List<ZhcxPersistentWordVO> listData = new ArrayList<>();
|
|
- zhcxPersistentManageDos.forEach(ev->{
|
|
|
|
- if("处罚".equals(ev.getType())){
|
|
|
|
|
|
+ zhcxPersistentManageDos.forEach(ev -> {
|
|
|
|
+ if ("处罚".equals(ev.getType())) {
|
|
ev.setPunishAmount(ev.getAmount());
|
|
ev.setPunishAmount(ev.getAmount());
|
|
ev.setPunishCount(ev.getCount());
|
|
ev.setPunishCount(ev.getCount());
|
|
listData.add(ev);
|
|
listData.add(ev);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- zhcxPersistentManageDos.forEach(ev->{
|
|
|
|
- if("奖励".equals(ev.getType())){
|
|
|
|
- listData.forEach(item->{
|
|
|
|
- if(item.getFirstorgname().equals(ev.getFirstorgname())){
|
|
|
|
|
|
+ zhcxPersistentManageDos.forEach(ev -> {
|
|
|
|
+ if ("奖励".equals(ev.getType())) {
|
|
|
|
+ listData.forEach(item -> {
|
|
|
|
+ if (item.getFirstorgname().equals(ev.getFirstorgname())) {
|
|
item.setRewardAmount(ev.getAmount());
|
|
item.setRewardAmount(ev.getAmount());
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -342,7 +340,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- if(!b){
|
|
|
|
|
|
+ if (!b) {
|
|
ev.setRewardAmount(ev.getAmount());
|
|
ev.setRewardAmount(ev.getAmount());
|
|
listData.add(ev);
|
|
listData.add(ev);
|
|
}
|
|
}
|
|
@@ -354,14 +352,14 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
formDataVo.setSlaveTableDataList(slaveTableDataList);
|
|
formDataVo.setSlaveTableDataList(slaveTableDataList);
|
|
try {
|
|
try {
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("dc0d69edf9e64f1abd151b1441411002");
|
|
SysFileItemDo fileTemp = sysFileItemService.getById("dc0d69edf9e64f1abd151b1441411002");
|
|
- if(ObjectUtil.isNull(doc[0])) {
|
|
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
doc[0] = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
doc[0] = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
} else {
|
|
} else {
|
|
Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
Document docTemp = fillWordDataByMap(fileTemp.getFullpath(), formDataVo);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.info("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.info("顽症导出word失败:" + e);
|
|
}
|
|
}
|
|
Map<String, List<ZhcxPersistentManageDo>> typeList = v.stream()
|
|
Map<String, List<ZhcxPersistentManageDo>> typeList = v.stream()
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getType));
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getType));
|
|
@@ -370,20 +368,20 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
typeList.forEach((k1, v1) -> {
|
|
typeList.forEach((k1, v1) -> {
|
|
if (k1.contains("处罚")) {
|
|
if (k1.contains("处罚")) {
|
|
punishListData.addAll(v1);
|
|
punishListData.addAll(v1);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
rewardListData.addAll(v1);
|
|
rewardListData.addAll(v1);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
if (punishListData.size() > 0) {
|
|
if (punishListData.size() > 0) {
|
|
- initWeekWord(doc, punishListData,"fc9d0bd3d7354037afa6092d6a64ed5a");
|
|
|
|
|
|
+ initWeekWord(doc, punishListData, "fc9d0bd3d7354037afa6092d6a64ed5a");
|
|
}
|
|
}
|
|
if (rewardListData.size() > 0) {
|
|
if (rewardListData.size() > 0) {
|
|
- initWeekWord(doc, rewardListData,"73ae110bb9e84aeab985c14d4678670b");
|
|
|
|
|
|
+ initWeekWord(doc, rewardListData, "73ae110bb9e84aeab985c14d4678670b");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
i.getAndIncrement();
|
|
i.getAndIncrement();
|
|
- if(i.get() < groupList.size() - 1) {
|
|
|
|
|
|
+ if (i.get() < groupList.size() - 1) {
|
|
if (!ObjectUtil.isNull(doc[0])) {
|
|
if (!ObjectUtil.isNull(doc[0])) {
|
|
WordHelpUtils.addPageBreak(doc[0]);
|
|
WordHelpUtils.addPageBreak(doc[0]);
|
|
}
|
|
}
|
|
@@ -395,7 +393,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + "报告");
|
|
response.setHeader("Content-Disposition", "attachment;filename=" + "报告");
|
|
doc[0].save(response.getOutputStream(), com.aspose.words.SaveOptions.createSaveOptions(com.aspose.words.SaveFormat.DOCX));
|
|
doc[0].save(response.getOutputStream(), com.aspose.words.SaveOptions.createSaveOptions(com.aspose.words.SaveFormat.DOCX));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("顽症导出word失败:"+e);
|
|
|
|
|
|
+ log.error("顽症导出word失败:" + e);
|
|
throw new CustomException("导出失败");
|
|
throw new CustomException("导出失败");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -405,16 +403,16 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
public void syncWzPlatform(List<String> ids) {
|
|
public void syncWzPlatform(List<String> ids) {
|
|
//zhcxPersistentManageDao.syncWzDataUrl
|
|
//zhcxPersistentManageDao.syncWzDataUrl
|
|
LambdaQueryWrapper<ZhcxPersistentManageDo> queryWrapper = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<ZhcxPersistentManageDo> queryWrapper = Wrappers.lambdaQuery();
|
|
- queryWrapper.in(ZhcxPersistentManageDo::getId,ids);
|
|
|
|
|
|
+ queryWrapper.in(ZhcxPersistentManageDo::getId, ids);
|
|
List<ZhcxPersistentManageDo> list = this.list(queryWrapper);
|
|
List<ZhcxPersistentManageDo> list = this.list(queryWrapper);
|
|
List<ZhcxPersistentManageDto> dtoList = new ArrayList<>();
|
|
List<ZhcxPersistentManageDto> dtoList = new ArrayList<>();
|
|
- if(ObjectUtil.isEmpty(list)) {
|
|
|
|
- return ;
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(list)) {
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
List<ZhcxPersistentManageDo> updateList = new ArrayList<>();
|
|
List<ZhcxPersistentManageDo> updateList = new ArrayList<>();
|
|
ZhcxPersistentManageDo manageDo;
|
|
ZhcxPersistentManageDo manageDo;
|
|
ZhcxPersistentManageDto manageDto;
|
|
ZhcxPersistentManageDto manageDto;
|
|
- for(ZhcxPersistentManageDo persistentManageDo : list){
|
|
|
|
|
|
+ for (ZhcxPersistentManageDo persistentManageDo : list) {
|
|
manageDo = new ZhcxPersistentManageDo();
|
|
manageDo = new ZhcxPersistentManageDo();
|
|
manageDto = new ZhcxPersistentManageDto();
|
|
manageDto = new ZhcxPersistentManageDto();
|
|
manageDo.setId(persistentManageDo.getId());
|
|
manageDo.setId(persistentManageDo.getId());
|
|
@@ -427,10 +425,10 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
Date checkdate = manageDto.getCheckdate();
|
|
Date checkdate = manageDto.getCheckdate();
|
|
SysOrganizationDo curOrgTopParent = sysOrganizationService.getCurOrgTopParent(persistentManageDo.getFirstorgid());
|
|
SysOrganizationDo curOrgTopParent = sysOrganizationService.getCurOrgTopParent(persistentManageDo.getFirstorgid());
|
|
manageDto.setBaseorgname(curOrgTopParent.getFullname());
|
|
manageDto.setBaseorgname(curOrgTopParent.getFullname());
|
|
- manageDto.setFineNo(fill + "("+(checkdate.getYear()+1900)+")" +period);
|
|
|
|
|
|
+ manageDto.setFineNo(fill + "(" + (checkdate.getYear() + 1900) + ")" + period);
|
|
if (rectifystatus.equals("未整改")) {
|
|
if (rectifystatus.equals("未整改")) {
|
|
manageDto.setRectifystatus("0");
|
|
manageDto.setRectifystatus("0");
|
|
- }else if (rectifystatus.equals("已整改")) {
|
|
|
|
|
|
+ } else if (rectifystatus.equals("已整改")) {
|
|
manageDto.setRectifystatus("1");
|
|
manageDto.setRectifystatus("1");
|
|
}
|
|
}
|
|
dtoList.add(manageDto);
|
|
dtoList.add(manageDto);
|
|
@@ -444,12 +442,12 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
syncWzDataUrl, HttpMethod.POST, requestEntity, String.class);
|
|
syncWzDataUrl, HttpMethod.POST, requestEntity, String.class);
|
|
int statusCodeValue = response.getStatusCodeValue();
|
|
int statusCodeValue = response.getStatusCodeValue();
|
|
System.out.println("Response status code: " + statusCodeValue);
|
|
System.out.println("Response status code: " + statusCodeValue);
|
|
- if(200 != statusCodeValue) {
|
|
|
|
|
|
+ if (200 != statusCodeValue) {
|
|
log.error("请求结果:{}", statusCodeValue);
|
|
log.error("请求结果:{}", statusCodeValue);
|
|
throw new CustomException("同步失败,请联系管理员!");
|
|
throw new CustomException("同步失败,请联系管理员!");
|
|
}
|
|
}
|
|
//修改同步状态
|
|
//修改同步状态
|
|
- if(updateList.size()>0){
|
|
|
|
|
|
+ if (updateList.size() > 0) {
|
|
this.updateBatchById(updateList);
|
|
this.updateBatchById(updateList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -460,7 +458,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
public List<ZhcxPersistentReportDto> reportData(Map<String, Object> map) {
|
|
public List<ZhcxPersistentReportDto> reportData(Map<String, Object> map) {
|
|
Object yearObj = map.get("year");
|
|
Object yearObj = map.get("year");
|
|
Object monthObj = map.get("month");
|
|
Object monthObj = map.get("month");
|
|
- if(ObjectUtil.isEmpty(yearObj) || ObjectUtil.isEmpty(monthObj)){
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(yearObj) || ObjectUtil.isEmpty(monthObj)) {
|
|
throw new CustomException("缺少查询参数");
|
|
throw new CustomException("缺少查询参数");
|
|
}
|
|
}
|
|
String year = (String) yearObj;
|
|
String year = (String) yearObj;
|
|
@@ -482,11 +480,11 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
//当前日期大于传入日期
|
|
//当前日期大于传入日期
|
|
processDeptUserCount(year, month, reportDataMap, reportList);
|
|
processDeptUserCount(year, month, reportDataMap, reportList);
|
|
} else if (currentDate.isEqual(passedDate)) {
|
|
} else if (currentDate.isEqual(passedDate)) {
|
|
- processOrgUserCount(organization.getId(),month, reportDataMap, reportList);
|
|
|
|
|
|
+ processOrgUserCount(organization.getId(), month, reportDataMap, reportList);
|
|
}
|
|
}
|
|
- reportList.sort(Comparator.comparing(ZhcxPersistentReportDto::getSort,Comparator.reverseOrder()));
|
|
|
|
|
|
+ reportList.sort(Comparator.comparing(ZhcxPersistentReportDto::getSort, Comparator.reverseOrder()));
|
|
for (int i = 0; i < reportList.size(); i++) {
|
|
for (int i = 0; i < reportList.size(); i++) {
|
|
- reportList.get(i).setNo(i+1);
|
|
|
|
|
|
+ reportList.get(i).setNo(i + 1);
|
|
}
|
|
}
|
|
return reportList;
|
|
return reportList;
|
|
}
|
|
}
|
|
@@ -536,7 +534,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
String year = (String) yearObj;
|
|
String year = (String) yearObj;
|
|
String month = (String) monthObj;
|
|
String month = (String) monthObj;
|
|
List<ZhcxPersistentReportDto> dtos = this.reportData(map);
|
|
List<ZhcxPersistentReportDto> dtos = this.reportData(map);
|
|
- if(!excelUtils.GetLicense()) {
|
|
|
|
|
|
+ if (!excelUtils.GetLicense()) {
|
|
throw new CustomException("获取license异常");
|
|
throw new CustomException("获取license异常");
|
|
}
|
|
}
|
|
Workbook workbook = new Workbook();
|
|
Workbook workbook = new Workbook();
|
|
@@ -576,7 +574,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
for (int i = 0; i <= worksheet.getCells().getMaxColumn(); i++) {
|
|
for (int i = 0; i <= worksheet.getCells().getMaxColumn(); i++) {
|
|
worksheet.getCells().setColumnWidth(i, worksheet.getCells().getColumnWidth(i) + 2);
|
|
worksheet.getCells().setColumnWidth(i, worksheet.getCells().getColumnWidth(i) + 2);
|
|
}
|
|
}
|
|
- worksheet.setName(year+"-"+month+"-顽症统计");
|
|
|
|
|
|
+ worksheet.setName(year + "-" + month + "-顽症统计");
|
|
response.addHeader("Pargam", "no-cache");
|
|
response.addHeader("Pargam", "no-cache");
|
|
response.addHeader("Cache-Control", "no-cache");
|
|
response.addHeader("Cache-Control", "no-cache");
|
|
response.setContentType("application/octet-stream;charset=ISO8859-1");
|
|
response.setContentType("application/octet-stream;charset=ISO8859-1");
|
|
@@ -584,11 +582,60 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
workbook.save(response.getOutputStream(), com.aspose.cells.SaveFormat.XLSX);
|
|
workbook.save(response.getOutputStream(), com.aspose.cells.SaveFormat.XLSX);
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("导出错误", e);
|
|
log.error("导出错误", e);
|
|
- }finally {
|
|
|
|
|
|
+ } finally {
|
|
workbook.dispose();
|
|
workbook.dispose();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void jyWordExport(Map<String, Object> map, HttpServletResponse response) {
|
|
|
|
+ List<ZhcxCoreInspectionIndicatorsTemplateDo> zhcxCoreInspectionIndicatorsTemplateDos = zhcxPersistentManageDao.getCoreInspectionIndicatorsTemplateDos();
|
|
|
|
+ List<ZhcxCoreInspectionDetailDo> zhcxCoreInspectionDetailDos = zhcxPersistentManageDao.getCoreInspectionDetailDos();
|
|
|
|
+ List<ZhcxCheckBeforeQualifiedDo> zhcxCheckBeforeQualifiedDos = zhcxPersistentManageDao.getCheckBeforeQualifiedDos();
|
|
|
|
+ if (zhcxCoreInspectionIndicatorsTemplateDos.size() == 0) {
|
|
|
|
+ throw new CustomException("暂无导出数据");
|
|
|
|
+ } else {
|
|
|
|
+ SysFileItemDo fileItemDo = sysFileItemService.getById("b3051738445f4e7884115bca40b5db79");
|
|
|
|
+ final Document[] doc = {WordHelpUtils.getDoc(fileItemDo.getFullpath())};
|
|
|
|
+ for (ZhcxCoreInspectionIndicatorsTemplateDo zhcxCoreInspectionIndicatorsTemplateDo : zhcxCoreInspectionIndicatorsTemplateDos) {
|
|
|
|
+ FormData formData = new FormData();
|
|
|
|
+ List<ZhcxCoreInspectionIndicatorsTemplateDo> mainList = new ArrayList<>();
|
|
|
|
+ mainList.add(zhcxCoreInspectionIndicatorsTemplateDo);
|
|
|
|
+ List<Map<String, Object>> mainDataList = convertList(mainList, ZhcxCoreInspectionIndicatorsTemplateDo.class);
|
|
|
|
+ formData.setMainDataList(mainDataList);
|
|
|
|
+ List<List<Map<String, Object>>> slaveTableDataList = new ArrayList<>();
|
|
|
|
+ List<ZhcxCoreInspectionDetailDo> coreInspectionDetailDos = zhcxCoreInspectionDetailDos.stream().filter(d -> d.getPid().equals(zhcxCoreInspectionIndicatorsTemplateDo.getId())).collect(Collectors.toList());
|
|
|
|
+ List<ZhcxCheckBeforeQualifiedDo> checkBeforeQualifiedDos = zhcxCheckBeforeQualifiedDos.stream().filter(q -> q.getPid().equals(zhcxCoreInspectionIndicatorsTemplateDo.getId())).collect(Collectors.toList());
|
|
|
|
+ List<Map<String, Object>> detailMaps = convertList(coreInspectionDetailDos, ZhcxCoreInspectionDetailDo.class);
|
|
|
|
+ List<Map<String, Object>> qualifMaps = convertList(checkBeforeQualifiedDos, ZhcxCheckBeforeQualifiedDo.class);
|
|
|
|
+ slaveTableDataList.add(detailMaps);
|
|
|
|
+ slaveTableDataList.add(qualifMaps);
|
|
|
|
+ formData.setSlaveTableDataList(slaveTableDataList);
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ if (ObjectUtil.isNull(doc[0])) {
|
|
|
|
+ doc[0] = ExcelExportUtil.fillWordDataByMap(fileItemDo.getFullpath(), formData);
|
|
|
|
+ } else {
|
|
|
|
+ Document docTemp = ExcelExportUtil.fillWordDataByMap(fileItemDo.getFullpath(), formData);
|
|
|
|
+ doc[0].appendDocument(docTemp, ImportFormatMode.KEEP_DIFFERENT_STYLES);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.info("核心检验指标导出word失败:" + e);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ doc[0].updateFields();
|
|
|
|
+ response.setContentType("application/octet-stream;charset=ISO8859-1");
|
|
|
|
+ response.setHeader("Content-Disposition", "attachment;filename=" + "报告");
|
|
|
|
+ doc[0].save(response.getOutputStream(), com.aspose.words.SaveOptions.createSaveOptions(com.aspose.words.SaveFormat.DOCX));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("核心检验指标导出word失败:" + e);
|
|
|
|
+ throw new CustomException("导出失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
private void buildHeader(Cells cells) {
|
|
private void buildHeader(Cells cells) {
|
|
cells.merge(0, 0, 2, 1);
|
|
cells.merge(0, 0, 2, 1);
|
|
cells.get(0, 0).setValue("月份");
|
|
cells.get(0, 0).setValue("月份");
|
|
@@ -614,16 +661,16 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
|
|
|
cells.merge(0, 8, 2, 1);
|
|
cells.merge(0, 8, 2, 1);
|
|
cells.get(0, 8).setValue("人均处罚总额(元)");
|
|
cells.get(0, 8).setValue("人均处罚总额(元)");
|
|
- for(int i = 3;i<7;i++){
|
|
|
|
- for(int j = 0;j<2;j++){
|
|
|
|
- if(j == 0 && !(i % 2 != 0)){
|
|
|
|
|
|
+ for (int i = 3; i < 7; i++) {
|
|
|
|
+ for (int j = 0; j < 2; j++) {
|
|
|
|
+ if (j == 0 && !(i % 2 != 0)) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
Style style = cells.get(j, i).getStyle();
|
|
Style style = cells.get(j, i).getStyle();
|
|
style.setPattern(BackgroundType.SOLID);
|
|
style.setPattern(BackgroundType.SOLID);
|
|
- if (i <5) {
|
|
|
|
|
|
+ if (i < 5) {
|
|
style.setForegroundColor(COLORS[0]);
|
|
style.setForegroundColor(COLORS[0]);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
style.setForegroundColor(COLORS[1]);
|
|
style.setForegroundColor(COLORS[1]);
|
|
}
|
|
}
|
|
cells.get(j, i).setStyle(style);
|
|
cells.get(j, i).setStyle(style);
|
|
@@ -641,12 +688,12 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
cells.get(row, 6).setValue(dto.getPunishNumberPer() == null ? 0 : dto.getPunishNumberPer());
|
|
cells.get(row, 6).setValue(dto.getPunishNumberPer() == null ? 0 : dto.getPunishNumberPer());
|
|
cells.get(row, 7).setValue(dto.getPunishTotalAmount() == null ? 0 : dto.getPunishTotalAmount());
|
|
cells.get(row, 7).setValue(dto.getPunishTotalAmount() == null ? 0 : dto.getPunishTotalAmount());
|
|
cells.get(row, 8).setValue(dto.getPunishTotalAmountPer() == null ? 0 : dto.getPunishTotalAmountPer());
|
|
cells.get(row, 8).setValue(dto.getPunishTotalAmountPer() == null ? 0 : dto.getPunishTotalAmountPer());
|
|
- for(int i = 3;i<7;i++){
|
|
|
|
|
|
+ for (int i = 3; i < 7; i++) {
|
|
Style style = cells.get(row, i).getStyle();
|
|
Style style = cells.get(row, i).getStyle();
|
|
style.setPattern(BackgroundType.SOLID);
|
|
style.setPattern(BackgroundType.SOLID);
|
|
- if (i <5) {
|
|
|
|
|
|
+ if (i < 5) {
|
|
style.setForegroundColor(COLORS[0]);
|
|
style.setForegroundColor(COLORS[0]);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
style.setForegroundColor(COLORS[1]);
|
|
style.setForegroundColor(COLORS[1]);
|
|
}
|
|
}
|
|
cells.get(row, i).setStyle(style);
|
|
cells.get(row, i).setStyle(style);
|
|
@@ -662,15 +709,16 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
ZhcxPersistentReportDto dto = buildReportDto(i + 1, month, org, report);
|
|
ZhcxPersistentReportDto dto = buildReportDto(i + 1, month, org, report);
|
|
reportList.add(dto);
|
|
reportList.add(dto);
|
|
}
|
|
}
|
|
- if(deptUserCount.size() == 0){
|
|
|
|
|
|
+ if (deptUserCount.size() == 0) {
|
|
SysOrganizationDo organization = sysOrganizationService.getOne(
|
|
SysOrganizationDo organization = sysOrganizationService.getOne(
|
|
new LambdaQueryWrapper<SysOrganizationDo>().eq(SysOrganizationDo::getCode, DEPT_CODE));
|
|
new LambdaQueryWrapper<SysOrganizationDo>().eq(SysOrganizationDo::getCode, DEPT_CODE));
|
|
|
|
|
|
- processOrgUserCount(organization.getId(),month, reportDataMap, reportList);
|
|
|
|
|
|
+ processOrgUserCount(organization.getId(), month, reportDataMap, reportList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
// 处理组织用户统计数据
|
|
// 处理组织用户统计数据
|
|
- private void processOrgUserCount(String orgId,String month, Map<String, PersistentVo> reportDataMap, List<ZhcxPersistentReportDto> reportList) {
|
|
|
|
|
|
+ private void processOrgUserCount(String orgId, String month, Map<String, PersistentVo> reportDataMap, List<ZhcxPersistentReportDto> reportList) {
|
|
List<OrganizationVo> orgUserCount = zhcxPersistentManageDao.getOrgUserCount(orgId);
|
|
List<OrganizationVo> orgUserCount = zhcxPersistentManageDao.getOrgUserCount(orgId);
|
|
Map<String, OrganizationVo> parentNodeMap = new HashMap<>();
|
|
Map<String, OrganizationVo> parentNodeMap = new HashMap<>();
|
|
|
|
|
|
@@ -694,6 +742,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
reportList.add(dto);
|
|
reportList.add(dto);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
// 构造 DTO
|
|
// 构造 DTO
|
|
private ZhcxPersistentReportDto buildReportDto(int no, String month, OrganizationVo org, PersistentVo report) {
|
|
private ZhcxPersistentReportDto buildReportDto(int no, String month, OrganizationVo org, PersistentVo report) {
|
|
ZhcxPersistentReportDto dto = new ZhcxPersistentReportDto();
|
|
ZhcxPersistentReportDto dto = new ZhcxPersistentReportDto();
|
|
@@ -707,12 +756,13 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
dto.setCheckNumber(report.getCheckNumber());
|
|
dto.setCheckNumber(report.getCheckNumber());
|
|
dto.setPunishNumber(report.getPunishNumber());
|
|
dto.setPunishNumber(report.getPunishNumber());
|
|
dto.setPunishTotalAmount(report.getPunishTotalAmount());
|
|
dto.setPunishTotalAmount(report.getPunishTotalAmount());
|
|
- dto.setCheckNumberPer(calculateRatio(report.getCheckNumber() == null?0:report.getCheckNumber(), org.getUserCount()));
|
|
|
|
- dto.setPunishNumberPer(calculateRatio(report.getPunishNumber() ==null?0:report.getPunishNumber(), org.getUserCount()));
|
|
|
|
- dto.setPunishTotalAmountPer(calculateRatio(report.getPunishTotalAmount() == null?0:report.getPunishTotalAmount(), org.getUserCount()));
|
|
|
|
|
|
+ dto.setCheckNumberPer(calculateRatio(report.getCheckNumber() == null ? 0 : report.getCheckNumber(), org.getUserCount()));
|
|
|
|
+ dto.setPunishNumberPer(calculateRatio(report.getPunishNumber() == null ? 0 : report.getPunishNumber(), org.getUserCount()));
|
|
|
|
+ dto.setPunishTotalAmountPer(calculateRatio(report.getPunishTotalAmount() == null ? 0 : report.getPunishTotalAmount(), org.getUserCount()));
|
|
}
|
|
}
|
|
return dto;
|
|
return dto;
|
|
}
|
|
}
|
|
|
|
+
|
|
private double calculateRatio(Number numerator, int denominator) {
|
|
private double calculateRatio(Number numerator, int denominator) {
|
|
if (denominator == 0) {
|
|
if (denominator == 0) {
|
|
return 0.0;
|
|
return 0.0;
|
|
@@ -723,7 +773,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
}
|
|
}
|
|
|
|
|
|
private void initWeekWord(Document[] doc, List<ZhcxPersistentManageDo> rewardListData, String tempId) {
|
|
private void initWeekWord(Document[] doc, List<ZhcxPersistentManageDo> rewardListData, String tempId) {
|
|
- if(rewardListData.size()>0){
|
|
|
|
|
|
+ if (rewardListData.size() > 0) {
|
|
Map<String, List<ZhcxPersistentManageDo>> collect = rewardListData.stream()
|
|
Map<String, List<ZhcxPersistentManageDo>> collect = rewardListData.stream()
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getFirstorgname));
|
|
.collect(Collectors.groupingBy(ZhcxPersistentManageDo::getFirstorgname));
|
|
try {
|
|
try {
|
|
@@ -736,7 +786,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
builder.moveToDocumentEnd();
|
|
builder.moveToDocumentEnd();
|
|
String fill = rewardListData.get(0).getFill();
|
|
String fill = rewardListData.get(0).getFill();
|
|
//循环动态添加表格
|
|
//循环动态添加表格
|
|
- createTable(builder,docDetail,collect,"table1",0,fill);
|
|
|
|
|
|
+ createTable(builder, docDetail, collect, "table1", 0, fill);
|
|
|
|
|
|
DocumentBuilder builder3 = new DocumentBuilder(doc[0]);
|
|
DocumentBuilder builder3 = new DocumentBuilder(doc[0]);
|
|
builder3.moveToDocumentEnd();
|
|
builder3.moveToDocumentEnd();
|
|
@@ -752,10 +802,11 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
|
|
|
/**
|
|
/**
|
|
* 填充 word 模板(map数据格式)
|
|
* 填充 word 模板(map数据格式)
|
|
- * @param file word二进制
|
|
|
|
|
|
+ *
|
|
|
|
+ * @param file word二进制
|
|
* @param formData 填充表单数据
|
|
* @param formData 填充表单数据
|
|
*/
|
|
*/
|
|
- private Document fillWordDataByMap(String file, FormDataVO formData){
|
|
|
|
|
|
+ private Document fillWordDataByMap(String file, FormDataVO formData) {
|
|
//获取word文档
|
|
//获取word文档
|
|
Document doc = WordHelpUtils.getDoc(file);
|
|
Document doc = WordHelpUtils.getDoc(file);
|
|
//初始化设置
|
|
//初始化设置
|
|
@@ -769,33 +820,35 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
|
|
|
private Document fillFormData(Document doc, FormDataVO formData) {
|
|
private Document fillFormData(Document doc, FormDataVO formData) {
|
|
|
|
|
|
- if(ObjectUtil.isNotEmpty(formData.getMainDataList())) {
|
|
|
|
- for(Map<String,Object> map : formData.getMainDataList()) {
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(formData.getMainDataList())) {
|
|
|
|
+ for (Map<String, Object> map : formData.getMainDataList()) {
|
|
//填充主表数据
|
|
//填充主表数据
|
|
WordHelpUtils.fillData(doc, map);
|
|
WordHelpUtils.fillData(doc, map);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//填充多个从表格数据
|
|
//填充多个从表格数据
|
|
- if(ObjectUtil.isNotEmpty(formData.getSlaveTableDataList())) {
|
|
|
|
- int i=0;
|
|
|
|
- for(List<Map<String,Object>> list :formData.getSlaveTableDataList()) {
|
|
|
|
|
|
+ if (ObjectUtil.isNotEmpty(formData.getSlaveTableDataList())) {
|
|
|
|
+ int i = 0;
|
|
|
|
+ for (List<Map<String, Object>> list : formData.getSlaveTableDataList()) {
|
|
i++;
|
|
i++;
|
|
WordHelpUtils.fillData(doc, list, "List" + i);
|
|
WordHelpUtils.fillData(doc, list, "List" + i);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return doc;
|
|
return doc;
|
|
}
|
|
}
|
|
|
|
+
|
|
public static int I = 0;
|
|
public static int I = 0;
|
|
public static int Q = 0;
|
|
public static int Q = 0;
|
|
|
|
+
|
|
private void createTable(DocumentBuilder builder, Document doc, Map<String, List<ZhcxPersistentManageDo>> gxyItemDataMap, String bookmarkName, int index, String fill) throws Exception {
|
|
private void createTable(DocumentBuilder builder, Document doc, Map<String, List<ZhcxPersistentManageDo>> gxyItemDataMap, String bookmarkName, int index, String fill) throws Exception {
|
|
//将list转为根据grade分组K的map,因为要按照K去动态复制多个表格。
|
|
//将list转为根据grade分组K的map,因为要按照K去动态复制多个表格。
|
|
- I =gxyItemDataMap.size()+1;
|
|
|
|
- Q =gxyItemDataMap.size()+1;
|
|
|
|
|
|
+ I = gxyItemDataMap.size() + 1;
|
|
|
|
+ Q = gxyItemDataMap.size() + 1;
|
|
|
|
|
|
/*1: 动态复制表格模板 {根据Map的长度大小来复制每行单元格}*/
|
|
/*1: 动态复制表格模板 {根据Map的长度大小来复制每行单元格}*/
|
|
- if (gxyItemDataMap.size()!=0){
|
|
|
|
- for (int i =0;i<gxyItemDataMap.size()-1;i++){
|
|
|
|
|
|
+ if (gxyItemDataMap.size() != 0) {
|
|
|
|
+ for (int i = 0; i < gxyItemDataMap.size() - 1; i++) {
|
|
addtable(doc); //动态生成表格
|
|
addtable(doc); //动态生成表格
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -806,15 +859,15 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
for (Map.Entry<String, List<ZhcxPersistentManageDo>> entry : gxyItemDataMap.entrySet()) {
|
|
for (Map.Entry<String, List<ZhcxPersistentManageDo>> entry : gxyItemDataMap.entrySet()) {
|
|
Q = Q - 1;
|
|
Q = Q - 1;
|
|
if (fill.contains("每周质量顽症督查") || fill.contains("油漆“零破坏”专项") || fill.contains("面漆后动火")) {
|
|
if (fill.contains("每周质量顽症督查") || fill.contains("油漆“零破坏”专项") || fill.contains("面漆后动火")) {
|
|
- addexcel(doc,entry.getKey(), idx2,entry.getValue());
|
|
|
|
- }else{
|
|
|
|
- addexcel(doc,null, idx2,entry.getValue());
|
|
|
|
|
|
+ addexcel(doc, entry.getKey(), idx2, entry.getValue());
|
|
|
|
+ } else {
|
|
|
|
+ addexcel(doc, null, idx2, entry.getValue());
|
|
}
|
|
}
|
|
System.out.println("Index = " + index + ", Key = " + entry.getKey() + ", Value = " + entry.getValue());
|
|
System.out.println("Index = " + index + ", Key = " + entry.getKey() + ", Value = " + entry.getValue());
|
|
idx2++;
|
|
idx2++;
|
|
}
|
|
}
|
|
NodeCollection tables = doc.getChildNodes(NodeType.TABLE, true);
|
|
NodeCollection tables = doc.getChildNodes(NodeType.TABLE, true);
|
|
- if(tables.getCount() > 0){
|
|
|
|
|
|
+ if (tables.getCount() > 0) {
|
|
// 第一个表格
|
|
// 第一个表格
|
|
Table mainTable = (Table) tables.get(0);
|
|
Table mainTable = (Table) tables.get(0);
|
|
// 遍历剩下的9个表格
|
|
// 遍历剩下的9个表格
|
|
@@ -832,17 +885,18 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
}
|
|
}
|
|
builder.moveToDocumentEnd();//光标结束
|
|
builder.moveToDocumentEnd();//光标结束
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* @Description: 向已有表格模板插入数据
|
|
* @Description: 向已有表格模板插入数据
|
|
* @Param: doc、index、List<GxyItemData>
|
|
* @Param: doc、index、List<GxyItemData>
|
|
*/
|
|
*/
|
|
- private void addexcel(Document doc, String k, int index, List<ZhcxPersistentManageDo> staff)throws Exception{
|
|
|
|
|
|
+ private void addexcel(Document doc, String k, int index, List<ZhcxPersistentManageDo> staff) throws Exception {
|
|
//根据索引获得表格
|
|
//根据索引获得表格
|
|
Table table = (Table) doc.getChild(NodeType.TABLE, index, true);
|
|
Table table = (Table) doc.getChild(NodeType.TABLE, index, true);
|
|
Row titleRow = table.getFirstRow();
|
|
Row titleRow = table.getFirstRow();
|
|
Range range1 = titleRow.getRange();
|
|
Range range1 = titleRow.getRange();
|
|
if (StringUtils.isNotBlank(k)) {
|
|
if (StringUtils.isNotBlank(k)) {
|
|
- range1.replace("title",k);
|
|
|
|
|
|
+ range1.replace("title", k);
|
|
}
|
|
}
|
|
int i = 0;
|
|
int i = 0;
|
|
for (ZhcxPersistentManageDo staf : staff) { // 替换变量
|
|
for (ZhcxPersistentManageDo staf : staff) { // 替换变量
|
|
@@ -850,26 +904,26 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
Row newRow = table.getLastRow();
|
|
Row newRow = table.getLastRow();
|
|
Node deepClone = table.getLastRow().deepClone(true); //得到最后一行
|
|
Node deepClone = table.getLastRow().deepClone(true); //得到最后一行
|
|
Range range = table.getLastRow().getRange();//得到值
|
|
Range range = table.getLastRow().getRange();//得到值
|
|
- String sitepic = staf.getSitepic() == null ?"":staf.getSitepic();
|
|
|
|
- String projectcode = staf.getProjectcode()== null ?"":staf.getProjectcode();
|
|
|
|
- String projectename = staf.getProjectename()== null ?"":staf.getProjectename();
|
|
|
|
- String content = staf.getContent()== null ?"":staf.getContent();
|
|
|
|
- String baseinfonum = staf.getBaseinfonum()== null ?"":staf.getBaseinfonum();
|
|
|
|
|
|
+ String sitepic = staf.getSitepic() == null ? "" : staf.getSitepic();
|
|
|
|
+ String projectcode = staf.getProjectcode() == null ? "" : staf.getProjectcode();
|
|
|
|
+ String projectename = staf.getProjectename() == null ? "" : staf.getProjectename();
|
|
|
|
+ String content = staf.getContent() == null ? "" : staf.getContent();
|
|
|
|
+ String baseinfonum = staf.getBaseinfonum() == null ? "" : staf.getBaseinfonum();
|
|
String subcontractename = staf.getSubcontractename() == null ? "" : staf.getSubcontractename();
|
|
String subcontractename = staf.getSubcontractename() == null ? "" : staf.getSubcontractename();
|
|
String remark = staf.getRemark() == null ? "" : staf.getRemark();
|
|
String remark = staf.getRemark() == null ? "" : staf.getRemark();
|
|
BigDecimal amount = staf.getAmount();
|
|
BigDecimal amount = staf.getAmount();
|
|
String rectifystatus = staf.getRectifystatus();
|
|
String rectifystatus = staf.getRectifystatus();
|
|
- if(StringUtils.isNotBlank(sitepic)){
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(sitepic)) {
|
|
String[] splits = StringUtils.toString(sitepic, "").split("\\^_\\^");
|
|
String[] splits = StringUtils.toString(sitepic, "").split("\\^_\\^");
|
|
Optional<String> firstId = Arrays.stream(splits)
|
|
Optional<String> firstId = Arrays.stream(splits)
|
|
.filter(s -> s.contains(".jpg")
|
|
.filter(s -> s.contains(".jpg")
|
|
|| s.contains(".jpeg")
|
|
|| s.contains(".jpeg")
|
|
|| s.contains(".png"))
|
|
|| s.contains(".png"))
|
|
.findFirst();
|
|
.findFirst();
|
|
- if(firstId.isPresent()){
|
|
|
|
|
|
+ if (firstId.isPresent()) {
|
|
String[] imgIds = firstId.get().split("-;-");
|
|
String[] imgIds = firstId.get().split("-;-");
|
|
SysFileItemDo fileItemDo = sysFileItemService.getById(imgIds[1]);
|
|
SysFileItemDo fileItemDo = sysFileItemService.getById(imgIds[1]);
|
|
- if(fileItemDo != null){
|
|
|
|
|
|
+ if (fileItemDo != null) {
|
|
BufferedInputStream inputStream = FileUtil.getInputStream(fileItemDo.getFullpath());
|
|
BufferedInputStream inputStream = FileUtil.getInputStream(fileItemDo.getFullpath());
|
|
// 使用DocumentBuilder插入图片
|
|
// 使用DocumentBuilder插入图片
|
|
DocumentBuilder builder = new DocumentBuilder(doc);
|
|
DocumentBuilder builder = new DocumentBuilder(doc);
|
|
@@ -893,21 +947,21 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- range.replace("index",String.valueOf(i));
|
|
|
|
|
|
+ range.replace("index", String.valueOf(i));
|
|
range.replace("pic", "");
|
|
range.replace("pic", "");
|
|
- range.replace("content",projectcode+projectename+content);
|
|
|
|
|
|
+ range.replace("content", projectcode + projectename + content);
|
|
range.replace("code", baseinfonum);
|
|
range.replace("code", baseinfonum);
|
|
range.replace("remark", remark);
|
|
range.replace("remark", remark);
|
|
if (amount != null) {
|
|
if (amount != null) {
|
|
range.replace("amount", String.valueOf(amount));
|
|
range.replace("amount", String.valueOf(amount));
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
range.replace("amount", "");
|
|
range.replace("amount", "");
|
|
}
|
|
}
|
|
- if("未整改".equals(rectifystatus)){
|
|
|
|
|
|
+ if ("未整改".equals(rectifystatus)) {
|
|
rectifystatus = "/";
|
|
rectifystatus = "/";
|
|
}
|
|
}
|
|
- range.replace("status",rectifystatus );
|
|
|
|
- range.replace("dept", staf.getFirstorgname()+staf.getSecondorgname()+subcontractename);
|
|
|
|
|
|
+ range.replace("status", rectifystatus);
|
|
|
|
+ range.replace("dept", staf.getFirstorgname() + staf.getSecondorgname() + subcontractename);
|
|
table.getRows().add(deepClone);
|
|
table.getRows().add(deepClone);
|
|
}
|
|
}
|
|
table.getLastRow().remove();
|
|
table.getLastRow().remove();
|
|
@@ -915,18 +969,18 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Description: 动态复制表格
|
|
* @Description: 动态复制表格
|
|
- * @Param: doc
|
|
|
|
|
|
+ * @Param: doc
|
|
* @return:
|
|
* @return:
|
|
*/
|
|
*/
|
|
- public static void addtable(Document doc) throws Exception{
|
|
|
|
|
|
+ public static void addtable(Document doc) throws Exception {
|
|
//获取第一个表格
|
|
//获取第一个表格
|
|
- Table table = (Table)doc.getChild(NodeType.TABLE, 0, true);
|
|
|
|
|
|
+ Table table = (Table) doc.getChild(NodeType.TABLE, 0, true);
|
|
//创建段落
|
|
//创建段落
|
|
Paragraph lastParagraph = new Paragraph(doc);
|
|
Paragraph lastParagraph = new Paragraph(doc);
|
|
//第一个表格末尾加段落
|
|
//第一个表格末尾加段落
|
|
table.getParentNode().insertAfter(lastParagraph, table);
|
|
table.getParentNode().insertAfter(lastParagraph, table);
|
|
- Table cloneTable = (Table)table.deepClone(true);
|
|
|
|
- table.getParentNode().insertAfter(cloneTable,lastParagraph);
|
|
|
|
|
|
+ Table cloneTable = (Table) table.deepClone(true);
|
|
|
|
+ table.getParentNode().insertAfter(cloneTable, lastParagraph);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -956,20 +1010,20 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
try {
|
|
try {
|
|
value = field.get(obj);
|
|
value = field.get(obj);
|
|
map.put(fieldName, value);
|
|
map.put(fieldName, value);
|
|
- if(fieldName == "sitepic"){
|
|
|
|
- if(value != null){
|
|
|
|
|
|
+ if (fieldName == "sitepic") {
|
|
|
|
+ if (value != null) {
|
|
String value1 = (String) value;
|
|
String value1 = (String) value;
|
|
- if(StringUtils.isNotBlank(value1)){
|
|
|
|
|
|
+ if (StringUtils.isNotBlank(value1)) {
|
|
String[] split = value1.split("\\^_\\^");
|
|
String[] split = value1.split("\\^_\\^");
|
|
map.put(fieldName, split[0]);
|
|
map.put(fieldName, split[0]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else if(fieldName == "rectifystatus"){
|
|
|
|
- if(!"已整改".equals(value)){
|
|
|
|
|
|
+ } else if (fieldName == "rectifystatus") {
|
|
|
|
+ if (!"已整改".equals(value)) {
|
|
map.put(fieldName, "/");
|
|
map.put(fieldName, "/");
|
|
}
|
|
}
|
|
- }else if(fieldName == "rectifystatus"){
|
|
|
|
- if(!"已整改".equals(value)){
|
|
|
|
|
|
+ } else if (fieldName == "rectifystatus") {
|
|
|
|
+ if (!"已整改".equals(value)) {
|
|
map.put(fieldName, "/");
|
|
map.put(fieldName, "/");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -978,7 +1032,7 @@ public class ZhcxPersistentManageServiceImpl extends ServiceImpl<ZhcxPersistentM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
index++;
|
|
index++;
|
|
- map.put("index",index);
|
|
|
|
|
|
+ map.put("index", index);
|
|
mapList.add(map);
|
|
mapList.add(map);
|
|
}
|
|
}
|
|
|
|
|