zzw 1 місяць тому
батько
коміт
7920f70626

+ 21 - 7
assistMg/src/main/java/com/hotent/enterpriseDeclare/controller/opinion/CostAuditTaskInfoController.java

@@ -28,6 +28,7 @@ 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.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -76,12 +77,23 @@ public class CostAuditTaskInfoController {
      */
     @GetMapping(value="/listByTaskId")
     public CommonResult<List<CostSurveyTemplateUpload>> listByTaskId(
-            @ApiParam(name="tas kId", value="任务ID", required = true)
-            @RequestParam String taskId) throws Exception {
-
+            @RequestParam(required = false) String taskId,
+            @RequestParam(required = false) String catalogId
+            ) throws Exception {
         List<CostSurveyTemplateUpload> uploadList = costSurveyTemplateUploadManager.listByTaskId(taskId);
-
-        return CommonResult.<List<CostSurveyTemplateUpload>>ok().value(uploadList);
+        //创建记录
+        if (uploadList.isEmpty()){
+            List<CostSurveyTemplateUpload> costSurveyTemplateUploads = costSurveyTemplateUploadManager.listByCatalogId(catalogId);
+            for (CostSurveyTemplateUpload costSurveyTemplateUpload : costSurveyTemplateUploads) {
+                CostSurveyTemplateUpload upload = new CostSurveyTemplateUpload();
+                BeanUtils.copyProperties(costSurveyTemplateUpload, upload);
+                upload.setId(null);
+                upload.setTaskId(taskId);
+                upload.setIsUpload("0");
+                costSurveyTemplateUploadManager.save(upload);
+            }
+        }
+        return CommonResult.<List<CostSurveyTemplateUpload>>ok().value( costSurveyTemplateUploadManager.listByTaskId(taskId));
     }
 
     /**
@@ -234,7 +246,7 @@ public class CostAuditTaskInfoController {
         }
 
         List<CostSurveyTemplateUploadData> dataList = costSurveyTemplateUploadDataManager.
-                listByUploadIdAndAuditedUnitId(queryData.getUploadId(), queryData.getAuditedUnitId(),queryData.getPeriodRecordId());
+                listByUploadIdAndAuditedUnitId(queryData.getUploadId(),queryData.getPeriodRecordId());
         return CommonResult.<List<CostSurveyTemplateUploadData>>ok().value(dataList);
     }
 
@@ -356,7 +368,9 @@ public class CostAuditTaskInfoController {
      */
     @PostMapping(value="/review")
     public CommonResult<String> review(@RequestBody CostSurveyTemplateUpload costProjectTaskMaterial){
-        costSurveyTemplateUploadManager.updateById(costProjectTaskMaterial);
+        CostSurveyTemplateUpload upload = costSurveyTemplateUploadManager.getById(costProjectTaskMaterial.getId());
+        upload.setAuditedStatus(costProjectTaskMaterial.getAuditedStatus());
+        costSurveyTemplateUploadManager.updateById(upload);
         return CommonResult.<String>ok();
     }
 }

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

@@ -25,12 +25,10 @@ public interface CostSurveyTemplateUploadDataDao extends BaseMapper<CostSurveyTe
     /**
      * 根据上传记录ID和企业ID查询数据列表
      * @param uploadId 上传记录ID
-     * @param auditedUnitId 企业ID
      * @return 数据列表
      */
     List<CostSurveyTemplateUploadData> selectByUploadIdAndAuditedUnitId(
             @Param("uploadId") String uploadId,
-            @Param("auditedUnitId") String auditedUnitId,
             @Param("periodRecordId") String periodRecordId
     );
     

+ 1 - 2
assistMg/src/main/java/com/hotent/enterpriseDeclare/manager/CostSurveyTemplateUploadDataManager.java

@@ -38,10 +38,9 @@ public interface CostSurveyTemplateUploadDataManager extends BaseManager<CostSur
     /**
      * 根据上传记录ID和企业ID查询数据列表
      * @param uploadId 上传记录ID
-     * @param auditedUnitId 企业ID
      * @return 数据列表
      */
