Ver Fonte

fit:三表导入导出

zzw há 1 mês atrás
pai
commit
6eecbaf58f

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

@@ -75,7 +75,7 @@ public class CostDocumentTemplateFileManagerImpl extends BaseManagerImpl<CostDoc
                         String replace = whereValue1.replace("?", "'" + whereValue + "'");
                         if (replace.contains("&")) {
                             AuditedUnit auditedUnit = auditedUnitManager.get(unitId);
-                             replace = replace.replace("&", auditedUnit.getUnitId());
+                            replace = replace.replace("&", "'" + auditedUnit.getUnitId() + "'");
                         }
                         costProjectDocumentFile.setWhereValue(replace);
                     }

Diff do ficheiro suprimidas por serem muito extensas
+ 490 - 101
assistMg/src/main/java/com/hotent/enterpriseDeclare/controller/material/CostProjectTaskSurveyGenericController.java


+ 35 - 11
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectApprovalManagerImpl.java

@@ -371,18 +371,42 @@ public class CostProjectApprovalManagerImpl extends BaseManagerImpl<CostProjectA
             throw new BaseException("项目已发布");
         }
 
+        // 给所有被监审企业发送任务通知
         if (ObjectUtil.isNotEmpty(req.getSendType())) {
-            if (req.getSendType().contains(",")) {
-                //站内通知
-                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(),null, "1", costProjectApproval.getProjectName(), req.getContent(),costProjectApproval.getAuditedUnitId().split(",")[0],"","");
-            } else if (req.getSendType().equals("2")) {
-                //短信发送
-            } else {
-                throw new BaseException("请选择正确的发送方式");
+            String[] unitIds = costProjectApproval.getAuditedUnitId().split(",");
+            for (String unitId : unitIds) {
+                // 查询企业对应的账号(用户ID)
+                AuditedUnit auditedUnit = auditedUnitManager.getOne(
+                    new LambdaQueryWrapper<AuditedUnit>()
+                        .eq(AuditedUnit::getUnitId, unitId)
+                        .eq(AuditedUnit::getIsDeleted, "0")
+                );
+
+                if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
+                    String title = "监审任务发布通知";
+                    String content = "您有新的监审任务:" + costProjectApproval.getProjectName();
+                    if (StringUtil.isNotEmpty(req.getContent())) {
+                        content += "," + req.getContent();
+                    }
+
+                    if (req.getSendType().contains(",") || req.getSendType().equals("1")) {
+                        // 站内通知
+                        this.costNoticeManager.sendNotice(
+                            req.getProjectId(),
+                            null,
+                            "1",
+                            title,
+                            content,
+                            unitId,
+                            "系统",
+                            auditedUnit.getAccount()
+                        );
+                    }
+
+                    if (req.getSendType().contains(",") || req.getSendType().equals("2")) {
+                        // 短信发送(预留)
+                    }
+                }
             }
         }
 

+ 250 - 30
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectTaskManagerImpl.java

@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.hotent.base.manager.impl.BaseManagerImpl;
 import com.hotent.base.util.AuthenticationUtil;
 import com.hotent.base.util.StringUtil;
+import com.hotent.baseInfo.manager.AuditedUnitManager;
 import com.hotent.baseInfo.manager.CostCatalogManager;
 import com.hotent.baseInfo.manager.CostDistrictManager;
+import com.hotent.baseInfo.model.AuditedUnit;
 import com.hotent.baseInfo.model.CostCatalog;
 import com.hotent.baseInfo.model.CostDistrict;
 import com.hotent.baseInfo.req.CostTaskSearchReq;
@@ -91,6 +93,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
     @Autowired
     private CostCatalogManager costCatalogManager;
 
