Przeglądaj źródła

1.特殊情况重签不赋值填报人,2.试验自检关联字段展示3.检测样品时间

DengLinLang 1 miesiąc temu
rodzic
commit
4287656b21
14 zmienionych plików z 436 dodań i 33 usunięć
  1. 15 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/InformationQueryClient.java
  2. 7 2
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java
  3. 5 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClientFallBack.java
  4. 6 0
      blade-service/blade-business/src/main/java/org/springblade/business/feignClient/InformationQueryClientImpl.java
  5. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/IEntrustInfoService.java
  6. 4 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/IInformationQueryService.java
  7. 9 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java
  8. 133 11
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/InformationQueryServiceImpl.java
  9. 4 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  10. 8 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  11. 128 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  12. 4 16
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  13. 5 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  14. 107 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

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

@@ -57,6 +57,21 @@ public interface InformationQueryClient {
                                             @RequestParam String pdfUrl,
                                             @RequestParam String firstFileName,
                                             @RequestBody List<JSONObject> linkDataList);
+    /**
+     * 重签版
+     */
+    @PostMapping(API_PREFIX + "/saveOrUpdateInformationQueryDataReSign")
+    String saveOrUpdateInformationQueryDataReSign(@RequestParam String wbsId,
+                                            @RequestParam String tableId,
+                                            @RequestParam String businessId,
+                                            @RequestParam String fileName,
+                                            @RequestParam Integer classify,
+                                            @RequestParam Integer sourceType,
+                                            @RequestParam String isFirst,
+                                            @RequestParam String sourceUrl,
+                                            @RequestParam String pdfUrl,
+                                            @RequestParam String firstFileName,
+                                            @RequestBody List<JSONObject> linkDataList);
 
     @PostMapping(API_PREFIX + "/informationQuerySaveData")
     void saveData(@RequestParam String id, @RequestParam String projectId, @RequestParam String contractId, @RequestParam String classify, @RequestParam String link, @RequestParam String trialProjectName);

+ 7 - 2
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java

@@ -10,8 +10,6 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RequestParam;
 
-import javax.servlet.http.HttpServletRequest;
-
 import java.util.List;
 
 import static org.springblade.core.launch.constant.AppConstant.APPLICATION_NAME_PREFIX;
@@ -59,6 +57,13 @@ public interface ExcelTabClient {
                  @RequestParam String projectId,
                  @RequestHeader("Blade-Auth") String header) throws Exception;
 
+    @PostMapping(API_PREFIX + "/synPDFInfoResign")
+    R synPDFInfoResign(@RequestParam String contractId,
+                 @RequestParam String nodeIds,
+                 @RequestParam String classify,
+                 @RequestParam String projectId,
+                 @RequestHeader("Blade-Auth") String header) throws Exception;
+
     @PostMapping(API_PREFIX + "/getArchiveTabList")
     List<ExcelTab> getArchiveTabList();
 

+ 5 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClientFallBack.java

@@ -10,7 +10,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Component;
 
-import javax.servlet.http.HttpServletRequest;
 import java.util.List;
 
 @Component
@@ -48,6 +47,11 @@ public class ExcelTabClientFallBack implements ExcelTabClient {
         return null;
     }
 
