Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

liuyc 2 vuotta sitten
vanhempi
commit
fee514625a
19 muutettua tiedostoa jossa 160 lisäystä ja 93 poistoa
  1. 1 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/ContractLogClient.java
  2. 1 1
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java
  3. 2 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java
  4. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java
  5. 1 2
      blade-service/blade-business/src/main/java/org/springblade/business/controller/ImageClassificationFileController.java
  6. 4 1
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java
  7. 2 2
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java
  8. 6 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml
  9. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java
  10. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/DatumPointService.java
  11. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ImageClassificationFileServiceImpl.java
  12. 5 5
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  13. 12 3
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  14. 7 3
      blade-service/blade-business/src/main/java/org/springblade/business/utils/YearTreeUtils.java
  15. 29 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  16. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java
  17. 10 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  18. 67 69
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  19. 5 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/ContractLogClient.java

@@ -37,6 +37,6 @@ public interface ContractLogClient {
      * 保存日志信息
      */
     @PostMapping(API_PREFIX + "/saveContractLog")
-    void saveContractLog(@RequestBody SaveContractLogVO saveContractLogVO);
+    String saveContractLog(@RequestBody SaveContractLogVO saveContractLogVO);
 
 }

+ 1 - 1
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java

@@ -34,7 +34,7 @@ public interface InformationQueryClient {
      * @param sourceType 1原生2数据化
      */
     @PostMapping(API_PREFIX + "/saveOrUpdateInformationQueryData")
-    void saveOrUpdateInformationQueryData(@RequestParam String wbsId,
+    String saveOrUpdateInformationQueryData(@RequestParam String wbsId,
                                           @RequestParam String tableId,
                                           @RequestParam String businessId,
                                           @RequestParam String fileName,

+ 2 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/InformationQueryVO.java

@@ -63,6 +63,8 @@ public class InformationQueryVO extends InformationQuery {
 
 	private String isFirst;
 
+	private String firstTitle;
+
 	@ApiModelProperty("上报批次")
 	private String reportNumber;
 

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -104,7 +104,7 @@ public class ContractLogController extends BladeController {
 		//获取填报时间
 		List<String> recordTimeList = this.contractLogService.queryReportLogTimeTree(contractId, nodePrimaryKeyId);
 		//转成结构树
-		return R.data(YearTreeUtils.yearMonthDayTree(recordTimeList));
+		return R.data(YearTreeUtils.yearMonthDayTree(recordTimeList, "ASC"));
 	}
 
 	/**

+ 1 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ImageClassificationFileController.java

@@ -31,7 +31,6 @@ import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.IoUtil;
-import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.ImageClassificationConfig;
 import org.springblade.manager.entity.WbsTreeContract;
@@ -178,7 +177,7 @@ public class ImageClassificationFileController extends BladeController {
 											//创建图片
 											drawing.createPicture(anchor, workbook.addPicture(CommonUtil.InputStreamToBytes(CommonUtil.getOSSInputStream(urls.get(i))), Workbook.PICTURE_TYPE_PNG));
 											//图片定位
-											FileUtils.imageOrientation(sheet, anchor, i == 1 ? new DataVO(0, 0) : new DataVO(1, 28));
+											FileUtils.imageOrientation(sheet, anchor, i == 1 ? new DataVO(1, 28) : new DataVO(0, 0));
 
 											//定位其它信息
 											//文字说明

+ 4 - 1
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java

@@ -82,7 +82,7 @@ public class ContractLogClientImpl implements ContractLogClient {
     }
 
     @Override
-    public void saveContractLog(SaveContractLogVO saveContractLogVO) {
+    public String saveContractLog(SaveContractLogVO saveContractLogVO) {
         ContractLog contractLog = new ContractLog();
         //复制数据
         BeanUtils.copyProperties(saveContractLogVO, contractLog);
@@ -108,6 +108,7 @@ public class ContractLogClientImpl implements ContractLogClient {
             //修改数据ID指向
             this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getDataId, contractLog.getDataId()).eq(ContractLog::getId, logJson.getString("id")));
 
+            return logJson.getString("id");
         } else {
             //获取节点信息
             WbsTreePrivate node =  this.wbsTreePrivateClient.queryByPKeyIds(Func.toStrList(saveContractLogVO.getWbsNodeId().toString())).get(0);
@@ -129,6 +130,8 @@ public class ContractLogClientImpl implements ContractLogClient {
             }
 
             this.contractLogService.save(contractLog);
+
+            return contractLog.getId().toString();
         }
 
     }

+ 2 - 2
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java

@@ -22,10 +22,10 @@ public class InformationQueryClientImpl implements InformationQueryClient {
     }
 
     @Override
-    public void saveOrUpdateInformationQueryData(String wbsId, String tableId,
+    public String saveOrUpdateInformationQueryData(String wbsId, String tableId,
                                                  String businessId, String fileName,
                                                  Integer classify, Integer sourceType,
                                                  String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
-        this.iInformationQueryService.saveOrUpdateInformationQueryData(wbsId, tableId, businessId, fileName, classify, sourceType, isFirst, sourceUrl, pdfUrl, firstFileName, linkDataList);
+        return this.iInformationQueryService.saveOrUpdateInformationQueryData(wbsId, tableId, businessId, fileName, classify, sourceType, isFirst, sourceUrl, pdfUrl, firstFileName, linkDataList);
     }
 }

+ 6 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/InformationQueryMapper.xml

@@ -132,6 +132,8 @@
                 </foreach>
                 and wtc.parent_id = #{parentId}
                 and wtc.is_deleted= '0'
+                AND wtc.node_type != 111
+                AND iq.type != 3
                 group by wtc.p_key_id
             ) AS querys
         ) AS querys ON wtc.p_key_id = querys.pKeyId
@@ -205,6 +207,8 @@
                     wtc.contract_id = #{contractId}
                 and wtc.parent_id = #{parentId}
                 and wtc.is_deleted= '0'
+                AND wtc.node_type != 111
+                AND iq.type != 3
                 AND wtc.type = 1
                 group by wtc.p_key_id
             ) AS querys
@@ -372,6 +376,8 @@
             <if test="query.reportNumber != null and query.reportNumber != ''"> and report_number = #{query.reportNumber} </if>
             <if test="query.fileUserIdAndName != null and query.fileUserIdAndName != ''"> and file_user_id_and_name like concat('%',#{query.fileUserIdAndName},'%') </if>
             <if test="query.queryValue != null and query.queryValue != ''"> and (name like concat('%',#{query.queryValue},'%') OR number like concat('%',#{query.queryValue},'%')) </if>
+            <if test="query.firstTitle != null and query.firstTitle != ''"> and `type` = 3 </if>
+            <if test="query.firstTitle == null or query.firstTitle == ''"> and `type` != 3 </if>
             <if test="query.wbsIds != null">
                 and wbs_id in
                 <foreach collection="query.wbsIds" item="wbsIdc" open="(" separator="," close=")">

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java

@@ -69,7 +69,7 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
 	 * @param classify 1施工2质检
 	 * @param sourceType 1原生2数据化
 	 */
-	void saveOrUpdateInformationQueryData(String wbsId, String tableId,
+	String saveOrUpdateInformationQueryData(String wbsId, String tableId,
 										  String businessId, String fileName,
 										  Integer classify, Integer sourceType,
 										  String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList);

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/DatumPointService.java

@@ -58,6 +58,9 @@ public class DatumPointService extends BaseServiceImpl<DatumPointMapper, DatumPo
                               Map<String, Object> map = new HashMap<>();
                               map.put(finalKey+"__"+ka[0], e.getX());
                               map.put(finalKey+"__"+ka[1], e.getY());
+                              if(ka.length>2){
+                                  map.put(finalKey+"__"+ka[2], e.getH());
+                              }
                               result.put(e.getName(), map);
                           });
                       }

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ImageClassificationFileServiceImpl.java

@@ -60,7 +60,7 @@ public class ImageClassificationFileServiceImpl extends BaseServiceImpl<ImageCla
 		List<String> yearMonthDayList = new ArrayList<>();
 		shootingTimes.forEach(date -> yearMonthDayList.add(DateFormatUtils.format(date, "yyyy-MM-dd")));
 		//转成结构树
-		return YearTreeUtils.yearMonthDayTree(yearMonthDayList);
+		return YearTreeUtils.yearMonthDayTree(yearMonthDayList, "DESC");
 	}
 
 	@Override

+ 5 - 5
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java

@@ -167,7 +167,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 	}
 
