|
@@ -18,9 +18,9 @@ package org.springblade.manager.service.impl;
|
|
|
|
|
|
import cn.hutool.core.date.StopWatch;
|
|
|
import cn.hutool.log.StaticLog;
|
|
|
-import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.aliyun.oss.ServiceException;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
@@ -51,28 +51,22 @@ import org.springblade.manager.formula.KeyMapper;
|
|
|
import org.springblade.manager.formula.impl.TableElementConverter;
|
|
|
import org.springblade.manager.service.*;
|
|
|
import org.springblade.manager.utils.FileUtils;
|
|
|
-import org.springblade.manager.vo.ExceTabTreVO;
|
|
|
-import org.springblade.manager.vo.ExcelTabVO;
|
|
|
+import org.springblade.manager.vo.*;
|
|
|
import org.springblade.manager.mapper.ExcelTabMapper;
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
|
-import org.springblade.manager.vo.ExcelTabWbsTypeVO;
|
|
|
-import org.springblade.manager.vo.WbsTreeVO;
|
|
|
import org.springblade.resource.feign.NewIOSSClient;
|
|
|
import org.springblade.system.cache.ParamCache;
|
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
-import org.springframework.jdbc.datasource.DataSourceUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
-import javax.sql.DataSource;
|
|
|
import java.awt.*;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.File;
|
|
|
import java.io.FileInputStream;
|
|
|
import java.io.FileNotFoundException;
|
|
|
-import java.sql.Connection;
|
|
|
import java.sql.SQLException;
|
|
|
import java.util.*;
|
|
|
import java.util.List;
|
|
@@ -331,7 +325,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
public void formulaFillData(List<TableInfo> tableInfoList, Long nodeId) {
|
|
|
if (Func.isNotEmpty(tableInfoList)) {
|
|
|
/*每次都是部分表单提交,保证跨节点跨表取数正常,其次是反向依赖的被动刷新*/
|
|
|
- List<WbsTreeContract> tableAll = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId());
|
|
|
+ List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(nodeId.toString(), "1", tableInfoList.get(0).getContractId(), tableInfoList.get(0).getProjectId());
|
|
|
StopWatch stopWatch = new StopWatch();
|
|
|
List<KeyMapper> keyMappers = this.formulaService.getKeyMapperList(tableInfoList.stream().map(TableInfo::getPkeyId).filter(Func::isNotEmpty).map(Long::parseLong).collect(Collectors.toList()));
|
|
|
if (Func.isNotEmpty(keyMappers)) {
|
|
@@ -536,10 +530,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public void saveOrUpdateInfo(List<TableInfo> tableInfoList) throws SQLException {
|
|
|
+ public R saveOrUpdateInfo(List<TableInfo> tableInfoList){
|
|
|
|
|
|
if (ListUtils.isNotEmpty(tableInfoList)) {
|
|
|
//施工资料填报
|
|
|
+ String pkids="";
|
|
|
try {
|
|
|
for (TableInfo tableInfo : tableInfoList) {
|
|
|
WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
|
|
@@ -547,7 +542,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
if (wbsTreeContract == null) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+ pkids+=tableInfo.getPkeyId()+",";
|
|
|
String tabName = wbsTreeContract.getInitTableName();
|
|
|
// 判读修改还是 添加
|
|
|
String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
|
|
@@ -603,12 +598,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
|
|
|
//保存操作记录
|
|
|
this.operationLogClient.saveUserOperationLog(1, "资料填报", "工序填报页面", json);
|
|
|
-
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ return R.fail("操作失败");
|
|
|
}
|
|
|
}
|
|
|
- return R.success("添加成功");
|
|
|
+ return R.fail("操作成功");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -932,40 +927,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
return R.data(bladeFile2.getLink());
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
|
- String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
- // 获取有权限的节点信息
|
|
|
- List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
|
- List<String> data = new ArrayList<>();
|
|
|
- if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
|
|
|
- for (WbsTreeContract wbsInfo : wbsTreeContractList) {
|
|
|
- // 隐藏的不生成pdf
|
|
|
- if (wbsInfo.getIsBussShow() == null || wbsInfo.getIsBussShow() != 2) { //
|
|
|
- if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
|
|
|
- data.add(wbsInfo.getPdfUrl());
|
|
|
- } else {
|
|
|
- R bussPdfInfo = this.getBussPdfInfo(wbsInfo.getPKeyId());
|
|
|
- if (bussPdfInfo.getCode() == 200) {
|
|
|
- data.add(bussPdfInfo.getData() + "");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String listPdf = file_path + "pdf/" + nodeId + ".pdf";
|
|
|
- File tabpdf2 = ResourceUtil.getFile(listPdf);
|
|
|
- if (tabpdf2.exists()) {
|
|
|
- tabpdf2.delete();
|
|
|
- }
|
|
|
- FileUtils.mergePdfPublicMethods(data, listPdf);
|
|
|
- BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
|
|
|
-
|
|
|
- // 合并pdf集合
|
|
|
- String sql = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + classify + "' and wbs_id='" + nodeId + "' and contract_id ='" + contractId + "' ";
|
|
|
- jdbcTemplate.execute(sql);
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
public R getBussDataInfo(Long pkeyId) {
|
|
@@ -1140,7 +1101,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
public void getBussPdfs(String nodeId, String classify, String contractId, String projectId) throws Exception {
|
|
|
String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
|
|
|
// 获取有权限的节点信息
|
|
|
- List<WbsTreeContract> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
|
+ List<AppWbsTreeContractVO> wbsTreeContractList = wbsTreeContractService.searchNodeAllTable(nodeId, classify, contractId, projectId);
|
|
|
List<String> data = new ArrayList<>();
|
|
|
if (wbsTreeContractList != null && wbsTreeContractList.size() >= 1) {
|
|
|
for (WbsTreeContract wbsInfo : wbsTreeContractList) {
|