+    @Autowired
+    private AuditedUnitManager auditedUnitManager;
+
 
     @Override
     public List<CostProjectTask> getTaskList(CostTaskSearchReq req) throws Exception {
@@ -432,6 +437,11 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
             case "10":
                 // 催报
                 resultMessage = remindUnitTask(task, req);
+                break;
+            case "8":
+                // 复核
+                resultMessage = reviewTask(task, req);
+                break;
             default:
                 return "未知的操作类型";
         }
@@ -628,6 +638,36 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         }
         String prevNodeStatus = prevNode.getNodeKey();
 
+        // 更新流程节点时间:清空当前节点的结束时间,重置上一节点的开始时间
+        CostProjectProccess proccess = costProjectProccessManager.getOne(
+                new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId,task.getProjectId())
+        );
+
+        // 清空当前节点的实际结束时间和操作信息
+        CostProjectProccessNode currentNode = costProjectProccessNodeManager.getOne(
+                new LambdaQueryWrapper<CostProjectProccessNode>()
+                        .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
+                        .eq(CostProjectProccessNode::getProcessNodeKey, task.getCurrentNode())
+        );
+        if (currentNode != null) {
+            currentNode.setActEndTime(null);
+            currentNode.setActUserIds(null);
+            currentNode.setActUserNames(null);
+            currentNode.setActRemarks(null);
+            costProjectProccessNodeManager.updateById(currentNode);
+        }
+
+        // 重置上一节点的开始时间
+        CostProjectProccessNode prevNodeObj = costProjectProccessNodeManager.getOne(
+                new LambdaQueryWrapper<CostProjectProccessNode>()
+                        .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
+                        .eq(CostProjectProccessNode::getProcessNodeKey, prevNodeStatus)
+        );
+        if (prevNodeObj != null) {
+            prevNodeObj.setActStartTime(LocalDateTime.now());
+            costProjectProccessNodeManager.updateById(prevNodeObj);
+        }
+
         // 主任务退回上一步,重置归档状态
         nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
         nTask.setCurrentNode(prevNodeStatus);
@@ -663,37 +703,68 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                 child.setStatus(childStatus);
                 child.setCurrentNode(prevNodeStatus);
                 costProjectTaskManager.updateById(child);
+
+                // 如果退回到意见反馈节点,通知企业
+                if ("yjfk".equals(prevNodeStatus) && StringUtil.isNotEmpty(child.getAuditedUnitId())) {
+                    AuditedUnit auditedUnit = auditedUnitManager.getOne(
+                        new LambdaQueryWrapper<AuditedUnit>()
+                            .eq(AuditedUnit::getUnitId, child.getAuditedUnitId())
+                            .eq(AuditedUnit::getIsDeleted, "0")
+                    );
+                    if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
+                        String noticeTitle = "意见反馈通知";
+                        String noticeContent = "您的项目(" + child.getProjectName() + ")需要反馈意见,请及时处理";
+                        String orgId = getCurrentUserMainOrgId();
+                        Org org = orgManager.getById(orgId);
+                        String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
+                        costNoticeManager.sendNotice(
+                            child.getProjectId(),
+                            child.getId(),
+                            "1",
+                            noticeTitle,
+                            noticeContent,
+                            child.getAuditedUnitId(),
+                            noticeSource,
+                            auditedUnit.getAccount()
+                        );
+                    }
+                }
             }
         }
 
-
         // 通知内容组装
-        String title = NodeConstant.getNodeValueByKey(prevNodeStatus) + "退回上一步";
+        String title = "已退回至" + NodeConstant.getNodeValueByKey(prevNodeStatus);
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String orgId = getCurrentUserMainOrgId();
         Org org = orgManager.getById(orgId);
         String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+        String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]已退回至[" + NodeConstant.getNodeValueByKey(prevNodeStatus) + "]," + task.getProjectName();