-	private void saveOrUpdateFirstInformationQueryData(String primaryKeyId, String tableId,
+	private String saveOrUpdateFirstInformationQueryData(String primaryKeyId, String tableId,
 													   String businessId, String fileName,
 													   Integer classify, Integer sourceType,
 													   String sourceUrl,
@@ -277,13 +277,13 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 
 			//保存数据
 			this.baseMapper.insert(newData);
-
 		}
 
+		return businessId;
 	}
 
 	@Override
-	public void saveOrUpdateInformationQueryData(String primaryKeyId, String tableId,
+	public String saveOrUpdateInformationQueryData(String primaryKeyId, String tableId,
 												 String businessId, String fileName,
 												 Integer classify, Integer sourceType,
 												 String isFirst, String sourceUrl,
@@ -291,7 +291,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 		BladeUser user = AuthUtil.getUser();
 
 		if(StringUtils.isNotEmpty(isFirst) && "true".equals(isFirst)){
-			this.saveOrUpdateFirstInformationQueryData(primaryKeyId, tableId, businessId, fileName, classify, sourceType, sourceUrl, pdfUrl, firstFileName, linkDataList);
+			return this.saveOrUpdateFirstInformationQueryData(primaryKeyId, tableId, businessId, fileName, classify, sourceType, sourceUrl, pdfUrl, firstFileName, linkDataList);
 		} else {
 			//首先根据wbsId获取合同段ID和项目ID
 			WbsTreeContract contractTree = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(Long.parseLong(primaryKeyId));
@@ -351,7 +351,7 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
 				this.baseMapper.insert(newData);
 			}
 		}
-
+		return null;
 	}
 
 	@Override

