Browse Source

2024 5 14 号

zhuwei 1 year ago
parent
commit
a18e69080e
26 changed files with 688 additions and 77 deletions
  1. 1 0
      blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/LargeFileEndpoint.java
  2. 86 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/EntrustDataInfoVO.java
  3. 77 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSampleDataInfoVO.java
  4. 5 0
      blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSampleInfoVO.java
  5. 5 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClient.java
  6. 6 0
      blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClientFallBack.java
  7. 6 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.java
  8. 24 0
      blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.xml
  9. 1 1
      blade-service/blade-business/src/main/java/org/springblade/business/service/ITrialSampleInfoService.java
  10. 2 41
      blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java
  11. 1 1
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java
  12. 10 4
      blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java
  13. 15 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java
  14. 32 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java
  15. 33 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java
  16. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml
  17. 1 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java
  18. 4 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.java
  19. 17 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml
  20. 6 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IExcelTabService.java
  21. 5 0
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/IWbsTreePrivateService.java
  22. 327 23
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/ExcelTabServiceImpl.java
  23. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/FormulaServiceImpl.java
  24. 8 3
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java
  25. 13 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java
  26. 1 1
      blade-service/blade-manager/src/main/java/org/springblade/manager/utils/WbsElementUtil.java

+ 1 - 0
blade-ops/blade-resource/src/main/java/org/springblade/resource/endpoint/LargeFileEndpoint.java

@@ -505,6 +505,7 @@ public class LargeFileEndpoint {
      */
      */
     private void merge(LargeFile largeFile, String basePath) throws FileNotFoundException, InterruptedException {
     private void merge(LargeFile largeFile, String basePath) throws FileNotFoundException, InterruptedException {
         //合并分片开始
         //合并分片开始
+        System.out.println("---------"+largeFile);
         String path = largeFile.getPath(); //获取到的路径 没有.1 .2 这样的东西
         String path = largeFile.getPath(); //获取到的路径 没有.1 .2 这样的东西
         //截取视频所在的路径
         //截取视频所在的路径
         path = path.replace(basePath, "");
         path = path.replace(basePath, "");

+ 86 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/EntrustDataInfoVO.java

@@ -0,0 +1,86 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.springblade.business.entity.EntrustInfo;
+
+/**
+ * 委托单信息表视图实体类
+ *
+ * @author BladeX
+ * @since 2024-05-08
+ */
+@Data
+public class EntrustDataInfoVO {
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * id
+	 */
+	@ApiModelProperty("id")
+	private String id;
+	/**
+	 * 委托单位
+	 */
+	@ApiModelProperty("委托单位")
+	private String entrustInfo;
+	/**
+	 * 委托单位名称
+	 */
+	@ApiModelProperty("委托单位名称")
+	private String entrustName;
+
+	/**
+	 * 委托单位名称
+	 */
+	@ApiModelProperty("样品名称")
+	private String materialName;
+
+	/**
+	 * 委托单位名称
+	 */
+	@ApiModelProperty("取样数量")
+	private String materialCount;
+
+	/**
+	 * 样品编号
+	 */
+	@ApiModelProperty("样品编号")
+	private String specificationNumber;
+
+	/**
+	 * 试验数量
+	 */
+	@ApiModelProperty("试验数量")
+	private Integer expCount;
+
+	/**
+	 * 规格型号
+	 */
+	@ApiModelProperty(value = "规格型号")
+	private String specificationModel;
+
+
+	/**
+	 * 计算单位
+	 */
+	@ApiModelProperty(value = "计算单位")
+	private String calculationUnit;
+}

+ 77 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSampleDataInfoVO.java

@@ -0,0 +1,77 @@
+package org.springblade.business.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springblade.business.entity.TrialSampleInfo;
+
+
+@Data
+public class TrialSampleDataInfoVO extends TrialSampleInfo {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 开始时间
+     */
+    @ApiModelProperty(value = "开始时间")
+    private String startTime;
+
+    /**
+     * 结束时间
+     */
+    @ApiModelProperty(value = "结束时间")
+    private String endTime;
+
+    /**
+     * 取样人
+     */
+    @ApiModelProperty(value = "取样人")
+    private String userName;
+
+    /**
+     * 委托单上报时间
+     */
+    @ApiModelProperty(value = "委托单上报时间")
+    private String entrustTime;
+
+    /**
+     * 入库时间
+     */
+    @ApiModelProperty(value = "入库时间")
+    private String carryTime;
+
+    /**
+     * 创建试验时间
+     */
+    @ApiModelProperty(value = "创建试验时间")
+    private String testedTime;
+
+    /**
+     * 留样时间
+     */
+    @ApiModelProperty(value = "留样时间")
+    private String resamTime;
+
+    /**
+     * 废除时间
+     */
+    @ApiModelProperty(value = "废除时间")
+    private String repealTime;
+
+    /**
+     * 废除原因
+     */
+    @ApiModelProperty(value = "废除原因")
+    private String repealReason;
+
+    /**
+     * 委托单状态
+     */
+    @ApiModelProperty(value = "委托单状态")
+    private Integer entrustStatus;
+
+    /**
+     * 委托单状态
+     */
+    @ApiModelProperty(value = "委托单状态名称")
+    private String entrustStatusName;
+}

+ 5 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialSampleInfoVO.java

@@ -40,5 +40,10 @@ public class TrialSampleInfoVO extends TrialSampleInfo {
     @ApiModelProperty("进场材料id")
     @ApiModelProperty("进场材料id")
     private Long mobilizationId;
     private Long mobilizationId;
 
 
+    /**
+     * 委托单信息id
+     */
+    @ApiModelProperty("委托单信息id")
+    private Long entrustId;
 
 
 }
 }

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

@@ -1,5 +1,6 @@
 package org.springblade.manager.feign;
 package org.springblade.manager.feign;
 
 
+import com.alibaba.fastjson.JSONObject;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.api.R;
 import org.springblade.manager.entity.ExcelTab;
 import org.springblade.manager.entity.ExcelTab;
@@ -61,4 +62,8 @@ public interface ExcelTabClient {
     @PostMapping(API_PREFIX + "/getArchiveTabList")
     @PostMapping(API_PREFIX + "/getArchiveTabList")
     List<ExcelTab> getArchiveTabList();
     List<ExcelTab> getArchiveTabList();
 
 
+
+    // 保存
+    @PostMapping(API_PREFIX + "/saveEntrustTabData")
+    String saveEntrustTabData(@RequestBody JSONObject table) throws RuntimeException;
 }
 }

+ 6 - 0
blade-service-api/blade-manager-api/src/main/java/org/springblade/manager/feign/ExcelTabClientFallBack.java

@@ -1,5 +1,6 @@
 package org.springblade.manager.feign;
 package org.springblade.manager.feign;
 
 
+import com.alibaba.fastjson.JSONObject;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
 import org.springblade.business.dto.TrialSelfInspectionRecordDTO;
@@ -52,4 +53,9 @@ public class ExcelTabClientFallBack implements ExcelTabClient {
         return null;
         return null;
     }
     }
 
 
+    @Override
+    public String saveEntrustTabData(JSONObject table) throws RuntimeException {
+        return null;
+    }
+
 }
 }

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

@@ -1,7 +1,10 @@
 package org.springblade.business.mapper;
 package org.springblade.business.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springblade.business.entity.TrialSampleInfo;
 import org.springblade.business.entity.TrialSampleInfo;
+import org.springblade.business.vo.TrialSampleDataInfoVO;
+import org.springblade.business.vo.TrialSampleInfoVO;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -9,4 +12,7 @@ public interface TrialSampleInfoMapper extends BaseMapper<TrialSampleInfo> {
 
 
     List<Long> selectTrialSelfSample(Long id);
     List<Long> selectTrialSelfSample(Long id);
 
 
+
+    List<TrialSampleInfoVO> trialSamplePage(IPage<TrialSampleInfoVO> page, TrialSampleInfoVO obj);
+
 }
 }

+ 24 - 0
blade-service/blade-business/src/main/java/org/springblade/business/mapper/TrialSampleInfoMapper.xml

@@ -37,5 +37,29 @@
         select sampling_id from u_trial_self_sample where self_id = #{id}
         select sampling_id from u_trial_self_sample where self_id = #{id}
     </select>
     </select>
 
 
+    <select id="trialSamplePage" resultType="org.springblade.business.vo.TrialSampleInfoVO">
+        SELECT  a.*,
+               (SELECT name from blade_user c where a.user_id=c.id) as userName,
+               (SELECT c.mobilization_id from u_trial_sampling_record c where a.id=c.sample_info_id) as mobilizationId,
+               b.id as entrustId
+        from u_trial_sample_info  a LEFT JOIN u_entrust_info b on a.id = b.sample_id
+        where a.is_deleted = 0
+       <if test="param2.nodeId != null and param2.nodeId != '' ">
+            and a.node_id = #{param2.nodeId}
+        </if>
 
 
+        <if test="param2.startTime != null and param2.startTime != '' ">
+            and a.create_time &gt;= #{param2.startTime}
+        </if>
+
+        <if test="param2.endTime != null and param2.endTime != '' ">
+            and a.create_time &lt;= #{param2.endTime}
+        </if>
+        <if test="param2.queryValue != null and param2.queryValue != ''">
+            AND (   a.material_name like CONCAT(CONCAT('%', #{param2.queryValue}), '%'))
+                    or a.specification_model like CONCAT(CONCAT('%', #{param2.queryValue}), '%'))
+                    or a.specification_number like CONCAT(CONCAT('%', #{param2.queryValue}), '%'))
+            )
+        </if>
+    </select>
 </mapper>
 </mapper>

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

@@ -16,7 +16,7 @@ public interface ITrialSampleInfoService extends BaseService<TrialSampleInfo> {
 
 
     TrialSampleInfo sampleDetail(Long id);
     TrialSampleInfo sampleDetail(Long id);
 
 
-    IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfo> page, TrialSampleInfoVO obj);
+    IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfoVO> page, TrialSampleInfoVO obj);
 
 
     boolean sampleSubmit(TrialSampleInfoDTO obj);
     boolean sampleSubmit(TrialSampleInfoDTO obj);
 
 

+ 2 - 41
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialSampleInfoServiceImpl.java

@@ -123,48 +123,9 @@ public class TrialSampleInfoServiceImpl extends BaseServiceImpl<TrialSampleInfoM
     }
     }
 
 
     @Override
     @Override
-    public IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfo> page, TrialSampleInfoVO obj) {
-        QueryWrapper<TrialSampleInfo> queryWrapper = Condition.getQueryWrapper(obj);
-        if (StringUtils.isNotEmpty(String.valueOf(obj.getNodeId()))) {
-            queryWrapper.lambda().eq(TrialSampleInfo::getNodeId, obj.getNodeId());
-        }
-        if (StringUtils.isNotEmpty(obj.getStartTime()) && StringUtils.isNotEmpty(obj.getEndTime())) {
-            String endTime = obj.getEndTime();
-            endTime = DateUtil.format(DateUtils.addDays(DateUtil.parse(endTime, "yyyy-MM-dd"), 1), "yyyy-MM-dd");
-            queryWrapper.lambda().between(TrialSampleInfo::getCreateTime, obj.getStartTime(), endTime);
-        }
-        if (ObjectUtil.isNotEmpty(obj.getQueryValue())) {
-            queryWrapper.lambda().and(wrapper -> wrapper.like(TrialSampleInfo::getMaterialName, obj.getQueryValue())
-                    .or().like(TrialSampleInfo::getSpecificationModel, obj.getQueryValue())
-                    .or().like(TrialSampleInfo::getSpecificationNumber, obj.getQueryValue()));
-        }
-        IPage<TrialSampleInfo> pages = this.page(page, queryWrapper.lambda().orderBy(true, false, TrialSampleInfo::getCreateTime));
-        IPage<TrialSampleInfoVO> trialMaterialMobilizationVOIPage = TrialSampleInfoWarpper.build().pageVO(pages);
-        List<TrialSampleInfoVO> records = trialMaterialMobilizationVOIPage.getRecords();
-        List<TrialSamplingRecord> list = trialSamplingRecordMapper.selectAll();
-        List<User> userList = iUserClient.selectUserAll();
-        for (TrialSampleInfoVO record : records) {
-            if (ObjectUtils.isEmpty(record.getMaterialCount())) {
-                record.setMaterialCount("0");
-            }
-            if (ObjectUtils.isEmpty(record.getRepresentativeCount())) {
-                record.setRepresentativeCount("0");
-            }
+    public IPage<TrialSampleInfoVO> selectPage(IPage<TrialSampleInfoVO> page, TrialSampleInfoVO obj) {
 
 
-            for (User user : userList) {
-                if (record.getUserId().equals(user.getId())) {
-                    record.setUserName(user.getName());
-                    break;
-                }
-            }
-            for (TrialSamplingRecord trialSamplingRecord : list) {
-                if (record.getId().equals(trialSamplingRecord.getSampleInfoId())) {
-                    record.setMobilizationId(trialSamplingRecord.getMobilizationId());
-                    break;
-                }
-            }
-        }
-        return trialMaterialMobilizationVOIPage.setRecords(records);
+        return page.setRecords(baseMapper.trialSamplePage(page, obj));
     }
     }
 
 
     @Override
     @Override

+ 1 - 1
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/controller/EVisaController.java

@@ -56,7 +56,7 @@ public class EVisaController {
 
 
     // 电签主类
     // 电签主类
 
 
-  //  @Scheduled(cron = "0/20 * * * * ?")
+    @Scheduled(cron = "0/20 * * * * ?")
     public void SignInfo() {
     public void SignInfo() {
         //执行代码
         //执行代码
         log.info("扫描开始");
         log.info("扫描开始");

+ 10 - 4
blade-service/blade-e-visa/src/main/java/org/springblade/evisa/service/impl/EVisaServiceImpl.java

@@ -93,8 +93,8 @@ import java.util.*;
 @AllArgsConstructor
 @AllArgsConstructor
 public class EVisaServiceImpl implements EVisaService {
 public class EVisaServiceImpl implements EVisaService {
 
 
-   // private static final String SIGN_HOST = "172.30.224.79";
-    private static final String SIGN_HOST = "47.115.117.246";
+    private static final String SIGN_HOST = "172.30.224.79";
+    //private static final String SIGN_HOST = "47.115.117.246";
 
 
     private static final String SIGN_PORT = "8183";
     private static final String SIGN_PORT = "8183";
 
 
@@ -478,8 +478,14 @@ public class EVisaServiceImpl implements EVisaService {
                     for (Map<String, Object> eVisaConfig : maps) {
                     for (Map<String, Object> eVisaConfig : maps) {
                         //设置签章策略
                         //设置签章策略
                         SealStrategyVO vo = new SealStrategyVO();
                         SealStrategyVO vo = new SealStrategyVO();
-                        vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + task.getUserId());
-                        vo.setSealPassword(task.getUserId().toString().substring(0, EVisaConstant.USER_ID_SUB));
+                        String userId = task.getUserId()+"";
+                        vo.setSealCode(EVisaConstant.SIGN_SEAL_CODE + userId);
+
+                        if(userId.length()<=EVisaConstant.USER_ID_SUB){
+                            vo.setSealPassword(task.getUserId().toString());
+                        }else{
+                            vo.setSealPassword(task.getUserId().toString().substring(0, EVisaConstant.USER_ID_SUB));
+                        }
                         vo.setSealPerson(task.getNickName());
                         vo.setSealPerson(task.getNickName());
                         //设置签字文件
                         //设置签字文件
                         vo.setImageUrl(eVisaConfig.get("signature_file_url") + "");
                         vo.setImageUrl(eVisaConfig.get("signature_file_url") + "");

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

@@ -4054,4 +4054,19 @@ public class ExcelTabController extends BladeController {
     public R getPriWbsPdfByPId(Long pkeyId) throws Exception {
     public R getPriWbsPdfByPId(Long pkeyId) throws Exception {
         return excelTabService.getPriWbsPdfByPId(pkeyId);
         return excelTabService.getPriWbsPdfByPId(pkeyId);
     }
     }
+
+
+    @GetMapping("/get-buss-dataInfo-trial_entrust")
+    @ApiOperationSupport(order = 34)
+    @ApiOperation(value = "获取试验用户保存数据-委托单", notes = "获取试验用户保存数据-委托单")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "pkeyId", value = "表id", required = true),
+            @ApiImplicitParam(name = "id", value = "记录id-当做groupId", required = true),
+            @ApiImplicitParam(name = "contractId", value = "合同段id", required = true)
+    })
+    public R<List<Map<String, Object>>> getBussDataInfoTrialentrust(Long id, Long pkeyId, Long contractId) {
+
+        List<Map<String, Object>> bussDataInfoTrial = excelTabService.getBussDataInfoTrial(id, pkeyId, contractId);
+        return R.data(bussDataInfoTrial);
+    }
 }
 }

+ 32 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/WbsTreePrivateController.java

@@ -771,4 +771,36 @@ public class WbsTreePrivateController extends BladeController {
         return R.success("同步成功");
         return R.success("同步成功");
     }
     }
 
 
+
+    /**
+     * 试验节点关联
+     */
+    @ApiOperationSupport(order = 30)
+    @ApiOperation(value = "节点关联", notes = "节点关联")
+    @RequestMapping(value = "/link-node-tree", method = RequestMethod.POST)
+    public R linkNodeTree(@RequestParam String pkeyid,@RequestParam String nodeids) {
+        if(pkeyid==null && StringUtil.isEmpty(pkeyid) ){
+            R.fail("pkeyid不能为null");
+        }
+        if(nodeids==null && StringUtil.isEmpty(nodeids) ){
+            R.fail("nodeids不能为null");
+        }
+        int i = wbsTreePrivateService.linkNodeTreeInfo(pkeyid, nodeids);
+        return R.success("操作成功");
+    }
+
+    /**
+     * node节点回显示
+     */
+    @ApiOperationSupport(order = 31)
+    @ApiOperation(value = "node节点回显示", notes = "node节点回显示")
+    @RequestMapping(value = "/getlinek-node-treelist", method = RequestMethod.POST)
+    public R linkNodeTreeBynodeId(@RequestParam String pkeyid) {
+        if(pkeyid==null && StringUtil.isEmpty(pkeyid) ){
+            R.fail("pkeyid不能为null");
+        }
+        List<Long> wbsTreePrivates = wbsTreePrivateService.linkNodeTreeBynodeId(pkeyid);
+        return R.data(wbsTreePrivates);
+    }
+
 }
 }

+ 33 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/ExcelTabClientImpl.java

@@ -12,6 +12,7 @@ import org.springblade.business.feign.InformationQueryClient;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.oss.model.BladeFile;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.core.tool.utils.ResourceUtil;
 import org.springblade.core.tool.utils.ResourceUtil;
 import org.springblade.manager.bean.TableInfo;
 import org.springblade.manager.bean.TableInfo;
@@ -135,5 +136,37 @@ public class ExcelTabClientImpl implements ExcelTabClient {
         return excelTabService.getListByParentName("档案");
         return excelTabService.getListByParentName("档案");
     }
     }
 
 
+    // 保存委托单数据接口
+    @Override
+    public String saveEntrustTabData(JSONObject table) throws RuntimeException {
+        String pdfUrl = "";
+        String nodeId = table.getString("nodeId");
+        String groupId = table.getString("groupId");
+        String contractId = table.getString("contractId");
+        String pkeyId = table.getString("pkeyId");
+        JSONArray dataArray = new JSONArray();
+        dataArray.add(table);
+
+        List<TableInfo> tableInfoList = this.excelTabService.getTableInfoListTrial(dataArray, "entrustInfo");
+        try {
+            //------公式填充------
+            this.excelTabService.formulaFillData(tableInfoList, Long.parseLong(nodeId), ExecuteType.TESTING);
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("试验公式执行异常,操作失败");
+        }
+        try {
+            //------试验填报数据保存,当前记录id作为groupId------
+            this.excelTabService.saveOrUpdateInfoTrial(tableInfoList, Func.toLong(groupId));
+
+            pdfUrl = this.excelTabService.getEntrustPDFTrial(Func.toLong(pkeyId),contractId,Func.toLong(groupId));
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException("试验填报数据保存异常,操作失败");
+        }
+        return pdfUrl;
+    }
+
 
 
 }
 }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/ContractInfoMapper.xml