-    List<CostSurveyTemplateUploadData> listByUploadIdAndAuditedUnitId(String uploadId, String auditedUnitId,String periodRecordId);
+    List<CostSurveyTemplateUploadData> listByUploadIdAndAuditedUnitId(String uploadId, String periodRecordId);
     
     /**
      * 根据行数据ID查询数据列表

+ 5 - 2
assistMg/src/main/java/com/hotent/enterpriseDeclare/manager/impl/CostSurveyTemplateUploadDataManagerImpl.java

@@ -51,8 +51,8 @@ public class CostSurveyTemplateUploadDataManagerImpl extends BaseManagerImpl<Cos
     }
 
     @Override
-    public List<CostSurveyTemplateUploadData> listByUploadIdAndAuditedUnitId(String uploadId, String auditedUnitId,String periodRecordId) {
-        return costSurveyTemplateUploadDataDao.selectByUploadIdAndAuditedUnitId(uploadId, auditedUnitId,periodRecordId);
+    public List<CostSurveyTemplateUploadData> listByUploadIdAndAuditedUnitId(String uploadId, String periodRecordId) {
+        return costSurveyTemplateUploadDataDao.selectByUploadIdAndAuditedUnitId(uploadId, periodRecordId);
     }
 
     @Override
@@ -119,6 +119,9 @@ public class CostSurveyTemplateUploadDataManagerImpl extends BaseManagerImpl<Cos
         }
         CostSurveyTemplateUpload upload = costSurveyTemplateUploadManager.getById(uploadId);
         upload.setIsUpload("1");
+        if ("2".equals( upload.getAuditedStatus())){
+            upload.setAuditedStatus("0");
+        }
         costSurveyTemplateUploadManager.updateById(upload);
     }
 

+ 3 - 0
assistMg/src/main/java/com/hotent/project/controller/CostProjectTaskMaterialController.java

@@ -54,6 +54,9 @@ public class CostProjectTaskMaterialController extends BaseController<CostProjec
 		if(StringUtils.isNotBlank(costProjectTaskMaterial.getFileUrl())) {
 			costProjectTaskMaterial.setIsUpload("1");
 		}
+		if ("2".equals(costProjectTaskMaterial.getAuditedStatus())){
+			costProjectTaskMaterial.setAuditedStatus("0");
+		}
 		baseService.createOrUpdate(costProjectTaskMaterial);
 		return CommonResult.<String>ok().message(msg);
 	}

+ 36 - 12
assistMg/src/main/java/com/hotent/project/manager/impl/CostProjectTaskManagerImpl.java

@@ -21,7 +21,9 @@ import com.hotent.project.resp.CostProjectApprovalDetailResp;
 import com.hotent.surveyinfo.manager.CostSurveyTemplateUploadManager;
 import com.hotent.surveyinfo.model.CostSurveyTemplateUpload;
 import com.hotent.uc.api.model.IUser;
+import com.hotent.uc.manager.OrgManager;
 import com.hotent.uc.manager.UserManager;
+import com.hotent.uc.model.Org;
 import com.hotent.uc.model.User;
 import com.hotent.uc.util.ContextUtil;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +32,8 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
+import static com.hotent.base.util.AuthenticationUtil.getCurrentUserMainOrgId;
+
 /**
  * 项目任务表 服务实现类
  *
@@ -67,7 +71,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
 
     @Autowired
     private CostProjectTaskLogManager costProjectTaskLogManager;
-
+    @Autowired
+    private OrgManager orgManager;
 
 
     @Override
@@ -293,6 +298,11 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         task.setCurrentNode(NodeConstant.clcs.getNodeKey());
         task.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
         this.updateById(task);
+        // 3. 父任务也修改
+        CostProjectTask parentTask = this.getById(task.getPid());
+        parentTask.setCurrentNode(NodeConstant.clcs.getNodeKey());
+        parentTask.setStatus(TaskStatusConstant.AUDITING.getStatusCode());
+        this.updateById(parentTask);
 
         return "任务提交成功,已进入材料初审阶段";
     }
@@ -396,7 +406,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         // 操作人
         String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "已通过" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
-        String noticeSource = "系统";
+        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, content, enterpriseId, noticeSource, sendTarget);
 
@@ -414,7 +426,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                 // 通知内容组装
                 String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "退回";
                 String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
-                String noticeSource = "系统";
+                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() + "已退回" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
@@ -443,7 +457,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + TaskStatusConstant.getStatusNameByCode(status);
         String content = "[" + NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "]" + AuthenticationUtil.getCurrentUserFullname() + "已" + TaskStatusConstant.getStatusNameByCode(status) + task.getAuditedUnitName() + "的项目(" + task.getProjectName() + ")";
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
-        String noticeSource = "系统";
+        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, content, enterpriseId, noticeSource, sendTarget);
 
@@ -456,7 +472,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
     private String supplementMaterial(CostProjectTask task, CostTaskPageReq req) {
         String currentNode = task.getCurrentNode();
         String title = NodeConstant.getNodeValueByKey(currentNode) + TaskStatusConstant.BCCL.getStatusName();
-        String noticeSource = "系统";
+        String orgId = getCurrentUserMainOrgId();
+        Org org = orgManager.getById(orgId);
+        String noticeSource = (org.getName()) + " " + AuthenticationUtil.getCurrentUserFullname();
 
         switch (currentNode) {
             // 集体审议节点:支持指定多个子任务补充材料
@@ -530,7 +548,7 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                         .eq(CostProjectTask::getIsDeleted, "0")
         );
 
-        // 根据退回后的节点,设置子任务状态(参考completeTask的逻辑)
+        // 根据退回后的节点,设置子任务状态
         String childStatus = "";
         switch (prevNodeStatus) {
             case "yjfk":
@@ -546,16 +564,20 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         }
 
         for (CostProjectTask child : children) {
-            child.setStatus(childStatus);
-            child.setCurrentNode(prevNodeStatus);
-            costProjectTaskManager.updateById(child);
+            if (!child.getStatus().equals(TaskStatusConstant.SUSPENDED.getStatusCode())) {
+                child.setStatus(childStatus);
+                child.setCurrentNode(prevNodeStatus);
+                costProjectTaskManager.updateById(child);
+            }
         }
 
+
         // 通知内容组装
         String title = NodeConstant.getNodeValueByKey(prevNodeStatus) + "退回上一步";
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
-        String noticeSource = "系统";
-        String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
+        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);
 
         return title;
@@ -612,7 +634,9 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
         // 通知内容组装
         String title = NodeConstant.getNodeValueByKey(task.getCurrentNode()) + "扭转至下一步";
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
-        String noticeSource = "系统";
+        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);
 

+ 0 - 56
assistMg/src/main/resources/mapper/CostProjectTaskMaterialMapper.xml

@@ -1,56 +0,0 @@
-<?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.project.dao.CostProjectTaskMaterialDao">
-
-    <!-- 通用查询映射结果 -->
-    <resultMap id="BaseResultMap" type="com.hotent.project.model.CostProjectTaskMaterial">
-        <id column="id" property="id" />
-    <result column="task_id" property="taskId" />
-    <result column="audited_status" property="auditedStatus" />
-    <result column="audited_user_id" property="auditedUserId" />
-    <result column="create_by" property="createBy" />
-    <result column="project_id" property="projectId" />
-    <result column="catalog_id" property="catalogId" />
-    <result column="information_type" property="informationType" />
-    <result column="information_name" property="informationName" />
-    <result column="information_require" property="informationRequire" />
-    <result column="order_num" property="orderNum" />
-    <result column="is_required" property="isRequired" />
-    <result column="template_id" property="templateId" />
-    <result column="create_time" property="createTime" />
-    <result column="update_by" property="updateBy" />
-    <result column="format_required" property="formatRequired" />
-    <result column="update_time" property="updateTime" />
-    <result column="is_upload" property="isUpload" />
-    </resultMap>
-
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, task_id, audited_status, audited_user_id, create_by, project_id,is_upload, catalog_id, information_type, information_name, information_require, order_num, is_required, template_id, create_time, update_by, format_required, update_time
-    </sql>
-
-	<select id="selectPage" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
-		from
-			cost_project_task_material
-		${ew.customSqlSegment}
-	</select>
-	
-	<select id="selectList" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
-		from
-			cost_project_task_material
-		${ew.customSqlSegment}
-	</select>
-	
-	<select id="selectById" resultMap="BaseResultMap">
-		select 
-			<include refid="Base_Column_List"/> 
-		from
-			cost_project_task_material
-		where 
-		    id = ${id}
-	</select>
-</mapper>

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

@@ -69,7 +69,6 @@
             cost_survey_template_upload_data
         WHERE 
             upload_id = #{uploadId}
-            AND audited_unit_id = #{auditedUnitId}
             AND is_deleted = '0'
             <if test="periodRecordId != null">
                 AND period_record_id = #{periodRecordId}