Răsfoiți Sursa

废除通知

huangjn 2 ani în urmă
părinte
comite
02f10e0c8b

+ 7 - 0
blade-service-api/blade-business-api/src/main/java/org/springblade/business/feign/TaskClient.java

@@ -27,6 +27,7 @@ public interface TaskClient {
     String QUERY_FORM_DATA_ID = API_PREFIX + "/query-form-data-id";
     String QUERY_BUSINESS_DATA_TASK = API_PREFIX + "/query-business-data-task";
     String QUERY_APPROVAL_USER = API_PREFIX + "/query-approval-user";
+    String QUERY_APPROVAL_USER_TASK_ID = API_PREFIX + "/query-approval-user-by-task-id";
     String QUERY_BUSINESS_TABLE_E_VISA_CONFIG = API_PREFIX + "/query-business-table-e-visa-config";
     String QUERY_TASK_CONTRACT_ID = API_PREFIX + "/query-task-contract-id";
 
@@ -48,6 +49,12 @@ public interface TaskClient {
     @GetMapping(QUERY_APPROVAL_USER)
     List<TaskParallel> queryApprovalUser(@RequestParam String formDataIds);
 
+    /**
+     * 获取填报人列表
+     */
+    @GetMapping(QUERY_APPROVAL_USER_TASK_ID)
+    List<TaskParallel> queryApprovalUserByTaskId(@RequestParam String taskId);
+
     /**
      * 获取业务数据
      */

+ 27 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/ArchiveFileController.java

@@ -13,6 +13,7 @@ import lombok.AllArgsConstructor;
 
 import org.apache.commons.lang.StringUtils;
 import org.springblade.business.entity.Task;
+import org.springblade.business.entity.TaskParallel;
 import org.springblade.business.feign.MessageWarningClient;
 import org.springblade.business.feign.OperationLogClient;
 import org.springblade.business.feign.RecycleBinClient;
@@ -166,6 +167,10 @@ public class ArchiveFileController extends BladeController {
 					this.archiveFileService.update(Wrappers.<ArchiveFile>lambdaUpdate().set(ArchiveFile::getEVisaFile, null).set(ArchiveFile::getStatus, 0).in(ArchiveFile::getId, Arrays.asList(task.getFormDataId().split(","))));
 				}
 				List<ArchiveFile> archiveFiles = this.archiveFileService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
+
+				//获取当前任务的环节审批人
+				List<TaskParallel> linkList = this.taskClient.queryApprovalUserByTaskId(task.getProcessInstanceId());
+
 				for(ArchiveFile archiveFile : archiveFiles){
 					try{
 						ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(archiveFile.getProjectId())).get(0);
@@ -191,6 +196,28 @@ public class ArchiveFileController extends BladeController {
 						json.put("operationObjName", archiveFile.getFileName());
 						this.operationLogClient.saveUserOperationLog(26, "其它文件", "工程文件", json);
 
+						if(linkList != null && linkList.size() > 0){
+
+							List<MessageWarningVO> messageList = new ArrayList<>();
+							for(TaskParallel taskParallel : linkList){
+								messageList.add(new MessageWarningVO(
+										Long.parseLong(task.getProjectId()),
+										Long.parseLong(task.getContractId()),
+										//废除通知
+										3,
+										//内容
+										(StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + archiveFile.getFileName() + "】流程,请及时查看",
+										//推送的目标人
+										Long.parseLong(taskParallel.getTaskUser()),
+										//默认未读
+										0
+								));
+							}
+							if(messageList.size() > 0){
+								this.messageWarningClient.savePushUserMessageWarning(messageList);
+							}
+						}
+
 					}catch (Exception e){
 						e.printStackTrace();
 					}

+ 38 - 2
blade-service/blade-business/src/main/java/org/springblade/business/controller/ContractLogController.java

@@ -84,7 +84,7 @@ public class ContractLogController extends BladeController {
 	@ApiImplicitParams({
 			@ApiImplicitParam(name = "contractId", value = "合同段ID"),
 			@ApiImplicitParam(name = "nodePrimaryKeyId", value = "左侧填报日志节点primaryKeyId"),
-			@ApiImplicitParam(name = "time", value = "所选的时间,格式为yyyy-MM-dd")
+			@ApiImplicitParam(name = "time", value = "所选的时间,格式为yyyy-MM-dd、yyyy-MM、yyyy")
 	})
 	public R<List<ContractLog>> queryLogByContractIdAndNodePrimaryKeyId(@RequestParam String contractId, @RequestParam String nodePrimaryKeyId, @RequestParam String time){
 		return R.data(this.contractLogService.list(Wrappers.<ContractLog>lambdaQuery().eq(ContractLog::getContractId, contractId).eq(ContractLog::getWbsNodeId, nodePrimaryKeyId).like(ContractLog::getRecordTime, time)));
@@ -336,8 +336,13 @@ public class ContractLogController extends BladeController {
 				}
 
 				List<ContractLog> contractLogs = this.contractLogService.getBaseMapper().selectBatchIds(Arrays.asList(task.getFormDataId().split(",")));
+				List<String> fileNameList = new ArrayList<>();
 				for(ContractLog contractLog : contractLogs){
 
+					if(!fileNameList.contains(contractLog.getFileName())){
+						fileNameList.add(contractLog.getFileName());
+					}
+
 					ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(contractLog.getProjectId().toString())).get(0);
 					ContractInfo contractInfo = this.contractClient.getContractById(contractLog.getContractId());
 
@@ -354,7 +359,6 @@ public class ContractLogController extends BladeController {
 								contractLog.getCreateUser(),
 								//默认未读
 								0
-
 						));
 
 						//保存操作记录
@@ -364,11 +368,43 @@ public class ContractLogController extends BladeController {
 
 						this.operationLogClient.saveUserOperationLog(9, "台账日志", "日志填报", json);
 
+
 					}catch (Exception e){
 						e.printStackTrace();
 					}
 
 				}
+				try{
+					//获取当前任务的环节审批人
+					List<TaskParallel> linkList = this.taskClient.queryApprovalUserByTaskId(task.getProcessInstanceId());
+					if(linkList != null && linkList.size() > 0){
+						ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(task.getProjectId())).get(0);
+						ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(task.getContractId()));
+
+						List<MessageWarningVO> messageList = new ArrayList<>();
+						for(String fileName : fileNameList){
+							for(TaskParallel taskParallel : linkList){
+								messageList.add(new MessageWarningVO(
+										Long.parseLong(task.getProjectId()),
+										Long.parseLong(task.getContractId()),
+										//废除通知
+										3,
+										//内容
+										(StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + fileName + "】流程,请及时查看",
+										//推送的目标人
+										Long.parseLong(taskParallel.getTaskUser()),
+										//默认未读
+										0
+								));
+							}
+						}
+						if(messageList.size() > 0){
+							this.messageWarningClient.savePushUserMessageWarning(messageList);
+						}
+					}
+				}catch (Exception e){
+					e.printStackTrace();
+				}
 			}
 		}
 		return R.data(true);

+ 29 - 0
blade-service/blade-business/src/main/java/org/springblade/business/controller/InformationWriteQueryController.java

@@ -602,6 +602,9 @@ public class InformationWriteQueryController extends BladeController {
 						projects.forEach(project -> projectMap.put(project.getId().toString(), project));
 						contracts.forEach(contract -> contractMap.put(contract.getId().toString(), contract));
 
+						//获取当前任务的环节审批人
+						List<TaskParallel> linkList = this.taskClient.queryApprovalUserByTaskId(task.getProcessInstanceId());
+
 						for(InformationQuery query : queries){
 							if(StringUtils.isNotEmpty(query.getFileUserIdAndName())){
 								String[] userArray = query.getFileUserIdAndName().split(",");
@@ -638,8 +641,34 @@ public class InformationWriteQueryController extends BladeController {
 									}
 								}
 							}
+
+							if(linkList != null && linkList.size() > 0){
+								ProjectInfo projectInfo = this.projectClient.queryProjectList(Func.toStrList(task.getProjectId())).get(0);
+								ContractInfo contractInfo = this.contractClient.getContractById(Long.parseLong(task.getContractId()));
+
+								List<MessageWarningVO> messageList = new ArrayList<>();
+								for(TaskParallel taskParallel : linkList){
+									messageList.add(new MessageWarningVO(
+											Long.parseLong(task.getProjectId()),
+											Long.parseLong(task.getContractId()),
+											//废除通知
+											3,
+											//内容
+											(StringUtils.isNotEmpty(projectInfo.getProjectAlias()) ? projectInfo.getProjectAlias() : projectInfo.getProjectName()) + contractInfo.getContractName() + "的用户" + AuthUtil.getNickName() + "废除了【" + query.getName() + "】流程,请及时查看",
+											//推送的目标人
+											Long.parseLong(taskParallel.getTaskUser()),
+											//默认未读
+											0
+									));
+								}
+								if(messageList.size() > 0){
+									this.messageWarningClient.savePushUserMessageWarning(messageList);
+								}
+							}
+
 						}
 					}
