|
|
@ -9,7 +9,6 @@ import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
import com.hnac.hzims.common.utils.DateUtil; |
|
|
|
import com.hnac.hzims.common.utils.DateUtil; |
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
import com.hnac.hzims.message.MessageConstants; |
|
|
|
import com.hnac.hzims.message.dto.BusinessMessageDTO; |
|
|
|
import com.hnac.hzims.message.dto.BusinessMessageDTO; |
|
|
|
import com.hnac.hzims.message.dto.MessagePushRecordDto; |
|
|
|
|
|
|
|
import com.hnac.hzims.message.dto.PlanMsgRecordDto; |
|
|
|
import com.hnac.hzims.message.dto.PlanMsgRecordDto; |
|
|
|
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; |
|
|
|
import com.hnac.hzims.message.entity.config.MessageTemplateEntity; |
|
|
|
import com.hnac.hzims.message.fegin.IMessageClient; |
|
|
|
import com.hnac.hzims.message.fegin.IMessageClient; |
|
|
@ -34,8 +33,6 @@ import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springblade.flow.core.feign.IFlowClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.feign.ISysClient; |
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -51,10 +48,8 @@ import java.time.ZoneId; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.CompletableFuture; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.concurrent.ThreadPoolExecutor; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE; |
|
|
|
import static org.springblade.core.tool.utils.DateUtil.PATTERN_DATE; |
|
|
|
|
|
|
|
|
|
|
@ -273,7 +268,7 @@ public class MaintenanceServiceImpl implements MaintenanceService { |
|
|
|
//拆分设备 每个设备生成一条任务
|
|
|
|
//拆分设备 每个设备生成一条任务
|
|
|
|
if (StringUtil.isNotBlank(finalPlanEntity.getEmCode())) { |
|
|
|
if (StringUtil.isNotBlank(finalPlanEntity.getEmCode())) { |
|
|
|
log.info("finalPlanEntity.getEmCode() : {}", finalPlanEntity.getEmCode()); |
|
|
|
log.info("finalPlanEntity.getEmCode() : {}", finalPlanEntity.getEmCode()); |
|
|
|
List<String> emCodeList = Arrays.asList(finalPlanEntity.getEmCode().split(",")); |
|
|
|
String[] emCodeList = finalPlanEntity.getEmCode().split(","); |
|
|
|
for (String emCode : emCodeList) { |
|
|
|
for (String emCode : emCodeList) { |
|
|
|
taskEntity.setEmCode(emCode); |
|
|
|
taskEntity.setEmCode(emCode); |
|
|
|
this.fillTask(taskEntity, finalPlanEntity); |
|
|
|
this.fillTask(taskEntity, finalPlanEntity); |
|
|
@ -359,23 +354,26 @@ public class MaintenanceServiceImpl implements MaintenanceService { |
|
|
|
BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo); |
|
|
|
BeanUtils.copyProperties(taskEntity, operMaintenanceTaskEntityVo); |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
Map<String, Object> params = new HashMap<>(); |
|
|
|
params.put("taskId", taskEntity.getId()); |
|
|
|
params.put("taskId", taskEntity.getId()); |
|
|
|
List<String> userIdList = Stream.of(taskEntity.getDisposer().split(",")).collect(Collectors.toList()); |
|
|
|
int index = 1; |
|
|
|
String taskUsers = userIdList.stream().filter(o -> StringUtils.isNotBlank(o)).map(s -> { |
|
|
|
for(String userId :taskEntity.getDisposer().split(",")){ |
|
|
|
return "taskUser_".concat(s); |
|
|
|
if(index > 1){ |
|
|
|
}).collect(Collectors.joining(",")); |
|
|
|
params.put("initUserIds" + index , "taskUser_".concat(userId)); |
|
|
|
params.put("initUserIds", taskUsers); |
|
|
|
}else{ |
|
|
|
|
|
|
|
params.put("initUserIds", "taskUser_".concat(userId)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
index++; |
|
|
|
|
|
|
|
} |
|
|
|
params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); |
|
|
|
params.put("operMaintenanceTaskEntityVo", operMaintenanceTaskEntityVo); |
|
|
|
|
|
|
|
|
|
|
|
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId(); |
|
|
|
return flowClient.startProcessInstanceContainNameByKey(processDefinitionKey, String.valueOf(taskEntity.getId()), taskEntity.getTitle(), params).getData().getProcessInstanceId(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/* |
|
|
|
* 推送日常维护任务消息 |
|
|
|
推送日常维护任务消息 |
|
|
|
* |
|
|
|
|
|
|
|
* @return void |
|
|
|
@return void |
|
|
|
* @Param taskEntity 日常维护任务 |
|
|
|
* @Param taskEntity 日常维护任务 |
|
|
|
**/ |
|
|
|
*/ |
|
|
|
private void pushTaskMessage(OperMaintenanceTaskEntity taskEntity) { |
|
|
|
private void pushTaskMessage(OperMaintenanceTaskEntity taskEntity) { |
|
|
|
log.info("开始保存{}的日常维护消息推送记录", taskEntity.getDisposer()); |
|
|
|
log.info("开始保存{}的日常维护消息推送记录", taskEntity.getDisposer()); |
|
|
|
R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId()); |
|
|
|
R<MessageTemplateEntity> templateR = messageClient.getMsgTemplateById(taskEntity.getMessageTemplateId()); |
|
|
|