+ 12 - 3
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -673,7 +673,11 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
      * 施工日志等
      */
     private void updateContractLogBusinessDataStatus(String formDataId, Integer status, String newFileUrl){
-        this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getStatus, status).set(ContractLog::getEVisaPdfUrl, newFileUrl).in(ContractLog::getId, Arrays.asList(formDataId.split(","))));
+        this.contractLogService.update(Wrappers.<ContractLog>lambdaUpdate().set(ContractLog::getStatus, status)
+                .set(ContractLog::getEVisaPdfUrl, newFileUrl)
+                .set(ContractLog::getAuditUserIdAndName, null)
+                .set(ContractLog::getBatch, null)
+                .in(ContractLog::getId, Arrays.asList(formDataId.split(","))));
         //解锁
         DistributedRedisLock.release(formDataId);
     }
@@ -682,7 +686,11 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
      * 资料填报
      */
     private void updateWriteBusinessDataStatus(String formDataId, Integer status, String newFileUrl){
-        this.informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getStatus, status).set(InformationQuery::getEVisaPdfUrl, newFileUrl).in(InformationQuery::getId, Arrays.asList(formDataId.split(","))));
+        this.informationQueryService.update(Wrappers.<InformationQuery>lambdaUpdate().set(InformationQuery::getStatus, status)
+                .set(InformationQuery::getEVisaPdfUrl, newFileUrl)
+                .set(InformationQuery::getReportNumber, null)
+                .set(InformationQuery::getAuditUserIdAndName, null)
+                .in(InformationQuery::getId, Arrays.asList(formDataId.split(","))));
         //解锁
         DistributedRedisLock.release(formDataId);
     }