@@ -542,6 +542,6 @@
     </select>
     </select>
 
 
     <select id="getContractInfoByContractId" resultType="org.springblade.manager.entity.ContractInfo">
     <select id="getContractInfoByContractId" resultType="org.springblade.manager.entity.ContractInfo">
-        SELECT a.* from m_contract_info a,m_contract_relation_jlyz b  where a.id=b.contract_id_sg and  is_deleted = 0 and status = 1 and contract_id_jlyz=#{contractId}
+        SELECT distinct * from m_contract_info where id in(SELECT contract_id_sg from m_contract_relation_jlyz where contract_id_jlyz=#{contractId}) or id=#{contractId}
     </select>
     </select>
 </mapper>
 </mapper>

+ 1 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreeContractMapper.java

@@ -106,4 +106,5 @@ public interface WbsTreeContractMapper extends EasyBaseMapper<WbsTreeContract> {
     List<WbsTreeContract> getAllNodeByProjectId(@Param("projectId") Long id);
     List<WbsTreeContract> getAllNodeByProjectId(@Param("projectId") Long id);
 
 
     void updateIsPId(@Param("map") Map<Long, Long> map);
     void updateIsPId(@Param("map") Map<Long, Long> map);
+
 }
 }

+ 4 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.java

@@ -113,6 +113,10 @@ public interface WbsTreePrivateMapper extends EasyBaseMapper<WbsTreePrivate> {
 
 
     List<WbsTreeContract> getcontractAllNode(@Param("projectId") Long projectId);
     List<WbsTreeContract> getcontractAllNode(@Param("projectId") Long projectId);
 
 
+    int linkNodeTreeInfo(@Param("pkeyid") String pkeyid,@Param("list") List<String> list);
+
     //根据项目id,获取所有type为1的节点
     //根据项目id,获取所有type为1的节点
     List<WbsTreePrivate> getAllNodeByProjectId(@Param("projectId") Long projectId);
     List<WbsTreePrivate> getAllNodeByProjectId(@Param("projectId") Long projectId);
+
+    List<Long> linkNodeTreeBynodeId(@Param("pkeyid") String pkeyid);
 }
 }