+        if (StringUtil.isNotEmpty(req.getContent())) {
+            content += ",原因:" + req.getContent();
+        }
+        costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
         return title;
     }
 
     /**
      * 扭转下一步,修改状态和节点(主任务操作,子任务同步节点流转)
+     * 自动完成办结操作并扭转到下一步
      */
     private String toNextSubmit(CostProjectTask task, CostTaskPageReq req) {
         CostProjectTask nTask = costProjectTaskManager.getById(task.getId());
         if (!"0".equals(task.getPid())) {
             return "仅支持主任务进行此操作";
         }
-        if (!nTask.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode())) {
-            throw new RuntimeException("请办结任务后,再进行扭转下一步");
-        }
+
+        // 获取下一节点
         NodeConstant nextNode = NodeConstant.getNextNode(nTask.getCurrentNode());
         if (nextNode == null) {
             throw new RuntimeException("当前节点已是最后一步,无法扭转");
         }
-        String nextNodeStatus = nextNode.getNodeKey();        
+        String nextNodeStatus = nextNode.getNodeKey();
+
+        // 获取所有子任务
         List<CostProjectTask> children = costProjectTaskManager.list(
                 new LambdaQueryWrapper<CostProjectTask>()
                         .eq(CostProjectTask::getPid, nTask.getId())
@@ -707,28 +778,13 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         if (!allChildrenCompleted) {
             throw new RuntimeException("子任务未全部办结,主任务无法扭转");
         }
-        
-        // 主任务扭转到下一节点
-        nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
-        nTask.setCurrentNode(nextNodeStatus);
-        nTask.setIsGd("0");
-        costProjectTaskManager.updateById(nTask);
-        
-        // 子任务同步节点流转,根据节点设置对应状态
-        String childStatus = "";
-        switch (nextNodeStatus) {
-            case "yjfk":
-                childStatus = TaskStatusConstant.WAIT_FEEDBACK.getStatusCode();
-                break;
-            case "jtsy":
-            case "cjbg":
-            case "gd":
-                childStatus = TaskStatusConstant.COMPLETED.getStatusCode();
-                break;
-            default:
-                childStatus = TaskStatusConstant.AUDITING.getStatusCode();
-                break;
+
+        // 先完成当前节点的办结操作(如果未办结)
+        if (!nTask.getStatus().equals(TaskStatusConstant.COMPLETED.getStatusCode())) {
+            nTask.setStatus(TaskStatusConstant.COMPLETED.getStatusCode());
+            costProjectTaskManager.updateById(nTask);
         }
+
         // 修改当前节点的结束时间
         CostProjectProccess proccess = costProjectProccessManager.getOne(
                 new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId,task.getProjectId())
@@ -743,6 +799,14 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         one.setActRemarks(req.getContent());
         one.setActEndTime(LocalDateTime.now());
         costProjectProccessNodeManager.updateById(one);
+
+        // 主任务扭转到下一节点
+        nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
+        nTask.setCurrentNode(nextNodeStatus);
+        nTask.setIsGd("0");
+        costProjectTaskManager.updateById(nTask);
+
+        // 设置下一节点的开始时间
         CostProjectProccessNode two = costProjectProccessNodeManager.getOne(
                 new LambdaQueryWrapper<CostProjectProccessNode>()
                         .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
@@ -751,23 +815,69 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         two.setActStartTime(LocalDateTime.now());
         costProjectProccessNodeManager.updateById(two);
 
+        // 子任务同步节点流转,根据节点设置对应状态
+        String childStatus = "";
+        switch (nextNodeStatus) {
+            case "yjfk":
+                childStatus = TaskStatusConstant.WAIT_FEEDBACK.getStatusCode();
+                break;
+            case "jtsy":
+            case "cjbg":
+            case "gd":
+                childStatus = TaskStatusConstant.COMPLETED.getStatusCode();
+                break;
+            default:
+                childStatus = TaskStatusConstant.AUDITING.getStatusCode();
+                break;
+        }
+
         // 同步所有非中止状态的子任务
         for (CostProjectTask child : children) {
             if (!child.getStatus().equals(TaskStatusConstant.SUSPENDED.getStatusCode())) {
                 child.setStatus(childStatus);
                 child.setCurrentNode(nextNodeStatus);
                 costProjectTaskManager.updateById(child);
+
+                // 如果扭转到意见反馈节点,通知企业
+                if ("yjfk".equals(nextNodeStatus) && StringUtil.isNotEmpty(child.getAuditedUnitId())) {
+                    AuditedUnit auditedUnit = auditedUnitManager.getOne(
+                        new LambdaQueryWrapper<AuditedUnit>()
+                            .eq(AuditedUnit::getUnitId, child.getAuditedUnitId())
+                            .eq(AuditedUnit::getIsDeleted, "0")
+                    );
+                    if (auditedUnit != null && StringUtil.isNotEmpty(auditedUnit.getAccount())) {
+                        String noticeTitle = "意见反馈通知";
+                        String noticeContent = "您的项目(" + child.getProjectName() + ")需要反馈意见,请及时处理";
+                        String orgId = getCurrentUserMainOrgId();
+                        Org org = orgManager.getById(orgId);
+                        String noticeSource = (org != null ? org.getName() : "系统") + " " + AuthenticationUtil.getCurrentUserFullname();
+                        costNoticeManager.sendNotice(
+                            child.getProjectId(),
+                            child.getId(),
+                            "1",
+                            noticeTitle,
+                            noticeContent,
+                            child.getAuditedUnitId(),
+                            noticeSource,
+                            auditedUnit.getAccount()
+                        );
+                    }
+                }
             }
         }
 
         // 通知内容组装
-        String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "扭转至下一步";
+        String title = NodeConstant.getNodeValueByKey(nextNodeStatus) + "已开始";
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String orgId = getCurrentUserMainOrgId();
         Org org = orgManager.getById(orgId);
         String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+        String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]已办结并扭转至[" + NodeConstant.getNodeValueByKey(nextNodeStatus) + "]," + task.getProjectName();
+        if (StringUtil.isNotEmpty(req.getContent())) {
+            content += ",备注:" + req.getContent();
+        }
+        costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
         return title;
     }
 
@@ -1097,4 +1207,114 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         return title;
     }
 