+    @Override
+    public R synPDFInfoResign(String contractId, String nodeIds, String classify, String projectId, String header) throws Exception {
+        return null;
+    }
+
     @Override
     public List<ExcelTab> getArchiveTabList(){
         return null;

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

@@ -56,6 +56,12 @@ public class InformationQueryClientImpl implements InformationQueryClient {
         return this.iInformationQueryService.saveOrUpdateInformationQueryData(wbsId, tableId, businessId, fileName, classify, sourceType, isFirst, sourceUrl, pdfUrl, firstFileName, linkDataList);
     }
 
+    @Override
+    public String saveOrUpdateInformationQueryDataReSign(String wbsId, String tableId, String businessId, String fileName, Integer classify, Integer sourceType, String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
+        return this.iInformationQueryService.saveOrUpdateInformationQueryDataReSign(wbsId, tableId, businessId, fileName, classify, sourceType, isFirst, sourceUrl, pdfUrl, firstFileName, linkDataList);
+    }
+
+
     @Override
     public void saveData(String id, String projectId, String contractId, String classify, String link, String trialProjectName) {
         InformationQuery obj = new InformationQuery();

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

@@ -46,7 +46,7 @@ public interface IEntrustInfoService extends BaseService<EntrustInfo> {
 	EntrustDataInfoVO getReportDetail(String id);
 
 	/**
-	 * 样品分
+	 * 样品分
 	 * @param page
 	 * @param trialSampleInfo
 	 * @return

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

@@ -91,7 +91,10 @@ public interface IInformationQueryService extends BaseService<InformationQuery>
                                             String businessId, String fileName,
                                             Integer classify, Integer sourceType,
                                             String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList);
-
+    String saveOrUpdateInformationQueryDataReSign(String wbsId, String tableId,
+                                            String businessId, String fileName,
+                                            Integer classify, Integer sourceType,
+                                            String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList);
     /**
      * 获取当前合同段下所有的上报批次
      *

+ 9 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java

@@ -18,6 +18,7 @@ package org.springblade.business.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.springblade.business.entity.EntrustInfo;
@@ -67,6 +68,14 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 
 	@Override
 	public IPage<TrialSampleDataInfoVO> samplePage(IPage<TrialSampleDataInfoVO> page, TrialSampleDataInfoVO trialSampleInfo) {
+		String startTime = trialSampleInfo.getStartTime();
+		String endTime = trialSampleInfo.getEndTime();
+		if(StringUtils.isNotEmpty(startTime) && StringUtils.isNotEmpty(endTime)){
+			startTime = startTime +" 00:00:00";
+			endTime = endTime +" 23:59:59";
+			trialSampleInfo.setStartTime(startTime);
+			trialSampleInfo.setEndTime(endTime);
+		}
 		return page.setRecords(baseMapper.samplePage(page, trialSampleInfo));
 	}
 

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

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
@@ -11,11 +12,11 @@ import org.apache.commons.lang.StringUtils;
 import org.apache.http.client.utils.DateUtils;
 import org.springblade.business.entity.*;
 import org.springblade.business.feign.TaskClient;
+import org.springblade.business.mapper.InformationQueryMapper;
 import org.springblade.business.service.*;
 import org.springblade.business.utils.FileUtils;
 import org.springblade.business.vo.FileUserVO;
 import org.springblade.business.vo.InformationQueryVO;
-import org.springblade.business.mapper.InformationQueryMapper;
 import org.springblade.business.vo.QueryProcessDataVO;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.SnowFlakeUtil;
@@ -35,6 +36,7 @@ import org.springblade.manager.feign.WbsTreeContractClient;
 import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springblade.system.cache.ParamCache;
+import org.springblade.system.entity.Dept;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,7 +44,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -79,6 +80,10 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
     private final ContractClient contractClient;
 
     private final JdbcTemplate jdbcTemplate;
+    //超级管理员的角色id
+    private final String SUPER_ADMIN_ROLE_ID ="1123598816738675201";
+    //泓创智诚公司的部门id
+    private final Long  HONGCHENG_DEPT_ID = 1536982621165592577L;
 
     @Autowired
     StringRedisTemplate RedisTemplate;
@@ -395,18 +400,114 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
                 if (StringUtils.isNotEmpty(fileName)) {
                     oldData.setName(fileName);
                 }
+                     //拼接填报人信息
+                     String fileUser = userId + "-" + userNmae;
+                     if (StringUtils.isNotEmpty(oldData.getFileUserIdAndName())) {
+                         if (!oldData.getFileUserIdAndName().contains(userId.toString())) {
+                             //不包含,拼接
+                             oldData.setFileUserIdAndName(oldData.getFileUserIdAndName() + "," + fileUser);
+                         }
+                     } else {
+                         oldData.setFileUserIdAndName(fileUser);
+                     }
+                oldData.setUpdateTime(new Date());
+                oldData.setUpdateUser(userId);
 
-                //拼接填报人信息
-                String fileUser = userId + "-" + userNmae;
-                if (StringUtils.isNotEmpty(oldData.getFileUserIdAndName())) {
-                    if (!oldData.getFileUserIdAndName().contains(userId.toString())) {
-                        //不包含,拼接
-                        oldData.setFileUserIdAndName(oldData.getFileUserIdAndName() + "," + fileUser);
-                    }
-                } else {
-                    oldData.setFileUserIdAndName(fileUser);
+                List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+                if (linkIds.size() > 0) {
+                    oldData.setSjRecordIds(StringUtils.join(linkIds, ","));
                 }
 
+                //修改数据
+                this.baseMapper.updateById(oldData);
+            } else {
+                //新增基础数据
+                InformationQuery newData = new InformationQuery();
+                //设置文件题名
+                newData.setName(fileName);
+                //设置文件类型
+                newData.setCategory(contractTree.getNodeType());
+                //项目ID
+                newData.setProjectId(Long.parseLong(contractTree.getProjectId()));
+                //合同段ID
+                newData.setContractId(Long.parseLong(contractTree.getContractId()));
+                //施工资料还是质检资料
+                newData.setClassify(classify);
+                //节点ID
+                newData.setWbsId(contractTree.getPKeyId());
+
+                //1资料填报,2试验,3首件
+                newData.setType((contractTree.getIsExpernode() == null || contractTree.getIsExpernode() <= 0) ? 1 : 2);
+
+                //流程状态,默认未上报
+                newData.setStatus(0);
+                //填报人ID及姓名
+                newData.setFileUserIdAndName(userId + "-" + userNmae);
+                //数据源类型
+                newData.setSourceType(sourceType);
+                newData.setCreateUser(userId);
+                newData.setCreateTime(new Date());
+
+                List<String> linkIds = linkDataList.stream().map(json -> json.getString("id")).distinct().collect(Collectors.toList());
+                if (linkIds.size() > 0) {
+                    newData.setSjRecordIds(StringUtils.join(linkIds, ","));
+                }
+                //保存数据
+                this.baseMapper.insert(newData);
+            }
+        }
+        return null;
+    }
+
+    @Override
+    public String saveOrUpdateInformationQueryDataReSign(String primaryKeyId, String tableId, String businessId, String fileName, Integer classify, Integer sourceType, String isFirst, String sourceUrl, String pdfUrl, String firstFileName, List<JSONObject> linkDataList) {
+        Long userId = 0L;
+        String userNmae = "";
+
+        if (primaryKeyId.indexOf(":") >= 0) {
+            String prdata[] = primaryKeyId.split(":");
+            primaryKeyId = prdata[0];
+            userId = Long.parseLong(prdata[1]);
+            R<User> userR = userClient.userInfoById(userId);
+            userNmae = userR.getData().getName();
+        } else {
+            BladeUser user = AuthUtil.getUser();
+            if (user != null) {
+                userId = user.getUserId();
+                userNmae = user.getNickName();
+            } else {
+                /*非客户端调用,request里不一定有用户信息,暂停后续操作*/
+                return null;
+            }
+        }
+
+        if (StringUtils.isNotEmpty(isFirst) && "true".equals(isFirst)) {
+            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));
+
+            //判断当前填报节点下是否已经存在相应数据
+            InformationQuery oldData = this.baseMapper.getInformationQueryByWbsId(contractTree.getPKeyId(), classify);
+
+            if (oldData != null) {
+                //存在记录,修改
+                if (StringUtils.isNotEmpty(fileName)) {
+                    oldData.setName(fileName);
+                }
+                //判断是否为超级管理员并且所属部门是在泓创智诚的公司下的部门 ture为跳过 false赋值
+                if(!judgeRoleIdAndDeptId(userId)){
+                    //拼接填报人信息
+                    String fileUser = userId + "-" + userNmae;
+                    if (StringUtils.isNotEmpty(oldData.getFileUserIdAndName())) {
+                        if (!oldData.getFileUserIdAndName().contains(userId.toString())) {
+                            //不包含,拼接
+                            oldData.setFileUserIdAndName(oldData.getFileUserIdAndName() + "," + fileUser);
+                        }
+                    } else {
+                        oldData.setFileUserIdAndName(fileUser);
+                    }
+                }
                 oldData.setUpdateTime(new Date());
                 oldData.setUpdateUser(userId);
 
@@ -455,6 +556,27 @@ public class InformationQueryServiceImpl extends BaseServiceImpl<InformationQuer
         }
         return null;
     }