+ 17 - 0
blade-service/blade-manager/src/main/java/org/springblade/manager/mapper/WbsTreePrivateMapper.xml

@@ -870,4 +870,21 @@
         WHERE id = #{pKeyId}
         WHERE id = #{pKeyId}
     </delete>
     </delete>
 
 
+    <update id="linkNodeTreeInfo">
+        <foreach collection="list" item="item" separator=";">
+            update
+            m_wbs_tree_private
+            set
+            er_tree_id = #{pkeyid}
+            where
+            p_key_id = #{item}
+            and is_deleted=0
+            and `type` = 1
+        </foreach>
+    </update>
+
+    <select id="linkNodeTreeBynodeId" resultType="java.lang.Long" >
+        select p_key_id
+        from m_wbs_tree_private where er_tree_id = #{pkeyid} and `type` = 1 and is_deleted = 0
+    </select>
 </mapper>
 </mapper>

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

@@ -192,4 +192,10 @@ public interface IExcelTabService extends BaseService<ExcelTab> {
      * 获取项目表单的PDF
      * 获取项目表单的PDF
      */
      */
     R getPriWbsPdfByPId(Long pkeyId) throws Exception;
     R getPriWbsPdfByPId(Long pkeyId) throws Exception;
+
+
+    /**
+     * 试验委托单 生成 pdf
+     */
+    String getEntrustPDFTrial(Long pKeyId, String contractId, Long groupId) throws Exception;
 }
 }

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

@@ -97,4 +97,9 @@ public interface IWbsTreePrivateService extends BaseService<WbsTreePrivate> {
     void syncFormToContractNode(Long projectId, String nodeId, Long primaryKeyId);
     void syncFormToContractNode(Long projectId, String nodeId, Long primaryKeyId);
 
 
     void syncPid(Long projectId);
     void syncPid(Long projectId);
+    //试验关联 node tree
+    int linkNodeTreeInfo(String pkeyId, String nodeIds);
+    //获取数据回显
+    List<Long> linkNodeTreeBynodeId(String pkeyId);
+
 }
 }

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

@@ -726,7 +726,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         int status = callback.getStatus();
         int status = callback.getStatus();
         int saved = 0;
         int saved = 0;
         //status=6,表示点击保存按钮 2 关闭保存
         //status=6,表示点击保存按钮 2 关闭保存
-        if (status == 3 || status == 6) //MustSave, Corrupted
+        /*if (status == 3 || status == 6) //MustSave, Corrupted
         {
         {
             //获取url
             //获取url
             String downloadUri = callback.getUrl();
             String downloadUri = callback.getUrl();
@@ -775,7 +775,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 editCallback.setError(1);
                 editCallback.setError(1);
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
-        }
+        }*/
         return editCallback;
         return editCallback;
     }
     }
 
 