@@ -693,7 +701,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     private void updateArchiveFileBusinessDataStatus(String formDataId, Integer status, String newFileUrl){
         LambdaUpdateWrapper<ArchiveFile> wrapper = Wrappers.lambdaUpdate();
         //更改状态,更改电签文件信息
-        wrapper.set(ArchiveFile::getStatus, status).set(ArchiveFile::getEVisaFile, newFileUrl);
+        wrapper.set(ArchiveFile::getStatus, status)
+                .set(ArchiveFile::getEVisaFile, newFileUrl);
         this.archiveFileService.update(wrapper.in(ArchiveFile::getId, Arrays.asList(formDataId.split(","))));
         //解锁
         DistributedRedisLock.release(formDataId);

+ 7 - 3
blade-service/blade-business/src/main/java/org/springblade/business/utils/YearTreeUtils.java

@@ -6,7 +6,7 @@ import java.util.*;
 
 public class YearTreeUtils {
 
-    public static List<TreeVo> yearMonthDayTree(List<String> yearMonthDayList){
+    public static List<TreeVo> yearMonthDayTree(List<String> yearMonthDayList, String sort){
 
         //最终集合
         List<TreeVo> result = new ArrayList<>();
@@ -67,8 +67,12 @@ public class YearTreeUtils {
             TreeVo yearResult = new TreeVo(year, monthResult, year);
             result.add(yearResult);
         }
-        //时间倒序
-        result.sort(Comparator.comparing(TreeVo::getName).reversed());
+
+        if("DESC".equals(sort)){
+            result.sort(Comparator.comparing(TreeVo::getName).reversed());
+        } else {
+            result.sort(Comparator.comparing(TreeVo::getName));
+        }
 
         return result;
     }

+ 29 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -2231,4 +2231,33 @@ public class ExcelTabController extends BladeController {
         return R.data(300, null, "未找到数据");
     }
 
+    @PostMapping("/save_log_first_buss_data")
+    @ApiOperationSupport(order = 29)
+    @ApiOperation(value = "填报页面数据保存", notes = "填报页面数据保存")
+    public R<String> saveLogOrFirstBussData(@Valid @RequestBody JSONObject dataInfo, BladeUser bladeUser) throws Exception {
+        JSONArray dataArray = new JSONArray();
+        if (dataInfo.containsKey("dataInfo")) { // 节点保存
+            JSONObject jsonObject = dataInfo.getJSONObject("dataInfo");
+            dataArray = jsonObject.getJSONArray("orderList");
+        } else { // 单个保存
+            dataArray.add(dataInfo);
+        }
+        List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
+        try {
+            this.excelTabService.formulaFillData(tableInfoList);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        // 保存数据到数据库
+        String isFirst = tableInfoList.get(0).getIsFirst();
+        if(StringUtils.isNotEmpty(isFirst)){
+            //保存首件
+            return R.data(this.excelTabService.saveOrUpdateFirst(tableInfoList));
+        } else {
+            //保存日志
+            return R.data(this.excelTabService.saveOrUpdateTheLog(tableInfoList));
+        }
+    }
+
 }

+ 2 - 2
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/FirstController.java

@@ -168,7 +168,7 @@ public class FirstController extends BladeController {
     @GetMapping("/get-first-buss-pdfInfo")
     @ApiOperationSupport(order = 3)
     @ApiOperation(value = "首件-pdf预览", notes = "首件列表ID")
-    @ApiImplicitParam(name = "firstId", value = "pkeyId", required = true)
+    @ApiImplicitParam(name = "firstId", value = "首件ID", required = true)
     public R<String> getBussPdfInfo(String firstId) {
         if(StringUtils.isNotEmpty(firstId)){
             //PDF路径集合
@@ -324,7 +324,7 @@ public class FirstController extends BladeController {
                             pdfUrls.add(bladeFile.getLink());
 
                             //将封面的pdf修改
-                            String updatePdfUrl = "UPDATE u_information_query SET pdf_url = " + bladeFile.getLink() + " WHERE id = " + firstId;
+                            String updatePdfUrl = "UPDATE u_information_query SET pdf_url = '" + bladeFile.getLink() + "' WHERE id = " + firstId;
                             this.jdbcTemplate.execute(updatePdfUrl);
 
                             wb.dispose();

+ 10 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java

@@ -108,4 +108,14 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
 	// 获取用户端 单个表单接口数据
 	R getBussDataInfo(Long pkeyId);
 
+	/**
+	 * 保存 首件数据
+	 */
+	String saveOrUpdateFirst(List<TableInfo> tableInfoList);
+
+	/**
+	 * 保存 日志数据
+	 */
+	String saveOrUpdateTheLog(List<TableInfo> tableInfoList);
+
 }

+ 67 - 69
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -190,6 +190,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if (dataInfo2.containsKey("firstFileName")) {
             tableInfo.setFirstFileName(dataInfo2.getString("firstFileName"));
         }
+        //关联的信息
+        if(dataInfo2.containsKey("linkProcessList")){
+            tableInfo.setLinkProcessList(dataInfo2.getJSONArray("linkProcessList"));
+        }
     }
 
     /**
@@ -348,7 +352,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
     /**
      * 保存日志
      */
-    private void saveOrUpdateTheLog(List<TableInfo> tableInfoList) {
+    public String saveOrUpdateTheLog(List<TableInfo> tableInfoList) {
         //查询绑定的节点
         WbsTreePrivate tableNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, tableInfoList.get(0).getPkeyId()));
         WbsTreePrivate parentNode = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getProjectId, tableNode.getProjectId()).eq(WbsTreePrivate::getId, tableNode.getParentId()));
@@ -433,7 +437,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
 
         //保存日志记录
-        this.contractLogClient.saveContractLog(new SaveContractLogVO(
+        return this.contractLogClient.saveContractLog(new SaveContractLogVO(
                 Long.parseLong(businessId),
                 tableInfoList.get(0).getProjectId(),
                 tableInfoList.get(0).getContractId(),
@@ -443,10 +447,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 recordTime,
                 logWbsList
         ));
-
     }
 
-    private void saveOrUpdateFirst(List<TableInfo> tableInfoList) {
+    /**
+     * 保存首件
+     */
+    public String saveOrUpdateFirst(List<TableInfo> tableInfoList) {
         //获取首件绑定的节点
         String firstNodeId = tableInfoList.get(0).getFirstNodeId();
         //获取首件关联的施工记录
@@ -456,13 +462,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
 
         //获取数据所在数据表名
-        WbsTreeContract table = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
+        WbsTreeContract table = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery()
+                .eq(WbsTreeContract::getContractId, tableInfoList.get(0).getContractId())
+                .eq(WbsTreeContract::getTableType, 111));
         if (table == null) {
-            return;
+            return null;
         }
         String tableName = table.getInitTableName();
         if (StringUtils.isEmpty(tableName)) {
-            return;
+            return null;
         }
 
         //获取首件记录ID
@@ -506,88 +514,78 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
         try {
             //新增或修改首件记录
-            this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, tableInfoList.get(0).getPkeyId() + "", firstId, "文件名称", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
+            return this.informationQueryClient.saveOrUpdateInformationQueryData(firstNodeId, table.getPKeyId() + "", firstId, "文件名称", Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "true", sourceUrl, pdfUrl, firstFileName, linkProcessList);
         } catch (Exception e) {
             e.printStackTrace();
         }
-
+        return null;
     }
 
     @Override
     public void saveOrUpdateInfo(List<TableInfo> tableInfoList) {
         if (ListUtils.isNotEmpty(tableInfoList)) {
-            if (StringUtils.isNotEmpty(tableInfoList.get(0).getIsFirst())) {
-                //首件填报
-                this.saveOrUpdateFirst(tableInfoList);
-
-            } else if (StringUtils.isNotEmpty(tableInfoList.get(0).getIsTheLog())) {
-                //日志填报
-                this.saveOrUpdateTheLog(tableInfoList);
-
-            } else {
-                //施工资料填报
-                for (TableInfo tableInfo : tableInfoList) {
-                    WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-                            .eq(WbsTreeContract::getPKeyId, tableInfo.getPkeyId()));
-                    if (wbsTreeContract == null) {
-                        continue;
-                    }
-
-                    String tabName = wbsTreeContract.getInitTableName();
-
-                    // 判读修改还是 添加
-                    String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
-                    jdbcTemplate.execute(delSql);
-
-                    String sqlInfo = "";
-                    LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
-                    sqlInfo = "INSERT INTO " + tabName + " ( ";
-                    String keyStr = "id,";
-                    String valStr = SnowFlakeUtil.getId() + ",";
-                    for (String keys : dataMap2.keySet()) {
-                        keyStr += keys + ",";
-                        valStr += "'" + dataMap2.get(keys) + "',";
-                    }
-                    keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
-                    valStr = valStr.substring(0, valStr.lastIndexOf(","));
-                    sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
+            //施工资料填报
+            for (TableInfo tableInfo : tableInfoList) {
+                WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                        .eq(WbsTreeContract::getPKeyId, tableInfo.getPkeyId()));
+                if (wbsTreeContract == null) {
+                    continue;
+                }
 
-                    WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-                            .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, tableInfo.getContractId()));
+                String tabName = wbsTreeContract.getInitTableName();
 
-                    if (wbsTreeContractByP != null) {
-                        //处理文件提名
-                        String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId()) ? Long.valueOf(wbsTreeContractByP.getOldId()) : wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()), wbsTreeContractByP);
-                        fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
+                // 判读修改还是 添加
+                String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
+                jdbcTemplate.execute(delSql);
 
-                        //huangjn 保存成功后调用生成资料查询列表数据
-                        this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2, "是否是首件(临时,暂时没用到)", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
-                    }
-
-                    UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
-                    updateWrapper.in("p_key_id", tableInfo.getPkeyId());
-                    updateWrapper.set("is_tab_pdf", 2);
-                    wbsTreeContractService.update(updateWrapper);
-                    jdbcTemplate.execute(sqlInfo);
-                    // pdf 预览添加
-                    //this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
+                String sqlInfo = "";
+                LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
+                sqlInfo = "INSERT INTO " + tabName + " ( ";
+                String keyStr = "id,";
+                String valStr = SnowFlakeUtil.getId() + ",";
+                for (String keys : dataMap2.keySet()) {
+                    keyStr += keys + ",";
+                    valStr += "'" + dataMap2.get(keys) + "',";
                 }
+                keyStr = keyStr.substring(0, keyStr.lastIndexOf(","));
+                valStr = valStr.substring(0, valStr.lastIndexOf(","));
+                sqlInfo = sqlInfo + keyStr + ") VALUES (" + valStr + ")";
 
-                try {
-                    //获取节点
-                    WbsTreeContract wbsTreeContract = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
+                WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                        .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, tableInfo.getContractId()));
 
-                    WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
-                            .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
+                if (wbsTreeContractByP != null) {
                     //处理文件提名
                     String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId()) ? Long.valueOf(wbsTreeContractByP.getOldId()) : wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()), wbsTreeContractByP);
                     fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
 
                     //huangjn 保存成功后调用生成资料查询列表数据