+    public boolean judgeRoleIdAndDeptId(Long userId ){
+        String sqlForUser = "select role_id ,dept_id from blade_user where id = "+userId;
+        User user = jdbcTemplate.queryForObject(sqlForUser, new BeanPropertyRowMapper<>(User.class));
+        String sqlforSkipDept = "select id from blade_dept where parent_id = "+HONGCHENG_DEPT_ID + " or id = "+HONGCHENG_DEPT_ID;
+        List<Dept> depts = jdbcTemplate.query(sqlforSkipDept, new BeanPropertyRowMapper<>(Dept.class));
+        String roleId = user.getRoleId();
+        String deptId = user.getDeptId();
+        //既是超级管理员同时是泓创下面的部门才允许跳过填报人赋值
+        if(roleId.contains(SUPER_ADMIN_ROLE_ID)){
+            Boolean flag = false;
+            for (Dept dept : depts) {
+                if(deptId.contains(dept.getId().toString())){
+                    flag = true;
+                    return flag;
+                }
+            }
+            return flag;
+        }else {
+            return false;
+        }
+    }
 
     @Override
     public List<Integer> getReportNumberByContractId(Integer classify, String contractId) {

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

@@ -1473,7 +1473,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
                     if (type == 1) {
                         //重新保存
                         long startTime_1 = System.currentTimeMillis();
-                        result = this.saveNodePdf(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
+                        result = this.saveNodePdfResign(typeMap.get(task.getFormDataId()), queryMap.get(task.getFormDataId()), contractId, projectId, header);
                         long endTime_1 = System.currentTimeMillis();
                         long executionTime_1 = endTime_1 - startTime_1;
                         log.info("saveNodePdf执行时间:" + executionTime_1 + " 毫秒");
@@ -1530,6 +1530,9 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
     R saveNodePdf(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
         return excelTabClient.synPDFInfo(contractId, nodePKeyIds, classify, projectId, header);
     }
+    R saveNodePdfResign(String classify, String nodePKeyIds, String contractId, String projectId, String header) throws Exception {
+        return excelTabClient.synPDFInfoResign(contractId, nodePKeyIds, classify, projectId, header);
+    }
 
     @Override
     public Task getTaskByFormDataId(String formDataId) {

+ 8 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java

@@ -175,6 +175,14 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 if (entrustInfo != null){
                     record.setEntrustName(entrustInfo.getEntrustName());
                     record.setEntrustNo(entrustInfo.getEntrustNo());
+                    //材料id不为空
+                     if(Func.isNotEmpty(entrustInfo.getSampleId())){
+                         TrialSampleInfo sampleInfo = trialSampleInfoMapper.selectById(entrustInfo.getSampleId());
+                         if (Func.isNotEmpty(sampleInfo)){
+                             record.setSpecificationNumber(sampleInfo.getSpecificationNumber());
+                             record.setSpecificationModel(sampleInfo.getSpecificationModel());
+                         }
+                     }
                 }
                 //合并的pdfUrl
                 String pdf = this.getMergePdfToTrialNew(record.getContractId(), record.getId());

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

@@ -1980,6 +1980,82 @@ public class ExcelTabController extends BladeController {
         executionTime.brief();
         return R.data("操作成功");
     }
+    //重签调这个方法
+    public R saveBussDataResign(JSONObject dataInfo) throws Exception {
+        ExecutionTime executionTime = new ExecutionTime();
+        JSONArray dataArray = new JSONArray();
+        if (dataInfo.containsKey("dataInfo")) { //节点保存
+            JSONObject jsonObject = dataInfo.getJSONObject("dataInfo");
+            dataArray = jsonObject.getJSONArray("orderList");
+        } else { //单个保存
+            dataArray.add(dataInfo);
+        }
+
+        JSONObject tableInfo1 = dataArray.getJSONObject(0);
+        String nodeId = tableInfo1.getString("nodeId");
+        String contractId = tableInfo1.getString("contractId");
+        String projectId = tableInfo1.getString("projectId");
+        String classify = tableInfo1.getString("classify");
+
+        /*全加载,或者可以优化成依赖加载*/
+        List<AppWbsTreeContractVO> tableAll = new ArrayList<>();
+        List<TableInfo> tableInfoList = this.excelTabService.getTableInfoList(dataArray);
+
+        executionTime.info("公式前");
+        //公式填充
+        this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId), ExecuteType.INSPECTION);
+        assert tableInfoList != null;
+        if(tableInfoList.size()==0){
+            R.success("数据未发生变化");
+        }
+        executionTime.info("公式耗时");
+        //保存数据到数据库
+        R<Object> result = this.excelTabService.saveOrUpdateInfoResign(tableInfoList);
+        if (!result.isSuccess()) {
+            return R.fail(result.getMsg());
+        }
+        executionTime.info("表单保存耗时");
+
+        List<String> errorPKeyIds = new ArrayList<>();
+        //单个pdf加载
+        if (tableInfoList != null) {
+            tableInfoList.parallelStream().forEach(tableInfo -> {
+                R bussPdfInfo = null;
+                try {
+                    bussPdfInfo = excelTabService.getBussPdfInfo(Long.parseLong(tableInfo.getPkeyId()));
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+                if (ObjectUtil.isEmpty(bussPdfInfo) || bussPdfInfo.getCode() != 200) {
+                    //如果返回的单张pdfUrl为空,那么表示发生异常,返回异常信息
+                    errorPKeyIds.add(tableInfo.getPkeyId());
+                }
+            });
+        }
+        executionTime.info("PDF刷新耗时");
+        //发生异常后直接返回,不进行合并
+        if (errorPKeyIds.size() > 0) {
+            List<AppWbsTreeContractVO> errorTabs = new LinkedList<>();
+            for (AppWbsTreeContractVO appWbsTreeContractVO : tableAll) {
+                if (errorPKeyIds.contains(appWbsTreeContractVO.getPKeyId().toString())) {
+                    errorTabs.add(appWbsTreeContractVO);
+                }
+            }
+            if (errorTabs.size() > 0) {
+                List<String> names = errorTabs.stream().map(WbsTreeContract::getNodeName).collect(Collectors.toList());
+                return R.fail("以下的表在生成pdf文件时发生了异常【" + StringUtils.join(names, "、") + "】");
+            }
+        }
+
+        //合并pdf加载
+        excelTabService.getBussPdfs(nodeId, classify, contractId, projectId);
+        executionTime.info("PDF合并耗时");
+        //更新缓存
+        informationQueryClient.delAsyncWbsTree(contractId);
+        executionTime.info("缓存删除耗时");
+        executionTime.brief();
+        return R.data("操作成功");
+    }
 
     /*并发加载表单数据*/
     public void doForTableIst(List<AppWbsTreeContractVO> tableAll,List<TableInfo> tableInfoList){
@@ -4034,6 +4110,58 @@ public class ExcelTabController extends BladeController {
         }
         return R.data("成功");
     }
+    public R synPDFInfoResign(String contractId, String nodeIds, String classify, String projectId) {
+
+        if (contractId == null && StringUtils.isEmpty(contractId)) {
+            return R.data("contractId不能为空");
+        }
+
+        if (nodeIds == null && StringUtils.isEmpty(nodeIds)) {
+            return R.data("nodeId不能为空");
+        }
+
+        if (classify == null && StringUtils.isEmpty(classify)) {
+            return R.data("classify不能为空");
+        }
+
+        if (projectId == null && StringUtils.isEmpty(projectId)) {
+            return R.data("projectId不能为空");
+        }
+
+        String nodeId[] = Func.toStrArray(nodeIds);
+        try {
+            for (String noId : nodeId) {
+                JSONObject js = new JSONObject();
+                JSONObject js2 = new JSONObject();
+                List<AppWbsTreeContractVO> tableAll = wbsTreeContractService.searchNodeAllTable(noId, classify, contractId, projectId, null);
+                JSONArray array = new JSONArray();
+                if (tableAll != null && tableAll.size() >= 1) {
+                    /*只需加载第一张即可,生效会自动补全*/
+                    for(AppWbsTreeContractVO tab:tableAll) {
+                        //  AppWbsTreeContractVO tab = tableAll.get(0);
+                        Map<String, Object> jo = excelTabService.getBussDataInfo(tab.getPKeyId(), 0);
+                        String s = new Gson().toJson(jo);
+                        //字符串转jsonobject
+                        JSONObject obj = JSON.parseObject(s);
+                        obj.put("classify", classify);
+                        obj.put("nodeId", noId);
+                        obj.put("contractId", contractId);
+                        obj.put("pkeyId", tab.getPKeyId());
+                        obj.put("projectId", projectId);
+                        obj.put("isCollapseLoad", true);
+                        obj.put("isRenderForm", true);
+                        array.add(obj);
+                    }
+                }
+                js2.put("orderList", array);
+                js.put("dataInfo", js2);
+                this.saveBussDataResign(js);
+            }
+        } catch (Exception e) {
+            return null;
+        }
+        return R.data("成功");
+    }
 
     @PostMapping("/test-downLoad-excel")
     @ApiOperationSupport(order = 73)

+ 4 - 16
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -1,50 +1,34 @@
 package org.springblade.manager.feign;
 
-import com.alibaba.druid.util.DaemonThreadFactory;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
-import org.jsoup.Jsoup;
-import org.jsoup.nodes.Document;
-import org.jsoup.select.Elements;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.entity.InformationQuery;
 import org.springblade.business.feign.InformationQueryClient;
-import org.springblade.common.constant.CommonConstant;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.core.tool.utils.IoUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.ResourceUtil;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.controller.ExcelTabController;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.TrialSelfDataRecord;
-import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.enums.ExecuteType;
 import org.springblade.manager.service.IExcelTabService;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.utils.FileUtils;
-import org.springblade.manager.vo.WbsTreePrivateVO4;
 import org.springblade.resource.feign.NewIOSSClient;
-import org.springblade.system.cache.ParamCache;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
 import java.util.List;
-import java.util.Map;
 import java.util.stream.Collectors;
 
 @RestController
@@ -149,6 +133,10 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     public R synPDFInfo(String contractId, String nodeIds, String classify, String projectId, String authorization) throws Exception {
         return excelTabController.synPDFInfo(contractId, nodeIds, classify, projectId);
     }
+    @Override
+    public R synPDFInfoResign(String contractId, String nodeIds, String classify, String projectId, String authorization) throws Exception {
+        return excelTabController.synPDFInfoResign(contractId, nodeIds, classify, projectId);
+    }
 
     @Override
     public List<ExcelTab> getArchiveTabList() {

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

@@ -107,6 +107,11 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
      */
     R<Object> saveOrUpdateInfo(List<TableInfo> tableInfoList) throws SQLException;
 
+    /**
+     * 结果信息持久化重签版
+     */
+    R<Object> saveOrUpdateInfoResign(List<TableInfo> tableInfoList) throws SQLException;
+
     Map<String, String> getTablbCols(String pkeyid, String colkey) throws FileNotFoundException;
 
     // 获取用户端 单个表单接口数据

+ 107 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

@@ -78,6 +78,7 @@ import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.DefaultTransactionDefinition;
 
 import java.io.*;
+import java.sql.SQLException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -1243,6 +1244,112 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         return R.success("操作成功");
     }
 
+    @Override
+    public R<Object> saveOrUpdateInfoResign(List<TableInfo> tableInfoList) throws SQLException {
+        if (ListUtils.isNotEmpty(tableInfoList)) {
+            //施工资料填报
+            String pkids = "";
+            StringBuilder log = new StringBuilder("异常:");
+            StringBuilder saveData = new StringBuilder(tableInfoList.toString());
+            try {
+                for (TableInfo tableInfo : tableInfoList) {
+                    WbsTreeContract wbsTreeContract = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                            .eq(WbsTreeContract::getPKeyId, tableInfo.getPkeyId()));
+                    if (wbsTreeContract == null) {
+                        continue;
+                    }
+                    pkids += tableInfo.getPkeyId() + ",";
+                    String tabName = wbsTreeContract.getInitTableName();
+                    // 判读修改还是 添加
+                    String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
+
+
+                    String sqlInfo = "";
+                    LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
+                    /*检查发现有p_key_id缺失的情况,导致表单数据丢失,所以强制覆盖*/
+                    dataMap2.put("p_key_id", tableInfo.getPkeyId());
+                    //统计保存的字段
+
+                    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 + ")";
+
+                    WbsTreeContract wbsTreeContractByP = wbsTreeContractService.getBaseMapper().selectOne(Wrappers.<WbsTreeContract>query().lambda()
+                            .eq(WbsTreeContract::getId, wbsTreeContract.getParentId()).eq(WbsTreeContract::getContractId, tableInfo.getContractId()));
+
+                    if (wbsTreeContractByP != null) {
+                        //处理文件提名
+                        String fileName = this.wbsParamService.createFileTitle(wbsTreeContractByP);
+
+                        //huangjn 保存成功后调用生成资料查询列表数据
+                        this.informationQueryClient.saveOrUpdateInformationQueryDataReSign(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);
+                    BladeUser user = AuthUtil.getUser();
+                    TransactionStatus transactionStatus = this.beginTransaction(transactionManager1);
+                    try {
+                        //添加被张表的操作日志
+                        StringBuffer sb = new StringBuffer();
+                        String sqlInfoNew = sqlInfo.replace("\"", "'");
+                        sb.append("insert into blade_tab_sql(p_key_id,user_id,create_time,sql_info) VALUES(");
+                        sb.append(tableInfo.getPkeyId());sb.append(",");sb.append(user.getUserId());
+                        sb.append(","); sb.append("SYSDATE()");sb.append(",\"");sb.append(sqlInfoNew);
+                        sb.append("\")");
+                        jdbcTemplate.execute(delSql);
+                        jdbcTemplate.execute(sqlInfo);
+                        jdbcTemplate.execute(sb.toString());
+                        transactionManager1.commit(transactionStatus);
+                    } catch (Exception e) {
+                        transactionManager1.rollback(transactionStatus);
+                        log.append(e.getMessage()).append("@@");
+                        e.printStackTrace();
+                        return R.fail(reason(e.getMessage()));
+                    }
+                }
+                //获取节点
+                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(wbsTreeContractByP);
+
+                //huangjn 保存成功后调用生成资料查询列表数据
+                this.informationQueryClient.saveOrUpdateInformationQueryDataReSign(wbsTreeContractByP.getPKeyId() + "", "首件使用字段", "业务ID(主要将来给首件使用)", fileName, Integer.parseInt(tableInfoList.get(0).getClassify()), 2, "false", "源文件(首件字段)", "pdf文件(首件字段)", "首件上传总结报告名称", new ArrayList<>());
+
+                JSONObject json = new JSONObject();
+                json.put("operationObjIds", Func.toStrList(pkids));
+                json.put("operationObjName", wbsTreeContractByP.getNodeName() + "节点数据操作");
+                json.put("saveData", saveData.toString());
+                json.put("projectId", wbsTreeContract.getProjectId());
+                json.put("contractId", wbsTreeContract.getContractId());
+
+                //保存操作记录
+                this.operationLogClient.saveUserOperationLog(1, "资料填报", "工序填报页面", json);
+                // 更新redis
+                informationQueryClient.AsyncWbsTree(wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getParentId() + "", wbsTreeContractByP.getContractId(), "", "1");
+            } catch (Exception e) {
+                e.printStackTrace();
+                return R.fail("操作失败");
+            }
+            if (log.length() > 5) {
+                return R.fail(reason(log.toString()));
+            }
+        }
+        return R.success("操作成功");
+    }
+
     public String reason(String log) {
         /*保存的时候错误提示例如:字段过短提示 yangyj*/
         StringBuilder sb = new StringBuilder();