+
 					try{
 						JSONObject json = new JSONObject();
 						json.put("operationObjIds", Func.toStrList(task.getFormDataId()));

+ 1 - 1
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/ContractLogClientImpl.java

@@ -141,7 +141,7 @@ public class ContractLogClientImpl implements ContractLogClient {
             contractLog.setCreateUser(AuthUtil.getUserId());
             contractLog.setCreateUserName(AuthUtil.getNickName());
             contractLog.setStatus(0);
-            contractLog.setFileName(saveContractLogVO.getRecordTime() + " " + node.getNodeName());
+            contractLog.setFileName(saveContractLogVO.getRecordTime() + " " + node.getNodeName() + " " + AuthUtil.getNickName());
 
             if(saveContractLogVO.getCorrelationIds() != null && saveContractLogVO.getCorrelationIds().size() > 0){
                 List<JSONObject> list = saveContractLogVO.getCorrelationIds();

+ 5 - 0
blade-service/blade-business/src/main/java/org/springblade/business/feignClient/TaskClientImpl.java

@@ -83,6 +83,11 @@ public class TaskClientImpl implements TaskClient {
         return this.taskService.queryApprovalUser(formDataIds);
     }
 
+    @Override
+    public List<TaskParallel> queryApprovalUserByTaskId(String taskId) {
+        return this.taskParallelService.list(Wrappers.<TaskParallel>lambdaQuery().eq(TaskParallel::getProcessInstanceId, taskId));
+    }
+
     @Override
     public TaskApprovalVO queryBusinessDataTask(TaskApprovalVO taskApprovalVO) {
         return this.taskService.queryBusinessDataTask(taskApprovalVO);

+ 0 - 1
blade-service/blade-manager/src/main/java/org/springblade/manager/controller/SignPfxFileController.java

@@ -20,7 +20,6 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.mixsmart.utils.StringUtils;
-import feign.Contract;
 import io.swagger.annotations.*;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import lombok.AllArgsConstructor;

+ 7 - 4
blade-service/blade-manager/src/main/java/org/springblade/manager/feign/WbsTreeContractClientImpl.java

@@ -3,14 +3,12 @@ package org.springblade.manager.feign;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.mixsmart.utils.StringUtils;
 import lombok.AllArgsConstructor;
 import org.springblade.common.constant.CommonConstant;
 import org.springblade.common.utils.CommonUtil;
-import org.springblade.core.tool.utils.Func;
 import org.springblade.manager.entity.ContractInfo;
 import org.springblade.manager.entity.ContractRelationJlyz;
 import org.springblade.manager.entity.WbsTreeContract;
@@ -22,6 +20,7 @@ import org.springblade.manager.vo.WbsTreeContractTreeVOS;
 import org.springblade.system.cache.ParamCache;
 import org.springblade.system.entity.DictBiz;
 import org.springblade.system.feign.IDictBizClient;
+import org.springblade.system.feign.ISysClient;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.*;
@@ -36,6 +35,8 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
 
     private final IDictBizClient dictBizClient;
 
+    private final ISysClient sysClient;
+
     @Override
     public List<WbsTreeContract> queryContractTreeNodeByPKIds(List<Long> PKIds) {
         return this.wbsTreeContractService.list(Wrappers.<WbsTreeContract>lambdaQuery().in(WbsTreeContract::getPKeyId, PKIds));
@@ -197,9 +198,11 @@ public class WbsTreeContractClientImpl implements WbsTreeContractClient {
             List<WbsTreeContractTreeVOS> vosResult = new ArrayList<>();
 
             //获取施工配置,如果未找到配置则使用默认判断
-            String sgTheLog = StringUtils.isNotEmpty(ParamCache.getValue(CommonConstant.SG_THE_LOG)) ? ParamCache.getValue(CommonConstant.SG_THE_LOG) : "7,9,13";
+            String sgLogConfig = this.sysClient.getParamValue(CommonConstant.SG_THE_LOG).getData();
+            String sgTheLog = StringUtils.isNotEmpty(sgLogConfig) ? sgLogConfig : "7,9,13";
             //获取监理配置,如果未找到配置则使用默认判断
-            String jlTheLOg = StringUtils.isNotEmpty(ParamCache.getValue(CommonConstant.JL_THE_LOG)) ? ParamCache.getValue(CommonConstant.JL_THE_LOG) : "8,10,11,12";
+            String jlLogConfig = this.sysClient.getParamValue(CommonConstant.JL_THE_LOG).getData();
+            String jlTheLOg = StringUtils.isNotEmpty(jlLogConfig) ? jlLogConfig : "8,10,11,12";
 
             result.forEach(node -> {
                if(new Integer("2").equals(contract.getContractType()) && Arrays.asList(jlTheLOg.split(",")).contains(node.getNodeType().toString())){