-                    this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
-                } catch (Exception e) {
-                    e.printStackTrace();
+                    this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfo.getClassify()), 2, "是否是首件(临时,暂时没用到)", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
                 }
+
+                UpdateWrapper<WbsTreeContract> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.in("p_key_id", tableInfo.getPkeyId());
+                updateWrapper.set("is_tab_pdf", 2);
+                wbsTreeContractService.update(updateWrapper);
+                jdbcTemplate.execute(sqlInfo);
+                // pdf 预览添加
+                //this.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
+            }
+
+            try {
+                //获取节点
+                WbsTreeContract wbsTreeContract = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId, tableInfoList.get(0).getPkeyId()));
+
+                WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                        .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, wbsTreeContract.getContractId()));
+                //处理文件提名
+                String fileName = this.wbsParamService.createFileTitle(Func.isNotEmpty(wbsTreeContractByP.getOldId()) ? Long.valueOf(wbsTreeContractByP.getOldId()) : wbsTreeContractByP.getId(), Long.parseLong(wbsTreeContractByP.getContractId()), wbsTreeContractByP);
+                fileName = StringUtils.isNotEmpty(fileName) ? fileName : "缺少文件提名配置";
+
+                //huangjn 保存成功后调用生成资料查询列表数据
+                this.informationQueryClient.saveOrUpdateInformationQueryData(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
+            } catch (Exception e) {
+                e.printStackTrace();
             }
         }
     }

+ 5 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java

@@ -129,11 +129,15 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
         if(CollectionUtil.isNotEmpty(this.env.formDataList)){
             for(FormData fd:this.env.formDataList){
                 /*预处理公式脚本*/
-                if(Func.isEmpty(fd.getFormula())){
+                if(!fd.verify()){
                     /*不存公式,则认为执行完成,不会再主动执行*/
                     fd.setFinished(Boolean.TRUE);
                     continue;
                 }
+                if("FORM_SITE".equals(fd.getFormula().getNumber())){
+                    fd.setFinished(Boolean.TRUE);
+                    continue;
+                }
                 String tmp =fd.getFormula().getFormula();
                 tmp = tmp.replace(FC, CustomFunction.CLASS_CALL);
                 if(tmp.contains(CustomFunction.CLASS_CALL+"ifelse")){