Commit 44479e60 authored by hezhuozhi's avatar hezhuozhi

Merge remote-tracking branch 'origin/developer_bw' into developer_bw

parents 0f4afbff 0cc2e7c3
...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.map.MapBuilder; import cn.hutool.core.map.MapBuilder;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.net.HttpHeaders; import com.google.common.net.HttpHeaders;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils; import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
...@@ -12,10 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; ...@@ -12,10 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.hygf.api.Enum.CommonEnum; import com.yeejoin.amos.boot.module.hygf.api.Enum.CommonEnum;
import com.yeejoin.amos.boot.module.hygf.api.dto.*; import com.yeejoin.amos.boot.module.hygf.api.dto.*;
import com.yeejoin.amos.boot.module.hygf.api.entity.*; import com.yeejoin.amos.boot.module.hygf.api.entity.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAuditingMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.*;
import com.yeejoin.amos.boot.module.hygf.api.mapper.FinancingAuditingMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.HygfWorkOrderStationAuditingMapper;
import com.yeejoin.amos.boot.module.hygf.api.mapper.PowerStationMapper;
import com.yeejoin.amos.boot.module.hygf.api.util.JsonUtils; import com.yeejoin.amos.boot.module.hygf.api.util.JsonUtils;
import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient; import com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient;
...@@ -100,6 +98,8 @@ public class CommonServiceImpl { ...@@ -100,6 +98,8 @@ public class CommonServiceImpl {
@Autowired @Autowired
BasicGridAuditingMapper basicGridAuditingMapper; BasicGridAuditingMapper basicGridAuditingMapper;
@Autowired @Autowired
ConstructionRecordsMapper constructionRecordsMapper;
@Autowired
FinancingAuditingMapper financingAuditingMapper; FinancingAuditingMapper financingAuditingMapper;
private static final String TEMP_DIR_NAME = "temp"; private static final String TEMP_DIR_NAME = "temp";
private static final String TEMPLATE_FILE_PATH = "templates/informationTemp.xlsx"; // 模版文件路径 private static final String TEMPLATE_FILE_PATH = "templates/informationTemp.xlsx"; // 模版文件路径
...@@ -510,15 +510,14 @@ public class CommonServiceImpl { ...@@ -510,15 +510,14 @@ public class CommonServiceImpl {
String basicGridInstanceId = basicGridAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId); String basicGridInstanceId = basicGridAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
String financingInstanceId = financingAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId); String financingInstanceId = financingAuditingMapper.getInstanceIdByhouseId(peasantHouseholdId);
List<LinkedHashMap> powerStationWorkLog = new ArrayList<>(); List<LinkedHashMap> powerStationWorkLog = new ArrayList<>();
List<LinkedHashMap> workOrderStationWorkLog = new ArrayList<>(); List<ConstructionRecords> workOrderStationWorkLog = new ArrayList<>();
List<LinkedHashMap> basicGridWorkLog = new ArrayList<>(); List<LinkedHashMap> basicGridWorkLog = new ArrayList<>();
List<LinkedHashMap> financingWorkLog = new ArrayList<>(); List<LinkedHashMap> financingWorkLog = new ArrayList<>();
List<LinkedHashMap> accptWorkLog = new ArrayList<>(); List<LinkedHashMap> accptWorkLog = new ArrayList<>();
workOrderStationWorkLog = this.getConstructionRecords(peasantHouseholdId);
try { try {
powerStationWorkLog = this.getWorkLog(powerStationInstanceId); powerStationWorkLog = this.getWorkLog(powerStationInstanceId);
workOrderStationWorkLog = this.getWorkLog(workOrderStationInstanceId);
basicGridWorkLog = this.getWorkLog(basicGridInstanceId); basicGridWorkLog = this.getWorkLog(basicGridInstanceId);
financingWorkLog = this.getWorkLog(financingInstanceId); financingWorkLog = this.getWorkLog(financingInstanceId);
accptWorkLog = this.getWorkLog(returnDto.getAcceptanceCheck().getInstanceId()); accptWorkLog = this.getWorkLog(returnDto.getAcceptanceCheck().getInstanceId());
...@@ -1121,6 +1120,23 @@ public class CommonServiceImpl { ...@@ -1121,6 +1120,23 @@ public class CommonServiceImpl {
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne, (List<Map<String, Object>>) data); documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne, (List<Map<String, Object>>) data);
} }
} }
if (sheet.getSheetName().contains("操作记录")) {
int startRowNum = 1;
if (null !=data){
int headerRow = startRowNum + 1; // 表头所在的行
int headerOneRow = startRowNum; // 表头所在的行
int dataStartRow = startRowNum+2; // 数据开始的行
startRowNum= dataStartRow +1;
// 假设表头内容如下:
String headerOne = "施工完工操作记录";
String[] headersNames = {"操作人","操作内容","操作时间", "备注",};
String[] headers = {"operator", "operationContent", "operationTime", "notes"};
List<Map<String, Object>> maps = convertListToMap((List<ConstructionRecords>) data);
documentSpecialProcessing(sheet,headerRow,headerOneRow,dataStartRow,headersNames,headers,headerOne, maps);
}
}
} }
private String removePlaceholders(String fieldValue) { private String removePlaceholders(String fieldValue) {
...@@ -1401,7 +1417,13 @@ public class CommonServiceImpl { ...@@ -1401,7 +1417,13 @@ public class CommonServiceImpl {
// 从第四行开始填充数据 // 从第四行开始填充数据
for (int dataIndex = 0; dataIndex < data.size(); dataIndex++) { for (int dataIndex = 0; dataIndex < data.size(); dataIndex++) {
Row dataRow = sheet.createRow(dataStartRow + dataIndex); Row dataRow = sheet.createRow(dataStartRow + dataIndex);
Map<String, Object> rowData = (Map<String, Object>) data.get(dataIndex).get("map"); Map<String, Object> result = (Map<String, Object>) data.get(dataIndex);
Map<String, Object> rowData = new HashMap<>();
if (result.containsKey("map")){
rowData = (Map<String, Object>)result.get("map");
}else {
rowData = result;
}
for (int i = 0; i < headersNames.length; i++) { for (int i = 0; i < headersNames.length; i++) {
Cell dataCell = dataRow.createCell(i); Cell dataCell = dataRow.createCell(i);
if (rowData.containsKey(headers[i])) { if (rowData.containsKey(headers[i])) {
...@@ -1466,7 +1488,11 @@ public class CommonServiceImpl { ...@@ -1466,7 +1488,11 @@ public class CommonServiceImpl {
} else { } else {
dataCell.setCellValue(""); // 假设所有数据都是字符串格式 dataCell.setCellValue(""); // 假设所有数据都是字符串格式
} }
} else { } else if( value instanceof Date) {
String s = DateUtils.date2LongStr((Date) value);
dataCell.setCellValue(s);
}
else {
dataCell.setCellValue(null == value?"":value.toString()); // 假设所有数据都是字符串格式 dataCell.setCellValue(null == value?"":value.toString()); // 假设所有数据都是字符串格式
} }
} else { } else {
...@@ -1566,7 +1592,7 @@ public class CommonServiceImpl { ...@@ -1566,7 +1592,7 @@ public class CommonServiceImpl {
} }
List<LinkedHashMap> getWorkLog (String processInstanceId){ List<LinkedHashMap> getWorkLog (String processInstanceId){
if (!StringUtils.isEmpty(processInstanceId)) { if (StringUtils.isEmpty(processInstanceId)) {
return null; return null;
} }
List<LinkedHashMap> flowLoggernew = new ArrayList<>(); List<LinkedHashMap> flowLoggernew = new ArrayList<>();
...@@ -1600,6 +1626,15 @@ public class CommonServiceImpl { ...@@ -1600,6 +1626,15 @@ public class CommonServiceImpl {
return flowLoggernew; return flowLoggernew;
} }
List<ConstructionRecords> getConstructionRecords (String peasantHouseholdId) {
// 施工自审操作记录
LambdaQueryWrapper<ConstructionRecords> up5 = new LambdaQueryWrapper<ConstructionRecords>();
up5.eq(ConstructionRecords::getPeasantHouseholdId, peasantHouseholdId);
up5.orderByAsc(ConstructionRecords::getRecDate);
return constructionRecordsMapper.selectList(up5);
}
public Object getSchedule(String peasantHouseholdId) { public Object getSchedule(String peasantHouseholdId) {
if (!redisUtils.hasKey(peasantHouseholdId)){ if (!redisUtils.hasKey(peasantHouseholdId)){
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment