liuyc 2 жил өмнө
parent
commit
5d2c37f1e7

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

@@ -48,7 +48,7 @@ public interface InformationQueryClient {
                                             @RequestBody List<JSONObject> linkDataList);
 
     @PostMapping(API_PREFIX + "/saveData")
-    void saveData(@RequestParam String nodeId, @RequestParam String projectId, @RequestParam String contractId, @RequestParam String classify, @RequestParam String link);
+    void saveData(@RequestParam String nodeId, @RequestParam String projectId, @RequestParam String contractId, @RequestParam String classify, @RequestParam String link, @RequestParam String trialProjectName);
 
     @PostMapping(API_PREFIX + "/updateInformationQuery")
     void updateInformationQuery(@RequestParam String link, @RequestParam String classify, @RequestParam String nodeId, @RequestParam String contractId);

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

@@ -22,7 +22,7 @@ public interface ExcelTabClient {
     ExcelTab getById(@RequestParam String id);
 
     @PostMapping(API_PREFIX + "/saveTabData")
-    String saveTabData(@RequestBody JSONObject dataInfo, @RequestParam Integer type, @RequestParam Integer tableType, @RequestParam Long id) throws Exception;
+    String saveTabData(@RequestBody JSONObject dataInfo, @RequestParam Integer type, @RequestParam Integer tableType, @RequestParam Long id, @RequestParam String tabIds) throws Exception;
 
     @PostMapping(API_PREFIX + "/getBussPDFTrial")
     void getBussPDFTrial(@RequestParam Long pkeyId) throws Exception;

+ 55 - 48
blade-service/blade-business/src/main/java/org/springblade/business/controller/EVisaTaskCheckController.java

@@ -1,5 +1,6 @@
 package org.springblade.business.controller;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -20,13 +21,12 @@ import org.springblade.business.vo.FixedFlowVO;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
-import org.springblade.manager.entity.ContractInfo;
-import org.springblade.manager.entity.SignPfxFile;
-import org.springblade.manager.entity.WbsTreeContract;
-import org.springblade.manager.entity.WbsTreePrivate;
+import org.springblade.manager.entity.*;
 import org.springblade.manager.feign.*;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.*;
@@ -58,6 +58,8 @@ public class EVisaTaskCheckController {
 
     private final IFixedFlowService fixedFlowService;
 
+    private final JdbcTemplate jdbcTemplate;
+
     /**
      * 检查所选的流程环节处理人是否具有审批权限(三大填报页、日志列表的批量上报、首件列表的批量上报)
      */
@@ -71,19 +73,19 @@ public class EVisaTaskCheckController {
             @ApiImplicitParam(name = "theLogPrimaryKeyId", value = "日志左侧所选的填报类型ID"),
             @ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
     })
-    public R<Boolean> checkCustomFlowUserIsEVisaPermissions(@RequestBody JSONObject json){
-        if(json.containsKey("customFlowUserList") && !json.getJSONArray("customFlowUserList").isEmpty()){
+    public R<Boolean> checkCustomFlowUserIsEVisaPermissions(@RequestBody JSONObject json) {
+        if (json.containsKey("customFlowUserList") && !json.getJSONArray("customFlowUserList").isEmpty()) {
             //获取审批人
             List<Long> customFlowUserList = json.getJSONArray("customFlowUserList").toJavaList(Long.class);
             //获取这些审批人在当前合同段的权限
             List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(customFlowUserList, json.getString("contractId"));
-            if(userRoleList == null || userRoleList.size() <= 0){
+            if (userRoleList == null || userRoleList.size() <= 0) {
                 return R.data(300, false, "所选审批人均未找到当前表格所需要的签字岗位,请联系服务人员处理");
             }
 
             //获取电签配置
             List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
-            if(jsonList == null){
+            if (jsonList == null) {
                 return R.data(300, false, "未找到符合电签配置的相关流程,请联系服务人员处理");
             }
 
@@ -91,8 +93,8 @@ public class EVisaTaskCheckController {
             List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
             //检查
             //循环审批人的角色集合,并判断电签配置中是否含有这个角色
-            for(JSONObject userRole : userRoleList){
-                if(!eVisaRoleList.contains(userRole.getString("roleId"))){
+            for (JSONObject userRole : userRoleList) {
+                if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
                     User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
                     return R.data(300, false, "所选中的用户【" + user.getRealName() + "】不具备当前表格所需要的签字岗位,请联系维护人员处理或更换审批人员");
                 }
@@ -116,7 +118,7 @@ public class EVisaTaskCheckController {
             @ApiImplicitParam(name = "theLogPrimaryKeyId", value = "日志左侧所选的填报类型ID"),
             @ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
     })
-    public R<IPage<FixedFlowVO>> queryFixedFlow(@RequestBody JSONObject json){
+    public R<IPage<FixedFlowVO>> queryFixedFlow(@RequestBody JSONObject json) {
         //获取所有流程
         FixedFlowVO vo = new FixedFlowVO();
         vo.setCurrent(1);
@@ -130,7 +132,7 @@ public class EVisaTaskCheckController {
         //获取对应表格的所有电签配置
         List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
 
-        if(jsonList == null){
+        if (jsonList == null) {
             return R.fail(300, "未找到符合电签配置的相关流程,请联系服务人员处理");
         }
 
@@ -138,7 +140,7 @@ public class EVisaTaskCheckController {
         List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
 
         //校验这些预设流程哪些是符合条件的
-        for(FixedFlowVO next : flowList){
+        for (FixedFlowVO next : flowList) {
             //先将流程设置为可选
             next.setDisabled(false);
 
@@ -147,14 +149,14 @@ public class EVisaTaskCheckController {
 
             //获取这些人当前合同段下的权限
             List<JSONObject> userRoleList = this.saveUserInfoByProjectClient.queryUserContractRole(flowLink.stream().map(FixedFlowLink::getFixedFlowLinkUser).distinct().collect(Collectors.toList()), json.getString("contractId"));
-            if(userRoleList == null){
+            if (userRoleList == null) {
                 next.setDisabled(true);
             } else {
                 //校验流程
-                if(eVisaRoleList.size() >= userRoleList.size()){
+                if (eVisaRoleList.size() >= userRoleList.size()) {
                     //循环审批人的角色集合,并判断电签配置中是否含有这个角色
-                    for(JSONObject userRole : userRoleList){
-                        if(!eVisaRoleList.contains(userRole.getString("roleId"))){
+                    for (JSONObject userRole : userRoleList) {
+                        if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
                             //但凡有个不符合条件,禁选
                             next.setDisabled(true);
                             break;
@@ -163,8 +165,8 @@ public class EVisaTaskCheckController {
                 } else {
                     //小于,反向判断
                     List<String> userRoleIds = userRoleList.stream().map(jsonObject -> jsonObject.getString("roleId")).distinct().collect(Collectors.toList());
-                    for(String eVisaRole : eVisaRoleList){
-                        if(!userRoleIds.contains(eVisaRole)){
+                    for (String eVisaRole : eVisaRoleList) {
+                        if (!userRoleIds.contains(eVisaRole)) {
                             //但凡有个不符合条件,禁选
                             next.setDisabled(true);
                             break;
@@ -186,18 +188,18 @@ public class EVisaTaskCheckController {
     @GetMapping("/checkFlowUserIsExistPfxFile")
     @ApiOperationSupport(order = 4)
     @ApiOperation(value = "检查当前审批人是否存在证书")
-    public R<Boolean> checkTaskUserIsExistPfxFile(){
+    public R<Boolean> checkTaskUserIsExistPfxFile() {
         //获取当前审批人的证书
         List<SignPfxFile> signPfxFiles = this.signPfxClient.querySignPfxByUserIdOrContractId(AuthUtil.getUserId().toString(), "");
-        if(signPfxFiles != null && signPfxFiles.size() > 0){
+        if (signPfxFiles != null && signPfxFiles.size() > 0) {
             SignPfxFile signPfxFile = signPfxFiles.get(0);
-            if(StringUtils.isEmpty(signPfxFile.getCertificateFileUrl())){
+            if (StringUtils.isEmpty(signPfxFile.getCertificateFileUrl())) {
                 return R.data(300, false, "当前用户未配置签字证书,请联系维护人员处理");
             }
-            if(!new Integer("1").equals(signPfxFile.getIsRegister())){
+            if (!new Integer("1").equals(signPfxFile.getIsRegister())) {
                 return R.data(300, false, "当前用户的证书未注册,请联系维护人员处理");
             }
-            if(StringUtils.isEmpty(signPfxFile.getSignatureFileUrl())){
+            if (StringUtils.isEmpty(signPfxFile.getSignatureFileUrl())) {
                 return R.data(300, false, "当前用户未配置签字体,请联系维护人员处理");
             }
             return R.data(true);
@@ -216,8 +218,8 @@ public class EVisaTaskCheckController {
             @ApiImplicitParam(name = "contractId", value = "合同段ID", required = true),
             @ApiImplicitParam(name = "queryIds", value = "资料查询列表中的记录ID,以数组的形式")
     })
-    public R<Boolean> batchCheckFlowUserIsEVisaPermissions(@RequestBody JSONObject json){
-        if(json.containsKey("flowId")) {
+    public R<Boolean> batchCheckFlowUserIsEVisaPermissions(@RequestBody JSONObject json) {
+        if (json.containsKey("flowId")) {
             //首先找到对应流程下的审批人组
             List<FixedFlowLink> flowLink = this.fixedFlowLinkService.selectFixedFlowLink(json.getString("flowId"));
 
@@ -234,11 +236,11 @@ public class EVisaTaskCheckController {
             //做一一对应处理
             Map<String, InformationQuery> queryMap = new HashMap<>();
             Map<String, WbsTreeContract> queryToNodeMap = new HashMap<>();
-            for(InformationQuery query : queryList){
+            for (InformationQuery query : queryList) {
                 Iterator<WbsTreeContract> iterator = contractTreeList.iterator();
-                while (iterator.hasNext()){
+                while (iterator.hasNext()) {
                     WbsTreeContract next = iterator.next();
-                    if(next.getPKeyId().equals(query.getWbsId())){
+                    if (next.getPKeyId().equals(query.getWbsId())) {
                         queryToNodeMap.put(query.getId().toString(), next);
                         iterator.remove();
                         break;
@@ -248,12 +250,12 @@ public class EVisaTaskCheckController {
             }
             //循环判断
             Set<String> keys = queryMap.keySet();
-            for(String key : keys){
+            for (String key : keys) {
                 //获取记录
                 InformationQuery query = queryMap.get(key);
                 //获取节点
                 WbsTreeContract contractNode = queryToNodeMap.get(key);
-                if(contractNode == null){
+                if (contractNode == null) {
                     //避免未找到对应的节点
                     contractNode = this.wbsTreeContractClient.getContractWbsTreeByPrimaryKeyId(query.getWbsId());
                 }
@@ -265,7 +267,7 @@ public class EVisaTaskCheckController {
 
                 //获取这些表格的电签配置信息
                 List<JSONObject> jsonList = this.queryTableEVisaConfig(JSONArray.parseArray(JSONObject.toJSONString(privateTablePrimaryKeyIds), String.class));
-                if(jsonList == null){
+                if (jsonList == null) {
                     return R.data(300, false, "所选资料【" + query.getName() + "】未找到电签配置,请联系维护人员处理或暂时取消这份资料的上报");
                 }
 
@@ -273,8 +275,8 @@ public class EVisaTaskCheckController {
                 List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
 
                 //循环审批人的角色集合,并判断电签配置中是否含有这个角色
-                for(JSONObject userRole : userRoleList){
-                    if(!eVisaRoleList.contains(userRole.getString("roleId"))){
+                for (JSONObject userRole : userRoleList) {
+                    if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
                         User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
                         return R.data(300, false, "所选流程中的用户【" + user.getRealName() + "】对于所选资料【" + query.getName() + "】不具有相关审批权限,请联系维护人员处理或更换审批流程");
                     }
@@ -300,8 +302,8 @@ public class EVisaTaskCheckController {
             @ApiImplicitParam(name = "theLogPrimaryKeyId", value = "日志左侧所选的填报类型ID"),
             @ApiImplicitParam(name = "firstId", value = "首件记录ID,列表批量上报时传任意一个即可")
     })
-    public R<Boolean> checkFlowUserIsEVisaPermissions(@RequestBody JSONObject json){
-        if(json.containsKey("flowId")){
+    public R<Boolean> checkFlowUserIsEVisaPermissions(@RequestBody JSONObject json) {
+        if (json.containsKey("flowId")) {
             //首先找到对应流程下的审批人组
             List<FixedFlowLink> flowLink = this.fixedFlowLinkService.selectFixedFlowLink(json.getString("flowId"));
 
@@ -312,15 +314,15 @@ public class EVisaTaskCheckController {
             //获取对应表格的所有电签配置
             List<JSONObject> jsonList = this.queryTableEVisaConfig(json);
 
-            if(jsonList == null){
+            if (jsonList == null) {
                 return R.data(300, false, "当前表格均未配置电签关键字,请联系维护人员处理");
             }
             //汇总电签配置的审批角色
             List<String> eVisaRoleList = jsonList.stream().map(jsonObject -> jsonObject.getString("sigRoleId")).distinct().collect(Collectors.toList());
 
             //循环审批人的角色集合,并判断电签配置中是否含有这个角色
-            for(JSONObject userRole : userRoleList){
-                if(!eVisaRoleList.contains(userRole.getString("roleId"))){
+            for (JSONObject userRole : userRoleList) {
+                if (!eVisaRoleList.contains(userRole.getString("roleId"))) {
                     User user = this.userClient.userInfoById(userRole.getLong("userId")).getData();
                     return R.data(300, false, "所选流程中的用户【" + user.getRealName() + "】不具有相关审批权限,请联系维护人员处理或更换审批流程");
                 }
@@ -335,16 +337,16 @@ public class EVisaTaskCheckController {
     /**
      * 获取表格的电签配置
      */
-    private List<JSONObject> queryTableEVisaConfig(JSONObject json){
+    private List<JSONObject> queryTableEVisaConfig(JSONObject json) {
         List<JSONObject> jsonList;
-        if(json.containsKey("theLogPrimaryKeyId") && StringUtils.isNotEmpty(json.getString("theLogPrimaryKeyId"))){
+        if (json.containsKey("theLogPrimaryKeyId") && StringUtils.isNotEmpty(json.getString("theLogPrimaryKeyId"))) {
             //日志,需要先获取对应的表格
             jsonList = this.queryTableEVisaConfig(Func.toStrList(json.getString("theLogPrimaryKeyId")));
 
-        } else if(json.containsKey("firstId") && StringUtils.isNotEmpty(json.getString("firstId"))){
+        } else if (json.containsKey("firstId") && StringUtils.isNotEmpty(json.getString("firstId"))) {
             //首件,先获取记录
             InformationQuery query = this.informationQueryService.getById(json.getLong("firstId"));
-            if(query != null){
+            if (query != null) {
                 jsonList = this.queryTableEVisaConfig(Func.toStrList(this.wbsTreeContractClient.getContractNodeByPrimaryKeyId(query.getTableId()).getIsTypePrivatePid().toString()));
             } else {
                 jsonList = null;
@@ -352,7 +354,12 @@ public class EVisaTaskCheckController {
 
         } else {
             //资料填报
-            jsonList = this.eVisaConfigClient.queryEVisaConfigAllByTableIds(json.getJSONArray("privatePKeyId").toJavaList(String.class));
+            //jsonList = this.eVisaConfigClient.queryEVisaConfigAllByTableIds(json.getJSONArray("privatePKeyId").toJavaList(String.class));
+
+            List<String> ids = json.getJSONArray("privatePKeyId").toJavaList(String.class);
+            String sql = "select * from m_textdict_info where tab_id in(" + StringUtils.join(ids, ",") + ")";
+            List<TextdictInfo> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(TextdictInfo.class));
+            jsonList = JSONArray.parseArray(JSONObject.toJSONString(query), JSONObject.class);
         }
         return jsonList;
     }
@@ -360,11 +367,11 @@ public class EVisaTaskCheckController {
     /**
      * 获取表格的电签配置
      */
-    private List<JSONObject> queryTableEVisaConfig(List<String> primaryKeyIds){
+    private List<JSONObject> queryTableEVisaConfig(List<String> primaryKeyIds) {
         List<JSONObject> jsonList;
 
         List<WbsTreePrivate> privateTreeList = this.wbsTreePrivateClient.queryExcelTableByParentId(this.wbsTreePrivateClient.queryByPKeyIds(primaryKeyIds).get(0));
-        if(privateTreeList != null && privateTreeList.size() > 0){
+        if (privateTreeList != null && privateTreeList.size() > 0) {
             List<Long> pKeyList = privateTreeList.stream().map(WbsTreePrivate::getPKeyId).distinct().collect(Collectors.toList());
             jsonList = this.eVisaConfigClient.queryEVisaConfigAllByTableIds(JSONArray.parseArray(JSONObject.toJSONString(pKeyList), String.class));
         } else {
@@ -381,9 +388,9 @@ public class EVisaTaskCheckController {
     @GetMapping("/checkContractIsOpenEVisa")
     @ApiOperation(value = "检查当前合同段是否开启电签")
     @ApiOperationSupport(order = 1)
-    public R<Boolean> checkContractIsOpenEVisa(@RequestParam String contractId){
+    public R<Boolean> checkContractIsOpenEVisa(@RequestParam String contractId) {
         ContractInfo contract = this.contractClient.getContractById(Func.toLong(contractId));
-        if(contract != null){
+        if (contract != null) {
             boolean isOpen = new Integer("1").equals(contract.getIsElectronicSignature());
             return R.data(isOpen, isOpen ? "当前合同段已经开启电签" : "当前合同段未开启电签,不允许上报,请联系维护人员处理");
         }

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

@@ -46,7 +46,7 @@ public class InformationQueryClientImpl implements InformationQueryClient {
     }
 
     @Override
-    public void saveData(String nodeId, String projectId, String contractId, String classify, String link) {
+    public void saveData(String nodeId, String projectId, String contractId, String classify, String link,String trialProjectName) {
         InformationQuery obj = new InformationQuery();
         obj.setId(SnowFlakeUtil.getId());
         obj.setWbsId(Long.valueOf(nodeId));
@@ -54,6 +54,7 @@ public class InformationQueryClientImpl implements InformationQueryClient {
         obj.setContractId(Long.valueOf(contractId));
         obj.setClassify(Integer.valueOf(classify));
         obj.setPdfUrl(link);
+        obj.setName(trialProjectName);
         iInformationQueryService.save(obj);
     }
 

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

@@ -244,15 +244,23 @@ public class TrialSelfInspectionRecordServiceImpl
         FileUtils.mergePdfPublicMethods(listPDFURL, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(dto.getNodeId() + ".pdf", listPdf);
 
+        //获取试验记录id的试验项目名称
+        List<String> collect = trialSelfInspectionRecords.stream().map(TrialSelfInspectionRecord::getTrialProjectName).collect(Collectors.toList());
+        String oneName = collect.stream().findAny().orElse(null);
+        String trialProjectName = "";
+        if (StringUtils.isNotEmpty(oneName)) {
+            trialProjectName = oneName + "等" + collect.size() + "个文件";
+        }
+
         if (ObjectUtil.isNotEmpty(bladeFile)) {
             //修改pdfURL
             String querySql = "select * from u_information_query where classify='" + dto.getType() + "' and wbs_id='" + dto.getNodeId() + "' and contract_id ='" + dto.getContractId() + "'";
             List<Map<String, Object>> resultSQL = jdbcTemplate.queryForList(querySql);
             if (resultSQL.size() > 0) {
-                String sql3 = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "' where classify= '" + dto.getType() + "' and wbs_id='" + dto.getNodeId() + "' and contract_id ='" + dto.getContractId() + "'";
+                String sql3 = "update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name = '" + trialProjectName + "' where classify= '" + dto.getType() + "' and wbs_id='" + dto.getNodeId() + "' and contract_id ='" + dto.getContractId() + "'";
                 jdbcTemplate.execute(sql3);
             } else {
-                informationQueryClient.saveData(dto.getNodeId(), dto.getProjectId(), dto.getContractId(), String.valueOf(dto.getType()), bladeFile.getLink());
+                informationQueryClient.saveData(dto.getNodeId(), dto.getProjectId(), dto.getContractId(), String.valueOf(dto.getType()), bladeFile.getLink(), trialProjectName);
             }
             return true;
         } else {
@@ -510,7 +518,21 @@ public class TrialSelfInspectionRecordServiceImpl
         dto.setTableIds(tableIdsAll);
 
         //新增或修改
-        this.saveOrUpdate(dto);
+        if (this.saveOrUpdate(dto)) {
+            try {
+                //保存实体表数据、记录信息、生成pdf
+                String pdfURL = excelTabClient.saveTabData(dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId(), dto.getTableIds());
+                //返回合并pdfURL
+                if (StringUtils.isNotEmpty(pdfURL)) {
+                    LambdaUpdateWrapper<TrialSelfInspectionRecord> updateWrapper = new LambdaUpdateWrapper<>();
+                    updateWrapper.set(TrialSelfInspectionRecord::getPdfUrl, pdfURL);
+                    updateWrapper.eq(TrialSelfInspectionRecord::getId, dto.getId());
+                    this.update(null, updateWrapper);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
 
         if (ObjectUtil.isNotEmpty(dto.getId())) {
             //关联样品信息
@@ -570,17 +592,6 @@ public class TrialSelfInspectionRecordServiceImpl
             }
         }
 
-        //保存实体表数据、记录信息
-        String pdfURL = excelTabClient.saveTabData(dto.getDataInfo(), dto.getType(), dto.getTableType(), dto.getId());
-
-        //返回合并pdfURL
-        if (StringUtils.isNotEmpty(pdfURL)) {
-            LambdaUpdateWrapper<TrialSelfInspectionRecord> updateWrapper = new LambdaUpdateWrapper<>();
-            updateWrapper.set(TrialSelfInspectionRecord::getPdfUrl, pdfURL);
-            updateWrapper.eq(TrialSelfInspectionRecord::getId, dto.getId());
-            this.update(null, updateWrapper);
-        }
-
         //新增设备使用记录信息
         if (StringUtils.isNotEmpty(dto.getDeviceUseIds())) {
             trialDeviceUseService.addDeviceUseInfo(dto);
@@ -678,7 +689,7 @@ public class TrialSelfInspectionRecordServiceImpl
             for (TrialSelfInspectionRecordVO record : records) {
                 //是否关联过
                 for (String recordId : selectedIds) {
-                    if (record.getId().toString().equals(recordId)){
+                    if (record.getId().toString().equals(recordId)) {
                         record.setIsSelectedStatus(1);
                     }
                 }

+ 1 - 1
blade-service/blade-manager/pom.xml

@@ -176,7 +176,7 @@
                     <target>${java.version}</target>
                     <encoding>${project.build.sourceEncoding}</encoding>
                     <compilerArguments>
-                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar:${java.home}/lib/jsse.jar
+                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar;${java.home}/lib/jsse.jar
                         </bootclasspath>
                     </compilerArguments>
                 </configuration>

+ 11 - 10
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -1014,27 +1014,27 @@ public class ExcelTabController extends BladeController {
                             data.attr("title", inputText);
                             // 添加多选框
 
-                             String[] cheText = textInfo.split("□");
+                            String[] cheText = textInfo.split("□");
                             JSONArray objs = new JSONArray();
                             if (cheText != null && cheText.length >= 1) {
-                                int key =1;
-                                for (String keyval:cheText) {
+                                int key = 1;
+                                for (String keyval : cheText) {
                                     JSONObject jsonObject = new JSONObject();
-                                    if(StringUtils.isNotEmpty(keyval)){
+                                    if (StringUtils.isNotEmpty(keyval)) {
                                         jsonObject.put("key", key);
                                         jsonObject.put("name", keyval);
                                         objs.add(jsonObject);
-                                        keyId+=1;
+                                        keyId += 1;
                                     }
                                 }
-                            }else{
+                            } else {
                                 JSONObject jsonObject = new JSONObject();
                                 jsonObject.put("key", "1");
                                 jsonObject.put("name", "");
                                 objs.add(jsonObject);
                             }
 
-                            String checkbox = "<hc-form-checkbox-group :objs='"+objs+"'  @change='checkboxGroupChange' @contextmenu.prevent.native='RightClick("+parm+")' trIndex="+i+" tdIndex="+j+"  x1="+x1+" x2="+x2+" y1="+y1+" y2="+y2+" placeholder=''> </hc-form-checkbox-group>";
+                            String checkbox = "<hc-form-checkbox-group :objs='" + objs + "'  @change='checkboxGroupChange' @contextmenu.prevent.native='RightClick(" + parm + ")' trIndex=" + i + " tdIndex=" + j + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " placeholder=''> </hc-form-checkbox-group>";
                             data.empty().append(checkbox);
 
                         } else {
@@ -2607,10 +2607,11 @@ public class ExcelTabController extends BladeController {
     @ApiOperationSupport(order = 34)
     @ApiOperation(value = "获取试验用户保存数据", notes = "获取试验用户保存数据")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
+            @ApiImplicitParam(name = "pkeyId", value = "表id", required = true),
+            @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true)
     })
-    public R<List<Map<String, Object>>> getBussDataInfoTrial(Long pkeyId) {
-        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(pkeyId);
+    public R<List<Map<String, Object>>> getBussDataInfoTrial(Long id, Long pkeyId) {
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId);
         return R.data(bussDataInfoTrial);
     }
 

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TableFileController.java

@@ -124,7 +124,7 @@ public class TableFileController extends BladeController {
             wbsTreePrivateService.update(updateWrapper);
         }
         Long pkeyId = Long.parseLong(tableFile.getTabId() + "");
-        excelTabService.getBussPDFTrial(null, pkeyId, null);
+        excelTabService.getBussPDFTrial(pkeyId, contractId, id);
 
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));

+ 21 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -3,13 +3,20 @@ package org.springblade.manager.feign;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import lombok.AllArgsConstructor;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.entity.ExcelTab;
+import org.springblade.manager.entity.WbsTreePrivate;
 import org.springblade.manager.service.IExcelTabService;
+import org.springframework.jdbc.core.BeanPropertyRowMapper;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Iterator;
 import java.util.List;
+import java.util.stream.Collectors;
 
 @RestController
 @AllArgsConstructor
@@ -23,7 +30,8 @@ public class ExcelTabClientImpl implements ExcelTabClient {
     }
 
     @Override
-    public String saveTabData(JSONObject dataInfo, Integer type, Integer tableType, Long id) throws Exception {
+    @Transactional(rollbackFor = Exception.class)
+    public String saveTabData(JSONObject dataInfo, Integer type, Integer tableType, Long id, String tabIds) throws Exception {
         JSONArray dataArray = dataInfo.getJSONArray("orderList");
         //通用参数
         JSONObject table = dataArray.getJSONObject(0);
@@ -35,30 +43,32 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         String pdfUrl = "";
         if (dataArray.size() == 1) {
             //单表PDF
-            //保存数据到数据库-试验
-            this.excelTabService.saveOrUpdateInfoTrial(tableInfoList);
-            //公式
+            //保存数据到数据库-试验,当前记录id作为groupId
+            this.excelTabService.saveOrUpdateInfoTrial(tableInfoList, id);
             try {
+                //公式填充
                 this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId));
             } catch (Exception e) {
                 e.printStackTrace();
             }
 
-            //单表PDF加载
-            for (TableInfo tableInfo : tableInfoList) {
-                excelTabService.getBussPDFTrial(tableInfo, Long.valueOf(tableInfo.getPkeyId()), contractId);
-            }
+            //单表PDF
+            TableInfo tableInfo = tableInfoList.stream().findAny().orElse(null);
+            assert tableInfo != null;
+            pdfUrl = excelTabService.getBussPDFTrial(Long.valueOf(tableInfo.getPkeyId()), contractId, id);
 
         } else if (dataArray.size() > 1) {
             //多表PDF
-            this.excelTabService.saveOrUpdateInfoTrial(tableInfoList);
+            //保存数据到数据库-试验,当前记录id作为groupId
+            this.excelTabService.saveOrUpdateInfoTrial(tableInfoList, id);
             try {
+                //公式填充
                 this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId));
             } catch (Exception e) {
                 e.printStackTrace();
             }
 
-            //合并PDF加载
+            //多表合并PDF
             pdfUrl = excelTabService.getBussPDFSTrial(nodeId,
                     tableType, //tableType = 表类型 1=记录表 2=报告单
                     String.valueOf(type), //type = 所属方 1=施工质检 2=监理抽检
@@ -72,7 +82,7 @@ public class ExcelTabClientImpl implements ExcelTabClient {
 
     @Override
     public void getBussPDFTrial(Long pkeyId) throws Exception {
-        excelTabService.getBussPDFTrial(null, pkeyId, null);
+        excelTabService.getBussPDFTrial(pkeyId, null, null);
     }
 
     @Override

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

@@ -17,6 +17,8 @@
 package org.springblade.manager.mapper;
 
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.vo.ExceTabTreVO;
 import org.springblade.manager.vo.ExcelTabVO;
@@ -66,4 +68,7 @@ public interface ExcelTabMapper extends BaseMapper<ExcelTab> {
 
 	Integer removeBussTabInfoById(@Param("pkeyid") String pkeyid);
 
+	@Select("select trial_project_name from u_trial_self_inspection_record where id = #{id}")
+    String selectTrialRecordOne(@Param("id") Long id);
+
 }

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

@@ -97,11 +97,6 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
      */
     R saveOrUpdateInfo(List<TableInfo> tableInfoList) throws SQLException;
 
-    /**
-     * 结果信息持久化 - 试验
-     */
-    void saveOrUpdateInfoTrial(List<TableInfo> tableInfoList) throws SQLException;
-
     Map<String, String> getTablbCols(String pkeyid, String colkey) throws FileNotFoundException;
 
     // 获取用户端 单个表单接口数据
@@ -115,14 +110,22 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
 
 
     // 试验
+
+    /**
+     * 结果信息持久化 - 试验
+     */
+    void saveOrUpdateInfoTrial(List<TableInfo> tableInfoList, Long groupId) throws SQLException;
+
     /**
      * 获取试验用户端 单个表单接口数据
      */
-    List<Map<String, Object>> getBussDataInfoTrial(Long pkeyId);
+    List<Map<String, Object>> getBussDataInfoTrial(Long id, Long pkeyId);
+
     /**
      * 单PDF 生成 - 试验
      */
-    String getBussPDFTrial(TableInfo tableInfo, Long pKeyId, String contractId) throws Exception;
+    String getBussPDFTrial(Long pKeyId, String contractId, Long id) throws Exception;
+
     /**
      * 多PDF 合并 - 试验
      */

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

@@ -32,6 +32,7 @@ import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
+import org.springblade.business.entity.TrialSelfInspectionRecord;
 import org.springblade.business.feign.ContractLogClient;
 import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.business.feign.OperationLogClient;
@@ -1182,7 +1183,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 获取填报信息
      */
     @Override
-    public List<Map<String, Object>> getBussDataInfoTrial(Long pkeyId) {
+    public List<Map<String, Object>> getBussDataInfoTrial(Long groupId, Long pkeyId) {
         List<Map<String, Object>> list = new ArrayList<>();
         Map<String, Object> reData = new HashMap<>();
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
@@ -1202,7 +1203,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             throw new ServiceException("无实体表对应");
         }
 
-        String querySql = "select * from " + wbsTreePrivate.getInitTableName() + " where p_key_id=" + pkeyId;
+        String querySql = "select * from " + wbsTreePrivate.getInitTableName() + " where p_key_id=" + pkeyId + " group_id = " + groupId;
         List<Map<String, Object>> dataIn = jdbcTemplate.queryForList(querySql);
 
         // 匹配关联
@@ -1210,13 +1211,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
             String htmlString = IoUtil.readToString(new FileInputStream(file1));
             Document doc = Jsoup.parse(htmlString);
-            //解析
-            /*Elements dwtitle = doc.select("el-input[placeholder~=.*承包单位]");
-            Elements sgtitle = doc.select("el-input[placeholder~=^施工单位]");
-            Elements htdtitle = doc.select("el-input[placeholder~=.*合同段.*]");
-            Elements jltitle = doc.select("el-input[placeholder~=^监理单位]");
-            Elements bhtitle = doc.select("el-input[placeholder~=^编号]");*/
-
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
@@ -1311,7 +1305,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 单pdf
      */
     @Override
-    public String getBussPDFTrial(TableInfo tableInfo, Long pkeyId, String contractId) throws Exception {
+    @Transactional(rollbackFor = Exception.class)
+    public String getBussPDFTrial(Long pkeyId, String contractId, Long id) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, pkeyId));
@@ -1336,7 +1331,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             throw new ServiceException("操作失败!");
         }
 
-        List<Map<String, Object>> bussDataInfoTrial = getBussDataInfoTrial(pkeyId);
+        //获取数据信息
+        List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(id, pkeyId);
         Map<String, Object> DataInfo = bussDataInfoTrial.stream().findAny().orElse(null);
 
         // 获取excel流 和 html流
@@ -1542,6 +1538,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      * 试验 多pdf
      */
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public String getBussPDFSTrial(String nodeId, Integer tableType, String classify, String contractId, String projectId, Long id) throws Exception {
         String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         //获取有权限的节点信息
@@ -1552,14 +1549,17 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             for (WbsTreePrivate wbsInfo : wbsTreePrivateList) {
                 //隐藏的不生成pdf
                 if (wbsInfo.getIsBussShow() == null || wbsInfo.getIsBussShow() != 2) { //
-                    if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
+                    /*if (StringUtils.isNotEmpty(wbsInfo.getPdfUrl())) {
                         data.add(wbsInfo.getPdfUrl());
-                    } else {
-                        String bussPdfInfo = this.getBussPDFTrial(null, wbsInfo.getPKeyId(), contractId);
-                        if (StringUtils.isNotEmpty(bussPdfInfo)) {
-                            data.add(bussPdfInfo + "");
-                        }
+                    } else {*/
+
+                    //重新生成pdf
+                    String bussPdfInfo = this.getBussPDFTrial(wbsInfo.getPKeyId(), contractId, id);
+                    if (StringUtils.isNotEmpty(bussPdfInfo)) {
+                        data.add(bussPdfInfo);
                     }
+                    //}
+
                 }
             }
         }
@@ -1572,15 +1572,18 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         FileUtils.mergePdfPublicMethods(data, listPdf);
         BladeFile bladeFile = this.newIOSSClient.uploadFile(nodeId + ".pdf", listPdf);
 
+        //获取试验记录id的试验项目名称
+        String trialProjectName = baseMapper.selectTrialRecordOne(id);
+
         //合并PDF集合
         String querySql = "select * from u_information_query where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
         List<Map<String, Object>> resultSQL = jdbcTemplate.queryForList(querySql);
         if (resultSQL.size() > 0) {
-            String updateSql = "update u_information_query set pdf_url = '" + bladeFile.getLink() + "' where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
+            String updateSql = "update u_information_query set pdf_url = '" + bladeFile.getLink() + "', name = '" + trialProjectName + "'  where classify='" + classify + "' and  wbs_id='" + id + "' and contract_id ='" + contractId + "'";
             jdbcTemplate.execute(updateSql);
             //informationQueryClient.updateInformationQuery(bladeFile.getLink(), classify, id.toString(), contractId);
         } else {
-            informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink());
+            informationQueryClient.saveData(id.toString(), projectId, contractId, classify, bladeFile.getLink(), trialProjectName);
         }
         return bladeFile.getLink();
     }
@@ -1590,7 +1593,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
      */
     @Override
     @Transactional
-    public void saveOrUpdateInfoTrial(List<TableInfo> tableInfoList) throws SQLException {
+    public void saveOrUpdateInfoTrial(List<TableInfo> tableInfoList, Long groupId) throws SQLException {
         //试验填报
         if (ListUtils.isNotEmpty(tableInfoList)) {
             try {
@@ -1603,14 +1606,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
 
                     String tabName = wbsTreePrivate.getInitTableName();
                     // 判读修改还是 添加
-                    String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId();
+                    String delSql = "delete from " + tabName + " where p_key_id=" + tableInfo.getPkeyId() + " and group_id = " + groupId;
                     jdbcTemplate.execute(delSql);
 
                     String sqlInfo = "";
                     LinkedHashMap<String, String> dataMap2 = tableInfo.getDataMap();
                     sqlInfo = "INSERT INTO " + tabName + " ( ";
-                    String keyStr = "id,";
-                    String valStr = SnowFlakeUtil.getId() + ",";
+                    String keyStr = "id,group_id";
+                    String valStr = SnowFlakeUtil.getId() + "," + groupId + ",";
                     for (String keys : dataMap2.keySet()) {
                         keyStr += keys + ",";
                         valStr += "'" + dataMap2.get(keys) + "',";