فهرست منبع

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectTaskManagerImpl.java
赵越越 1 ماه پیش
والد
کامیت
f931da43ea
28فایلهای تغییر یافته به همراه1459 افزوده شده و 125 حذف شده
  1. 1 1
      assembly/src/main/resources/application-dev.yml
  2. 5 2
      assistMg/src/main/java/com/hotent/baseInfo/manager/impl/CostDocumentTemplateFileManagerImpl.java
  3. 192 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/controller/opinion/CostAuditTaskInfoController.java
  4. 42 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/dao/CostSurveyTemplateUploadDataDao.java
  5. 68 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/manager/CostSurveyTemplateUploadDataManager.java
  6. 149 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/manager/impl/CostSurveyTemplateUploadDataManagerImpl.java
  7. 217 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/model/CostSurveyTemplateUploadData.java
  8. 24 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/req/CostSurveyTemplateUploadDataQueryReq.java
  9. 30 0
      assistMg/src/main/java/com/hotent/enterpriseDeclare/req/CostSurveyTemplateUploadDataReq.java
  10. 38 0
      assistMg/src/main/java/com/hotent/project/controller/CostProjectDocumentController.java
  11. 1 1
      assistMg/src/main/java/com/hotent/project/manager/CostNoticeManager.java
  12. 5 0
      assistMg/src/main/java/com/hotent/project/manager/CostProjectDocumentFileManager.java
  13. 2 0
      assistMg/src/main/java/com/hotent/project/manager/CostProjectDocumentManager.java
  14. 4 3
      assistMg/src/main/java/com/hotent/project/manager/impl/CostNoticeManagerImpl.java
  15. 26 14
      assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectApprovalManagerImpl.java
  16. 8 7
      assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentFileManagerImpl.java
  17. 52 7
      assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentManagerImpl.java
  18. 40 76
      assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectTaskManagerImpl.java
  19. 10 0
      assistMg/src/main/java/com/hotent/project/model/CostNotice.java
  20. 2 0
      assistMg/src/main/java/com/hotent/project/req/CostProjectNoticePageReq.java
  21. 25 0
      assistMg/src/main/java/com/hotent/surveyinfo/dao/CostSurveyTemplateUploadDao.java
  22. 24 0
      assistMg/src/main/java/com/hotent/surveyinfo/manager/CostSurveyTemplateUploadManager.java
  23. 27 0
      assistMg/src/main/java/com/hotent/surveyinfo/manager/impl/CostSurveyTemplateUploadManagerImpl.java
  24. 273 0
      assistMg/src/main/java/com/hotent/surveyinfo/model/CostSurveyTemplateUpload.java
  25. 4 4
      assistMg/src/main/java/com/hotent/util/FileUploadUtil.java
  26. 11 10
      assistMg/src/main/java/com/hotent/util/wordexcelutils/DocumentProcessorExample.java
  27. 88 0
      assistMg/src/main/resources/mapper/CostSurveyTemplateUploadDataMapper.xml
  28. 91 0
      assistMg/src/main/resources/mapper/CostSurveyTemplateUploadMapper.xml

+ 1 - 1
assembly/src/main/resources/application-dev.yml

@@ -198,4 +198,4 @@ third:
 
 assistmg:
   profile: /home/eip/uploadPath
-  imgUrl: http://116.204.117.33:9056
+  imgUrl: http://116.204.117.33:9506

+ 5 - 2
assistMg/src/main/java/com/hotent/baseInfo/manager/impl/CostDocumentTemplateFileManagerImpl.java

@@ -2,6 +2,7 @@ package com.hotent.baseInfo.manager.impl;
 
 import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.hotent.base.util.StringUtil;
 import com.hotent.baseInfo.model.CostDocumentTemplateFile;
 import com.hotent.baseInfo.dao.CostDocumentTemplateFileDao;
 import com.hotent.baseInfo.manager.CostDocumentTemplateFileManager;
@@ -54,8 +55,10 @@ public class CostDocumentTemplateFileManagerImpl extends BaseManagerImpl<CostDoc
         QueryWrapper<CostDocumentTemplateFile> eq = new QueryWrapper<CostDocumentTemplateFile>().eq("document_id", documentId);
         for (CostDocumentTemplateFile costProjectDocumentFile : documentFileList) {
             try {
-                //获取whereValue字段值
-                costProjectDocumentFile.setDataValue(this.baseMapper.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereValue(),whereValue));
+                if (StringUtil.isNotEmpty(costProjectDocumentFile.getTableName())){
+                    //获取whereValue字段值
+                    costProjectDocumentFile.setDataValue(this.baseMapper.getColValue(costProjectDocumentFile.getTableName(), costProjectDocumentFile.getColName(), costProjectDocumentFile.getWhereValue(),whereValue));
+                }
             } catch (Exception e) {
                 throw new BaseException("获取字段失败:" + costProjectDocumentFile.getColName());
             }

+ 192 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/controller/opinion/CostAuditTaskInfoController.java