@@ -1336,14 +1336,14 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             // 施工单位名称
             // 施工单位名称
             if (dwtitle.size() >= 1) {
             if (dwtitle.size() >= 1) {
                 int y = Integer.parseInt(dwtitle.attr("trindex"));
                 int y = Integer.parseInt(dwtitle.attr("trindex"));
-                if (y <= 10) {
+                if (y <= 20) {
                     reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                     reData.put(dwtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                 }
                 }
 
 
             }
             }
             if (sgtitle.size() >= 1) {
             if (sgtitle.size() >= 1) {
                 int y = Integer.parseInt(sgtitle.attr("trindex"));
                 int y = Integer.parseInt(sgtitle.attr("trindex"));
-                if (y <= 10) {
+                if (y <= 20) {
                     reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                     reData.put(sgtitle.attr("keyName"), contractInfo.getConstructionUnitName());
                 }
                 }
             }
             }
@@ -1359,10 +1359,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
             }
             // 监理单位名称
             // 监理单位名称
             if (jltitle.size() >= 1) {
             if (jltitle.size() >= 1) {
-
                 for (Element element : jltitle) {
                 for (Element element : jltitle) {
                     int trindex = Integer.parseInt(element.attr("trindex"));
                     int trindex = Integer.parseInt(element.attr("trindex"));
-                    if (trindex <= 10) {
+                    String placeholderxx = element.attr("placeholder");
+
+                    if (trindex < 10 || placeholderxx.equals("监理单位")) {
                         reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
                         reData.put(element.attr("keyName"), contractInfo.getSupervisionUnitName());
                     }
                     }
                 }
                 }
@@ -1406,7 +1407,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             //电签默认值
             //电签默认值
             if (defText.size() >= 1) {
             if (defText.size() >= 1) {
                 for (Element element : defText) {
                 for (Element element : defText) {
-                    reData.put(element.attr("id"), element.attr("defText"));
+                    reData.put(element.attr("keyName"), element.attr("defText"));
                 }
                 }
             }
             }
 
 
@@ -1677,7 +1678,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             //电签默认值
             //电签默认值
             if (defText.size() >= 1) {
             if (defText.size() >= 1) {
                 for (Element element : defText) {
                 for (Element element : defText) {
-                    reData.put(element.attr("id"), element.attr("defText"));
+                    reData.put(element.attr("keyName"), element.attr("defText"));
                 }
                 }
             }
             }
 
 
@@ -1853,7 +1854,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         }
         }
 
 
         int all = 0;
         int all = 0;
-        for (int i = 0; i < 10; i++) {
+        List<CellRangeAddress> mergedRegions = sheet.getMergedRegions();
+        int xle = 10;
+        if(mergedRegions.size()<=10){
+            xle = mergedRegions.size();
+        }
+        for (int i = 0; i < xle; i++) {
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             int xx = mergedCell.getNumberOfCells();
             int xx = mergedCell.getNumberOfCells();
             if (xx >= all) {
             if (xx >= all) {
@@ -1861,7 +1867,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             }
             }
         }
         }
 
 
