diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java index 01bf92b..5fb7af9 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/accessTicket/service/impl/AccessTicketServiceImpl.java @@ -36,8 +36,12 @@ import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.*; import org.springblade.flow.core.entity.BladeFlow; import org.springblade.flow.core.feign.IFlowClient; +import org.springblade.message.MessageConstants; +import org.springblade.message.dto.BusinessMessageDTO; +import org.springblade.message.fegin.IMessageClient; import org.springblade.system.cache.DictCache; import org.springblade.system.entity.Dict; +import org.springblade.system.feign.ISysClient; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.beans.factory.annotation.Value; @@ -56,6 +60,7 @@ import java.util.*; @RequiredArgsConstructor public class AccessTicketServiceImpl extends ServiceImpl implements AccessTicketService { + private final ISysClient sysClient; private final IUserClient userClient; @@ -63,6 +68,8 @@ public class AccessTicketServiceImpl extends ServiceImpl result = sysClient.getDeptName(entity.getCreateDept()); + if (result.isSuccess()) { + message.setDeptName(result.getData()); + } + // 内容 + message.setContent(content); + message.setTenantId(entity.getTenantId()); + User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); + message.setCreateUser(admin.getId()); + message.setUserIds(userId); + messageClient.sendAppAndWsMsgByUsers(message); + } + + /** * 保存检修工作票 * @param param */ @@ -207,26 +247,9 @@ public class AccessTicketServiceImpl extends ServiceImpl variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(entity,DateUtil.PATTERN_DATETIME), Map.class); R result = flowClient.startProcessInstanceContainNameByKey(AccessTicketConstants.ACCESS_TICKET_PROCESS_KEY, - StringUtil.format("{}:{}",AccessTicketConstants.ACCESS_TICKET_TABLE, entity.getId()), DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME) +"_" + entity.getDeviceName() + "_检修工作票", variables); + StringUtil.format("{}:{}",AccessTicketConstants.ACCESS_TICKET_TABLE, entity.getId()), entity.getCreateTime() +"_" + entity.getDeviceName() + "_检修工作票", variables); log.info("access_ticket : start_process_result _ {}",result); // 更新任务流程Id if (!result.isSuccess() || 200 != result.getCode()) {