@@ -0,0 +1,192 @@
+package com.hotent.enterpriseDeclare.controller.opinion;
+
+
+import com.hotent.base.annotation.ApiGroup;
+import com.hotent.base.constants.ApiGroupConsts;
+import com.hotent.base.model.CommonResult;
+import com.hotent.base.util.StringUtil;
+import com.hotent.enterpriseDeclare.manager.CostSurveyTemplateUploadDataManager;
+import com.hotent.enterpriseDeclare.model.CostSurveyTemplateUploadData;
+import com.hotent.surveyinfo.dao.CostSurveyTemplateItemsDao;
+import com.hotent.surveyinfo.manager.CostSurveyTemplateHeadersManager;
+import com.hotent.surveyinfo.manager.CostSurveyTemplateUploadManager;
+import com.hotent.surveyinfo.manager.CostSurveyTemplateVersionManager;
+import com.hotent.surveyinfo.model.CostSurveyTemplateHeaders;
+import com.hotent.surveyinfo.model.CostSurveyTemplateItems;
+import com.hotent.surveyinfo.model.CostSurveyTemplateUpload;
+import com.hotent.surveyinfo.model.CostSurveyTemplateVersion;
+import com.hotent.surveyinfo.model.dto.CostItemData;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Api(tags = "成本监审任务填报")
+@RestController
+@RequestMapping("/api/enterprise/castTaskInfo")
+@ApiGroup(group = {ApiGroupConsts.GROUP_COST})
+public class CostAuditTaskInfoController {
+
+
+    @Autowired
+    private CostSurveyTemplateUploadManager costSurveyTemplateUploadManager;
+
+    @Autowired
+    private CostSurveyTemplateItemsDao costSurveyTemplateItemsDao;
+
+    @Autowired
+    private CostSurveyTemplateVersionManager costSurveyTemplateVersionManager;
+
+    @Autowired
+    private CostSurveyTemplateHeadersManager costSurveyTemplateHeadersManager;
+
+    @Autowired
+    private CostSurveyTemplateUploadDataManager costSurveyTemplateUploadDataManager;
+
+    /**
+     * 企业报送-成本申报表-列表
+     * @param catalogId 监管目录ID
+     * @return 上传记录列表(包含是否必填、是否上传等信息)
+     * @throws Exception
+     */
+    @GetMapping(value="/listUploadByCatalogId")
+    @ApiOperation(value="根据监管目录ID查询成本调查表模板上传记录列表", httpMethod = "GET", notes = "根据监管目录ID查询成本调查表模板上传记录列表,包含是否必填、是否上传等信息")
+    public CommonResult<List<CostSurveyTemplateUpload>> listUploadByCatalogId(
+            @ApiParam(name="catalogId", value="监管目录ID", required = true)
+            @RequestParam String catalogId) throws Exception {
+
+        List<CostSurveyTemplateUpload> uploadList = costSurveyTemplateUploadManager.listByCatalogId(catalogId);
+
+        return CommonResult.<List<CostSurveyTemplateUpload>>ok().value(uploadList);
+    }
+
+    /**
+     * 企业报送-成本申报表-在线填报所需字段
+     * @param surveyTemplateId 成本调查表id
+     * @return 指标项数据列表(带key-value拼接)
+     */
+    @GetMapping(value = "/listItemsByCurrentTemplateId")
+    @ApiOperation(value = "根据成本调查表现行模板id获取所有指标数据", httpMethod = "GET", notes = "根据成本调查表现行模板id获取所有指标数据(带key-value拼接)")
+    public CommonResult<CostItemData> listItemsByCurrentTemplateId(
+            @ApiParam(name = "surveyTemplateId", value = "关联的成本调查表ID", required = true)
+            @RequestParam(required = true) String surveyTemplateId) throws Exception
+    {
+
+        //根据模板id 查询历史版本是现行的版本信息
+        CostSurveyTemplateVersion versiontemplate = costSurveyTemplateVersionManager.selectCurrentVersion(surveyTemplateId);
+        if (versiontemplate == null) {
+            return CommonResult.<CostItemData>ok().value(new CostItemData());
+        }
+
+        List<CostSurveyTemplateItems> items = costSurveyTemplateItemsDao.selectBySurveyTemplateIdAndVersion(surveyTemplateId, versiontemplate.getId());
+        List<CostSurveyTemplateHeaders> headlist = costSurveyTemplateHeadersManager.listVisibleBySurveyTemplateIdAndVersion(surveyTemplateId, versiontemplate.getId());
+        String filename = headlist.stream().map(CostSurveyTemplateHeaders::getFieldName).collect(Collectors.joining(","));
+        String filenids = headlist.stream().map(CostSurveyTemplateHeaders::getId).collect(Collectors.joining(","));
+
+        // 按 orderNum 分组
+        Map<Integer, List<CostSurveyTemplateItems>> groupedByHeadersId = items.stream()
+                .collect(Collectors.groupingBy(CostSurveyTemplateItems::getOrderNum));
+
+        List<Map<String, String>> result = new ArrayList<>();
+
+        for (Map.Entry<Integer, List<CostSurveyTemplateItems>> entry : groupedByHeadersId.entrySet()) {
+            List<CostSurveyTemplateItems> group = entry.getValue();
+            if (group.isEmpty()) continue;
+
+            // 主项(可以取第一个)
+            CostSurveyTemplateItems mainItem = group.get(0);
+
+            String headersIds = "";
+            String itemIds = "";
+            // 构造 key-value 映射
+            Map<String, String> keyValueMap = new HashMap<>();
+            for (CostSurveyTemplateItems item : group) {
+                if (item.getRkey() != null && item.getRvalue() != null) {
+                    keyValueMap.put(item.getRkey(), item.getRvalue());
+                    headersIds += item.getHeadersId() + ",";
+                    itemIds += item.getId() + ",";
+                }
+            }
+            if (!StringUtil.isEmpty(headersIds))
+                headersIds = headersIds.substring(0, headersIds.length() - 1);
+
+            if (!StringUtil.isEmpty(itemIds))
+                itemIds = itemIds.substring(0, itemIds.length() - 1);
+
+            //mainItem 放入到keyValueMap中 除了 key value 这两个字段
+            keyValueMap.put("id", mainItem.getId());
+            keyValueMap.put("surveyTemplateId", mainItem.getSurveyTemplateId());
+            keyValueMap.put("versionId", mainItem.getVersionId());
+            keyValueMap.put("headersId", mainItem.getHeadersId());
+            keyValueMap.put("cellCode", mainItem.getCellCode());
+            keyValueMap.put("calculationFormula", mainItem.getCalculationFormula());
+            keyValueMap.put("unit", mainItem.getUnit());
+            keyValueMap.put("orderNum", mainItem.getOrderNum().toString());
+            keyValueMap.put("jsonStr", mainItem.getJsonStr());
+            keyValueMap.put("headersIds", headersIds);
+            keyValueMap.put("itemIds", itemIds);
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+            keyValueMap.put("createTime", mainItem.getCreateTime() != null ? mainItem.getCreateTime().format(formatter) : null);
+            keyValueMap.put("updateTime", mainItem.getUpdateTime() != null ? mainItem.getUpdateTime().format(formatter) : null);
+            keyValueMap.put("createBy", mainItem.getCreateBy());
+            keyValueMap.put("updateBy", mainItem.getUpdateBy());
+            keyValueMap.put("projectId", mainItem.getProjectId());
+            keyValueMap.put("orderText", mainItem.getOrderText());
+            keyValueMap.put("calculationTemplateId", mainItem.getCalculationTemplateId());
+            keyValueMap.put("rowid", mainItem.getRowid());
+            keyValueMap.put("parentid", mainItem.getParentid());
+
+            result.add(keyValueMap);
+        }
+        CostItemData data = new CostItemData();
+        data.setFixedFields(filename); // 存储动态字段名
+        data.setItemlist(result);
+        data.setFixedFieldids(filenids);
+        return CommonResult.<CostItemData>ok().value(data);
+    }
+
+    /**
+     * 企业报送-成本申报表-在线填报保持
+     * @param dataList 数据列表(实体类列表,包含uploadId、auditedUnitId、rowid、rkey、rvalue等字段)
+     * @return 保存结果
+     */
+    @PostMapping(value = "/saveUploadData")
+    @ApiOperation(value = "保存成本调查表模板上传数据", httpMethod = "POST", notes = "保存成本调查表模板上传数据,直接使用实体类列表")
+    public CommonResult<String> saveUploadData(
+            @ApiParam(name = "dataList", value = "数据列表", required = true)
+            @RequestBody List<CostSurveyTemplateUploadData> dataList) throws Exception {
+
+        if (dataList == null || dataList.isEmpty()) {
+            return CommonResult.<String>error().message("数据列表不能为空");
+        }
+
+
+        costSurveyTemplateUploadDataManager.saveData(dataList);
+        return CommonResult.<String>ok().message("保存数据成功");
+    }
+
+    /**
+     * 企业报送-成本申报表-在线填报记录查看
+     * @param queryData 查询条件(实体类,包含uploadId和auditedUnitId)
+     * @return 数据列表(实体类列表)
+     */
+    @PostMapping(value = "/getUploadData")
+    @ApiOperation(value = "查询成本调查表模板上传数据", httpMethod = "POST", notes = "查询成本调查表模板上传数据,返回实体类列表")
+    public CommonResult<List<CostSurveyTemplateUploadData>> getUploadData(
+            @ApiParam(name = "queryData", value = "查询条件", required = true)
+            @RequestBody CostSurveyTemplateUploadData queryData) throws Exception {
+
+        if (queryData == null || StringUtil.isEmpty(queryData.getUploadId()) || StringUtil.isEmpty(queryData.getAuditedUnitId())) {
+            return CommonResult.<List<CostSurveyTemplateUploadData>>error().message("uploadId和auditedUnitId不能为空");
+        }
+
+        List<CostSurveyTemplateUploadData> dataList = costSurveyTemplateUploadDataManager.listByUploadIdAndAuditedUnitId(queryData.getUploadId(), queryData.getAuditedUnitId());
+        return CommonResult.<List<CostSurveyTemplateUploadData>>ok().value(dataList);
+    }
+}
+

+ 42 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/dao/CostSurveyTemplateUploadDataDao.java

@@ -0,0 +1,42 @@
+package com.hotent.enterpriseDeclare.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.hotent.enterpriseDeclare.model.CostSurveyTemplateUploadData;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 成本调查表模板上传数据表 Mapper 接口
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+public interface CostSurveyTemplateUploadDataDao extends BaseMapper<CostSurveyTemplateUploadData> {
+    
+    /**
+     * 根据上传记录ID查询数据列表
+     * @param uploadId 上传记录ID
+     * @return 数据列表
+     */
+    List<CostSurveyTemplateUploadData> selectByUploadId(@Param("uploadId") String uploadId);
+    
+    /**
+     * 根据上传记录ID和企业ID查询数据列表
+     * @param uploadId 上传记录ID
+     * @param auditedUnitId 企业ID
+     * @return 数据列表
+     */
+    List<CostSurveyTemplateUploadData> selectByUploadIdAndAuditedUnitId(
+            @Param("uploadId") String uploadId,
+            @Param("auditedUnitId") String auditedUnitId);
+    
+    /**
+     * 根据行数据ID查询数据列表
+     * @param rowid 行数据ID
+     * @return 数据列表
+     */
+    List<CostSurveyTemplateUploadData> selectByRowid(@Param("rowid") String rowid);
+}
+

+ 68 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/manager/CostSurveyTemplateUploadDataManager.java

@@ -0,0 +1,68 @@
+package com.hotent.enterpriseDeclare.manager;
+
+import com.hotent.base.manager.BaseManager;
+import com.hotent.enterpriseDeclare.model.CostSurveyTemplateUploadData;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 成本调查表模板上传数据表 服务类
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+public interface CostSurveyTemplateUploadDataManager extends BaseManager<CostSurveyTemplateUploadData> {
+    
+    /**
+     * 根据主键获取详情
+     * @param id
+     * @return
+     */
+    CostSurveyTemplateUploadData getDetail(String id);
+    
+    /**
+     * 新建、更新数据
+     * @param costSurveyTemplateUploadData
+     */
+    void createOrUpdate(CostSurveyTemplateUploadData costSurveyTemplateUploadData);
+    
+    /**
+     * 根据上传记录ID查询数据列表
+     * @param uploadId 上传记录ID
+     * @return 数据列表
+     */
+    List<CostSurveyTemplateUploadData> listByUploadId(String uploadId);
+    
+    /**
+     * 根据上传记录ID和企业ID查询数据列表
+     * @param uploadId 上传记录ID
+     * @param auditedUnitId 企业ID
+     * @return 数据列表
+     */
+    List<CostSurveyTemplateUploadData> listByUploadIdAndAuditedUnitId(String uploadId, String auditedUnitId);
+    
+    /**
+     * 根据行数据ID查询数据列表
+     * @param rowid 行数据ID
+     * @return 数据列表
+     */
+    List<CostSurveyTemplateUploadData> listByRowid(String rowid);
+    
+    /**
+     * 保存数据(直接使用实体类列表,实体类中包含uploadId和auditedUnitId)
+     * @param dataList 数据列表(实体类列表)
+     */
+    void saveData(List<CostSurveyTemplateUploadData> dataList);
+    
+
+
+    
+    /**
+     * 根据上传记录ID删除数据
+     * @param uploadId 上传记录ID
+     */
+    void deleteByUploadId(String uploadId);
+}
+

