liuyc 2 ani în urmă
părinte
comite
1cbe3bd7af

+ 9 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/vo/TrialDetectionDataVO.java

@@ -15,4 +15,13 @@ public class TrialDetectionDataVO extends TrialDetectionData {
     @ApiModelProperty(value = "是否关联选择过 0=否 1=是")
     private Integer isSelectedStatus;
 
+    @ApiModelProperty(value = "委托单附件URL名称")
+    private String delegationOrderUrlName;
+
+    @ApiModelProperty(value = "记录表附件URL名称")
+    private String recordTableUrlName;
+
+    @ApiModelProperty(value = "报告单附件URL名称")
+    private String reportAttachmentUrlName;
+
 }

+ 6 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -1211,6 +1211,9 @@ public class InformationWriteQueryController extends BladeController {
 
                 Map<String, String> queryMap = new HashMap<>();
                 queryList.forEach(query -> queryMap.put(query.getId().toString(), query.getName()));
+
+                boolean var = false;
+
                 try {
                     for (String id : ids) {
 
@@ -1264,16 +1267,17 @@ public class InformationWriteQueryController extends BladeController {
                                 String sql = "update u_trial_self_inspection_record set task_status = '待审批' where id = " + startTaskVO.getTrialSelfInspectionRecordId();
                                 jdbcTemplate.execute(sql);
                             }
+
+                            var = true;
                         }
                     }
 
-                    if (StringUtils.isNotEmpty(trialIds)) {
+                    if (StringUtils.isNotEmpty(trialIds) && var) {
                         //修改试验记录上报任务状态(批量上报)
                         String sql = "update u_trial_self_inspection_record set task_status = '待审批' where id in(" + trialIds + ")";
                         jdbcTemplate.execute(sql);
                     }
 
-
                 } catch (Exception e) {
                     e.printStackTrace();
                     return R.data(300, false, "上报失败");

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

@@ -159,7 +159,7 @@ public class TrialContainerController extends BladeController {
         response.reset();
         response.setContentType("application/vnd.ms-excel");
         response.setCharacterEncoding(org.apache.commons.codec.Charsets.UTF_8.name());
-        response.setHeader("Content-Disposition", "attachment;filename=" + sheetName + ".xlsx");
+        response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(sheetName + ".xlsx", "UTF-8") + "");
         OutputStream outputStream = response.getOutputStream();
         workbook.write(outputStream);
         outputStream.flush();

+ 12 - 9
blade-service/blade-business/src/main/java/org/springblade/business/controller/TrialDetectionController.java

@@ -161,15 +161,18 @@ public class TrialDetectionController extends BladeController {
         if (recordList.size() > 0) {
             return R.fail("只能删除未上报或已废除的试验记录信息,操作失败");
         }
-
-        String sql = "delete from u_trial_self_data_record where record_id in(" + ids + ");" +
-                "delete from u_trial_self_sample where self_id in(" + ids + ");" +
-                "delete from u_trial_raw_material_self_record where self_record_id in(" + ids + ");" +
-                "delete from u_trial_self_quality_project where self_id in(" + ids + ");" +
-                "delete from u_trial_self_inspection_record where id in(" + ids + ");" +
-                "delete from u_information_query where wbs_id in(" + ids + ") and type = 2;";
-        jdbcTemplate.execute(sql);
-
+        String sql1 = "delete from u_trial_self_data_record where record_id in(" + ids + ")";
+        jdbcTemplate.execute(sql1);
+        String sql2 = "delete from u_trial_self_sample where self_id in(" + ids + ")";
+        jdbcTemplate.execute(sql2);
+        String sql3 = "delete from u_trial_raw_material_self_record where self_record_id in(" + ids + ")";
+        jdbcTemplate.execute(sql3);
+        String sql4 = "delete from u_trial_self_quality_project where self_id in(" + ids + ")";
+        jdbcTemplate.execute(sql4);
+        String sql5 = "delete from u_trial_self_inspection_record where id in(" + ids + ")";
+        jdbcTemplate.execute(sql5);
+        String sql6 = "delete from u_information_query where wbs_id in(" + ids + ") and type = 2";
+        jdbcTemplate.execute(sql6);
         return R.status(true);
     }
 

+ 15 - 24
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialContainerClassificationServiceImpl.java

@@ -10,6 +10,7 @@ import org.springblade.business.mapper.TrialContainerClassificationMapper;
 import org.springblade.business.service.ITrialContainerClassificationService;
 import org.springblade.business.utils.BeanFieldUtils;
 import org.springblade.business.utils.ExcelUtils;
+import org.springblade.business.utils.ExcelUtils2;
 import org.springblade.business.vo.TrialContainerClassificationPageVO;
 import org.springblade.business.vo.TrialContainerClassificationVO;
 import org.springblade.common.utils.FileUtils;
@@ -25,7 +26,9 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -281,25 +284,15 @@ public class TrialContainerClassificationServiceImpl
         File convert = FileUtils.convert(file);
         String path = convert.getPath();
         try {
-            List<List<Map<String, Object>>> lists = ExcelUtils.importExcel(path, 1, 1, 1);
+            InputStream inputStream = new FileInputStream(convert);
             //获取第一行title
-            List<Object> titleName = new ArrayList<>();
-            for (List<Map<String, Object>> list : lists) {
-                for (Map<String, Object> row : list) {
-                    for (Map.Entry<String, Object> col : row.entrySet()) {
-                        titleName.add(col.getValue());
-                    }
-                    break;
-                }
-                break;
-            }
-
+            List<String> collect = new ArrayList<>();
+            List<Map<String, String>> maps = ExcelUtils2.readExcel(inputStream,collect);
             //根据title对应fieldName、构造fieldKeys
             List<TrialContainerClassification> fieldBeans = baseMapper.selectList(Wrappers.<TrialContainerClassification>lambdaQuery()
                     .eq(TrialContainerClassification::getContainerInitTabName, containerInitTabName)
                     .isNotNull(TrialContainerClassification::getFieldId)
             );
-            List<String> collect = titleName.stream().map(String::valueOf).collect(Collectors.toList());
             StringBuilder keys = new StringBuilder();
             for (TrialContainerClassification fieldBean : fieldBeans) {
                 for (String name : collect) {
@@ -312,18 +305,16 @@ public class TrialContainerClassificationServiceImpl
             String fieldKeys = keys.substring(0, keys.length() - 1);
 
             //解析构造插入数据
-            for (List<Map<String, Object>> list : lists) {
-                for (int i = 1; i < list.size(); i++) {
-                    StringBuilder values = new StringBuilder();
-                    for (Map.Entry<String, Object> col : list.get(i).entrySet()) {
-                        values.append("'").append(ObjectUtil.isNotEmpty(col.getValue()) ? col.getValue() : null).append("',");
-                    }
-                    //fieldValues
-                    String fieldValues = values.substring(0, values.length() - 1).replace("'null'", "null");
-
-                    //插入一行的数据
-                    baseMapper.insertData(containerInitTabName, SnowFlakeUtil.getId(), DateUtil.format(new Date(), "yyyy-MM-dd"), fieldKeys, fieldValues);
+            for (Map<String, String> map : maps) {
+                StringBuilder values = new StringBuilder();
+                for (Map.Entry<String, String> col : map.entrySet()) {
+                    values.append("'").append(ObjectUtil.isNotEmpty(col.getValue()) ? col.getValue() : null).append("',");
                 }
+                //fieldValues
+                String fieldValues = values.substring(0, values.length() - 1).replace("'null'", "null");
+
+                //插入一行的数据
+                baseMapper.insertData(containerInitTabName, SnowFlakeUtil.getId(), DateUtil.format(new Date(), "yyyy-MM-dd"), fieldKeys, fieldValues);
             }
         } catch (Exception e) {
             throw new ServiceException("导入时发生了异常,请检查excel模板格式是否与当前容器字段相对应");

+ 26 - 4
blade-service/blade-business/src/main/java/org/springblade/business/service/impl/TrialDetectionDataServiceImpl.java

@@ -31,6 +31,7 @@ import org.springblade.core.mp.utils.PageUtil;
 import org.springblade.core.tool.utils.*;
 import org.springblade.manager.entity.WbsTreeContract;
 import org.springblade.manager.entity.WbsTreePrivate;
+import org.springblade.resource.entity.Attach;
 import org.springblade.system.cache.ParamCache;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
@@ -41,6 +42,7 @@ import java.io.FileInputStream;
 import java.io.InputStream;
 import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.function.Function;
 import java.util.stream.Collectors;
 
 @Service
@@ -123,12 +125,32 @@ public class TrialDetectionDataServiceImpl extends BaseServiceImpl<TrialDetectio
             }
             IPage<TrialDetectionData> pages = this.page(page, queryWrapper.lambda().orderBy(true, false, TrialDetectionData::getCreateTime));
             List<TrialDetectionDataVO> trialDetectionDataVOS = BeanUtil.copyProperties(pages.getRecords(), TrialDetectionDataVO.class);
-
+            Map<String, Attach> fileMaps = jdbcTemplate.query("select link,original_name from blade_attach", new BeanPropertyRowMapper<>(Attach.class)).stream().collect(Collectors.toMap(Attach::getLink, Function.identity()));
+            List<String> list = new ArrayList<>();
             if (ObjectUtil.isNotEmpty(dto.getQualityTestPKeyId())) {
-                List<String> list = inspectionRecordMapper.selectSelectedStatusList(Long.parseLong(dto.getQualityTestPKeyId()), "2,3");
+                list = inspectionRecordMapper.selectSelectedStatusList(Long.parseLong(dto.getQualityTestPKeyId()), "2,3");
+            }
+            for (TrialDetectionDataVO trialDetectionDataVO : trialDetectionDataVOS) {
+                if (StringUtils.isNotEmpty(trialDetectionDataVO.getDelegationOrderUrl())) {
+                    Attach attach = fileMaps.get(trialDetectionDataVO.getDelegationOrderUrl());
+                    if (attach != null) {
+                        trialDetectionDataVO.setDelegationOrderUrlName(StringUtils.isNotEmpty(attach.getOriginalName()) ? attach.getOriginalName() : "");
+                    }
+                }
+                if (StringUtils.isNotEmpty(trialDetectionDataVO.getRecordTableUrl())) {
+                    Attach attach = fileMaps.get(trialDetectionDataVO.getRecordTableUrl());
+                    if (attach != null) {
+                        trialDetectionDataVO.setRecordTableUrlName(StringUtils.isNotEmpty(attach.getOriginalName()) ? attach.getOriginalName() : "");
+                    }
+                }
+                if (StringUtils.isNotEmpty(trialDetectionDataVO.getReportAttachmentUrl())) {
+                    Attach attach = fileMaps.get(trialDetectionDataVO.getReportAttachmentUrl());
+                    if (attach != null) {
+                        trialDetectionDataVO.setReportAttachmentUrlName(StringUtils.isNotEmpty(attach.getOriginalName()) ? attach.getOriginalName() : "");
+                    }
+                }
 
-                //是否关联过
-                for (TrialDetectionDataVO trialDetectionDataVO : trialDetectionDataVOS) {
+                if (list.size() > 0) {
                     for (String recordId : list) {
                         if (trialDetectionDataVO.getId().toString().equals(recordId)) {
                             trialDetectionDataVO.setIsSelectedStatus(1);

+ 82 - 0
blade-service/blade-business/src/main/java/org/springblade/business/utils/ExcelUtils2.java

@@ -0,0 +1,82 @@
+package org.springblade.business.utils;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.*;
+
+import org.apache.poi.ss.usermodel.*;
+
+public class ExcelUtils2 {
+
+    /**
+     * 读取 Excel 文件中指定范围内的数据,并封装为 List 返回。
+     *
+     * @return List<Map < String, Object>> 包含读取到的数据的 List
+     * @throws IOException
+     */
+    public static List<Map<String, String>> readExcel(InputStream is, List<String> titles) throws Exception {
+        Workbook workbook = WorkbookFactory.create(is);
+        Sheet sheet = workbook.getSheetAt(0);
+        if (sheet == null) {
+            throw new IllegalArgumentException("Excel 文件中没有 Sheet");
+        }
+
+        int firstRowIndex = sheet.getFirstRowNum();  //获取第一行的行号
+        int lastRowIndex = sheet.getLastRowNum();    //获取最后一行的行号
+
+        Row firstRow = sheet.getRow(firstRowIndex); // 获取第一行
+        int firstColIndex = firstRow.getFirstCellNum();   //获取第一列的列号
+        int lastColIndex = firstRow.getLastCellNum() - 1; //获取最后一列的列号
+
+        for (int j = firstColIndex; j <= lastColIndex; j++) {
+            Cell cell = firstRow.getCell(j);
+            if (cell != null) {
+                cell.setCellType(CellType.STRING);
+                String title = cell.getStringCellValue().trim();
+                titles.add(title);
+            }
+        }
+
+        List<Map<String, String>> list = new ArrayList<>();
+        for (int i = firstRowIndex + 1; i <= lastRowIndex; i++) {
+            Row row = sheet.getRow(i);
+            if (row == null) {
+                continue;
+            }
+
+            Map<String, String> map = new LinkedHashMap<>();
+            for (int j = firstColIndex; j <= lastColIndex; j++) {
+                Cell cell = row.getCell(j);
+                cell.setCellType(CellType.STRING);
+                String value = getCellValue(cell);
+                String key = titles.get(j - firstColIndex);
+                map.put(key, value);
+            }
+            list.add(map);
+        }
+
+        return list;
+    }
+
+
+    /**
+     * 获取单元格的值,并将其转换为字符串类型
+     */
+    private static String getCellValue(Cell cell) {
+        if (cell == null) {
+            return "";
+        }
+        if (cell.getCellTypeEnum().equals(CellType.NUMERIC)) {
+            return String.valueOf(cell.getNumericCellValue());
+        } else if (cell.getCellTypeEnum().equals(CellType.STRING)) {
+            return String.valueOf(cell.getStringCellValue());
+        } else if (cell.getCellTypeEnum().equals(CellType.BOOLEAN)) {
+            return String.valueOf(cell.getBooleanCellValue());
+        } else {
+            return "";
+        }
+    }
+
+}
+
+

+ 13 - 5
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/ExcelTabController.java

@@ -717,8 +717,9 @@ public class ExcelTabController extends BladeController {
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pkeyId", value = "pkeyId", required = true)
     })
-    public R getExcelHtml(Long pkeyId) throws IOException, InterruptedException {
-
+    public R getExcelHtml(Long pkeyId) throws Exception {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         Thread.sleep(200);
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(pkeyId);
         if (wbsTreePrivate == null) {
@@ -728,9 +729,16 @@ public class ExcelTabController extends BladeController {
             return R.fail("请上传清表!");
         }
 
-        File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
-//        File file1 = ResourceUtil.getFile("D:\\develop\\1625742323381960704.html");
-        FileInputStream fileInputStream = new FileInputStream(file1);
+        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);
 
         // 远程搜索配置

+ 36 - 11
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/TextdictInfoController.java

@@ -33,7 +33,11 @@ import org.jsoup.Jsoup;
 import org.jsoup.nodes.Document;
 import org.jsoup.nodes.Element;
 import org.jsoup.select.Elements;
+import org.springblade.common.constant.CommonConstant;
+import org.springblade.common.utils.CommonUtil;
+import org.springblade.common.utils.FileUtils;
 import org.springblade.common.utils.SnowFlakeUtil;
+import org.springblade.common.utils.SystemUtils;
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
@@ -48,6 +52,7 @@ import org.springblade.manager.service.impl.WbsTreePrivateServiceImpl;
 import org.springblade.manager.vo.TextdictBy345VO;
 import org.springblade.manager.vo.TextdictDataInfoVO;
 import org.springblade.manager.vo.TextdictInfo_vo;
+import org.springblade.system.cache.ParamCache;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.JdbcTemplate;
 import org.springframework.web.bind.annotation.*;
@@ -57,10 +62,7 @@ import org.springblade.manager.vo.TextdictInfoVO;
 import org.springblade.manager.service.ITextdictInfoService;
 import org.springblade.core.boot.ctrl.BladeController;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
+import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -231,14 +233,24 @@ public class TextdictInfoController extends BladeController {
     @PostMapping("/saveTextInfo")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "新增或修改", notes = "传入textdictInfo")
-    public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws FileNotFoundException, InterruptedException {
-
+    public R saveTextInfo(@Valid @RequestBody TextdictDataInfoVO textdictInfo) throws Exception {
+        String file_path = ParamCache.getValue(CommonConstant.SYS_LOCAL_URL);
+        String sys_file_net_url = ParamCache.getValue(CommonConstant.SYS_FILE_NET_URL);
         // 获取 节点信息
         WbsTreePrivate wbsTreePrivate = wbsTreePrivateMapper.getByPKeyId(textdictInfo.getTableId());
 
         // 读取html页面信息
-        File file1 = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
-        String htmlString = IoUtil.readToString(new FileInputStream(file1));
+        String path = "";
+        String fileUrl = wbsTreePrivate.getHtmlUrl();
+        File file1 = ResourceUtil.getFile(fileUrl);
+        InputStream fileInputStream;
+        if (file1.exists()) {
+            fileInputStream = new FileInputStream(file1);
+        } else {
+            path = sys_file_net_url + fileUrl.replaceAll("//", "/").replaceAll(file_path, "");
+            fileInputStream = CommonUtil.getOSSInputStream(path);
+        }
+        String htmlString = IoUtil.readToString(fileInputStream);
         // 样式集合
         Document doc = Jsoup.parse(htmlString);
 
@@ -323,14 +335,27 @@ public class TextdictInfoController extends BladeController {
             element.empty().append("<el-date-picker @keyDowns='dateKeydown()' v-model=" + vmode + " type='datetimerange' range-separator='/' placeholder=" + placeholder + "  start-placeholder='开始日期'  end-placeholder='结束日期' format='YYYY年MM月DD日' trIndex=" + trindex + " keyname=" + keyname + " weighing=" + weighing + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + ">");
             element.children().get(0).attr("@change", "datePickerChange($event,'" + keyname + "')");
 
-        } else if (textdictInfo.getTextId().equals("img")) {
+        } else if (textdictInfo.getTextId().equals("img")) { //图片
             element.empty().append("<hc-table-form-upload @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight'  :src='" + vmode + "' placeholder=" + placeholder + " v-model=" + vmode + "  keyName=" + keyname + " weighing=" + weighing + "  @success='formUploadSuccess' @del='delTableFormFile' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + "></hc-table-form-upload> ");
+            element.removeAttr("style");
         } else if (textdictInfo.getTextId().equals("searchSelect")) { //搜索框
             element.empty().append("<hc-form-select-search id=" + keyname + " @keydown.shift.up='keyupShiftUp' @keydown.shift.down='keyupShiftDown' @keydown.shift.left='keyupShiftLeft' @keydown.shift.right='keyupShiftRight' type='dap_site_data' :val=" + vmode + " contractId=''  pkeyId='' @change='formRemoteChange' v-model=" + vmode + " placeholder=" + placeholder + " keyname=" + keyname + " weighing=" + weighing + "  @contextmenu.prevent.native='contextmenuClick(" + parm + ")'  @mouseup.right='RightClick(" + parm + ")' trIndex=" + trindex + " tdIndex=" + tdindex + "  x1=" + x1 + " x2=" + x2 + " y1=" + y1 + " y2=" + y2 + " style='width:100%;height:100%' > </hc-form-select-search>");
         }
         element.attr("@click", "getInformation(" + oncklickText + ")");
-        File writefile = new File(wbsTreePrivate.getHtmlUrl());
-        FileUtil.writeToFile(writefile, doc.html(), Boolean.parseBoolean("UTF-8"));
+
+        File writeFile = ResourceUtil.getFile(wbsTreePrivate.getHtmlUrl());
+        if (!writeFile.exists()) {
+            if (StringUtils.isNotEmpty(path)) {
+                File file = new File(path);
+                if (!file.exists()) {
+                    file.mkdirs();
+                }
+                FileUtil.writeToFile(file, doc.html(), Boolean.parseBoolean("UTF-8"));
+            }
+        } else {
+            FileUtil.writeToFile(writeFile, doc.html(), Boolean.parseBoolean("UTF-8"));
+        }
+
         Thread.sleep(300);
 
         // 清空相关的保存数据

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

@@ -13,7 +13,6 @@ import com.mixsmart.utils.FormulaUtils;
 import com.mixsmart.utils.ListUtils;
 import com.mixsmart.utils.RegexUtils;
 import com.spire.xls.CellRange;
-import com.spire.xls.Workbook;
 import com.spire.xls.*;
 import lombok.AllArgsConstructor;
 import org.apache.commons.collections4.CollectionUtils;
@@ -23,6 +22,7 @@ import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.usermodel.CellStyle;
 import org.apache.poi.ss.usermodel.Font;
 import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.util.IOUtils;
 import org.jsoup.Jsoup;
@@ -432,15 +432,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             currentNode.setWbsId(Long.parseLong(wtc.getWbsId()));
             currentNode.setId(StringUtils.isNotEmpty(wtc.getOldId()) ? Long.valueOf(wtc.getOldId()) : wtc.getId());
             currentNode.setRelateId(wtc.getId());
-            currentNode.setPrivateId(this.jdbcTemplate.queryForObject("select p_key_id from m_wbs_tree_private where id=" + currentNode.getId() + " and  project_id=" + wtc.getProjectId() + " and wbs_id=" + wtc.getWbsId() +" limit 1", Long.class));
+            currentNode.setPrivateId(this.jdbcTemplate.queryForObject("select p_key_id from m_wbs_tree_private where id=" + currentNode.getId() + " and  project_id=" + wtc.getProjectId() + " and wbs_id=" + wtc.getWbsId() + " limit 1", Long.class));
             return currentNode;
         }
         return null;
     }
 
 
-
-
     public <T extends BaseEntity> CurrentNode createCurrentNode(T entity) {
         if (entity instanceof WbsTreeContract) {
             WbsTreeContract wtc = (WbsTreeContract) entity;
@@ -451,7 +449,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
             currentNode.setWbsId(Long.parseLong(wtc.getWbsId()));
             currentNode.setId(StringUtils.isNotEmpty(wtc.getOldId()) ? Long.valueOf(wtc.getOldId()) : wtc.getId());
             currentNode.setRelateId(wtc.getId());
-            currentNode.setPrivateId(this.jdbcTemplate.queryForObject("select p_key_id from m_wbs_tree_private where id=" + currentNode.getId() + " and  project_id=" + wtc.getProjectId() + " and wbs_id=" + wtc.getWbsId() +" limit 1", Long.class));
+            currentNode.setPrivateId(this.jdbcTemplate.queryForObject("select p_key_id from m_wbs_tree_private where id=" + currentNode.getId() + " and  project_id=" + wtc.getProjectId() + " and wbs_id=" + wtc.getWbsId() + " limit 1", Long.class));
             return currentNode;
         } else if (entity instanceof WbsTreePrivate) {
             WbsTreePrivate wtc = (WbsTreePrivate) entity;
@@ -2268,7 +2266,10 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                             Object obj = DataInfo.get(val);
                                             if (obj instanceof String[]) {
                                                 String[] dataDate = (String[]) obj;
-                                                myData = dataDate[0] + "-" + dataDate[1].trim();
+                                                myData = dataDate[0].trim() + "-" + dataDate[1].trim();
+                                                if (dataDate[0].trim().equals(dataDate[1].trim())) {
+                                                    myData = dataDate[0];
+                                                }
                                             }
                                         }
 
@@ -2276,11 +2277,12 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                         //http:bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20220819/b53cb6700db369381e3b03d7737bcdec.jpg__16_1 可能是http
                                         if (myData.contains("http") && myData.contains("aliyuncs")) {
                                             InputStream imageIn = CommonUtil.getOSSInputStream(myData);
-                                            byte[] byteNew = IOUtils.toByteArray(imageIn);
-                                            byte[] bytesNew = CommonUtil.compressImage(byteNew);
+                                            byte[] byteNew = new byte[0];
+                                            if (imageIn != null) {
+                                                byteNew = IOUtils.toByteArray(imageIn);
+                                            }
 
-                                            // 这里根据实际需求选择图片类型
-                                            int pictureIdx = workbook.addPicture(bytesNew, 6);
+                                            byte[] bytes = CommonUtil.compressImage(byteNew);
 
                                             CreationHelper helper = workbook.getCreationHelper();
                                             ClientAnchor anchor = helper.createClientAnchor();
@@ -2292,8 +2294,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
                                             Drawing<?> drawing = sheet.createDrawingPatriarch();
                                             anchor.setAnchorType(ClientAnchor.AnchorType.MOVE_AND_RESIZE);
                                             // 插入图片
-                                            Picture pict = drawing.createPicture(anchor, pictureIdx); // 调整图片占单元格百分比的大小,1.0就是100%
-                                            pict.resize(1, 1);
+                                            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")) {