Эх сурвалжийг харах

试验相关bug,甬台温提示信息

chenr 7 сар өмнө
parent
commit
8bb8aa8bd4
14 өөрчлөгдсөн 176 нэмэгдсэн , 23 устгасан
  1. 2 1
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormData.java
  2. 9 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialSelfDataRecordVO1.java
  3. 9 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java
  4. 7 1
      blade-service/blade-business/src/main/java/org/springblade/business/controller/EntrustInfoController.java
  5. 16 3
      blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java
  6. 3 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogMapper.xml
  7. 2 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/IEntrustInfoService.java
  8. 19 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java
  9. 61 5
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/EntrustInfoServiceImpl.java
  10. 14 0
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java
  11. 6 6
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSelfInspectionRecordServiceImpl.java
  12. 2 1
      blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java
  13. 24 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  14. 2 2
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java

+ 2 - 1
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/dto/FormData.java

@@ -217,7 +217,8 @@ public class FormData {
 
     private String getKt(Integer index, String msg) {
         if (this.code != null && this.code.matches(CODE_REG)) {
-            return this.code.split(StringPool.COLON)[index];
+            String s = this.code.split(StringPool.COLON)[index];
+            return s;
         } else {
             return msg;
         }

+ 9 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/vo/TrialSelfDataRecordVO1.java

@@ -0,0 +1,9 @@
+package org.springblade.manager.vo;
+
+import lombok.Data;
+
+@Data
+public class TrialSelfDataRecordVO1 {
+    private String pdfUrl;
+    private Integer tableType;
+}

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

@@ -12,6 +12,7 @@ import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.apache.commons.lang.StringUtils;
+import org.apache.http.client.methods.HttpGet;
 import org.springblade.business.entity.ContractLog;
 import org.springblade.business.entity.FixedFlowLink;
 import org.springblade.business.entity.InformationQuery;
@@ -21,12 +22,14 @@ import org.springblade.business.service.IFixedFlowService;
 import org.springblade.business.service.IInformationQueryService;
 import org.springblade.business.utils.PDFUtil;
 import org.springblade.business.vo.FixedFlowVO;
+import org.springblade.common.constant.CommonConstant;
 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.ObjectUtil;
 import org.springblade.manager.entity.*;
 import org.springblade.manager.feign.*;
+import org.springblade.system.cache.ParamCache;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
@@ -868,7 +871,12 @@ public class EVisaTaskCheckController {
         ContractInfo contract = this.contractClient.getContractById(Func.toLong(contractId));
         if (contract != null) {
             boolean isOpen = new Integer("1").equals(contract.getIsElectronicSignature());
-            return R.data(isOpen, isOpen ? "当前合同段已经开启电签" : "当前合同段未开启电签,不允许上报,请联系维护人员处理");
+            String sys_isonline = ParamCache.getValue(CommonConstant.SYS_ISONLINE);
+            if("20".equals(sys_isonline)){
+                return R.data(isOpen, isOpen ? "当前合同段已经开启电签" : "电签服务已欠费,请联系信息化人员维护处理");
+            }else {
+                return R.data(isOpen, isOpen ? "当前合同段已经开启电签" : "当前合同段未开启电签,不允许上报,请联系维护人员处理");
+            }
         }
         return R.data(300, false, "未找到对应合同段");
     }

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

@@ -143,7 +143,7 @@ public class  EntrustInfoController extends BladeController {
 		return R.status(entrustInfoService.saveOrUpdate(entrustInfo));
 	}
 
-	
+
 	/**
 	 * 删除 委托单信息表
 	 */
@@ -154,6 +154,12 @@ public class  EntrustInfoController extends BladeController {
 		return  entrustInfoService.delEntrustInfo(ids);
 	}
 
+    @GetMapping("/annul")
+    @ApiOperationSupport(order = 7)
+    @ApiOperation(value = "废除委托单(撤回上报)")
+    public R annul(@RequestParam String id){
+        return entrustInfoService.annul(id);
+    }
 	@PostMapping("/get-report-detail")
 	@ApiOperationSupport(order = 8)
 	@ApiOperation(value = "获取报告详情", notes = "获取报告详情")

+ 16 - 3
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -591,6 +591,7 @@ public class InformationWriteQueryController extends BladeController {
     public R<Object> abolishOne(@RequestParam String primaryKeyId, @RequestParam String classify, @RequestParam String projectId, @RequestParam String contractId) {
         //查询填报状态
         InformationQuery businessData = this.informationQueryService.getOne(Wrappers.<InformationQuery>lambdaQuery().eq(InformationQuery::getWbsId, primaryKeyId).eq(InformationQuery::getClassify, classify).eq(InformationQuery::getType, 1));
+        primaryKeyId=primaryKeyId+"*";
         if (businessData != null) {
             //使用批量废除接口
             return this.batchAbolish(businessData.getId().toString(), primaryKeyId, projectId, contractId);
@@ -1249,12 +1250,24 @@ public class InformationWriteQueryController extends BladeController {
 
                 //批量废除直接调的该接口,primaryKeyId为null,ids=当前试验记录的ids
                 String sql="";
-                if(primaryKeyId!=null){
-                    sql="update u_trial_self_inspection_record set task_status = '未上报' where id="+primaryKeyId;
+                String sql1="";
+                if(primaryKeyId.indexOf("*")>0){
+                    primaryKeyId=primaryKeyId.substring(0, primaryKeyId.length() - 1);
+                     sql= "update u_trial_self_inspection_record set task_status = '未上报' where id="+primaryKeyId;
+                    sql1="SELECT e.* from u_entrust_info e left join u_trial_self_inspection_record t on t.entrust_id=e.id where t.id="+primaryKeyId;
                 }else {
-                    sql= "update u_trial_self_inspection_record set task_status = '已废除' where id in(" + ids + ")";
+                    sql= "update u_trial_self_inspection_record set task_status = '未上报' where id in(" + ids + ")";
+                    sql1="SELECT e.* from u_entrust_info e left join u_trial_self_inspection_record t on t.entrust_id=e.id where t.id in(" + ids + ")";
                 }
                 jdbcTemplate.execute(sql);
+                List<EntrustInfo> query = jdbcTemplate.query(sql1, new BeanPropertyRowMapper<>(EntrustInfo.class));
+                if(!query.isEmpty()){
+                    String[] idss = query.stream()
+                        .map(item -> String.valueOf(item.getId()))
+                        .toArray(String[]::new);
+                    String update="update u_entrust_info set status=3 where id in(" + String.join(",", idss)+ ")";
+                    jdbcTemplate.execute(update);
+                }
                 return R.data(200, aopParamsSet, "废除成功");
 
             } catch (Exception e) {

+ 3 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/ContractLogMapper.xml

@@ -93,7 +93,10 @@
         record_number,
         project_pileno,
         project_part,
+        contract_id,
+        wbs_node_id,
         data_id,
+        create_user,
         create_user_name,
         file_name,
         status,

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

@@ -75,4 +75,6 @@ public interface IEntrustInfoService extends BaseService<EntrustInfo> {
 	R delEntrustInfo(String ids);
 	//检查材料是否关联委托单
 	R checkSample(Long sampleId);
+
+    R annul(String id);
 }

+ 19 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/ContractLogServiceImpl.java

@@ -18,6 +18,7 @@ package org.springblade.business.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.alibaba.nacos.shaded.org.checkerframework.checker.units.qual.A;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.ContractLog;
@@ -32,6 +33,8 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.manager.feign.ExcelTabClient;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
@@ -50,6 +53,10 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
 
     private final JdbcTemplate jdbcTemplate;
 
+    @Autowired
+    private  ExcelTabClient excelTabClient;
+
+
     public ContractLogServiceImpl(JdbcTemplate jdbcTemplate) {
         this.jdbcTemplate = jdbcTemplate;
     }
@@ -98,10 +105,22 @@ public class ContractLogServiceImpl extends BaseServiceImpl<ContractLogMapper, C
         Integer count = this.baseMapper.selectPageCount(logVO);
         //分页信息
         List<ContractLog> result = this.baseMapper.constructionLogPage(current, logVO.getSize(), logVO, AuthUtil.getUserId());
+
         //没有数据
         if (result == null || result.size() == 0) {
             return Condition.getPage(query);
         }
+        //甬台温临时处理,在上面先查出所有的日志,将没有pdf的 让他重新生成
+//        try {
+//            for (ContractLog contractLog : result) {
+//                if(contractLog.getPdfUrl()==null){
+                        //pkeyID是日志表的private的pkeyid
+//                    excelTabClient.getTheContractLogBusinessData("1768465695416254470",contractLog.getWbsNodeId().toString(),contractLog.getRecordTime(),contractLog.getContractId().toString(),contractLog.getCreateUser());
+//                }
+//            }
+//        }catch (Exception e){
+//            e.printStackTrace();
+//        }
         //有数据,转换成VO
         List<ContractLogVO> deduplicatedList = JSONArray.parseArray(JSONObject.toJSONString(result), ContractLogVO.class);
 //        List<ContractLogVO> deduplicatedList = new ArrayList<>(voResult.stream()

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

@@ -21,26 +21,32 @@ 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.controller.EntrustInfoController;
 import org.springblade.business.entity.EntrustInfo;
+import org.springblade.business.entity.InformationQuery;
+import org.springblade.business.entity.Task;
 import org.springblade.business.mapper.EntrustInfoMapper;
 import org.springblade.business.service.IEntrustInfoService;
+import org.springblade.business.service.IInformationQueryService;
 import org.springblade.business.vo.EntrustDataInfoVO;
 import org.springblade.business.vo.EntrustInfoVO;
 import org.springblade.business.vo.LoadDataInfoVO;
 import org.springblade.business.vo.TrialSampleDataInfoVO;
+import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.core.secure.utils.SecureUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.feign.ExcelTabClient;
 import org.springblade.manager.feign.WbsTreePrivateClient;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.stereotype.Service;
 
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 委托单信息表 服务实现类
@@ -56,8 +62,9 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 	private final JdbcTemplate jdbcTemplate;
 	private final WbsTreePrivateClient wbsTreePrivateClient;
 	private final EntrustInfoMapper entrustInfoMapper;
+    private final IInformationQueryService informationQueryService;
 
-	@Override
+    @Override
 	public IPage<EntrustInfoVO> selectEntrustInfoPage(IPage<EntrustInfoVO> page, EntrustInfoVO entrustInfo) {
 		return page.setRecords(baseMapper.selectEntrustInfoPage(page, entrustInfo));
 	}
@@ -158,7 +165,10 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 			}
 		}
 		entrustInfo.setEntrustName(wbsTreePrivate.getNodeName());
-		this.saveOrUpdate(entrustInfo);
+        if(dataInfo.containsKey("id")){
+            entrustInfo.setId(Long.parseLong(dataInfo.get("id").toString()));
+        }
+        this.saveOrUpdate(entrustInfo);
 		dataInfo.put("groupId",entrustInfo.getId());
 		dataInfo.put("pkeyId", dataInfo.getString("nodeErTreeId"));
 		excelTabClient.saveEntrustTabData(dataInfo);
@@ -204,4 +214,50 @@ public class EntrustInfoServiceImpl extends BaseServiceImpl<EntrustInfoMapper, E
 		}
 		return R.success("操作成功");
 	}
+
+    @Override
+    public R annul(String id) {
+        if (ObjectUtil.isEmpty(SecureUtil.getUserId()) || SecureUtil.getUserId() == -1L) {
+            throw new ServiceException("未获取到当前用户信息");
+        }
+        String[] ids = id.split(",");
+        List<String>formDataIds=new ArrayList<>();
+        if(ids.length>0){
+            for (String i : ids) {
+                EntrustInfo entrustInfo = entrustInfoMapper.selectById(Long.parseLong(i));
+                if(entrustInfo.getStatus()!=2&&entrustInfo.getStatus()!=3){
+                    throw new ServiceException("该委托单不能废除"+entrustInfo.getEntrustNo());
+                }
+                entrustInfo.setEntrustEPdf(null);
+                entrustInfo.setStatus(1);
+                entrustInfoMapper.updateById(entrustInfo);
+            }
+            List<InformationQuery> queryList = this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getId, Arrays.asList(ids)));
+            if (queryList.size() == 0) {
+                //试验填报数据
+                queryList = new ArrayList<>(this.informationQueryService.list(Wrappers.<InformationQuery>lambdaQuery().in(InformationQuery::getWbsId, Arrays.asList(ids))));
+                //重新绑定trialSelfInspectionRecordId使用map
+                //试验记录 和 委托单 ids重新赋值映射为数据源ids
+                formDataIds = queryList.stream().map(InformationQuery::getId).map(String::valueOf).collect(Collectors.toList());
+            }
+            if(formDataIds.size()>0){
+                for (String formDataId : formDataIds) {
+                    String sql="Select * from u_task where form_data_id="+formDataId +" and status!=3 and is_deleted=0";
+                    Task task = jdbcTemplate.queryForObject(sql, new BeanPropertyRowMapper<>(Task.class));
+                    if(task!=null){
+                        String updateTaskParallel="update u_task_parallel set status=3 where process_instance_id='" + task.getProcessInstanceId() + "'";
+                        String updateTask="update u_task set status=3 where id="+task.getId()+" and status!=3 and is_deleted=0";
+                        String deleted="DELETE  u_task_batch WHERE JSON_EXTRACT(json_data,'$.taskId')="+task.getId();
+                        jdbcTemplate.update(updateTaskParallel);
+                        jdbcTemplate.update(updateTask);
+                        jdbcTemplate.execute(deleted);
+                    }
+                    String updateinformationQuery="update u_information_query set status=3,e_visa_pdf_url= null where id="+formDataId;
+                    jdbcTemplate.update(updateinformationQuery);
+                }
+            }
+
+        }
+        return R.success("操作成功");
+    }
 }

+ 14 - 0
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TaskServiceImpl.java

@@ -615,6 +615,20 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
             taskBatch.setNickName(nickName);
             taskBatch.setCreateTime(new Date());
             taskList.add(taskBatch);
+            //设置委托单的状态
+            try {
+                String sql="SELECT uei.* FROM u_entrust_info uei JOIN u_trial_self_inspection_record utsr ON uei.id = utsr.entrust_id JOIN u_information_query uiq ON utsr.id = uiq.wbs_id WHERE uiq.id = "+taskApprovalVO.getFormDataId()+" and uiq.status !=3 and uiq.is_deleted=0";
+                List<EntrustInfo> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(EntrustInfo.class));
+                if(!query.isEmpty()){
+                    EntrustInfo entrustInfo = query.get(0);
+                    if(entrustInfo.getStatus()==3){
+                        String update="update u_entrust_info set status = 4 where id="+entrustInfo.getId();
+                        jdbcTemplate.execute(update);
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
         this.taskBatchService.saveBatch(taskList);
     }

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

@@ -62,6 +62,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.jdbc.core.SingleColumnRowMapper;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -282,7 +283,8 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             String sqlEntrust = "select entrust_id from u_trial_self_inspection_record where is_deleted = 0 and id = "+nodeId ;
             TrialSelfInspectionRecord record = jdbcTemplate.queryForObject(sqlEntrust, new BeanPropertyRowMapper<>(TrialSelfInspectionRecord.class));
             if(ObjectUtil.isNotEmpty(record) && ObjectUtil.isNotEmpty(record.getEntrustId()) && record.getEntrustId() != 0){
-                String sqlEntrustPdf = "select entrust_pdf from u_entrust_info where is_deleted = 0 and id = "+record.getEntrustId();
+                //优先查询带电签的,没有电签在查entrust_pdf
+                String sqlEntrustPdf = "SELECT COALESCE(entrust_e_pdf, entrust_pdf) AS pdf_url from u_entrust_info where is_deleted = 0 and id = "+record.getEntrustId();
                 try {
                     entrustPdfUrl = jdbcTemplate.queryForObject(sqlEntrustPdf, String.class);
                 } catch (DataAccessException e) {
@@ -1087,9 +1089,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             //------初始编号信息------
             this.initBuildNumber(dto);
         }
-        //------新增或编辑------
         this.saveOrUpdate(dto);
-
         if (ObjectUtil.isNotEmpty(dto.getId())) {
             //------获取最新试验记录------
             TrialSelfInspectionRecord obj = baseMapper.selectById(dto.getId());
@@ -1315,7 +1315,7 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
                 updateSql = getUpdateSql(dto, pdfURL, listPdf, snowId, "record_pdf_url", 2, "report_pdf_url");
             } else {
                 //一起保存的数据  只改变pdf_url
-                this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).eq(TrialSelfInspectionRecord::getId, dto.getId()));
+                this.update(Wrappers.<TrialSelfInspectionRecord>lambdaUpdate().set(TrialSelfInspectionRecord::getPdfUrl, pdfURL).set(TrialSelfInspectionRecord::getTaskStatus,"未上报").eq(TrialSelfInspectionRecord::getId, dto.getId()));
             }
             if (ObjectUtil.isNotEmpty(updateSql)) {
                 jdbcTemplate.execute(updateSql);
@@ -1339,12 +1339,12 @@ public class TrialSelfInspectionRecordServiceImpl extends BaseServiceImpl<TrialS
             }
 
             BladeFile bladeFile = this.newIOSSClient.uploadFile(snowId + ".pdf", listPdf);