+ 149 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/manager/impl/CostSurveyTemplateUploadDataManagerImpl.java

@@ -0,0 +1,149 @@
+package com.hotent.enterpriseDeclare.manager.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.hotent.base.manager.impl.BaseManagerImpl;
+import com.hotent.base.util.StringUtil;
+import com.hotent.enterpriseDeclare.dao.CostSurveyTemplateUploadDataDao;
+import com.hotent.enterpriseDeclare.manager.CostSurveyTemplateUploadDataManager;
+import com.hotent.enterpriseDeclare.model.CostSurveyTemplateUploadData;
+import com.hotent.surveyinfo.manager.CostSurveyTemplateUploadManager;
+import com.hotent.surveyinfo.model.CostSurveyTemplateUpload;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * 成本调查表模板上传数据表 服务实现类
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+@Service
+public class CostSurveyTemplateUploadDataManagerImpl extends BaseManagerImpl<CostSurveyTemplateUploadDataDao, CostSurveyTemplateUploadData> implements CostSurveyTemplateUploadDataManager {
+
+    @Autowired
+    private CostSurveyTemplateUploadDataDao costSurveyTemplateUploadDataDao;
+
+    @Autowired
+    private CostSurveyTemplateUploadManager costSurveyTemplateUploadManager;
+
+    @Override
+    public CostSurveyTemplateUploadData getDetail(String id) {
+        CostSurveyTemplateUploadData data = this.get(id);
+        return data;
+    }
+
+    @Override
+    @Transactional
+    public void createOrUpdate(CostSurveyTemplateUploadData costSurveyTemplateUploadData) {
+        //新建或更新
+        this.saveOrUpdate(costSurveyTemplateUploadData);
+    }
+
+    @Override
+    public List<CostSurveyTemplateUploadData> listByUploadId(String uploadId) {
+        return costSurveyTemplateUploadDataDao.selectByUploadId(uploadId);
+    }
+
+    @Override
+    public List<CostSurveyTemplateUploadData> listByUploadIdAndAuditedUnitId(String uploadId, String auditedUnitId) {
+        return costSurveyTemplateUploadDataDao.selectByUploadIdAndAuditedUnitId(uploadId, auditedUnitId);
+    }
+
+    @Override
+    public List<CostSurveyTemplateUploadData> listByRowid(String rowid) {
+        return costSurveyTemplateUploadDataDao.selectByRowid(rowid);
+    }
+
+    @Override
+    @Transactional
+    public void saveData(List<CostSurveyTemplateUploadData> dataList) {
+        if (dataList == null || dataList.isEmpty()) {
+            return;
+        }
+
+        // 从第一条数据中提取信息
+        CostSurveyTemplateUploadData firstData = dataList.get(0);
+        String uploadId = firstData.getUploadId();
+        String auditedUnitId = firstData.getAuditedUnitId();
+        String catalogId = firstData.getCatalogId();
+        String surveyTemplateId = firstData.getSurveyTemplateId();
+        
+        if (auditedUnitId == null || auditedUnitId.isEmpty()) {
+            throw new IllegalArgumentException("auditedUnitId不能为空");
+        }
+
+        // 如果没有 uploadId,需要先创建主表
+        if (StringUtil.isEmpty(uploadId)) {
+            if (StringUtil.isEmpty(catalogId) || StringUtil.isEmpty(surveyTemplateId)) {
+                throw new IllegalArgumentException("创建主表时,catalogId和surveyTemplateId不能为空");
+            }
+
+            // 创建主表记录
+            CostSurveyTemplateUpload upload = new CostSurveyTemplateUpload();
+            upload.setCatalogId(catalogId);
+            upload.setSurveyTemplateId(surveyTemplateId);
+            upload.setIsRequired("1");
+            upload.setIsDeleted("0");
+            upload.setOrderNum(0);
+            costSurveyTemplateUploadManager.save(upload);
+            uploadId = upload.getId();
+        }
+
+        // 先删除该上传记录和企业下的所有数据
+        deleteByUploadIdAndAuditedUnitId(uploadId, auditedUnitId);
+
+        // 设置公共字段并保存新数据
+        List<CostSurveyTemplateUploadData> saveList = new ArrayList<>();
+        for (CostSurveyTemplateUploadData data : dataList) {
+            if (data.getRowid() == null || data.getRowid().isEmpty() || 
+                data.getRkey() == null || data.getRkey().isEmpty()) {
+                continue;
+            }
+
+            data.setUploadId(uploadId);
+            data.setAuditedUnitId(auditedUnitId);
+            if (data.getIsDeleted() == null) {
+                data.setIsDeleted("0");
+            }
+            if (data.getRvalue() == null) {
+                data.setRvalue("");
+            }
+            saveList.add(data);
+        }
+
+        // 批量保存
+        if (!saveList.isEmpty()) {
+            this.saveBatch(saveList);
+        }
+    }
+
+
+    @Override
+    @Transactional
+    public void deleteByUploadId(String uploadId) {
+        QueryWrapper<CostSurveyTemplateUploadData> wrapper = new QueryWrapper<>();
+        wrapper.eq("upload_id", uploadId);
+        wrapper.eq("is_deleted", "0");
+        this.remove(wrapper);
+    }
+
+    /**
+     * 根据上传记录ID和企业ID删除数据
+     * @param uploadId 上传记录ID
+     * @param auditedUnitId 企业ID
+     */
+    private void deleteByUploadIdAndAuditedUnitId(String uploadId, String auditedUnitId) {
+        QueryWrapper<CostSurveyTemplateUploadData> wrapper = new QueryWrapper<>();
+        wrapper.eq("upload_id", uploadId);
+        wrapper.eq("audited_unit_id", auditedUnitId);
+        wrapper.eq("is_deleted", "0");
+        this.remove(wrapper);
+    }
+}
+

+ 217 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/model/CostSurveyTemplateUploadData.java

