浏览代码

fit:财务数据表-财务表模板/流程通知调整

zzw 1 月之前
父节点
当前提交
c7011d3122

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

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 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.req.CostTaskSearchReq;
 import com.hotent.constant.BaseConstant;
@@ -29,7 +30,6 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 
-
 /**
  * 项目任务表 服务实现类
  *
@@ -341,10 +341,8 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
 
         // 发送通知
         String title = NodeConstant.getNodeValueByKey(task.getCurrentNode())+"通过";
-        String auditedUnit = task.getAuditedUnitName() == null ? "" : task.getAuditedUnitName();
-        String projectName = task.getProjectName() == null ? "" : task.getProjectName();
-        String year = task.getYear() == null ? "" : task.getYear();
-        String content = String.format("%s%s%s%s。", year, projectName, auditedUnit,title);
+        // 操作人
+        String content = "["+  NodeConstant.getNodeValueByKey(task.getCurrentNode()) +"]"+AuthenticationUtil.getCurrentUserFullname() + "已通过" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() +")";
         String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
         String noticeSource = "系统";
         String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
@@ -366,7 +364,9 @@ 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(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+
+                String content = "["+  NodeConstant.getNodeValueByKey(task.getCurrentNode()) +"]"+AuthenticationUtil.getCurrentUserFullname() + "已退回" + task.getAuditedUnitName() + "的项目(" + task.getProjectName() +")";
+                costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, content, enterpriseId, noticeSource, sendTarget);
 
                 // 更新任务的当前节点和状态
                 task.setStatus(TaskStatusConstant.NOT_PASSED.getStatusCode());
@@ -389,10 +389,11 @@ 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 sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, content, enterpriseId, noticeSource, sendTarget);
 
         return title;
     }
@@ -425,9 +426,10 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
                         childTask.setStatus(TaskStatusConstant.BCCL.getStatusCode());
                         costProjectTaskManager.updateById(childTask);
                         // 通知内容组装(针对子任务对应的单位)
+                        String childContent = "["+  NodeConstant.getNodeValueByKey(task.getCurrentNode()) +"]"+AuthenticationUtil.getCurrentUserFullname() + "要求" + childTask.getAuditedUnitName() + "补充材料,项目(" + task.getProjectName() +")";
                         String childEnterpriseId = childTask.getAuditedUnitId() == null ? "" : childTask.getAuditedUnitId();
                         String childSendTarget = childTask.getCreateBy() == null ? "" : childTask.getCreateBy();
-                        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), childEnterpriseId, noticeSource, childSendTarget);
+                        costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, childContent, childEnterpriseId, noticeSource, childSendTarget);
                         // 收集单位名称
                         if (StringUtil.isNotEmpty(childTask.getAuditedUnitName())) {
                             unitNames.add(childTask.getAuditedUnitName());
@@ -440,9 +442,10 @@ public class CostProjectTaskManagerImpl extends BaseManagerImpl<CostProjectTaskD
             default:
                 task.setStatus(TaskStatusConstant.BCCL.getStatusCode());
                 costProjectTaskManager.updateById(task);
+                String content = "["+  NodeConstant.getNodeValueByKey(task.getCurrentNode()) +"]"+AuthenticationUtil.getCurrentUserFullname() + "要求" + task.getAuditedUnitName() + "补充材料,项目(" + task.getProjectName() +")";
                 String enterpriseId = task.getAuditedUnitId() == null ? "" : task.getAuditedUnitId();
                 String sendTarget = task.getCreateBy() == null ? "" : task.getCreateBy();
-                costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, req.getContent(), enterpriseId, noticeSource, sendTarget);
+                costNoticeManager.sendNotice(task.getProjectId(),task.getId(),  "1", title, content, enterpriseId, noticeSource, sendTarget);
                 return title;
         }
     }

+ 1 - 1
assistMg/src/main/java/com/hotent/surveyinfo/controller/CostSurveyFdTemplateHeadersController.java

@@ -73,7 +73,7 @@ public class CostSurveyFdTemplateHeadersController extends BaseController<CostSu
 	@GetMapping("/getlistBySurveyTemplateIdAndVersion")
 	public CommonResult<List<CostSurveyFdTemplateHeaders>> getlistBySurveyTemplateIdAndVersion(
 			@ApiParam(name="surveyTemplateId",value="财务数据表id", required = true) @RequestParam String surveyTemplateId,
-			@ApiParam(name="versionId",value="版本id", required = true) @RequestParam String versionId) {
+			@ApiParam(name="versionId",value="版本id", required = false) @RequestParam(required = false) String versionId) {
 
 		List<CostSurveyFdTemplateHeaders> headersList =
 				costSurveyTemplateHeadersDao.selectBySurveyTemplateIdAndVersion(surveyTemplateId, versionId);

+ 1 - 1
assistMg/src/main/java/com/hotent/surveyinfo/controller/CostSurveyTemplateHeadersController.java

@@ -82,7 +82,7 @@ public class CostSurveyTemplateHeadersController extends BaseController<CostSurv
 	@GetMapping("/getlistBySurveyTemplateIdAndVersion")
 	public CommonResult<List<CostSurveyTemplateHeaders>> getlistBySurveyTemplateIdAndVersion(
 			@ApiParam(name="surveyTemplateId",value="成本调查表id", required = true) @RequestParam String surveyTemplateId,
-			@ApiParam(name="versionId",value="版本id", required = true) @RequestParam String versionId) {
+			@ApiParam(name="versionId",value="版本id", required = false) @RequestParam(required = false) String versionId) {
 
 		List<CostSurveyTemplateHeaders> headersList =
 				costSurveyTemplateHeadersDao.selectBySurveyTemplateIdAndVersion(surveyTemplateId, versionId);

+ 12 - 4
assistMg/src/main/resources/mapper/CostSurveyFdTemplateHeadersMapper.xml

@@ -71,9 +71,17 @@
 	</select>
 
 	<select id="selectBySurveyTemplateIdAndVersion" resultType="com.hotent.surveyinfo.model.CostSurveyFdTemplateHeaders">
-		SELECT
-		    <include refid="Base_Column_List"/>
-		    FROM cost_survey_fd_template_headers
-		WHERE survey_template_id = #{surveyTemplateId} AND version_id = #{version}
+		SELECT h.*
+		FROM cost_survey_fd_template_headers h
+		LEFT JOIN cost_survey_fd_template t
+		ON h.survey_template_id = t.survey_template_id
+		WHERE 1=1
+		AND h.survey_template_id = #{surveyTemplateId}
+		<if test="version != null and version != ''">
+			AND h.version_id = #{version}
+		</if>
+		<if test="version == null or version == ''">
+			AND t.status = 0
+		</if>
 	</select>
 </mapper>

+ 11 - 2
assistMg/src/main/resources/mapper/CostSurveyTemplateHeadersMapper.xml

@@ -72,7 +72,16 @@
 	</select>
 
 	<select id="selectBySurveyTemplateIdAndVersion" resultType="com.hotent.surveyinfo.model.CostSurveyTemplateHeaders">
-		SELECT * FROM cost_survey_template_headers
-		WHERE survey_template_id = #{surveyTemplateId} AND version_id = #{version}
+		SELECT h.* FROM cost_survey_template_headers h
+		 left join cost_survey_template t
+		           on h.survey_template_id = t.survey_template_id
+		WHERE 1=1
+		and h.survey_template_id = #{surveyTemplateId}
+		<if test="version != null and version != ''">
+			AND h.version_id = #{version}
+		</if>
+		<if test="version == null or version == ''">
+			AND t.status = 0
+		</if>
 	</select>
 </mapper>