+    /**
+     * 复核,主任务退回到实地审核节点,子任务恢复到流程初始状态
+     * @param task 任务对象
+     * @param req 请求参数
+     * @return 复核结果消息
+     */
+    private String reviewTask(CostProjectTask task, CostTaskPageReq req) {
+        CostProjectTask nTask = costProjectTaskManager.getById(task.getId());
+        if (!"0".equals(task.getPid())) {
+            return "仅支持主任务进行此操作";
+        }
+
+        // 获取实地审核节点
+        String reviewNodeKey = NodeConstant.sdshenhe.getNodeKey();
+
+        // 更新流程节点时间:清空当前节点及之后节点的时间,重置实地审核节点的开始时间
+        CostProjectProccess proccess = costProjectProccessManager.getOne(
+                new LambdaQueryWrapper<CostProjectProccess>().eq(CostProjectProccess::getProjectId, task.getProjectId())
+        );
+
+        if (proccess != null) {
+            // 清空当前节点的实际结束时间和操作信息
+            CostProjectProccessNode currentNode = costProjectProccessNodeManager.getOne(
+                    new LambdaQueryWrapper<CostProjectProccessNode>()
+                            .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
+                            .eq(CostProjectProccessNode::getProcessNodeKey, task.getCurrentNode())
+            );
+            if (currentNode != null) {
+                currentNode.setActEndTime(null);
+                currentNode.setActUserIds(null);
+                currentNode.setActUserNames(null);
+                currentNode.setActRemarks(null);
+                costProjectProccessNodeManager.updateById(currentNode);
+            }
+
+            // 清空实地审核之后所有节点的时间和操作信息
+            boolean foundReviewNode = false;
+            for (NodeConstant nodeConstant : NodeConstant.values()) {
+                if (nodeConstant.getNodeKey().equals(reviewNodeKey)) {
+                    foundReviewNode = true;
+                    continue;
+                }
+                if (foundReviewNode) {
+                    CostProjectProccessNode node = costProjectProccessNodeManager.getOne(
+                            new LambdaQueryWrapper<CostProjectProccessNode>()
+                                    .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
+                                    .eq(CostProjectProccessNode::getProcessNodeKey, nodeConstant.getNodeKey())
+                    );
+                    if (node != null) {
+                        node.setActStartTime(null);
+                        node.setActEndTime(null);
+                        node.setActUserIds(null);
+                        node.setActUserNames(null);
+                        node.setActRemarks(null);
+                        costProjectProccessNodeManager.updateById(node);
+                    }
+                }
+            }
+
+            // 重置实地审核节点的开始时间
+            CostProjectProccessNode reviewNode = costProjectProccessNodeManager.getOne(
+                    new LambdaQueryWrapper<CostProjectProccessNode>()
+                            .eq(CostProjectProccessNode::getProcessId, proccess.getProcessId())
+                            .eq(CostProjectProccessNode::getProcessNodeKey, reviewNodeKey)
+            );
+            if (reviewNode != null) {
+                reviewNode.setActStartTime(LocalDateTime.now());
+                costProjectProccessNodeManager.updateById(reviewNode);
+            }
+        }
+
+        // 主任务退回到实地审核节点
+        nTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
+        nTask.setCurrentNode(reviewNodeKey);
+        nTask.setIsGd("0");
+        costProjectTaskManager.updateById(nTask);
+
+        // 子任务恢复到流程初始状态(实地审核节点,审核中状态)
+        List<CostProjectTask> children = costProjectTaskManager.list(
+                new LambdaQueryWrapper<CostProjectTask>()
+                        .eq(CostProjectTask::getPid, nTask.getId())
+                        .eq(CostProjectTask::getIsDeleted, "0")
+        );
+
+        String initialNodeKey = NodeConstant.sdshenhe.getNodeKey();
+        for (CostProjectTask child : children) {
+            // 非中止状态的子任务恢复到初始状态
+            if (!child.getStatus().equals(TaskStatusConstant.SUSPENDED.getStatusCode())) {
+                child.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
+                child.setCurrentNode(initialNodeKey);
+                costProjectTaskManager.updateById(child);
+            }
+        }
+
+        // 发送通知
+        String title = "复核-已退回至" + NodeConstant.getNodeValueByKey(reviewNodeKey);
+        String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
+        String orgId = getCurrentUserMainOrgId();
+        Org org = orgManager.getById(orgId);
+        String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
+        String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
+        String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "要求复核,已退回至[" + NodeConstant.getNodeValueByKey(reviewNodeKey) + "]," + task.getProjectName();
+        if (StringUtil.isNotEmpty(req.getContent())) {
+            content += ",原因:" + req.getContent();
+        }
+        costNoticeManager.sendNotice(task.getProjectId(), task.getId(), "1", title, content, enterpriseId, noticeSource, sendTarget);
+
+        return title;
+    }
+
 }