@@ -0,0 +1,217 @@
+package com.hotent.enterpriseDeclare.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.hotent.base.entity.BaseModel;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * 成本调查表模板上传数据表
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+@ApiModel(value="CostSurveyTemplateUploadData对象", description="成本调查表模板上传数据表")
+public class CostSurveyTemplateUploadData extends BaseModel<CostSurveyTemplateUploadData> {
+
+    private static final long serialVersionUID = 1L;
+    
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    @JsonProperty("id")
+    private String id;
+    
+    @ApiModelProperty(value = "关联上传记录1ID")
+    @TableField("upload_id")
+    @JsonProperty("uploadId")
+    private String uploadId;
+    
+    @ApiModelProperty(value = "企业ID")
+    @TableField("audited_unit_id")
+    @JsonProperty("auditedUnitId")
+    private String auditedUnitId;
+    
+    @ApiModelProperty(value = "行数据ID(标识同一行的数据)")
+    @TableField("rowid")
+    @JsonProperty("rowid")
+    private String rowid;
+    
+    @ApiModelProperty(value = "数据key(动态字段名)")
+    @TableField("rkey")
+    @JsonProperty("rkey")
+    private String rkey;
+    
+    @ApiModelProperty(value = "数据值(动态字段值)")
+    @TableField("rvalue")
+    @JsonProperty("rvalue")
+    private String rvalue;
+    
+    @ApiModelProperty(value = "逻辑删除:0正常 1删除")
+    @TableField("is_deleted")
+    @JsonProperty("isDeleted")
+    private String isDeleted;
+    
+    @ApiModelProperty(value = "创建时间")
+    @TableField("create_time")
+    @JsonProperty("createTime")
+    private LocalDateTime createTime;
+    
+    @ApiModelProperty(value = "创建人")
+    @TableField("create_by")
+    @JsonProperty("createBy")
+    private String createBy;
+    
+    @ApiModelProperty(value = "更新时间")
+    @TableField("update_time")
+    @JsonProperty("updateTime")
+    private LocalDateTime updateTime;
+    
+    @ApiModelProperty(value = "更新人")
+    @TableField("update_by")
+    @JsonProperty("updateBy")
+    private String updateBy;
+
+    // 临时字段(用于创建主表,非数据库字段)
+    @ApiModelProperty(value = "监管目录ID(创建主表时使用)")
+    @TableField(exist = false)
+    @JsonProperty("catalogId")
+    private String catalogId;
+
+    @ApiModelProperty(value = "成本调查表模板ID(创建主表时使用)")
+    @TableField(exist = false)
+    @JsonProperty("surveyTemplateId")
+    private String surveyTemplateId;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getUploadId() {
+        return uploadId;
+    }
+
+    public void setUploadId(String uploadId) {
+        this.uploadId = uploadId;
+    }
+
+    public String getAuditedUnitId() {
+        return auditedUnitId;
+    }
+
+    public void setAuditedUnitId(String auditedUnitId) {
+        this.auditedUnitId = auditedUnitId;
+    }
+
+    public String getRowid() {
+        return rowid;
+    }
+
+    public void setRowid(String rowid) {
+        this.rowid = rowid;
+    }
+
+    public String getRkey() {
+        return rkey;
+    }
+
+    public void setRkey(String rkey) {
+        this.rkey = rkey;
+    }
+
+    public String getRvalue() {
+        return rvalue;
+    }
+
+    public void setRvalue(String rvalue) {
+        this.rvalue = rvalue;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public LocalDateTime getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(LocalDateTime createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public LocalDateTime getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(LocalDateTime updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public String getCatalogId() {
+        return catalogId;
+    }
+
+    public void setCatalogId(String catalogId) {
+        this.catalogId = catalogId;
+    }
+
+    public String getSurveyTemplateId() {
+        return surveyTemplateId;
+    }
+
+    public void setSurveyTemplateId(String surveyTemplateId) {
+        this.surveyTemplateId = surveyTemplateId;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "CostSurveyTemplateUploadData{" +
+            "id='" + id + '\'' +
+            ", uploadId='" + uploadId + '\'' +
+            ", auditedUnitId='" + auditedUnitId + '\'' +
+            ", rowid='" + rowid + '\'' +
+            ", rkey='" + rkey + '\'' +
+            ", rvalue='" + rvalue + '\'' +
+            ", isDeleted='" + isDeleted + '\'' +
+            ", createTime=" + createTime +
+            ", createBy='" + createBy + '\'' +
+            ", updateTime=" + updateTime +
+            ", updateBy='" + updateBy + '\'' +
+            '}';
+    }
+}
+

+ 24 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/req/CostSurveyTemplateUploadDataQueryReq.java

@@ -0,0 +1,24 @@
+package com.hotent.enterpriseDeclare.req;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 成本调查表模板上传数据查询请求参数
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+@ApiModel("成本调查表模板上传数据查询请求参数")
+@Data
+public class CostSurveyTemplateUploadDataQueryReq {
+    
+    @ApiModelProperty(value = "上传记录ID", required = true)
+    private String uploadId;
+    
+    @ApiModelProperty(value = "企业ID", required = true)
+    private String auditedUnitId;
+}
+

+ 30 - 0
assistMg/src/main/java/com/hotent/enterpriseDeclare/req/CostSurveyTemplateUploadDataReq.java

@@ -0,0 +1,30 @@
+package com.hotent.enterpriseDeclare.req;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 成本调查表模板上传数据保存请求参数
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+@ApiModel("成本调查表模板上传数据保存请求参数")
+@Data
+public class CostSurveyTemplateUploadDataReq {
+    
+    @ApiModelProperty(value = "上传记录ID", required = true)
+    private String uploadId;
+    
+    @ApiModelProperty(value = "企业ID", required = true)
+    private String auditedUnitId;
+    
+    @ApiModelProperty(value = "数据列表(Map格式,每个Map代表一行数据)", required = true)
+    private List<Map<String, String>> itemlist;
+}
+

+ 38 - 0
assistMg/src/main/java/com/hotent/project/controller/CostProjectDocumentController.java

@@ -1,10 +1,15 @@
 package com.hotent.project.controller;
 
 
+import com.aliyun.tea.utils.StringUtils;
 import com.hotent.base.annotation.ApiGroup;
 import com.hotent.base.constants.ApiGroupConsts;
 import com.hotent.common.CrudService;
+import com.hotent.config.EipConfig;
+import com.hotent.constant.BaseConstant;
+import com.hotent.project.manager.CostProjectDocumentFileManager;
 import com.hotent.project.model.CostProjectApproval;
+import com.hotent.project.model.CostProjectDocumentFile;
 import com.hotent.project.req.CostProjectApprovalPageReq;
 import com.hotent.project.req.CostProjectBasePageReq;
 import com.hotent.project.req.CostProjectDocumentPageReq;
@@ -13,6 +18,8 @@ import com.hotent.project.resp.CostProjectDocumentResp;
 import com.hotent.req.IdReq;
 import com.hotent.req.PageReq;
 import com.hotent.resp.PageResp;
+import com.hotent.util.FileUploadUtil;
+import com.hotent.util.wordexcelutils.DocumentProcessor;
 import io.swagger.annotations.Api;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -24,7 +31,10 @@ import com.hotent.base.controller.BaseController;
 import com.hotent.project.model.CostProjectDocument;
 import com.hotent.project.manager.CostProjectDocumentManager;
 
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * 监审项目文书表 前端控制器
@@ -44,6 +54,9 @@ public class CostProjectDocumentController extends BaseController<CostProjectDoc
 
 	@Autowired
 	private CostProjectDocumentManager costProjectDocumentManager;
+
+	@Autowired
+	private CostProjectDocumentFileManager costProjectDocumentFileManager;
 	/**
 	 * 根据id获取监审项目文书表数据详情
 	 * @param id
@@ -96,4 +109,29 @@ public class CostProjectDocumentController extends BaseController<CostProjectDoc
 		return CommonResult.<CostProjectDocumentResp>ok().value(costProjectDocumentManager.getByProjectId(projectId));
 	}
 
+	/**
+	 * 根据id生成文书并且下载
+	 * @param id
+	 * @return
+	 * @throws Exception
+	 * ModelAndView
+	 */
+	@GetMapping(value="/downDocument")
+	@ApiOperation(value="根据id生成文书并且下载",httpMethod = "GET",notes = "根据id生成文书并且下载")
+	public CommonResult<String> downDocument(@ApiParam(name="id",value="业务对象主键", required = true)@RequestParam(required=true) String id) throws Exception{
+		return CommonResult.<String>ok().value(costProjectDocumentManager.createDocument(id));
+	}
+
+
+	//上传扫描
+	@PostMapping(value="/updateScan")
+	@ApiOperation(value="",httpMethod = "POST",notes = "修改update")
+	public CommonResult<String> updateScan(@RequestBody CostProjectDocument req) {
+		CostProjectDocument entity = costProjectDocumentManager.get(req.getId());
+		entity.setScanDocumentUrl(req.getScanDocumentUrl());
+		costProjectDocumentManager.updateById(entity);
+		return CommonResult.<String>ok().message("修改成功");
+
+	}
+
 }

+ 1 - 1
assistMg/src/main/java/com/hotent/project/manager/CostNoticeManager.java

@@ -29,7 +29,7 @@ public interface CostNoticeManager extends BaseManager<CostNotice> {
 
 	IPage<CostNotice> pageList(CostProjectNoticePageReq req);
 
-	void sendNotice(String projectId, String number, String title, String content, String enterpriseId, String noticeSource, String sendTarget);
+	void sendNotice(String projectId,String taskId, String number, String title, String content, String enterpriseId, String noticeSource, String sendTarget);
 
 
 	/**

+ 5 - 0
assistMg/src/main/java/com/hotent/project/manager/CostProjectDocumentFileManager.java

@@ -26,5 +26,10 @@ public interface CostProjectDocumentFileManager extends BaseManager<CostProjectD
 	 */
 	void createOrUpdate(CostProjectDocumentFile costProjectDocumentFile);
 
+	/**
+	 * 根据文书id和项目id查询文书具体项目
+	 */
+	List<CostProjectDocumentFile> getCostProjectDocumentFiles(String projectId, String documentId);
+
 
 }

+ 2 - 0
assistMg/src/main/java/com/hotent/project/manager/CostProjectDocumentManager.java

@@ -54,4 +54,6 @@ public interface CostProjectDocumentManager extends BaseManager<CostProjectDocum
 	void deleteByIds(List<String> ids);
 
 	CostProjectDocumentResp getByProjectId(String projectId);
+
+	String createDocument(String id);
 }

+ 4 - 3
assistMg/src/main/java/com/hotent/project/manager/impl/CostNoticeManagerImpl.java

@@ -56,8 +56,8 @@ public class CostNoticeManagerImpl extends BaseManagerImpl<CostNoticeDao, CostNo
 		if(ObjectUtil.isNotEmpty(req.getProjectId())){
 			qw.eq(CostNotice::getProjectId, req.getProjectId());
 		}
-		if(ObjectUtil.isNotEmpty(req.getProjectId())){
-			qw.eq(CostNotice::getProjectId, req.getProjectId());
+		if(ObjectUtil.isNotEmpty(req.getTaskId())){
+			qw.eq(CostNotice::getTaskId, req.getTaskId());
 		}
 		if(ObjectUtil.isNotEmpty(req.getEnterpriseId())){
 			qw.eq(CostNotice::getEnterpriseId, req.getEnterpriseId());
@@ -69,11 +69,12 @@ public class CostNoticeManagerImpl extends BaseManagerImpl<CostNoticeDao, CostNo
 	}
 
 	@Override
-	public void sendNotice(String projectId, String number, String title, String content, String enterpriseId, String noticeSource, String sendTarget) {
+	public void sendNotice(String projectId,String taskId, String number, String title, String content, String enterpriseId, String noticeSource, String sendTarget) {
 		CostNotice costNotice = new CostNotice();
 		costNotice.setNoticeTitle(title);
 		costNotice.setNoticeType(number);
 		costNotice.setProjectId(projectId);
+		costNotice.setTaskId(taskId);
 		costNotice.setStatus(BaseConstant.NORMAL_STATUS);
 		costNotice.setNoticeContent(content);
 		costNotice.setEnterpriseId(enterpriseId);

+ 26 - 14
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectApprovalManagerImpl.java

@@ -1,6 +1,7 @@
 package com.hotent.project.manager.impl;
 
 import cn.hutool.core.util.ObjectUtil;
+import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -29,6 +30,7 @@ import com.hotent.uc.manager.UserManager;
 import com.hotent.uc.util.ContextUtil;
 import com.hotent.util.AreaCodeUtil;
 import com.hotent.util.CopyUtil;
+import dm.jdbc.convert.J2DB;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -357,11 +359,11 @@ public class CostProjectApprovalManagerImpl extends BaseManagerImpl<CostProjectA
         if (ObjectUtil.isNotEmpty(req.getSendType())) {
             if (req.getSendType().contains(",")) {
                 //站内通知
-                this.costNoticeManager.sendNotice(req.getProjectId(), "1", costProjectApproval.getProjectName(), req.getContent());
+                this.costNoticeManager.sendNotice(req.getProjectId(),null, "1", costProjectApproval.getProjectName(), req.getContent(), costProjectApproval.getAuditedUnitId().split(",")[0],"","");
                 //短信发送
             } else if (req.getSendType().equals("1")) {
                 //站内通知
-                this.costNoticeManager.sendNotice(req.getProjectId(), "1", costProjectApproval.getProjectName(), req.getContent());
+                this.costNoticeManager.sendNotice(req.getProjectId(),null, "1", costProjectApproval.getProjectName(), req.getContent(),costProjectApproval.getAuditedUnitId().split(",")[0],"","");
             } else if (req.getSendType().equals("2")) {
                 //短信发送
             } else {
@@ -493,23 +495,33 @@ public class CostProjectApprovalManagerImpl extends BaseManagerImpl<CostProjectA
 
             // 关联文书
             List<CostProjectTaskDocument> documents = CopyUtil.copyList(documentList, CostProjectTaskDocument.class);
-            documents.forEach(doc -> doc.setTaskId(childTask.getId()));
+            documents.forEach(doc ->{
+                doc.setTaskId(childTask.getId());
+                doc.setId(null);
+            } );
             taskDocumentList.addAll(documents);
 
             // 关联资料
             List<CostProjectTaskMaterial> materials = CopyUtil.copyList(materialList, CostProjectTaskMaterial.class);
-            materials.forEach(mat -> mat.setTaskId(childTask.getId()));
+            materials.forEach(mat ->{
+                mat.setTaskId(childTask.getId());
+                mat.setId(null);
+            } );
             taskMaterialList.addAll(materials);
 
             // 工作流程
             CostProjectTaskProccess process = CopyUtil.copy(projectProccess, CostProjectTaskProccess.class);
             process.setTaskId(childTask.getId());
+            process.setProcessId(null);
             taskProccessList.add(process);
 
 
             // 流程节点
             List<CostProjectTaskNode> nodes = CopyUtil.copyList(proccessNodeList, CostProjectTaskNode.class);
-            nodes.forEach(node -> node.setTaskId(childTask.getId()));
+            nodes.forEach(node -> {
+                node.setTaskId(childTask.getId());
+                node.setId(null);
+            });
             taskNodeList.addAll(nodes);
 
         }
@@ -614,15 +626,15 @@ public class CostProjectApprovalManagerImpl extends BaseManagerImpl<CostProjectA
 //                            .eq(CostProjectTaskProccess::getTaskId, userTask.getId())
 //            );
 
-
-            // 设置子任务对象
-            record.setUserTask(userTask);
-            // 设置主状态为子任务状态
-            record.setStatus(userTask.getStatus());
-            record.setStatusName(TaskStatusConstant.getStatusNameByCode(userTask.getStatus()));
-            record.setCurrentNode(userTask.getCurrentNode());
-            record.setCurrentNodeName(NodeConstant.getNodeValueByKey(userTask.getCurrentNode())+ "-"+ TaskStatusConstant.getStatusNameByCode(userTask.getStatus()));
-
+            if(userTask!=null) {
+                // 设置子任务对象
+                record.setUserTask(userTask);
+                // 设置主状态为子任务状态
+                record.setStatus(userTask.getStatus());
+                record.setStatusName(TaskStatusConstant.getStatusNameByCode(userTask.getStatus()));
+                record.setCurrentNode(userTask.getCurrentNode());
+                record.setCurrentNodeName(NodeConstant.getNodeValueByKey(userTask.getCurrentNode()) + "-" + TaskStatusConstant.getStatusNameByCode(userTask.getStatus()));
+            }
         }
         return result;
     }

+ 8 - 7
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentFileManagerImpl.java

@@ -1,18 +1,14 @@
 package com.hotent.project.manager.impl;
 
-import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.hotent.project.model.CostProjectDocumentFile;
 import com.hotent.project.dao.CostProjectDocumentFileDao;
 import com.hotent.project.manager.CostProjectDocumentFileManager;
 import com.hotent.base.manager.impl.BaseManagerImpl;
-import com.hotent.uc.exception.BaseException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+
 import java.util.List;
-import javax.annotation.Resource;
-import com.hotent.base.util.BeanUtils;
 
 
 /**
@@ -42,6 +38,11 @@ public class CostProjectDocumentFileManagerImpl extends BaseManagerImpl<CostProj
 	}
 
 
-
-
+	@Override
+	public List<CostProjectDocumentFile> getCostProjectDocumentFiles(String projectId, String documentId) {
+		LambdaQueryWrapper<CostProjectDocumentFile> wrapper = new LambdaQueryWrapper<>();
+		wrapper.eq(CostProjectDocumentFile::getProjectId,projectId);
+		wrapper.eq(CostProjectDocumentFile::getDocumentId,documentId);
+		return  this.list(wrapper);
+	}
 }

+ 52 - 7
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectDocumentManagerImpl.java

@@ -19,23 +19,22 @@ import com.hotent.project.dao.CostProjectDocumentDao;
 import com.hotent.project.manager.CostProjectDocumentManager;
 import com.hotent.base.manager.impl.BaseManagerImpl;
 import com.hotent.project.model.CostProjectDocumentFile;
-import com.hotent.project.req.CostProjectBasePageReq;
 import com.hotent.project.req.CostProjectDocumentPageReq;
 import com.hotent.project.req.CostProjectDocumentReq;
 import com.hotent.project.resp.CostProjectDocumentResp;
-import com.hotent.req.PageReq;
 import com.hotent.uc.exception.BaseException;
+import com.hotent.util.wordexcelutils.DocumentProcessor;
+import org.apache.commons.lang.StringUtils;
+import org.apache.tools.ant.util.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 
 import java.time.LocalDateTime;
-import java.util.ArrayList;
-import java.util.List;
-import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
 
-import com.hotent.base.util.BeanUtils;
+import com.hotent.util.FileUploadUtil;
 
 
 /**
@@ -60,6 +59,8 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
     @Autowired
     private CostDocumentWhManager costDocumentWhManager;
 
+
+
     @Override
     public CostProjectDocument getDetail(String id) {
         CostProjectDocument costProjectDocument = this.get(id);
@@ -199,6 +200,28 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
         req.getCostProjectDocumentFiles().forEach(costProjectDocumentFile -> {
             costProjectDocumentFile.setDocumentId(costProjectDocument.getDocumentId());
             costProjectDocumentFile.setProjectId(costProjectDocument.getProjectId());
+            //送达回证特殊处理字段 后期在说
+            if ("送达回证".equals(costProjectDocument.getDocumentName())) {
+                if (costProjectDocumentFile.getPinyin().equals("SongDaWenShuMingCheng")){
+                    costProjectDocumentFile.setDataValue(costDocumentTemplate.getDocumentName());
+                }
+                if (costProjectDocumentFile.getPinyin().equals("SongDaWenShuWenHao")){
+                    costProjectDocumentFile.setDataValue(whNo);
+                }
+                if (costProjectDocumentFile.getPinyin().equals("SongDaWenShuMingCheng")){
+                    costProjectDocumentFile.setDataValue(costDocumentTemplate.getDocumentName());
+                }
+                if (costProjectDocumentFile.getPinyin().equals("TongZhiSongDaShiJian")){
+                    costProjectDocumentFile.setDataValue(DateUtils.format(new Date(),"yyyy-MM-dd"));
+                }
+                if (costProjectDocumentFile.getPinyin().equals("BeiJianShenDanWeiBanGongDiDian")){
+                    costProjectDocumentFile.setDataValue(auditedUnit.getAddress());
+                }
+                if (costProjectDocumentFile.getPinyin().equals("ShouSongDaRen")){
+                    costProjectDocumentFile.setDataValue(auditedUnit.getContactName());
+                }
+            }
+
         });
         //保存解析出的文件内容
         costProjectDocumentFileManager.saveBatch(req.getCostProjectDocumentFiles());
@@ -270,6 +293,7 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
         selectCostProjectDocument.setDocumentWhId(req.getDocumentWhId());
         selectCostProjectDocument.setDocumentId(req.getDocumentId());
         selectCostProjectDocument.setEnterpriseId(req.getEnterpriseId());
+        selectCostProjectDocument.setElectronicDocumentUrl("");
 //        类型转换
          BeanUtil.copyProperties(req,selectCostProjectDocument);
         super.update(selectCostProjectDocument);
@@ -317,4 +341,25 @@ public class CostProjectDocumentManagerImpl extends BaseManagerImpl<CostProjectD
          return costProjectDocumentResp;
 
      }
+
+    @Override
+    public String createDocument(String id) {
+        CostProjectDocument costProjectDocument = this.getDetail(id);
+        List<CostProjectDocumentFile> list = costProjectDocumentFileManager.getCostProjectDocumentFiles(costProjectDocument.getProjectId(),costProjectDocument.getDocumentId());
+        CostDocumentTemplate costDocumentTemplate = this.costDocumentTemplateManager.get(costProjectDocument.getDocumentId());
+        //生成文书
+        Map<String,String> map = new HashMap<>();
+        list.stream().forEach(p->{
+            map.put("{"+p.getOriginalText()+"}",p.getDataValue());
+        });
+        //先处理一种文件
+        String templatePath = costDocumentTemplate.getFileUrl().replace(BaseConstant.RESOURCE_PREFIX,"");
+        templatePath = EipConfig.getProfile()+templatePath;
+
+        String fileExtension = FileUploadUtil.getFileExtension(costDocumentTemplate.getFileUrl());
+        String fileName = FileUploadUtil.generateFileName(costDocumentTemplate.getDocumentName()+"."+fileExtension);
+        String outputPath = FileUploadUtil.generateSavePath(EipConfig.getUploadPath(), fileName, fileExtension);
+        DocumentProcessor.processWordDocument(templatePath,outputPath,map,new LinkedHashMap<>());
+        return EipConfig.getImgUrl()+FileUploadUtil.getPathFileName(outputPath,fileName);
+    }
 }

+ 40 - 76
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectTaskManagerImpl.java

@@ -308,72 +308,21 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
      */
     private String completeTask(CostProjectTask task) {
         CostProjectTask nTask = costProjectTaskManager.getById(task.getId());
-        NodeConstant nextNode = NodeConstant.getNextNode(task.getCurrentNode());
         if (nTask == null){
             return "任务不存在";
         }
-        if (!nTask.getPid().equals("0") ) {
-            // 将当前任务置为办结
-            String nextNodeStatus = nextNode.getNodeKey();
-            task.setStatus(TaskStatusConstant.COMPLETED.getStatusCode());
-            task.setCurrentNode(nextNodeStatus);
-            costProjectTaskManager.updateById(task);
-            // 如果所有子任务都办结,则将父子任务都扭转
-            List<CostProjectTask> children = costProjectTaskManager.list(
-                    new LambdaQueryWrapper<CostProjectTask>()
-                            .eq(CostProjectTask::getPid, nTask.getPid())
-            );
-            boolean b = children.stream().allMatch(child ->
-                    child.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode()));
-            if(b){
-                CostProjectTask pNtask = costProjectTaskManager.getById(nTask.getPid());
-                pNtask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
-                pNtask.setCurrentNode(nextNodeStatus);
-                costProjectTaskManager.updateById(pNtask);
-                String  status = "";
-                switch (pNtask.getCurrentNode()){
-                    case "yjfk":
-                        status = TaskStatusConstant.WAIT_FEEDBACK.getStatusCode();
-                        break;
-                    case "jtsy":
-                        status = TaskStatusConstant.COMPLETED.getStatusCode();
-                        break;
-                    default:
-                        status = TaskStatusConstant.AUDITING.getStatusCode();
-                        break;
-                }
-                for (CostProjectTask child : children) {
-                    child.setStatus(status);
-                    child.setCurrentNode(nextNodeStatus);
-                    costProjectTaskManager.updateById(child);
-                }
-            }
-            // 如果下一个节点是"意见告知",生成空的初步意见数据
-            if (NodeConstant.yjfk.getNodeKey().equals(nextNodeStatus)) {
-                // 检查是否已存在初步意见
-                CostProjectTaskPreliminaryOpinion existingOpinion = preliminaryOpinionManager.getByTaskId(task.getId());
-                if (existingOpinion == null) {
-                    CostProjectTaskPreliminaryOpinion preliminaryOpinion = new CostProjectTaskPreliminaryOpinion();
-                    preliminaryOpinion.setTaskId(task.getId());
-                    preliminaryOpinion.setStatus("draft");
-                    preliminaryOpinion.setIsDeleted(BaseConstant.NORMAL_STATUS);
-                    preliminaryOpinionManager.createOrUpdate(preliminaryOpinion);
-                }
-            }
 
-        }else{
-            List<CostProjectTask> children = costProjectTaskManager.list(
-                    new LambdaQueryWrapper<CostProjectTask>()
-                            .eq(CostProjectTask::getPid, nTask.getId())
-            );
-            boolean b = children.stream().allMatch(child ->
-                    child.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode()));
-            if (!b) {
-                throw new RuntimeException("子任务未全部办结,主任务无法办结");
-            }
-            task.setStatus(TaskStatusConstant.COMPLETED.getStatusCode());
-            costProjectTaskManager.updateById(task);
+        List<CostProjectTask> children = costProjectTaskManager.list(
+                new LambdaQueryWrapper<CostProjectTask>()
+                        .eq(CostProjectTask::getPid, nTask.getId())
+        );
+        boolean b = children.stream().allMatch(child ->
+                child.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode()));
+        if (!b) {
+            throw new RuntimeException("子任务未全部办结,主任务无法办结");
         }
+        task.setStatus(TaskStatusConstant.COMPLETED.getStatusCode());
+        costProjectTaskManager.updateById(task);
 
         // 发送通知
         String title = NodeConstant.getNodeValueByKey(task.getCurrentNode())+"通过";
@@ -384,7 +333,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String noticeSource = "系统";
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
+        costNoticeManager.sendNotice(task.getProjectId(),task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
 
         return title;
     }
@@ -402,7 +351,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                 String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
                 String noticeSource = "系统";
                 String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-                costNoticeManager.sendNotice(task.getProjectId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+                costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
 
                 // 更新任务的当前节点和状态
                 task.setStatus(TaskStatusConstant.NOT_PASSED.getStatusCode());
@@ -428,7 +377,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String noticeSource = "系统";
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
 
         return title;
     }
@@ -463,7 +412,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                         // 通知内容组装(针对子任务对应的单位)
                         String childEnterpriseId = childTask.getAuditedUnitId() == null ? "" : childTask.getAuditedUnitId();
                         String childSendTarget = childTask.getCreateBy() == null ? "" : childTask.getCreateBy();
-                        costNoticeManager.sendNotice(task.getProjectId(), "1", title, req.getContent(), childEnterpriseId, noticeSource, childSendTarget);
+                        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), childEnterpriseId, noticeSource, childSendTarget);
                         // 收集单位名称
                         if (StringUtil.isNotEmpty(childTask.getAuditedUnitName())) {
                             unitNames.add(childTask.getAuditedUnitName());
@@ -478,7 +427,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                 costProjectTaskManager.updateById(task);
                 String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
                 String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-                costNoticeManager.sendNotice(task.getProjectId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+                costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
                 return title;
         }
     }