-        for (int i = 0; i < 10; i++) {
+        for (int i = 0; i < xle; i++) {
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             CellRangeAddress mergedCell = sheet.getMergedRegion(i);
             int xx = mergedCell.getNumberOfCells() + 2;
             int xx = mergedCell.getNumberOfCells() + 2;
             if (xx >= all) {
             if (xx >= all) {
@@ -1955,7 +1961,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                             }
                             }
 
 
                             String myData = DataInfo.get(val) + "";
                             String myData = DataInfo.get(val) + "";
-                            if ((myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0)) {
+                            System.out.println(data.attr("type").indexOf("date")>=0);
+                            if (data.attr("type").indexOf("date")>=0 && (myData.indexOf("T") >= 0 && myData.indexOf("-") >= 0) || (myData.indexOf(",") >= 0 && myData.indexOf("]") >= 0) ) {
                                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                                 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
                                 sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
                                 sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
                                 SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
                                 SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
@@ -2245,20 +2252,22 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                 JSONObject dataInfo2 = dataArray.getJSONObject(m);
                 JSONObject dataInfo2 = dataArray.getJSONObject(m);
                 tableInfo.setPkeyId(dataInfo2.getString("pkeyId"));
                 tableInfo.setPkeyId(dataInfo2.getString("pkeyId"));
                 tableInfo.setToBeUpdated(true);
                 tableInfo.setToBeUpdated(true);
-                if (!tabIds.contains(tableInfo.getPkeyId())) {
-                    //隐藏表不做处理
-                    continue;
-                }
 
 
+                // entrustInfo = 为 委托单信息
+                if(!tabIds.equals("entrustInfo")){
+                    if (!tabIds.contains(tableInfo.getPkeyId())) {
+                        //隐藏表不做处理
+                        continue;
+                    }
+                    tableInfo.setProjectId(dataInfo2.getString("projectId"));
+                    //填报的类型,施工或监理
+                    tableInfo.setClassify(dataInfo2.getString("classify"));
+                    //设置首件信息
+                    this.setFirstData(dataInfo2, tableInfo);
+                    //设置日志信息
+                    this.setTheLogData(dataInfo2, tableInfo);
+                }
                 tableInfo.setContractId(dataInfo2.getString("contractId"));
                 tableInfo.setContractId(dataInfo2.getString("contractId"));
-                tableInfo.setProjectId(dataInfo2.getString("projectId"));
-
-                //填报的类型,施工或监理
-                tableInfo.setClassify(dataInfo2.getString("classify"));
-                //设置首件信息
-                this.setFirstData(dataInfo2, tableInfo);
-                //设置日志信息
-                this.setTheLogData(dataInfo2, tableInfo);
 
 
                 dataInfo2.fluentRemove("contractId")
                 dataInfo2.fluentRemove("contractId")
                         .fluentRemove("pkeyId")
                         .fluentRemove("pkeyId")
@@ -3775,4 +3784,299 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
         return R.data(PdfAddimgUtil.getNetUrl(pdfPath));
         return R.data(PdfAddimgUtil.getNetUrl(pdfPath));
     }
     }
 
 
+
+    /**
+     * 试验 委托单 单pdf
+     */
+    @Override
+    public String getEntrustPDFTrial(Long pkeyId, String contractId, Long groupId) throws Exception {
+        String file_path = FileUtils.getSysLocalFileUrl();//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
+        WbsTreePrivate wbsTreePrivate = wbsTreePrivateService.getBaseMapper().selectOne(Wrappers.<WbsTreePrivate>query().lambda()
+                .eq(WbsTreePrivate::getPKeyId, pkeyId));
+        if (wbsTreePrivate == null) {
+            throw new ServiceException("该数据下无此节点!");
+        }
+        if (wbsTreePrivate.getHtmlUrl() == null) {
+            throw new ServiceException("请关联清表!");
+        }
+
+        String pdfPath = file_path + "/pdf//" + pkeyId + ".pdf";
+        String excelPath = file_path + "/pdf//" + pkeyId + ".xlsx";
+
+        File tabPdf = ResourceUtil.getFile(pdfPath);
+        if (tabPdf.exists()) {
+            tabPdf.delete();
+        }
+
+        //获取清表信息
+        ExcelTab excelTab = this.getById(wbsTreePrivate.getExcelId());
+
+        if (excelTab == null) {
+            throw new ServiceException("操作失败!");
+        }
+
+        //获取数据信息info
+        List<Map<String, Object>> bussDataInfoTrial = this.getBussDataInfoTrial(groupId, pkeyId, Long.parseLong(contractId));
+        Map<String, Object> DataInfo = new HashMap<>();
+        if (bussDataInfoTrial.size() > 0) {
+            DataInfo.putAll(bussDataInfoTrial.stream().findAny().orElse(null));
+        }
+
+        //获取清表excel文件
+        org.apache.poi.ss.usermodel.Workbook workbook = WorkbookFactory.create(Objects.requireNonNull(CommonUtil.getOSSInputStreamTow(excelTab.getFileUrl())));
+        Sheet sheet = workbook.getSheetAt(0);
+        sheet.setForceFormulaRecalculation(true);
+
+        //标题Title
+        ProjectInfo projectInfo = projectInfoService.getById(wbsTreePrivate.getProjectId());
+        int all = sheet.getRow(0).getLastCellNum();
+        int mergedCellCnt = sheet.getNumMergedRegions();
+        for (
+                int i = 0;
+                i < mergedCellCnt - 1; i++) {
+            CellRangeAddress mergedCell = sheet.getMergedRegion(i);
+            int xx = mergedCell.getNumberOfCells();
+            if (xx <= all) {
+                int fisRow = mergedCell.getFirstRow();
+                int firstCol = mergedCell.getFirstColumn();
+                Cell cell = sheet.getRow(fisRow).getCell(firstCol);
+                short fontIndex = cell.getCellStyle().getFontIndex();
+                Font oldFontAt = workbook.getFontAt(fontIndex);
+                Font redFont = workbook.createFont();
+                redFont.setFontHeightInPoints(oldFontAt.getFontHeightInPoints());//设置字体大小
+                redFont.setFontName(oldFontAt.getFontName());//设置字体
+                CellStyle newStyle = workbook.createCellStyle();//创建单元格样式
+                newStyle.cloneStyleFrom(cell.getCellStyle());
+                short fontHeightInPoints = redFont.getFontHeightInPoints();
+                if (fontHeightInPoints >= 14 && StringUtils.isEmpty(cell.getStringCellValue()) && fisRow <= 8) {
+                    String title = projectInfo.getProjectName();
+                    if (title.length() >= 30) {
+                        sheet.getRow(fisRow).setHeight((short) 900);
+                        newStyle.setWrapText(true);
+                    }
+                    redFont.setBold(true);
+                    newStyle.setFont(redFont);
+                    cell.setCellStyle(newStyle);
+                    cell.setCellValue(title);
+                    break;
+                }
+            }
+        }
+
+        //数据不为空,构造数据
+        String fileUrl = wbsTreePrivate.getHtmlUrl();
+        File file1 = ResourceUtil.getFile(fileUrl);
+        InputStream fileInputStream;
+        if (file1.exists()) {
+            fileInputStream = new FileInputStream(file1);
+        } else {
+            String path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
+            fileInputStream = CommonUtil.getOSSInputStream(path);
+        }
+
+        String htmlString = IoUtil.readToString(fileInputStream);
+        htmlString = htmlString.replaceAll("placeholder", "placeholderxx");
+        htmlString = htmlString.replaceAll("title", "titlexx");
+
+        Document doc = Jsoup.parse(htmlString);
+        Element table = doc.select("table").first();
+        Elements trs = table.select("tr");
+
+        if (ObjectUtil.isNotEmpty(DataInfo)) {
+            for (String val : Objects.requireNonNull(DataInfo).keySet()) {
+                if (val.contains("__")) {
+                    String[] DataVal = val.split("__");
+                    String[] xy = DataVal[1].split("_");
+                    if (Integer.parseInt(xy[0]) < trs.size()) {
+                        Element ytzData = trs.get(Integer.parseInt(xy[0]));
+                        if (ytzData != null) {
+                            Elements tdsx = ytzData.select("td");
+                            if (Integer.parseInt(xy[1]) < tdsx.size()) {
+                                Element data = ytzData.select("td").get(Integer.parseInt(xy[1]));
+                                if (data != null) {
+                                    if (data.html().contains("x1") && data.html().contains("y1")) {
+                                        int x1 = 0;
+                                        int x2 = 0;
+                                        int y1 = 0;
+                                        int y2 = 0;
+                                        if (data.html().contains("el-tooltip")) {
+                                            x1 = Integer.parseInt(data.children().get(0).children().get(0).attr("x1"));
+                                            x2 = Integer.parseInt(data.children().get(0).children().get(0).attr("x2"));
+                                            y1 = Integer.parseInt(data.children().get(0).children().get(0).attr("y1"));
+                                        } else {
+                                            x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                            y1 = Integer.parseInt(data.children().get(0).attr("y1"));
+                                        }
+                                        if (x1 == 0) {
+                                            x1 = 1;
+                                        }
+                                        String myData = DataInfo.get(val) + "";
+                                        if (myData.contains("T") && myData.contains("-") && myData.contains(":")) {
+                                            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
+                                            sdf.setTimeZone(TimeZone.getTimeZone("GTM+8"));
+                                            SimpleDateFormat formatStr = new SimpleDateFormat("yyyy年MM月dd日");
+                                            if (myData.contains(",") && myData.contains("]")) {
+
+                                                myData = myData.replace("[", "").replace("]", "").replaceAll("'", "");
+                                                String[] dataVal = myData.split(",");
+
+                                                Date Start_dataStr = sdf.parse(dataVal[0]);
+                                                Date end_dataStr = sdf.parse(dataVal[1]);
+                                                String StartDate = formatStr.format(Start_dataStr);
+                                                String endDate = formatStr.format(end_dataStr);
+                                                if (StartDate.equals(endDate)) {
+                                                    myData = StartDate;
+                                                } else {
+                                                    myData = StartDate + "-" + endDate;
+                                                }
+                                            } else {
+                                                String[] dataStr = myData.split("T")[0].split("-");
+                                                myData = StringUtil.format("{}年{}月{}日", dataStr[0], dataStr[1], Integer.parseInt(dataStr[2]));
+                                            }
+                                        }
+
+                                        if (myData.contains("lang.String")) {
+                                            Object obj = DataInfo.get(val);
+                                            if (obj instanceof String[]) {
+                                                String[] dataDate = (String[]) obj;
+                                                myData = dataDate[0].trim() + "-" + dataDate[1].trim();
+                                                if (dataDate[0].trim().equals(dataDate[1].trim())) {
+                                                    myData = dataDate[0];
+                                                }
+                                            }
+                                        }
+
+                                        if (myData.contains("http") && myData.contains("aliyuncs")) {
+                                            InputStream imageIn = CommonUtil.getOSSInputStream(myData);
+                                            byte[] byteNew = new byte[0];
+                                            if (imageIn != null) {
+                                                byteNew = IOUtils.toByteArray(imageIn);
+                                            }
+
+                                            byte[] bytes = CommonUtil.compressImage(byteNew);
+
+                                            CreationHelper helper = workbook.getCreationHelper();
+                                            ClientAnchor anchor = helper.createClientAnchor();
+                                            anchor.setCol1(x1); // param1是列号
+                                            anchor.setCol2(x2);
+                                            anchor.setRow1(y1); // param2是行号
+                                            anchor.setRow2(y2); // param2是行号
+
+                                            Drawing<?> drawing = sheet.createDrawingPatriarch();
+                                            anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
+                                            // 插入图片
+                                            Picture picture = drawing.createPicture(anchor, workbook.addPicture(bytes, Workbook.PICTURE_TYPE_PNG));
+                                            picture.resize(1, 1);
+                                            FileUtils.imageOrientation(sheet, anchor, new DataVO(x1 - 1, y1 - 1));
+
+                                        } else if (myData.equals("1") && data.html().contains("hc-form-checkbox-group")) {
+                                            Row row = sheet.getRow(y1 - 1);
+                                            if (row != null) {
+                                                Cell cell = row.getCell(x1 - 1);
+                                                if (cell != null) {
+                                                    String exceVal = cell.getStringCellValue().replaceAll(" ", "");
+                                                    short fontIndex = cell.getCellStyle().getFontIndex();
+                                                    Font fontAt = workbook.getFontAt(fontIndex);
+                                                    fontAt.setFontName("EUDC");
+                                                    cell.setCellValue(exceVal.replace("□", "\u2611"));
+                                                } else {
+                                                    ObjectUtils.isNotEmpty(cell);
+                                                }
+                                            }
+                                        } else {
+                                            Row row = sheet.getRow(y1 - 1);
+                                            if (row != null) {
+                                                Cell cell = row.getCell(x1 - 1);
+                                                if (cell != null) {
+                                                    cell.setCellValue(myData);
+                                                } else {
+                                                    ObjectUtils.isNotEmpty(cell);
+                                                }
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+
+                // 组装电签设置
+                QueryWrapper<TextdictInfo> queryWrapper = new QueryWrapper<>();
+                queryWrapper.select("col_key", "id");
+                queryWrapper.in("type", 2, 6);
+                queryWrapper.eq("tab_id", wbsTreePrivate.getPKeyId());
+
+                List<TextdictInfo> textdictInfos = textdictInfoService.getBaseMapper().selectList(queryWrapper);
+                if (textdictInfos != null && !textdictInfos.isEmpty()) {
+                    for (TextdictInfo e : textdictInfos) {
+                        String key = e.getColKey();
+                        String[] keys = key.split("__");
+                        String[] trtd = keys[1].split("_");
+                        if (Integer.parseInt(trtd[0]) < trs.size()) {
+                            Element ytzData = trs.get(Integer.parseInt(trtd[0]));
+                            if (ytzData != null) {
+                                Elements tdsx = ytzData.select("td");
+                                if (Integer.parseInt(trtd[1]) < tdsx.size()) {
+                                    Element data = ytzData.select("td").get(Integer.parseInt(trtd[1]));
+                                    if (data.html().contains("el-tooltip")) {
+                                        data = data.children().get(0);
+                                    }
+
+                                    int x1 = Integer.parseInt(data.children().get(0).attr("x1"));
+                                    if (x1 == 0) {
+                                        x1 = 1;
+                                    }
+                                    int y1 = Integer.parseInt(data.children().get(0).attr("y1"));
+
+                                    Row row = sheet.getRow(y1 - 1);
+                                    if (row != null) {
+                                        Cell cell = sheet.getRow(y1 - 1).getCell(x1 - 1);
+                                        if (cell != null) {
+                                            short fontIndex = cell.getCellStyle().getFontIndex();
+                                            Font oldfontAt = workbook.getFontAt(fontIndex);
+
+                                            Font redFont = workbook.createFont();
+                                            redFont.setColor(IndexedColors.WHITE.getIndex()); //设置字体颜色
+                                            redFont.setFontHeightInPoints(oldfontAt.getFontHeightInPoints());//设置字体大小
+                                            redFont.setFontName(oldfontAt.getFontName());//设置字体
+
+                                            CellStyle newStyle = workbook.createCellStyle(); //创建单元格样式
+                                            newStyle.cloneStyleFrom(cell.getCellStyle());
+                                            newStyle.setFont(redFont);
+                                            cell.setCellStyle(newStyle);
+                                            cell.setCellValue(e.getId() + "");
+                                        } else {
+                                            ObjectUtils.isNotEmpty(cell);
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+        //输出流
+        FileOutputStream outputStream = new FileOutputStream(excelPath);
+        workbook.write(outputStream);
+        FileUtils.setExcelScaleToPdf(excelPath, pdfPath);
+        BladeFile bladeFile = newIOSSClient.uploadFile(pkeyId + ".pdf", pdfPath);
+
+        if (bladeFile != null) {
+            String pdfUrl = bladeFile.getLink();
+            jdbcTemplate.update("update u_entrust_info set entrust_pdf = '"+pdfUrl+"' where id='"+groupId+"' ");
+            List<InformationQuery> query2 = jdbcTemplate.query("select id from u_information_query where classify = 1 and wbs_id ='" + groupId + "' and contract_id ='" + contractId + "'", new BeanPropertyRowMapper<>(InformationQuery.class));
+            if (query2.size() > 0) {
+                jdbcTemplate.execute("update u_information_query set pdf_url ='" + bladeFile.getLink() + "', name ='委托单'  where classify='1' and  wbs_id='" + groupId + "' and contract_id ='" + contractId + "'");
+            } else {
+                informationQueryClient.saveData(groupId.toString(), projectInfo.getId().toString(), contractId, "1", bladeFile.getLink(), "委托单");
+            }
+            return bladeFile.getLink();
+        }
+        return "操作失败";
+    }
+
 }
 }

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

@@ -3029,7 +3029,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
             //电签默认值
             //电签默认值
             if (defText.size() >= 1) {
             if (defText.size() >= 1) {
                 for (Element element : defText) {
                 for (Element element : defText) {
-                    reData.put(element.attr("id"), element.attr("defText"));
+                    reData.put(element.attr("keyName"), element.attr("defText"));
                 }
                 }
             }
             }
 
 

+ 8 - 3
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsFormElementServiceImpl.java

@@ -59,11 +59,11 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
     private final JdbcTemplate jdbcTemplate;
     private final JdbcTemplate jdbcTemplate;
 
 
     //元素字符串、数值、时间类型默认长度
     //元素字符串、数值、时间类型默认长度
-    public static final Integer DEFAULT_ELEMENT_LENGTH_VARCHAR = 250;
+    public static final Integer DEFAULT_ELEMENT_LENGTH_VARCHAR = 200;
     public static final Integer DEFAULT_ELEMENT_LENGTH_NUMBER = 50;
     public static final Integer DEFAULT_ELEMENT_LENGTH_NUMBER = 50;
     public static final Integer DEFAULT_ELEMENT_LENGTH_DATE = 50;
     public static final Integer DEFAULT_ELEMENT_LENGTH_DATE = 50;
     //实体表字段默认长度
     //实体表字段默认长度
-    private static final String ELEMENT_LENGTH_ENTITY = "250";
+    private static final String ELEMENT_LENGTH_ENTITY = "200";
 
 
     @Override
     @Override
     public IPage<WbsFormElementVO> selectWbsFormElementPage(IPage<WbsFormElementVO> page, WbsFormElementVO wbsFormElement) {
     public IPage<WbsFormElementVO> selectWbsFormElementPage(IPage<WbsFormElementVO> page, WbsFormElementVO wbsFormElement) {
@@ -101,10 +101,15 @@ public class WbsFormElementServiceImpl extends BaseServiceImpl<WbsFormElementMap
 
 
     private String createSQL(List<WbsFormElement> elementList) {
     private String createSQL(List<WbsFormElement> elementList) {
         StringBuilder sbr = new StringBuilder();
         StringBuilder sbr = new StringBuilder();
+        String datalengh =ELEMENT_LENGTH_ENTITY;
+        Integer data = (int) Math.floor(65000/3/elementList.size());
+        if(data< Func.toInt(ELEMENT_LENGTH_ENTITY)){
+            datalengh = data+"";
+        }
         for (WbsFormElement wbsFormElement : elementList) {
         for (WbsFormElement wbsFormElement : elementList) {
             //默认字段类型varchar 长度255
             //默认字段类型varchar 长度255
             sbr.append(wbsFormElement.getEKey());
             sbr.append(wbsFormElement.getEKey());
-            sbr.append(" ").append("varchar").append("(").append(ELEMENT_LENGTH_ENTITY).append(") ,\n");
+            sbr.append(" ").append("varchar").append("(").append(datalengh).append(") ,\n");
         }
         }
         return String.valueOf(sbr);
         return String.valueOf(sbr);
     }
     }

+ 13 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/service/impl/WbsTreePrivateServiceImpl.java

@@ -35,6 +35,7 @@ import org.springblade.manager.service.IElementFormulaMappingService;
 import org.springblade.manager.service.IFormulaService;
 import org.springblade.manager.service.IFormulaService;
 import org.springblade.manager.service.ITableInfoService;
 import org.springblade.manager.service.ITableInfoService;
 import org.springblade.manager.service.IWbsTreePrivateService;
 import org.springblade.manager.service.IWbsTreePrivateService;
+import org.springblade.manager.utils.FileUtils;
 import org.springblade.manager.vo.*;
 import org.springblade.manager.vo.*;
 import org.springblade.system.cache.ParamCache;
 import org.springblade.system.cache.ParamCache;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.BeanUtils;
@@ -2629,7 +2630,7 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
 
 
     @Override
     @Override
     public Object getExcelHtml(String primaryKeyId) throws Exception {
     public Object getExcelHtml(String primaryKeyId) throws Exception {
-        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String file_path = FileUtils.getSysLocalFileUrl();//ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         WbsTreePrivate wbsTreePrivate = baseMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
         WbsTreePrivate wbsTreePrivate = baseMapper.selectOne(Wrappers.<WbsTreePrivate>query().lambda()
                 .eq(WbsTreePrivate::getPKeyId, primaryKeyId));
                 .eq(WbsTreePrivate::getPKeyId, primaryKeyId));
@@ -2845,4 +2846,15 @@ public class WbsTreePrivateServiceImpl extends BaseServiceImpl<WbsTreePrivateMap
         System.out.println("总修改次数:"+total);
         System.out.println("总修改次数:"+total);
     }
     }
 
 
+    @Override
+    public int linkNodeTreeInfo(String pkeyId, String nodeIds) {
+        List<String> strList = Func.toStrList(nodeIds);
+        return baseMapper.linkNodeTreeInfo(pkeyId, strList);
+    }
+
+    @Override
+    public List<Long> linkNodeTreeBynodeId(String pkeyId) {
+        return baseMapper.linkNodeTreeBynodeId(pkeyId);
+    }
+
 }
 }

+ 1 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/utils/WbsElementUtil.java

@@ -57,7 +57,7 @@ public class WbsElementUtil {
                 case 1:  //字符串
                 case 1:  //字符串
                 case 7:  //文件
                 case 7:  //文件
                 case 6:  //签名
                 case 6:  //签名
-                    return "250";
+                    return "200";
                 case 2:  //整数
                 case 2:  //整数
                 case 5:  //数值
                 case 5:  //数值
                 case 3:  //小数
                 case 3:  //小数