-            updateSql = "update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "',"+param2+ "= '"+ pdfURL + "' where id='" + dto.getId()+"'";
+            updateSql = "update u_trial_self_inspection_record set pdf_url = '" + bladeFile.getLink() + "',"+param2+ "= '"+ pdfURL + "' ,task_status='未上报' where id='" + dto.getId()+"'";
             //合并后更新queryInfo表的pdfurl
             String updateForQurtyInfo = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify='" + dto.getType() + "' and  wbs_id='" + dto.getId() + "' and contract_id ='" + dto.getContractId() + "' ";
             jdbcTemplate.execute(updateForQurtyInfo);
         }else {
-            updateSql = "update u_trial_self_inspection_record set "+param2+" = '"+ pdfURL + "' where id='" + dto.getId()+"'";
+            updateSql = "update u_trial_self_inspection_record set "+param2+" = '"+ pdfURL + "' ,task_status='未上报' where id='" + dto.getId()+"'";
         }
         return updateSql;
     }

+ 2 - 1
blade-service/blade-manager/src/main/java/com/mixsmart/utils/FormulaUtils.java

@@ -1700,7 +1700,8 @@ public static Map<String,List<Long>> relatedPages(List<FormData> curFormDatas ,L
 
     public  static  String recovery(List<ElementData> dataList) {
         if (Func.isNotEmpty(dataList)) {
-            return dataList.stream().filter(e -> !e.isEmpty()).map(e -> e.stringValue() + "_^_" + e.getY() + "_" + e.getX()).collect(Collectors.joining("☆"));
+            String collect = dataList.stream().filter(e -> !e.isEmpty()).map(e -> e.stringValue() + "_^_" + e.getY() + "_" + e.getX()).collect(Collectors.joining("☆"));
+            return collect;
         }
         return "";
     }

+ 24 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -34,6 +34,7 @@ import org.springblade.manager.service.IExcelTabService;
 import org.springblade.manager.service.IProjectInfoService;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.utils.FileUtils;
+import org.springblade.manager.vo.TrialSelfDataRecordVO1;
 import org.springblade.resource.feign.NewIOSSClient;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -102,12 +103,19 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         try {
             if (isBatchSave == 0) {
                 //------单表PDF保存------
+                Integer type1 = Integer.parseInt(table.getString("type"));
                 TableInfo tableInfo = tableInfoList.stream().findAny().orElse(null);
                 if (tableInfo != null && tabIds.contains(tableInfo.getPkeyId())) {
                     String bussPDFTrial = excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id, 0, 0, dto);
                     if (StringUtils.isNotEmpty(bussPDFTrial)) {
-                        List<TrialSelfDataRecord> query = jdbcTemplate.query("select pdf_url from u_trial_self_data_record where record_id = " + id, new BeanPropertyRowMapper<>(TrialSelfDataRecord.class));
-                        List<String> pdfList = query.stream().map(TrialSelfDataRecord::getPdfUrl).collect(Collectors.toList());
+                        List<TrialSelfDataRecordVO1> query = jdbcTemplate.query("select t.pdf_url ,w.table_type from u_trial_self_data_record as t left join m_wbs_tree_private as w on t.tab_id=w.p_key_id where record_id = " + id+" ORDER BY w.table_type DESC, w.sort ASC", new BeanPropertyRowMapper<>(TrialSelfDataRecordVO1.class));
+                        List<String> pdfList = query.stream().map(TrialSelfDataRecordVO1::getPdfUrl).collect(Collectors.toList());
+                        List<String> pdfList1=new ArrayList<>();
+                        if(type1==1){
+                            pdfList1=query.stream().filter(f -> f.getTableType() == 9 || f.getTableType() == 1).map(TrialSelfDataRecordVO1::getPdfUrl).collect(Collectors.toList());
+                        }else {
+                            pdfList1=query.stream().filter(f -> f.getTableType() == 10 || f.getTableType() == 2).map(TrialSelfDataRecordVO1::getPdfUrl).collect(Collectors.toList());
+                        }
                         if (ObjectUtil.isNotEmpty(pdfList) && pdfList.size() > 0) {
                             String file_path = FileUtils.getSysLocalFileUrl();
                             String pdfPath = file_path + "/pdf//" + id + "_2.pdf";
@@ -124,7 +132,20 @@ public class ExcelTabClientImpl implements ExcelTabClient {
                                 } else {
                                     informationQueryClient.saveData(id.toString(), projectId, contractId, type.toString(), bladeFile.getLink(), (StringUtils.isNotEmpty(dto.getTrialProjectName()) ? dto.getTrialProjectName() : ""));
                                 }
-                                pdfUrl = bladeFile.getLink();
+                            }
+                        }
+
+                        if(ObjectUtil.isNotEmpty(pdfList1) && pdfList1.size() > 0){
+                            String file_path = FileUtils.getSysLocalFileUrl();
+                            String pdfPath = file_path + "/pdf//" + id + "_3.pdf";
+                            File tabPdf = ResourceUtil.getFile(pdfPath);
+                            if (tabPdf.exists()) {
+                                tabPdf.delete();
+                            }
+                            FileUtils.mergePdfPublicMethods(pdfList1, pdfPath);
+                            BladeFile bladeFile1 = newIOSSClient.uploadFile(id + "3.pdf", pdfPath);
+                            if(bladeFile1 != null){
+                                pdfUrl=bladeFile1.getLink();
                             }
                         }
                     }

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

@@ -2822,7 +2822,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         if(ObjectUtil.isNotEmpty(jsonObject)){
             for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
                 if(entry.getKey().contains("key")){
-                    if(!reData.containsKey(entry.getKey())){
+                    if(!reData.containsKey(entry.getKey())||reData.get(entry.getKey())==null||reData.get(entry.getKey()).equals("")){
                         reData.put(entry.getKey(),entry.getValue());
                     }
                 }
@@ -2992,7 +2992,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 }
             }
         }
-
         // 移除Id 和 p_key_id
         reData.remove("id");
         reData.remove("p_key_id");
@@ -3002,6 +3001,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         reData.remove("projectId");
         list.add(reData);
 
+
         return list;
     }