@@ -537,7 +486,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String noticeSource = "系统";
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
 
         return title;
     }
@@ -558,18 +507,33 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                 new LambdaQueryWrapper<CostProjectTask>()
                         .eq(CostProjectTask::getPid, nTask.getId())
         );
-        boolean b = children.stream().allMatch(
-                child -> child.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode()));
+        boolean b = children.stream().noneMatch(
+                child -> child.getStatus().equals(TaskStatusConstant.AUDITING.getStatusCode()));
         if (!b){
             throw new RuntimeException("子任务未全部办结,主任务无法扭转");
         }
-        // 主任务扭转下一步
-        String nextNodeKey = NodeConstant.getNextNode(nTask.getCurrentNode()).getNodeKey();
-        nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
-        nTask.setCurrentNode(nextNodeKey);
-        costProjectTaskManager.updateById(nTask);
+        // 将当前任务置为办结
+        String nextNodeStatus = NodeConstant.getNextNode(nTask.getCurrentNode()).getNodeKey();
+        task.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
+        task.setCurrentNode(nextNodeStatus);
+        nTask.setIsGd("0");
+        costProjectTaskManager.updateById(task);
+        // 如果所有子任务都办结,则将父子任务都扭转
+        String  status = "";
+        switch (nTask.getCurrentNode()){
+            case "yjfk":
+                status = TaskStatusConstant.WAIT_FEEDBACK.getStatusCode();
+                break;
+            case "jtsy":
+                status = TaskStatusConstant.COMPLETED.getStatusCode();
+                break;
+            default:
+                status = TaskStatusConstant.AUDITING.getStatusCode();
+                break;
+        }
         for (CostProjectTask child : children) {
-            child.setCurrentNode(nextNodeKey);
+            child.setStatus(status);
+            child.setCurrentNode(nextNodeStatus);
             costProjectTaskManager.updateById(child);
         }
         // 通知内容组装
@@ -577,7 +541,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String noticeSource = "系统";
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+        costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
 
         return title;
     }

+ 10 - 0
assistMg/src/main/java/com/hotent/project/model/CostNotice.java

@@ -97,6 +97,16 @@ public class CostNotice extends BaseModel<CostNotice> {
     @JsonProperty("sendTarget")
     private String sendTarget;
 
+    private String taskId;
+
+    public String getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(String taskId) {
+        this.taskId = taskId;
+    }
+
     // Getter & Setter
     public String getNoticeSource() { return noticeSource; }
     public void setNoticeSource(String noticeSource) { this.noticeSource = noticeSource; }

+ 2 - 0
assistMg/src/main/java/com/hotent/project/req/CostProjectNoticePageReq.java

@@ -30,6 +30,8 @@ public class CostProjectNoticePageReq extends PageReq {
 
     private String  enterpriseId;
 
+    private String taskId;
+
 
 
 

+ 25 - 0
assistMg/src/main/java/com/hotent/surveyinfo/dao/CostSurveyTemplateUploadDao.java

@@ -0,0 +1,25 @@
+package com.hotent.surveyinfo.dao;
+
+import com.hotent.surveyinfo.model.CostSurveyTemplateUpload;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 成本调查表模板上传记录表 Mapper 接口
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+public interface CostSurveyTemplateUploadDao extends BaseMapper<CostSurveyTemplateUpload> {
+
+    /**
+     * 根据目录ID查询上传记录列表(关联模板信息)
+     * @param catalogId 监管目录ID
+     * @return 上传记录列表
+     */
+    List<CostSurveyTemplateUpload> selectListByCatalogId(@Param("catalogId") String catalogId);
+}
+

+ 24 - 0
assistMg/src/main/java/com/hotent/surveyinfo/manager/CostSurveyTemplateUploadManager.java

@@ -0,0 +1,24 @@
+package com.hotent.surveyinfo.manager;
+
+import com.hotent.surveyinfo.model.CostSurveyTemplateUpload;
+import com.hotent.base.manager.BaseManager;
+
+import java.util.List;
+
+/**
+ * 成本调查表模板上传记录表 服务类
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+public interface CostSurveyTemplateUploadManager extends BaseManager<CostSurveyTemplateUpload> {
+
+    /**
+     * 根据目录ID查询上传记录列表
+     * @param catalogId 监管目录ID
+     * @return 上传记录列表
+     */
+    List<CostSurveyTemplateUpload> listByCatalogId(String catalogId);
+}
+

+ 27 - 0
assistMg/src/main/java/com/hotent/surveyinfo/manager/impl/CostSurveyTemplateUploadManagerImpl.java

@@ -0,0 +1,27 @@
+package com.hotent.surveyinfo.manager.impl;
+
+import com.hotent.surveyinfo.model.CostSurveyTemplateUpload;
+import com.hotent.surveyinfo.dao.CostSurveyTemplateUploadDao;
+import com.hotent.surveyinfo.manager.CostSurveyTemplateUploadManager;
+import com.hotent.base.manager.impl.BaseManagerImpl;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * 成本调查表模板上传记录表 服务实现类
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+@Service
+public class CostSurveyTemplateUploadManagerImpl extends BaseManagerImpl<CostSurveyTemplateUploadDao, CostSurveyTemplateUpload> implements CostSurveyTemplateUploadManager {
+
+    @Override
+    public List<CostSurveyTemplateUpload> listByCatalogId(String catalogId) {
+        return baseMapper.selectListByCatalogId(catalogId);
+    }
+}
+

+ 273 - 0
assistMg/src/main/java/com/hotent/surveyinfo/model/CostSurveyTemplateUpload.java

@@ -0,0 +1,273 @@
+package com.hotent.surveyinfo.model;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.hotent.base.entity.BaseModel;
+
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.io.Serializable;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/**
+ * 成本调查表模板上传记录表
+ *
+ * @company 山西清众科技股份有限公司
+ * @author 超级管理员
+ * @since 2025-01-XX
+ */
+@ApiModel(value="CostSurveyTemplateUpload对象", description="成本调查表模板上传记录表")
+public class CostSurveyTemplateUpload extends BaseModel<CostSurveyTemplateUpload> {
+
+    private static final long serialVersionUID = 1L;
+    
+    @ApiModelProperty(value = "主键ID")
+    @TableId(value = "id", type = IdType.ASSIGN_ID)
+    @JsonProperty("id")
+    private String id;
+    
+    @ApiModelProperty(value = "监管目录ID")
+    @TableField("catalog_id")
+    @JsonProperty("catalogId")
+    private String catalogId;
+    
+    @ApiModelProperty(value = "成本调查表模板ID")
+    @TableField("survey_template_id")
+    @JsonProperty("surveyTemplateId")
+    private String surveyTemplateId;
+    
+    @ApiModelProperty(value = "是否必填:0否 1是")
+    @TableField("is_required")
+    @JsonProperty("isRequired")
+    private String isRequired;
+    
+    @ApiModelProperty(value = "是否上传:0未上传 1已上传")
+    @TableField("is_upload")
+    @JsonProperty("isUpload")
+    private String isUpload;
+    
+    @ApiModelProperty(value = "上传时间")
+    @TableField("upload_time")
+    @JsonProperty("uploadTime")
+    private LocalDateTime uploadTime;
+    
+    @ApiModelProperty(value = "上传人")
+    @TableField("upload_by")
+    @JsonProperty("uploadBy")
+    private String uploadBy;
+    
+    @ApiModelProperty(value = "文件地址")
+    @TableField("file_url")
+    @JsonProperty("fileUrl")
+    private String fileUrl;
+    
+    @ApiModelProperty(value = "排序号")
+    @TableField("order_num")
+    @JsonProperty("orderNum")
+    private Integer orderNum;
+    
+    @ApiModelProperty(value = "逻辑删除:0正常 1删除")
+    @TableField("is_deleted")
+    @JsonProperty("isDeleted")
+    private String isDeleted;
+    
+    @ApiModelProperty(value = "创建时间")
+    @TableField("create_time")
+    @JsonProperty("createTime")
+    private LocalDateTime createTime;
+    
+    @ApiModelProperty(value = "创建人")
+    @TableField("create_by")
+    @JsonProperty("createBy")
+    private String createBy;
+    
+    @ApiModelProperty(value = "更新时间")
+    @TableField("update_time")
+    @JsonProperty("updateTime")
+    private LocalDateTime updateTime;
+    
+    @ApiModelProperty(value = "更新人")
+    @TableField("update_by")
+    @JsonProperty("updateBy")
+    private String updateBy;
+
+    // 关联查询字段(非数据库字段)
+    @ApiModelProperty(value = "调查表名称")
+    @TableField(exist = false)
+    @JsonProperty("surveyTemplateName")
+    private String surveyTemplateName;
+    
+    @ApiModelProperty(value = "模板类型:1单记录 2固定表 3动态表")
+    @TableField(exist = false)
+    @JsonProperty("templateType")
+    private String templateType;
+    
+    @ApiModelProperty(value = "资料类型")
+    @TableField(exist = false)
+    @JsonProperty("dataType")
+    private String dataType;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getCatalogId() {
+        return catalogId;
+    }
+
+    public void setCatalogId(String catalogId) {
+        this.catalogId = catalogId;
+    }
+
+    public String getSurveyTemplateId() {
+        return surveyTemplateId;
+    }
+
+    public void setSurveyTemplateId(String surveyTemplateId) {
+        this.surveyTemplateId = surveyTemplateId;
+    }
+
+    public String getIsRequired() {
+        return isRequired;
+    }
+
+    public void setIsRequired(String isRequired) {
+        this.isRequired = isRequired;
+    }
+
+    public String getIsUpload() {
+        return isUpload;
+    }
+
+    public void setIsUpload(String isUpload) {
+        this.isUpload = isUpload;
+    }
+
+    public LocalDateTime getUploadTime() {
+        return uploadTime;
+    }
+
+    public void setUploadTime(LocalDateTime uploadTime) {
+        this.uploadTime = uploadTime;
+    }
+
+    public String getUploadBy() {
+        return uploadBy;
+    }
+
+    public void setUploadBy(String uploadBy) {
+        this.uploadBy = uploadBy;
+    }
+
+    public String getFileUrl() {
+        return fileUrl;
+    }
+
+    public void setFileUrl(String fileUrl) {
+        this.fileUrl = fileUrl;
+    }
+
+    public Integer getOrderNum() {
+        return orderNum;
+    }
+
+    public void setOrderNum(Integer orderNum) {
+        this.orderNum = orderNum;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public LocalDateTime getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(LocalDateTime createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public LocalDateTime getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(LocalDateTime updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public String getSurveyTemplateName() {
+        return surveyTemplateName;
+    }
+
+    public void setSurveyTemplateName(String surveyTemplateName) {
+        this.surveyTemplateName = surveyTemplateName;
+    }
+
+    public String getTemplateType() {
+        return templateType;
+    }
+
+    public void setTemplateType(String templateType) {
+        this.templateType = templateType;
+    }
+
+    public String getDataType() {
+        return dataType;
+    }
+
+    public void setDataType(String dataType) {
+        this.dataType = dataType;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "CostSurveyTemplateUpload{" +
+            "id=" + id +
+            ", catalogId=" + catalogId +
+            ", surveyTemplateId=" + surveyTemplateId +
+            ", isRequired=" + isRequired +
+            ", isUpload=" + isUpload +
+            ", uploadTime=" + uploadTime +
+            ", uploadBy=" + uploadBy +
+            ", fileUrl=" + fileUrl +
+            ", orderNum=" + orderNum +
+            ", isDeleted=" + isDeleted +
+            ", createTime=" + createTime +
+            ", createBy=" + createBy +
+            ", updateTime=" + updateTime +
+            ", updateBy=" + updateBy +
+        "}";
+    }
+}
+

+ 4 - 4
assistMg/src/main/java/com/hotent/util/FileUploadUtil.java

@@ -96,7 +96,7 @@ public class FileUploadUtil {
     }
 
 
-    public static final String getPathFileName(String uploadDir, String fileName) throws IOException
+    public static final String getPathFileName(String uploadDir, String fileName)
     {
         int dirLastIndex = EipConfig.getProfile().length() + 1;
         String currentDir = StringUtils.substring(uploadDir, dirLastIndex);
@@ -157,7 +157,7 @@ public class FileUploadUtil {
      * @param fileName 文件名
      * @return 文件扩展名
      */
-    private static String getFileExtension(String fileName) {
+    public static String getFileExtension(String fileName) {
         if (fileName == null || fileName.lastIndexOf(".") == -1) {
             return "";
         }
@@ -169,7 +169,7 @@ public class FileUploadUtil {
      * @param originalFilename 原始文件名
      * @return 新文件名
      */
-    private static String generateFileName(String originalFilename) {
+    public static String generateFileName(String originalFilename) {
         String extension = "";
         String name = originalFilename;
 
@@ -192,7 +192,7 @@ public class FileUploadUtil {
      * @param fileExtension 文件扩展名
      * @return 完整保存路径
      */
-    private static String generateSavePath(String baseUploadPath, String fileName, String fileExtension) {
+    public static String generateSavePath(String baseUploadPath, String fileName, String fileExtension) {
         // 标准化路径分隔符
         String separator ="/";
 

+ 11 - 10
assistMg/src/main/java/com/hotent/util/wordexcelutils/DocumentProcessorExample.java

@@ -1,6 +1,7 @@
 package com.hotent.util.wordexcelutils;
 
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 public class DocumentProcessorExample {
@@ -9,27 +10,27 @@ public class DocumentProcessorExample {
         processWordExample();
 
         // Excel文档处理示例
-        processExcelExample();
+        //processExcelExample();
     }
 
     private static void processWordExample() {
         // 文本替换映射
         Map<String, String> textReplacements = new HashMap<>();
-        textReplacements.put("{name}", "张三");
-        textReplacements.put("{date}", "2023-10-01");
-        textReplacements.put("{company}", "某某公司");
+        textReplacements.put("{价格主管部门或成本调查机构}", "张三");
+        textReplacements.put("{送达文书名称}", "2023-10-01");
+        textReplacements.put("{送达文书文号}", "某某公司");
 
         // 图片替换映射
-        Map<String, String> imageReplacements = new HashMap<>();
-        imageReplacements.put("{signature}", "path/to/signature.png");
-        imageReplacements.put("{logo}", "path/to/logo.jpg");
+        //Map<String, String> imageReplacements = new HashMap<>();
+        //imageReplacements.put("{signature}", "path/to/signature.png");
+        //imageReplacements.put("{logo}", "path/to/logo.jpg");
 
         // 处理Word文档
         DocumentProcessor.processWordDocument(
-            "template.docx",
-            "output.docx",
+            "C:\\Users\\123\\Desktop\\送  达  回  证_20251105182242_856.docx",
+            "C:\\Users\\123\\Desktop\\output.docx",
             textReplacements,
-            imageReplacements
+            new LinkedHashMap<>()
         );
     }
 

+ 88 - 0
assistMg/src/main/resources/mapper/CostSurveyTemplateUploadDataMapper.xml

@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hotent.enterpriseDeclare.dao.CostSurveyTemplateUploadDataDao">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hotent.enterpriseDeclare.model.CostSurveyTemplateUploadData">
+        <id column="id" property="id" />
+        <result column="upload_id" property="uploadId" />
+        <result column="audited_unit_id" property="auditedUnitId" />
+        <result column="rowid" property="rowid" />
+        <result column="rkey" property="rkey" />
+        <result column="rvalue" property="rvalue" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="create_time" property="createTime" />
+        <result column="create_by" property="createBy" />
+        <result column="update_time" property="updateTime" />
+        <result column="update_by" property="updateBy" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, upload_id, audited_unit_id, rowid, rkey, rvalue, is_deleted, create_time, create_by, update_time, update_by
+    </sql>
+
+    <select id="selectPage" resultMap="BaseResultMap">
+        select 
+            <include refid="Base_Column_List"/> 
+        from
+            cost_survey_template_upload_data
+        ${ew.customSqlSegment}
+    </select>
+    
+    <select id="selectList" resultMap="BaseResultMap">
+        select 
+            <include refid="Base_Column_List"/> 
+        from
+            cost_survey_template_upload_data
+        ${ew.customSqlSegment}
+    </select>
+    
+    <select id="selectById" resultMap="BaseResultMap">
+        select 
+            <include refid="Base_Column_List"/> 
+        from
+            cost_survey_template_upload_data
+        where 
+            id = #{id}
+    </select>
+
+    <!-- 根据上传记录ID查询数据列表 -->
+    <select id="selectByUploadId" resultMap="BaseResultMap">
+        SELECT 
+            <include refid="Base_Column_List"/>
+        FROM 
+            cost_survey_template_upload_data
+        WHERE 
+            upload_id = #{uploadId}
+            AND is_deleted = '0'
+        ORDER BY rowid, rkey
+    </select>
+
+    <!-- 根据上传记录ID和企业ID查询数据列表 -->
+    <select id="selectByUploadIdAndAuditedUnitId" resultMap="BaseResultMap">
+        SELECT 
+            <include refid="Base_Column_List"/>
+        FROM 
+            cost_survey_template_upload_data
+        WHERE 
+            upload_id = #{uploadId}
+            AND audited_unit_id = #{auditedUnitId}
+            AND is_deleted = '0'
+        ORDER BY rowid, rkey
+    </select>
+
+    <!-- 根据行数据ID查询数据列表 -->
+    <select id="selectByRowid" resultMap="BaseResultMap">
+        SELECT 
+            <include refid="Base_Column_List"/>
+        FROM 
+            cost_survey_template_upload_data
+        WHERE 
+            rowid = #{rowid}
+            AND is_deleted = '0'
+        ORDER BY rkey
+    </select>
+
+</mapper>
+

+ 91 - 0
assistMg/src/main/resources/mapper/CostSurveyTemplateUploadMapper.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.hotent.surveyinfo.dao.CostSurveyTemplateUploadDao">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hotent.surveyinfo.model.CostSurveyTemplateUpload">
+        <id column="id" property="id" />
+        <result column="catalog_id" property="catalogId" />
+        <result column="survey_template_id" property="surveyTemplateId" />
+        <result column="is_required" property="isRequired" />
+        <result column="is_upload" property="isUpload" />
+        <result column="upload_time" property="uploadTime" />
+        <result column="upload_by" property="uploadBy" />
+        <result column="file_url" property="fileUrl" />
+        <result column="order_num" property="orderNum" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="create_time" property="createTime" />
+        <result column="create_by" property="createBy" />
+        <result column="update_time" property="updateTime" />
+        <result column="update_by" property="updateBy" />
+        <!-- 关联查询字段 -->
+        <result column="survey_template_name" property="surveyTemplateName" />
+        <result column="template_type" property="templateType" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, catalog_id, survey_template_id, is_required, is_upload, upload_time, upload_by, 
+        file_url, order_num, is_deleted, create_time, create_by, update_time, update_by
+    </sql>
+
+    <!-- 根据目录ID查询上传记录列表(关联模板信息) -->
+    <select id="selectListByCatalogId" resultMap="BaseResultMap">
+        SELECT 
+            COALESCE(u.id, '') as id,
+            t.catalog_id,
+            t.survey_template_id,
+            COALESCE(u.is_required, '1') as is_required,
+            COALESCE(u.is_upload, '0') as is_upload,
+            u.upload_time,
+            u.upload_by,
+            u.file_url,
+            COALESCE(u.order_num, 0) as order_num,
+            COALESCE(u.is_deleted, '0') as is_deleted,
+            COALESCE(u.create_time, t.create_time) as create_time,
+            COALESCE(u.create_by, t.create_by) as create_by,
+            u.update_time,
+            u.update_by,
+            t.survey_template_name,
+            t.template_type,
+            '模版定制' as data_type
+        FROM 
+            cost_survey_template t
+        LEFT JOIN 
+            cost_survey_template_upload u ON t.survey_template_id = u.survey_template_id 
+                AND u.catalog_id = #{catalogId} 
+                AND u.is_deleted = '0'
+        WHERE 
+            t.catalog_id = #{catalogId}
+            AND t.status = '0'
+            AND t.is_delete = '0'
+        ORDER BY 
+            COALESCE(u.order_num, 0) ASC, t.create_time ASC
+    </select>
+
+    <select id="selectPage" resultMap="BaseResultMap">
+        select 
+            <include refid="Base_Column_List"/> 
+        from
+            cost_survey_template_upload
+        ${ew.customSqlSegment}
+    </select>
+    
+    <select id="selectList" resultMap="BaseResultMap">
+        select 
+            <include refid="Base_Column_List"/> 
+        from
+            cost_survey_template_upload
+        ${ew.customSqlSegment}
+    </select>
+    
+    <select id="selectById" resultMap="BaseResultMap">
+        select 
+            <include refid="Base_Column_List"/> 
+        from
+            cost_survey_template_upload
+        where 
+            id = #{id}
+    </select>
+</mapper>
+