+ 43 - 6
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectTaskPreliminaryOpinionManagerImpl.java

@@ -1,14 +1,23 @@
 package com.hotent.project.manager.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.hotent.baseInfo.manager.AuditedUnitManager;
+import com.hotent.baseInfo.model.AuditedUnit;
 import com.hotent.constant.BaseConstant;
 import com.hotent.project.dao.CostProjectTaskPreliminaryOpinionDao;
+import com.hotent.project.manager.CostProjectTaskManager;
 import com.hotent.project.manager.CostProjectTaskPreliminaryOpinionManager;
+import com.hotent.project.model.CostProjectTask;
 import com.hotent.project.model.CostProjectTaskPreliminaryOpinion;
 import com.hotent.base.manager.impl.BaseManagerImpl;
+import com.hotent.uc.api.model.IUser;
+import com.hotent.uc.util.ContextUtil;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.List;
+
 /**
  * 成本审核意见表 服务实现类(包含初步意见、反馈意见、结论意见)
  *
@@ -19,6 +28,12 @@ import org.springframework.transaction.annotation.Transactional;
 @Service
 public class CostProjectTaskPreliminaryOpinionManagerImpl extends BaseManagerImpl<CostProjectTaskPreliminaryOpinionDao, CostProjectTaskPreliminaryOpinion> implements CostProjectTaskPreliminaryOpinionManager {
 
+    @Autowired
+    private AuditedUnitManager auditedUnitManager;
+
+    @Autowired
+    private CostProjectTaskManager costProjectTaskManager;
+
     @Override
     public CostProjectTaskPreliminaryOpinion getDetail(String id) {
         CostProjectTaskPreliminaryOpinion opinion = this.get(id);
@@ -28,17 +43,39 @@ public class CostProjectTaskPreliminaryOpinionManagerImpl extends BaseManagerImp
     @Override
     public CostProjectTaskPreliminaryOpinion getByTaskId(String taskId) {
         LambdaQueryWrapper<CostProjectTaskPreliminaryOpinion> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(CostProjectTaskPreliminaryOpinion::getTaskId, taskId)
-                   .last("LIMIT 1");
-
-        return this.getOne(queryWrapper);
+        queryWrapper.eq(CostProjectTaskPreliminaryOpinion::getTaskId, taskId);
+        List<CostProjectTaskPreliminaryOpinion> list = this.list(queryWrapper);
+        // 获取当前用户
+        IUser currentUser = ContextUtil.getCurrentUser();
+        AuditedUnit unit = auditedUnitManager.getOne(
+                new LambdaQueryWrapper<AuditedUnit>()
+                        .eq(AuditedUnit::getUnitId, currentUser.getUserId())
+                        .eq(AuditedUnit::getIsDeleted, "0")
+        );
+        if (unit == null){
+            return null ;
+        }
+        return list.stream().filter(item -> item.getUnitId().equals(unit.getUnitId())).findFirst().orElse(null);
     }
 
     @Override
     @Transactional
     public void createOrUpdate(CostProjectTaskPreliminaryOpinion opinion) {
-        //新建或更新
-        this.saveOrUpdate(opinion);
+        if (opinion.getId()==null){
+            // 监审用户 - 获取企业
+            String taskId = opinion.getTaskId();
+            List<CostProjectTask> list = costProjectTaskManager.list(
+                    new LambdaQueryWrapper<CostProjectTask>()
+                            .eq(CostProjectTask::getPid, taskId)
+            );
+            for (CostProjectTask costProjectTask : list) {
+                String auditedUnitId = costProjectTask.getAuditedUnitId();
+                opinion.setUnitId(auditedUnitId);
+                this.save( opinion);
+            }
+        }else {
+            this.updateById(opinion);
+        }
     }
 }
 

+ 2 - 0
assistMg/src/main/java/com/hotent/project/model/CostProjectTaskPreliminaryOpinion.java

@@ -118,5 +118,7 @@ public class CostProjectTaskPreliminaryOpinion extends BaseModel<CostProjectTask
     @JsonProperty("updateBy")
     private String updateBy;
 
+    private String unitId;
+
 }
 

+ 20 - 1
assistMg/src/main/java/com/hotent/project/req/CostProjectDocumentReq.java

@@ -26,57 +26,74 @@ public class CostProjectDocumentReq extends BaseModel<CostProjectDocumentReq> {
 
 
     @ApiModelProperty(value = "主键ID")
+    @JsonProperty("id")
     private String id;
     
     @ApiModelProperty(value = "关联监审项目ID")
+    @JsonProperty("projectId")
     private String projectId;
     
     @ApiModelProperty(value = "关联文书模板ID")
+    @JsonProperty("documentId")
     private String documentId;
 
 
 
     @ApiModelProperty(value = "文书别名")
+    @JsonProperty("documentAlias")
     private String documentAlias;
 
 
     @ApiModelProperty(value = "文书文号id")
+    @JsonProperty("documentWhId")
     private String documentWhId;
 
     @ApiModelProperty(value = "文书文号")
+    @JsonProperty("documentNumber")
     private String documentNumber;
     
     @ApiModelProperty(value = "关联被监审单位ID")
+    @JsonProperty("enterpriseId")
     private String enterpriseId;
     
     @ApiModelProperty(value = "生成时间")
+    @JsonProperty("generateTime")
     private LocalDateTime generateTime;
     
     @ApiModelProperty(value = "电子文书附件ID集合")
+    @JsonProperty("electronicDocumentUrl")
     private String electronicDocumentUrl;
     
     @ApiModelProperty(value = "扫描件附件ID集合")
+    @JsonProperty("scanDocumentUrl")
     private String scanDocumentUrl;
     
     @ApiModelProperty(value = "被监审单位反馈资料附件ID集合")
+    @JsonProperty("feedbackDocumentUrl")
     private String feedbackDocumentUrl;
     
     @ApiModelProperty(value = "是否推送被监审单位:0否 1是")
+    @JsonProperty("isPushed")
     private String isPushed;
     
     @ApiModelProperty(value = "推送时间")
+    @JsonProperty("pushTime")
     private LocalDateTime pushTime;
     
     @ApiModelProperty(value = "反馈时间")
+    @JsonProperty("feedbackTime")
     private LocalDateTime feedbackTime;
     
     @ApiModelProperty(value = "逻辑删除:0正常 1已删除")
+    @JsonProperty("isDeleted")
     private String isDeleted;
 
     @ApiModelProperty(value = "创建时间")
+    @JsonProperty("createTime")
     private LocalDateTime createTime;
 
     @ApiModelProperty(value = "创建人")
+    @JsonProperty("createBy")
     private String createBy;
 
     public List<CostProjectDocumentFile> getCostProjectDocumentFiles() {
@@ -88,13 +105,15 @@ public class CostProjectDocumentReq extends BaseModel<CostProjectDocumentReq> {
     }
 
     @ApiModelProperty(value = "更新时间")
+    @JsonProperty("updateTime")
     private LocalDateTime updateTime;
 
     @ApiModelProperty(value = "更新人")
+    @JsonProperty("updateBy")
     private String updateBy;
     
     @ApiModelProperty(value = "序号")
-
+    @JsonProperty("orderNum")
     private Integer orderNum;
 
     @ApiModelProperty(value = "文书文件内容")

+ 2 - 2
assistMg/src/main/java/com/hotent/surveyinfo/manager/CostSurveyTemplateManager.java

@@ -20,11 +20,9 @@ import java.util.List;
  */
 public interface CostSurveyTemplateManager extends BaseManager<CostSurveyTemplate> {
 
-	IPage<CostSurveyTemplate> getCostSurveyList(ConstSurveyPageReq req);
 
 	IPage<CostSurveyTemplate> getallCurrentCostSurveyList(ConstSurveyPageReq req);
 
-//	List<CostSurveyTemplate> selectByCondition(CostSurveyTemplate costSurveyTemplate );
 	/**
 	 * 根据主键获取详情
 	 * @param id
@@ -48,4 +46,6 @@ public interface CostSurveyTemplateManager extends BaseManager<CostSurveyTemplat
 	List<CostSurveyTemplate> listByCatalogId(String catalogId);
 
 	PageList<CostSurveyTemplate> getCostSurveyListPage( ConstSurveyPageParam params) throws Exception;
+
+	List<CostSurveyTemplate> taskListByCatalogId(String catalogId);
 }

+ 14 - 36
assistMg/src/main/java/com/hotent/surveyinfo/manager/impl/CostSurveyTemplateManagerImpl.java

@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.hotent.base.query.PageList;
 import com.hotent.base.query.QueryFilter;
 import com.hotent.base.util.StringUtil;
+import com.hotent.baseInfo.manager.CostCatalogSurveyManager;
+import com.hotent.baseInfo.model.CostCatalogSurvey;
 import com.hotent.surveyinfo.dao.CostSurveyTemplateHeadersDao;
 import com.hotent.surveyinfo.dao.CostSurveyTemplateVersionDao;
 import com.hotent.surveyinfo.manager.CostSurveyTemplateItemsManager;
@@ -27,6 +29,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
+import java.util.stream.Collectors;
 import javax.sql.DataSource;
 
 /**
@@ -51,45 +54,11 @@ public class CostSurveyTemplateManagerImpl extends BaseManagerImpl<CostSurveyTem
 	private DataSource dataSource;
 	@Autowired
 	private UserManager userService;
-	//@Override
-	public IPage<CostSurveyTemplate> getCostSurveyList(QueryFilter queryFilter) {
-		/*// 构建查询条件
-		LambdaQueryWrapper<CostSurveyTemplate> queryWrapper = new LambdaQueryWrapper<>();
-		queryWrapper.eq(CostSurveyTemplate::getIsDelete, "0")	;
-		IUser user = ContextUtil.getCurrentUser();
-		queryWrapper.eq(CostSurveyTemplate::getCreateBy, user.getAccount())	;
-		// 根据查询条件过滤
-		if (StringUtil.isNotEmpty(req.getType())) {
-			queryWrapper.eq(CostSurveyTemplate::getType, req.getType());
-		}
-		if (StringUtil.isNotEmpty(req.getContentType())) {
-			queryWrapper.like(CostSurveyTemplate::getContentType, req.getContentType());
-		}
-		if (StringUtil.isNotEmpty(req.getKeyword())) {
-			queryWrapper.like(CostSurveyTemplate::getSurveyTemplateName, req.getKeyword()).or().like(CostSurveyTemplate::getSurveyTemplateNameYw, req.getKeyword());
-		}
-		if (req.getStatus() != null) {
-			queryWrapper.eq(CostSurveyTemplate::getStatus, req.getStatus());
-		}
-		if (StringUtil.isNotEmpty(req.getCatalogId())) {
-			queryWrapper.like(CostSurveyTemplate::getCatalogId, req.getCatalogId());
-		}
-
-		// 排序:按编码排序
-        queryWrapper.orderByDesc(CostSurveyTemplate::getCreateTime);
 
-		// 创建分页对象
-		Page<CostSurveyTemplate> page = new Page<>(req.getPageNum(), req.getPageSize());
-		return this.page(page,queryWrapper);*/
-
-		return null;
-	}
+	@Autowired
+	private CostCatalogSurveyManager costCatalogSurveyManager;
 
-	@Override
-	public IPage<CostSurveyTemplate> getCostSurveyList(ConstSurveyPageReq req) {
 
-		return null;
-	}
 
 	@Override
 	public IPage<CostSurveyTemplate> getallCurrentCostSurveyList(ConstSurveyPageReq req) {
@@ -190,5 +159,14 @@ public class CostSurveyTemplateManagerImpl extends BaseManagerImpl<CostSurveyTem
 		return new PageList<>(page);
 	}
 
+	@Override
+	public List<CostSurveyTemplate> taskListByCatalogId(String catalogId) {
+		List<CostCatalogSurvey> list = costCatalogSurveyManager.list(
+				new LambdaQueryWrapper<CostCatalogSurvey>()
+						.eq(CostCatalogSurvey::getCatalogId, catalogId)
+		);
+		return this.listByIds(list.stream().map(CostCatalogSurvey::getSurveyId).collect(Collectors.toList()));
+	}
+
 
 }

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff