|
|
@ -4,7 +4,11 @@ import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
|
|
|
|
import com.hnac.hzims.message.dto.BusinessMessageDTO; |
|
|
|
|
|
|
|
import com.hnac.hzims.message.fegin.IMessageClient; |
|
|
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
|
|
|
import com.hnac.hzims.middle.process.to.ProcessWorkFlowResponse; |
|
|
|
|
|
|
|
import com.hnac.hzims.operational.access.dto.AccessPlanV4DTO; |
|
|
|
import com.hnac.hzims.operational.access.dto.AccessTaskV4DTO; |
|
|
|
import com.hnac.hzims.operational.access.dto.AccessTaskV4DTO; |
|
|
|
import com.hnac.hzims.operational.access.dto.OperAccessTaskDetailDTO; |
|
|
|
import com.hnac.hzims.operational.access.dto.OperAccessTaskDetailDTO; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; |
|
|
|
import com.hnac.hzims.operational.access.entity.OperAccessMaterialEntity; |
|
|
@ -25,6 +29,9 @@ import org.springblade.flow.core.entity.BladeFlow; |
|
|
|
import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springblade.flow.core.utils.FlowUtil; |
|
|
|
import org.springblade.flow.core.utils.FlowUtil; |
|
|
|
import org.springblade.flow.core.utils.TaskUtil; |
|
|
|
import org.springblade.flow.core.utils.TaskUtil; |
|
|
|
|
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
@ -47,8 +54,14 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { |
|
|
|
|
|
|
|
|
|
|
|
private final IOperAccessTaskDetailService detailService; |
|
|
|
private final IOperAccessTaskDetailService detailService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final ISysClient sysClient; |
|
|
|
|
|
|
|
|
|
|
|
private final IFlowClient flowClient; |
|
|
|
private final IFlowClient flowClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IMessageClient messageClient; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 开启检修任务流程 |
|
|
|
* 开启检修任务流程 |
|
|
|
* @param entity |
|
|
|
* @param entity |
|
|
@ -161,16 +174,52 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service { |
|
|
|
if(ObjectUtil.isNotEmpty(variables.get("examine")) && (Boolean) variables.get("examine")){ |
|
|
|
if(ObjectUtil.isNotEmpty(variables.get("examine")) && (Boolean) variables.get("examine")){ |
|
|
|
entity.setTaskName("流程结束"); |
|
|
|
entity.setTaskName("流程结束"); |
|
|
|
entity.setNextStepOperator("流程结束,无需人员处理"); |
|
|
|
entity.setNextStepOperator("流程结束,无需人员处理"); |
|
|
|
entity.setActEndTime(new Date()); |
|
|
|
|
|
|
|
// 更新任务数据
|
|
|
|
// 更新任务数据
|
|
|
|
this.taskService.updateById(entity); |
|
|
|
this.taskService.updateById(entity); |
|
|
|
}else if(ObjectUtil.isNotEmpty(variables.get("examine")) && !(Boolean) variables.get("examine")){ |
|
|
|
}else if(ObjectUtil.isEmpty(variables.get("examine")) && !(Boolean) variables.get("examine")){ |
|
|
|
|
|
|
|
String content = "您有一条检修任务待处理!检修任务名称:".concat(entity.getName()) |
|
|
|
|
|
|
|
.concat(",当前环节:") |
|
|
|
|
|
|
|
.concat(processWorkFlowResponse.getTaskName()); |
|
|
|
|
|
|
|
this.sendMessage(entity,processWorkFlowResponse.getUserId(),content); |
|
|
|
return this.taskService.updateById(entity); |
|
|
|
return this.taskService.updateById(entity); |
|
|
|
} |
|
|
|
} |
|
|
|
// 保存检修材料
|
|
|
|
// 保存检修材料
|
|
|
|
this.saveMaterial(entity); |
|
|
|
this.saveMaterial(entity); |
|
|
|
// 保存检修详情
|
|
|
|
// 保存检修详情
|
|
|
|
this.saveDetails(entity); |
|
|
|
this.saveDetails(entity); |
|
|
|
|
|
|
|
// 发送消息
|
|
|
|
|
|
|
|
String content = "您有一条检修任务待审批!检修任务名称:".concat(entity.getName()) |
|
|
|
|
|
|
|
.concat(",当前环节:") |
|
|
|
|
|
|
|
.concat(processWorkFlowResponse.getTaskName()); |
|
|
|
|
|
|
|
this.sendMessage(entity,processWorkFlowResponse.getUserId(),content); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 推送业务流程消息 |
|
|
|
|
|
|
|
* @param entity |
|
|
|
|
|
|
|
* @param userId |
|
|
|
|
|
|
|
* @param content |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private void sendMessage(AccessTaskV4DTO entity, String userId, String content) { |
|
|
|
|
|
|
|
BusinessMessageDTO message = new BusinessMessageDTO(); |
|
|
|
|
|
|
|
// 计划Id
|
|
|
|
|
|
|
|
message.setTaskId(entity.getId()); |
|
|
|
|
|
|
|
message.setBusinessClassify(MessageConstants.BusinessClassifyEnum.BUSINESS.getKey()); |
|
|
|
|
|
|
|
message.setBusinessKey(MessageConstants.BusinessClassifyEnum.OVERHAUL_TASK.getKey()); |
|
|
|
|
|
|
|
// 主题
|
|
|
|
|
|
|
|
message.setSubject(MessageConstants.BusinessClassifyEnum.OVERHAUL_TASK.getDescription()); |
|
|
|
|
|
|
|
message.setDeptId(entity.getCreateDept()); |
|
|
|
|
|
|
|
R<String> result = sysClient.getDeptName(entity.getCreateDept()); |
|
|
|
|
|
|
|
if (result.isSuccess()) { |
|
|
|
|
|
|
|
message.setDeptName(result.getData()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 内容
|
|
|
|
|
|
|
|
message.setContent(content); |
|
|
|
|
|
|
|
message.setTenantId("200000"); |
|
|
|
|
|
|
|
User admin = userClient.userByAccount("200000", "admin").getData(); |
|
|
|
|
|
|
|
message.setCreateUser(admin.getId()); |
|
|
|
|
|
|
|
message.setUserIds(userId); |
|
|
|
|
|
|
|
messageClient.sendAppAndWsMsgByUsers(message); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |