diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordEntityVo.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordEntityVo.java new file mode 100644 index 0000000..2b2e11d --- /dev/null +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordEntityVo.java @@ -0,0 +1,29 @@ +package com.hnac.hzims.message.vo.msgpushrecord; + +import lombok.Data; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 11:58 + */ +@Data +public class MessagePushRecordEntityVo { + + /** + * 站点编号 + */ + private String stationCode; + + /** + * 月份 + */ + private Integer month; + + + /** + * type + */ + private String type; +} diff --git a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordVo.java b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordVo.java index 2cbd0d7..0362dd8 100644 --- a/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordVo.java +++ b/hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordVo.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; +import java.time.YearMonth; /** * @Author WL @@ -17,6 +18,12 @@ public class MessagePushRecordVo implements Serializable { /** + * 年 + */ + private Integer year; + + + /** * 月份 */ private Integer month; @@ -25,7 +32,8 @@ public class MessagePushRecordVo implements Serializable { /** * 实现推送时间 */ - private String strMonth; + private YearMonth strMonth; + /** * 消息类型 diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/web/MessageStatisticsController.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/web/MessageStatisticsController.java index 77dd8ea..1c43025 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/web/MessageStatisticsController.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/controller/web/MessageStatisticsController.java @@ -1,10 +1,7 @@ package com.hnac.hzims.message.controller.web; import com.hnac.hzims.message.service.IMessagePushRecordService; -import com.hnac.hzims.message.vo.msgpushrecord.BusinessTypeStatVo; -import com.hnac.hzims.message.vo.msgpushrecord.MessagePushRecordTypeVo; -import com.hnac.hzims.message.vo.msgpushrecord.PushStatTypeVo; -import com.hnac.hzims.message.vo.msgpushrecord.UserPushStatTypeVo; +import com.hnac.hzims.message.vo.msgpushrecord.*; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; @@ -35,9 +32,9 @@ public class MessageStatisticsController { * @return */ @GetMapping("/smsPushStat") - public R smsPushStat() { + public R smsPushStat(MessagePushRecordEntityVo vo) { log.info("短信推送统计"); - List messagePushRecordVos = messagePushRecordService.smsPushStat(); + List messagePushRecordVos = messagePushRecordService.smsPushStat(vo); log.info("短信推送统计 返回的数据: {}",messagePushRecordVos); return R.data(messagePushRecordVos); } @@ -48,9 +45,9 @@ public class MessageStatisticsController { * 业务类型统计 */ @GetMapping("/businessTypeStat") - public R businessTypeStat() { + public R businessTypeStat(MessagePushRecordEntityVo vo) { log.info("业务类型统计"); - List messagePushRecordVos = messagePushRecordService.businessTypeStat(); + List messagePushRecordVos = messagePushRecordService.businessTypeStat(vo); log.info("业务类型统计 返回的数据: {}",messagePushRecordVos); return R.data(messagePushRecordVos); } @@ -60,9 +57,9 @@ public class MessageStatisticsController { * 人员发送统计 */ @GetMapping("/userPushStat") - public R userPushStat() { + public R userPushStat(MessagePushRecordEntityVo vo) { log.info("人员发送统计"); - List messagePushRecordVos = messagePushRecordService.userPushStat(); + List messagePushRecordVos = messagePushRecordService.userPushStat(vo); log.info("人员发送统计 返回的数据: {}",messagePushRecordVos); return R.data(messagePushRecordVos); } @@ -72,8 +69,8 @@ public class MessageStatisticsController { * 推送成功失败统计 */ @GetMapping("/pushStat") - public R pushStat() { - List messagePushRecordVos = messagePushRecordService.pushStat(); + public R pushStat(MessagePushRecordEntityVo vo) { + List messagePushRecordVos = messagePushRecordService.pushStat(vo); log.info("推送成功失败统计 返回的数据: {}",messagePushRecordVos); return R.data(messagePushRecordVos); } diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.java index 36af591..de23097 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.java @@ -1,14 +1,11 @@ package com.hnac.hzims.message.mapper; import com.hnac.hzims.message.entity.MessagePushRecordEntity; -import com.hnac.hzims.message.vo.msgpushrecord.BusinessTypeStatVo; -import com.hnac.hzims.message.vo.msgpushrecord.MessagePushRecordVo; -import com.hnac.hzims.message.vo.msgpushrecord.PushStatTypeVo; -import com.hnac.hzims.message.vo.msgpushrecord.UserPushStatTypeVo; +import com.hnac.hzims.message.vo.msgpushrecord.*; +import org.apache.ibatis.annotations.Param; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import java.util.List; -import java.util.Map; public interface MessagePushRecordMapper extends UserDataScopeBaseMapper { @@ -16,27 +13,27 @@ public interface MessagePushRecordMapper extends UserDataScopeBaseMapper smsPushStat(); + List smsPushStat(@Param("vo") MessagePushRecordEntityVo vo); /** * 业务类型统计 * @return */ - List businessTypeStat(); + List businessTypeStat(@Param("vo") MessagePushRecordEntityVo vo); /** * 人员发送统计 * @return */ - List userPushStat(); + List userPushStat(@Param("vo") MessagePushRecordEntityVo vo); /** * 推送成功失败统计 * @return */ - List pushStat(); + List pushStat(@Param("vo") MessagePushRecordEntityVo vo); } diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml b/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml index 4c88d7f..9ae9935 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/mapper/MessagePushRecordMapper.xml @@ -23,15 +23,32 @@ type from hzims_message_push_record where IS_DELETED = 0 + + + and + STATION_CODE = #{vo.stationCode} + group by strMonth, TYPE @@ -42,6 +59,18 @@ count(1) count from hzims_message_push_record where IS_DELETED = 0 + + and + STATION_CODE = #{vo.stationCode} + + + and + date_format(PLAN_TIME, '%m') = #{vo.month} + + + and + type = #{vo.type} + group by businessClassify, pusherName @@ -61,6 +90,18 @@ \ No newline at end of file diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java index 001cc23..b978230 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/IMessagePushRecordService.java @@ -2,15 +2,11 @@ package com.hnac.hzims.message.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.hnac.hzims.message.entity.MessagePushRecordEntity; -import com.hnac.hzims.message.vo.msgpushrecord.BusinessTypeStatVo; -import com.hnac.hzims.message.vo.msgpushrecord.MessagePushRecordTypeVo; -import com.hnac.hzims.message.vo.msgpushrecord.PushStatTypeVo; -import com.hnac.hzims.message.vo.msgpushrecord.UserPushStatTypeVo; +import com.hnac.hzims.message.vo.msgpushrecord.*; import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.support.Query; import java.util.List; -import java.util.Map; public interface IMessagePushRecordService extends BaseService { @@ -49,28 +45,28 @@ public interface IMessagePushRecordService extends BaseService smsPushStat(); + List smsPushStat(MessagePushRecordEntityVo vo); /** * 业务类型统计 * @return */ - List businessTypeStat(); + List businessTypeStat(MessagePushRecordEntityVo vo); /** * 人员发送统计 * @return */ - List userPushStat(); + List userPushStat(MessagePushRecordEntityVo vo); /** * 推送成功失败统计 * @return */ - List pushStat(); + List pushStat(MessagePushRecordEntityVo vo); diff --git a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java index 611b91e..c7d1e44 100644 --- a/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java +++ b/hzims-service/message/src/main/java/com/hnac/hzims/message/service/impl/MessagePushRecordServiceImpl.java @@ -94,14 +94,14 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl smsPushStat() { + public List smsPushStat(MessagePushRecordEntityVo vo) { //根据type统计数量 - List messagePushRecordVos = baseMapper.smsPushStat(); + List messagePushRecordVos = baseMapper.smsPushStat(vo); messagePushRecordVos.forEach(item -> { - String strMonth = item.getStrMonth(); + YearMonth strMonth = item.getStrMonth(); // 字符串转localDate 获取月份 - int month = this.getCurrentMonth(strMonth); - item.setMonth(month); + item.setMonth(strMonth.getMonthValue()); + item.setYear(strMonth.getYear()); }); //按类型分组 @@ -125,8 +125,8 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl businessTypeStat() { - List businessTypeStatVos = baseMapper.businessTypeStat(); + public List businessTypeStat(MessagePushRecordEntityVo vo) { + List businessTypeStatVos = baseMapper.businessTypeStat(vo); businessTypeStatVos.forEach(item -> { String businessClassifyByName = this.getBusinessClassifyByName(item.getBusinessClassify()); item.setBusinessClassifyName(businessClassifyByName); @@ -140,8 +140,8 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl userPushStat() { - List userPushStatTypeVos = baseMapper.userPushStat(); + public List userPushStat(MessagePushRecordEntityVo vo) { + List userPushStatTypeVos = baseMapper.userPushStat(vo); //添加业务类型名称 userPushStatTypeVos.forEach(item -> { List pushStatList = item.getPushStatList(); @@ -161,8 +161,8 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl pushStat() { - List pushStatTypeVos = baseMapper.pushStat(); + public List pushStat(MessagePushRecordEntityVo vo) { + List pushStatTypeVos = baseMapper.pushStat(vo); pushStatTypeVos.forEach(item -> { //业务类型名称 String businessClassify = item.getBusinessClassify(); @@ -249,8 +249,8 @@ public class MessagePushRecordServiceImpl extends BaseServiceImpl ticketServiceList; + private List ticketServiceList; @Autowired private WorkflowOperationLogService workflowOperationLogService; @@ -40,12 +39,12 @@ public class StandardWorkTicketConsumer implements IQueueConsume { @Override public void handlerMessage(String message) { log.info("监听到数据:{}", message); - WorkTicketMessageResponse response = JSONObject.parseObject(message, WorkTicketMessageResponse.class); - String taskDefinitionKey = response.getTaskDefinitionKey(); + ProcessWorkFlowResponse response = JSONObject.parseObject(message, ProcessWorkFlowResponse.class); + String taskDefinitionKey = response.getProcessDefinitionKey(); WorkflowQueue ticker = new WorkflowQueue(); - ticker.setDeploymentId(taskDefinitionKey); + ticker.setProcessDefinitionKey(taskDefinitionKey); //判断执行具体的实现类 - TicketService ticketService = ticketServiceList.stream().filter(item -> item.isWorkflowTicket(ticker)) + ProcessService ticketService = ticketServiceList.stream().filter(item -> item.isWorkflowProcess(ticker)) .findFirst().orElse(null); if (ObjectUtils.isNotEmpty(ticketService)) { //执行业务方法 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java index e158466..ade2805 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java @@ -10,8 +10,8 @@ import com.hnac.hzims.ticket.processflow.properties.TicketProperties; import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.processflow.strategy.service.TicketService; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; +import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import lombok.RequiredArgsConstructor; import org.springblade.core.tool.api.R; import org.springblade.core.tool.jackson.JsonUtil; @@ -48,7 +48,7 @@ public class ProcessTypeController { - private final List ticketServiceList; + private final List ticketServiceList; private final RedisTemplate redisTemplate; @@ -80,12 +80,12 @@ public class ProcessTypeController { public String list(@PathVariable String key) { //判断执行具体的实现类 WorkflowQueue workflowQueue = new WorkflowQueue(); - workflowQueue.setDeploymentId(key); - TicketService ticketService = - ticketServiceList.stream().filter(item -> item.isWorkflowTicket(workflowQueue)) + workflowQueue.setProcessDefinitionKey(key); + ProcessService ticketService = + ticketServiceList.stream().filter(item -> item.isWorkflowProcess(workflowQueue)) .findFirst().orElse(null); - String calculate = ticketService.calculate(null); - return calculate; + ticketService.calculate(null); + return "key"; } @@ -111,12 +111,11 @@ public class ProcessTypeController { action ="审批流处理") @GetMapping("/build") public void addList() { - - WorkTicketMessageResponse workTicketMessageResponse = new WorkTicketMessageResponse(); + ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse(); workTicketMessageResponse.setTaskId("1"); - workTicketMessageResponse.setProcessInstanceKey("1"); + workTicketMessageResponse.setProcessDefinitionKey("1"); workTicketMessageResponse.setTaskName("1"); - workTicketMessageResponse.setFormData(1); + workTicketMessageResponse.setFormData("1"); String qqqq = JsonUtil.toJson(workTicketMessageResponse); queueProduceService.sendMessage("blade:queue:flow",qqqq); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/TicketAbstractService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java similarity index 61% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/TicketAbstractService.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java index 0589fb2..c00872d 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/TicketAbstractService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java @@ -1,11 +1,8 @@ package com.hnac.hzims.ticket.processflow.strategy.abstracts; import com.hnac.hzims.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; -import com.hnac.hzims.ticket.processflow.properties.TicketProperties; import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; -import com.hnac.hzims.ticket.processflow.service.WorkflowOperationLogService; -import com.hnac.hzims.ticket.processflow.strategy.service.TicketService; +import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -18,7 +15,7 @@ import java.util.List; * @Date 2023/3/28 9:02 */ @Slf4j -public abstract class TicketAbstractService implements TicketService { +public abstract class ProcessAbstractService implements ProcessService { @@ -30,7 +27,7 @@ public abstract class TicketAbstractService implements TicketService { * * @return */ - public List getTicketList() { + public List getProcessList() { log.info("实例化:" + processTypeService); List workTickets = processTypeService.list(); return workTickets; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java similarity index 98% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java index ef486b0..70aafab 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java @@ -2,7 +2,6 @@ package com.hnac.hzims.ticket.processflow.strategy.core; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.StringUtils; -import com.hnac.hzims.common.config.RedisMessageListener; import lombok.Data; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.StringRedisTemplate; @@ -24,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger; * @Date 2023/3/27 10:11 */ @Component -public class TicketIdWorker { +public class ProcessIdWorker { private static Map cacheMap = new HashMap<>(); diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java index c29ea11..1424f63 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/entity/WorkflowQueue.java @@ -16,7 +16,7 @@ public class WorkflowQueue { /** * 当前环节流程ID */ - private String deploymentId; + private String processDefinitionKey; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/TicketService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java similarity index 63% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/TicketService.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java index 31ceab6..6dd725b 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/TicketService.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java @@ -1,6 +1,6 @@ package com.hnac.hzims.ticket.processflow.strategy.service; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; /** @@ -9,20 +9,20 @@ import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; * @Serial 1.0 * @Date 2023/3/27 16:39 */ -public interface TicketService { +public interface ProcessService { /** * 设置执行那种实现类 * @param flowQueue * @return */ - Boolean isWorkflowTicket(WorkflowQueue flowQueue); + Boolean isWorkflowProcess(WorkflowQueue flowQueue); /** * 两票管理业务方法 * @param response */ - String calculate(WorkTicketMessageResponse response); + void calculate(ProcessWorkFlowResponse response); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java similarity index 53% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeTicketServiceImpl.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java index 08e05d5..ea3f3e0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java @@ -1,10 +1,12 @@ package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; +import com.hnac.hzims.ticket.processflow.constant.TicketProcessConstant; import com.hnac.hzims.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; -import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; -import com.hnac.hzims.ticket.processflow.strategy.abstracts.TicketAbstractService; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; +import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -20,7 +22,14 @@ import java.util.List; */ @Slf4j @Service -public class MakeTicketServiceImpl extends TicketAbstractService { +@RequiredArgsConstructor +public class MakeProcessServiceImpl extends ProcessAbstractService { + + + + private final TicketProcessService ticketProcessService; + + /** * 设置执行那种实现类 * @@ -28,11 +37,9 @@ public class MakeTicketServiceImpl extends TicketAbstractService { * @return */ @Override - public Boolean isWorkflowTicket(WorkflowQueue flowQueue) { + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { log.info("是否执行开工作票流程环节操作~~~~,流程ticket: {}", flowQueue); - List ticketList = this.getTicketList(); - ProcessType properties = ticketList.get(0); - if (properties.getDeploymentId().equals(flowQueue.getDeploymentId())) { + if (TicketProcessConstant.STARTEVENT.equals(flowQueue.getProcessDefinitionKey())) { log.info("已执行开工作票流程环节操作~~~~"); return true; } @@ -46,9 +53,8 @@ public class MakeTicketServiceImpl extends TicketAbstractService { * @param response */ @Override - public String calculate(WorkTicketMessageResponse response) { - System.out.println("OperatorTicketServiceImpl"); - return "开票"; - + public void calculate(ProcessWorkFlowResponse response) { + log.info("启动开票流程环节...."); + ticketProcessService.startUp(response); } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java similarity index 62% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorTicketServiceImpl.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java index e5eb803..84088a0 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java @@ -1,9 +1,8 @@ package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; import com.hnac.hzims.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; -import com.hnac.hzims.ticket.processflow.strategy.abstracts.TicketAbstractService; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; +import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -20,7 +19,10 @@ import java.util.List; */ @Slf4j @Service -public class OperatorTicketServiceImpl extends TicketAbstractService { +public class OperatorProcessServiceImpl extends ProcessAbstractService { + + + /** * 设置执行那种实现类 * @@ -28,11 +30,11 @@ public class OperatorTicketServiceImpl extends TicketAbstractService { * @return */ @Override - public Boolean isWorkflowTicket(WorkflowQueue flowQueue) { + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { log.info("是否执行运行人接收操作~~~~,流程flowQueue: {}", flowQueue); - List ticketList = this.getTicketList(); + List ticketList = this.getProcessList(); ProcessType properties = ticketList.get(2); - if (properties.getDeploymentId().equals(flowQueue.getDeploymentId())) { + if (properties.getDeploymentId().equals(flowQueue.getProcessDefinitionKey())) { log.info("已执行运行人接收操作~~~~"); return true; } @@ -46,9 +48,7 @@ public class OperatorTicketServiceImpl extends TicketAbstractService { * @param response */ @Override - public String calculate(WorkTicketMessageResponse response) { + public void calculate(ProcessWorkFlowResponse response) { System.out.println("OperatorTicketServiceImpl"); - return "运行人接收"; - } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java similarity index 62% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureTicketServiceImpl.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java index cb36a91..4461926 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureTicketServiceImpl.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java @@ -1,9 +1,8 @@ package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; import com.hnac.hzims.ticket.processflow.entity.ProcessType; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; -import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; -import com.hnac.hzims.ticket.processflow.strategy.abstracts.TicketAbstractService; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.processflow.strategy.abstracts.ProcessAbstractService; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -20,7 +19,7 @@ import java.util.List; */ @Slf4j @Service -public class SignatureTicketServiceImpl extends TicketAbstractService { +public class SignatureProcessServiceImpl extends ProcessAbstractService { /** @@ -30,11 +29,11 @@ public class SignatureTicketServiceImpl extends TicketAbstractService { * @return */ @Override - public Boolean isWorkflowTicket(WorkflowQueue flowQueue) { + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { log.info("是否执行运行人接收操作~~~~,流程flowQueue: {}", flowQueue); - List ticketList = this.getTicketList(); + List ticketList = this.getProcessList(); ProcessType properties = ticketList.get(1); - if (properties.getDeploymentId().equals(flowQueue.getDeploymentId())){ + if (properties.getDeploymentId().equals(flowQueue.getProcessDefinitionKey())){ log.info("已执行运行人接收操作~~~~"); return true; } @@ -48,8 +47,7 @@ public class SignatureTicketServiceImpl extends TicketAbstractService { * @param response */ @Override - public String calculate(WorkTicketMessageResponse response) { + public void calculate(ProcessWorkFlowResponse response) { System.out.println("SignatureTicketServiceImpl"); - return "签发人签发"; } } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java index eba614f..37bf5c2 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/redisConsume/WorkTicketMsgConsume.java @@ -3,7 +3,7 @@ package com.hnac.hzims.ticket.redisConsume; import com.alibaba.fastjson.JSONObject; import com.hnac.hzims.common.config.RedisMessageListener; import com.hnac.hzims.ticket.constants.TicketConstants; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.twoTicket.service.IFirstWorkTicketService; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -31,8 +31,9 @@ public class WorkTicketMsgConsume { Assert.isTrue(StringUtil.isNotBlank(message),() -> { throw new ServiceException("两票接收流程消息为空!"); }); - WorkTicketMessageResponse response = JSONObject.parseObject(message, WorkTicketMessageResponse.class); - TicketConstants.WorkTicketFlowEnum workTicketFlowEnum = TicketConstants.WorkTicketFlowEnum.getEnumByFlowId(response.getTaskDefinitionKey()); + ProcessWorkFlowResponse response = JSONObject.parseObject(message, ProcessWorkFlowResponse.class); + TicketConstants.WorkTicketFlowEnum workTicketFlowEnum = + TicketConstants.WorkTicketFlowEnum.getEnumByFlowId(response.getProcessDefinitionKey()); switch(workTicketFlowEnum) { case START: //FIXME 开票暂用此接口 diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/WorkTicketMessageResponse.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java similarity index 65% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/WorkTicketMessageResponse.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java index 49df219..8e4dcbf 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/WorkTicketMessageResponse.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java @@ -7,16 +7,17 @@ import javax.validation.constraints.NotNull; import java.io.Serializable; /** + * * @author hx * @version 1.0 * @date 2023/3/14 19:13 */ @Data @EqualsAndHashCode -public class WorkTicketMessageResponse implements Serializable { +public class ProcessWorkFlowResponse implements Serializable { /**当前任务ID**/ - @NotNull + private String taskId; /**当前任务名称**/ @@ -24,20 +25,27 @@ public class WorkTicketMessageResponse implements Serializable { /**当前环节流程ID**/ @NotNull - private String taskDefinitionKey; + private String processDefinitionKey; + + + /** + * 业务Id + */ + private String businessKey; /** * 流程实例key */ - private String processInstanceKey; + private String processInstanceId; - /**下一环节处理人**/ - @NotNull + /** + * 下一环节处理人 + */ private String nextStepOperator; /**票据表单**/ - private Object formData; + private String formData; } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java index efb4657..9fa6697 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/controller/StandardWorkTicketController.java @@ -2,13 +2,13 @@ package com.hnac.hzims.ticket.standardTicket.controller; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.IdWorker; -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; import com.hnac.hzims.ticket.standardTicket.service.StandardWorkTicketService; import com.hnac.hzims.ticket.processflow.properties.TicketProperties; import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties; import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; -import com.hnac.hzims.ticket.processflow.strategy.service.TicketService; -import com.hnac.hzims.ticket.processflow.strategy.core.TicketIdWorker; +import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; +import com.hnac.hzims.ticket.processflow.strategy.core.ProcessIdWorker; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -43,11 +43,11 @@ public class StandardWorkTicketController { @Autowired - private TicketIdWorker standardTicketIdWorker; + private ProcessIdWorker standardTicketIdWorker; @Autowired - List ticketService; + List ticketService; @Autowired @@ -56,7 +56,7 @@ public class StandardWorkTicketController { @ApiOperation("测试开票") @PostMapping("/createTicket") public R createTicket() { - WorkTicketMessageResponse workTicketMessageResponse = new WorkTicketMessageResponse(); + ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse(); workTicketMessageResponse.setTaskId(IdWorker.get32UUID()); workTicketMessageResponse.setTaskName("工作流"); String jsonString = JSON.toJSONString(workTicketMessageResponse); @@ -79,11 +79,11 @@ public class StandardWorkTicketController { @GetMapping("/hello/{type}") public R hello(@PathVariable String type) { WorkflowQueue ticket = new WorkflowQueue(); - ticket.setDeploymentId(type); - TicketService service = ticketService.stream().filter(item -> item.isWorkflowTicket(ticket)) + ticket.setProcessDefinitionKey(type); + ProcessService service = ticketService.stream().filter(item -> item.isWorkflowProcess(ticket)) .findFirst().orElse(null); - String calculate = service.calculate(new WorkTicketMessageResponse()); - return R.data(calculate); + service.calculate(new ProcessWorkFlowResponse()); + return R.data("hello"); } diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketInfoMapper.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketInfoMapper.java new file mode 100644 index 0000000..5185416 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketInfoMapper.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.ticket.twoTicket.mapper; + +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; +import org.springframework.stereotype.Repository; +import org.springframework.stereotype.Service; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 11:29 + */ +@Repository +public interface WorkTicketInfoMapper extends UserDataScopeBaseMapper { + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java new file mode 100644 index 0000000..0c134f2 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java @@ -0,0 +1,19 @@ +package com.hnac.hzims.ticket.twoTicket.service; + +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; + +/** + * 开票处理流程接口 + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 11:08 + */ +public interface TicketProcessService { + + /** + * 启动开票流程 + * @param response + */ + void startUp(ProcessWorkFlowResponse response); +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/WorkTicketInfoService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/WorkTicketInfoService.java new file mode 100644 index 0000000..bfd29d3 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/WorkTicketInfoService.java @@ -0,0 +1,14 @@ +package com.hnac.hzims.ticket.twoTicket.service; + +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import org.springblade.core.mp.base.BaseService; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 11:31 + */ +public interface WorkTicketInfoService extends BaseService { + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java new file mode 100644 index 0000000..995459f --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java @@ -0,0 +1,38 @@ +package com.hnac.hzims.ticket.twoTicket.service.impl; + +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.twoTicket.service.TicketProcessService; +import com.hnac.hzims.ticket.twoTicket.service.WorkTicketInfoService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.flow.core.feign.IFlowClient; +import org.springframework.stereotype.Service; + +/** + * 开票处理流程实现类 + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 11:11 + */ +@Service +@Slf4j +@RequiredArgsConstructor +public class TicketProcessServiceImpl implements TicketProcessService { + + + private final IFlowClient flowClient; + + + private final WorkTicketInfoService workTicketInfoService; + + /** + * 启动开票流程 + * + * @param response + */ + @Override + public void startUp(ProcessWorkFlowResponse response) { + + } +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketInfoServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketInfoServiceImpl.java new file mode 100644 index 0000000..276a347 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketInfoServiceImpl.java @@ -0,0 +1,17 @@ +package com.hnac.hzims.ticket.twoTicket.service.impl; + +import com.hnac.hzims.ticket.twoTicket.mapper.WorkTicketInfoMapper; +import com.hnac.hzims.ticket.twoTicket.service.WorkTicketInfoService; +import com.hnac.hzims.ticket.workTicket.entity.WorkTicketInfoEntity; +import org.springblade.core.mp.base.BaseServiceImpl; +import org.springframework.stereotype.Service; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/8 11:32 + */ +@Service +public class WorkTicketInfoServiceImpl extends BaseServiceImpl implements WorkTicketInfoService { +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/SafetyMeasuresVo.java similarity index 92% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/SafetyMeasuresVo.java index 31b9d91..410dfb3 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/SafetyMeasuresVo.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.vo; +package com.hnac.hzims.ticket.twoTicket.vo.process; import lombok.Data; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java similarity index 94% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java index 60f6c9e..ddb5af3 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.vo; +package com.hnac.hzims.ticket.twoTicket.vo.process; import lombok.Data; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java similarity index 88% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java index 464c49a..e39e8b6 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.vo; +package com.hnac.hzims.ticket.twoTicket.vo.process; import lombok.Data; diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java similarity index 97% rename from hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java rename to hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java index ff458fb..8cb78cb 100644 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java @@ -1,4 +1,4 @@ -package com.hnac.hzims.ticket.processflow.vo; +package com.hnac.hzims.ticket.twoTicket.vo.process; import lombok.Data;