|
@@ -1,5 +1,6 @@
|
|
|
package org.springblade.business.controller;
|
|
|
|
|
|
+import cn.hutool.core.lang.hash.Hash;
|
|
|
import com.alibaba.excel.util.DateUtils;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
@@ -1200,17 +1201,32 @@ public class InformationWriteQueryController extends BladeController {
|
|
|
|
|
|
//试验批量上报
|
|
|
String trialIds = "";
|
|
|
+ Map<Long, Long> mapKey = new HashMap<>();
|
|
|
if (queryList.size() == 0 && startTaskVO.getTrialSelfInspectionRecordId() == 1L) {
|
|
|
+ //试验填报数据
|
|
|
queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids))));
|
|
|
- trialIds = startTaskVO.getIds();
|
|
|
+ //重新绑定trialSelfInspectionRecordId使用map
|
|
|
+ for (InformationQuery informationQuery : queryList) {
|
|
|
+ mapKey.put(informationQuery.getId(), informationQuery.getWbsId());
|
|
|
+ }
|
|
|
//试验记录ids重新赋值映射为数据源ids
|
|
|
ids = queryList.stream().map(InformationQuery::getId).map(String::valueOf).toArray(String[]::new);
|
|
|
+ trialIds = startTaskVO.getIds();
|
|
|
}
|
|
|
|
|
|
Map<String, String> queryMap = new HashMap<>();
|
|
|
queryList.forEach(query -> queryMap.put(query.getId().toString(), query.getName()));
|
|
|
try {
|
|
|
for (String id : ids) {
|
|
|
+
|
|
|
+ //试验-批量上报时,重新绑定当前试验记录id
|
|
|
+ if (ObjectUtil.isNotEmpty(startTaskVO.getTrialSelfInspectionRecordId()) && startTaskVO.getTrialSelfInspectionRecordId() == 1L) {
|
|
|
+ Long wbsId = mapKey.get(Long.parseLong(id));
|
|
|
+ if (ObjectUtil.isNotEmpty(wbsId)) {
|
|
|
+ startTaskVO.setTrialSelfInspectionRecordId(wbsId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//生成任务实体
|
|
|
TaskVO taskVO = new TaskVO();
|
|
|
BeanUtils.copyProperties(startTaskVO, taskVO);
|