From 7d642e42688cd5a0ce52abc991430c3fb327bd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E9=A3=9E=E5=AE=87?= <2684146481@qq.com> Date: Sat, 8 Apr 2023 13:46:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B6=88=E6=81=AF=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../msgpushrecord/MessagePushRecordEntityVo.java | 29 +++ .../vo/msgpushrecord/MessagePushRecordVo.java | 10 +- .../web/MessageStatisticsController.java | 21 +- .../message/mapper/MessagePushRecordMapper.java | 15 +- .../message/mapper/MessagePushRecordMapper.xml | 43 +++- .../message/service/IMessagePushRecordService.java | 14 +- .../service/impl/MessagePushRecordServiceImpl.java | 26 +-- .../constant/TicketProcessConstant.java | 14 ++ .../consumer/StandardWorkTicketConsumer.java | 15 +- .../controller/ProcessTypeController.java | 23 ++- .../strategy/abstracts/ProcessAbstractService.java | 36 ++++ .../strategy/abstracts/TicketAbstractService.java | 39 ---- .../processflow/strategy/core/ProcessIdWorker.java | 215 ++++++++++++++++++++ .../processflow/strategy/core/TicketIdWorker.java | 216 --------------------- .../processflow/strategy/entity/WorkflowQueue.java | 2 +- .../strategy/service/ProcessService.java | 28 +++ .../strategy/service/TicketService.java | 28 --- .../serviceimpl/MakeProcessServiceImpl.java | 60 ++++++ .../serviceimpl/MakeTicketServiceImpl.java | 54 ------ .../serviceimpl/OperatorProcessServiceImpl.java | 54 ++++++ .../serviceimpl/OperatorTicketServiceImpl.java | 54 ------ .../serviceimpl/SignatureProcessServiceImpl.java | 53 +++++ .../serviceimpl/SignatureTicketServiceImpl.java | 55 ------ .../ticket/processflow/vo/SafetyMeasuresVo.java | 47 ----- .../hzims/ticket/processflow/vo/TeamGroupVo.java | 71 ------- .../ticket/processflow/vo/TeamPersonnelVo.java | 36 ---- .../hzims/ticket/processflow/vo/WorkTicketVo.java | 162 ---------------- .../ticket/redisConsume/WorkTicketMsgConsume.java | 7 +- .../ticket/response/ProcessWorkFlowResponse.java | 51 +++++ .../ticket/response/WorkTicketMessageResponse.java | 43 ---- .../controller/StandardWorkTicketController.java | 20 +- .../twoTicket/mapper/WorkTicketInfoMapper.java | 17 ++ .../twoTicket/service/TicketProcessService.java | 19 ++ .../twoTicket/service/WorkTicketInfoService.java | 14 ++ .../service/impl/TicketProcessServiceImpl.java | 38 ++++ .../service/impl/WorkTicketInfoServiceImpl.java | 17 ++ .../twoTicket/vo/process/SafetyMeasuresVo.java | 47 +++++ .../ticket/twoTicket/vo/process/TeamGroupVo.java | 71 +++++++ .../twoTicket/vo/process/TeamPersonnelVo.java | 36 ++++ .../ticket/twoTicket/vo/process/WorkTicketVo.java | 162 ++++++++++++++++ 40 files changed, 1078 insertions(+), 884 deletions(-) create mode 100644 hzims-service-api/message-api/src/main/java/com/hnac/hzims/message/vo/msgpushrecord/MessagePushRecordEntityVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/constant/TicketProcessConstant.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/TicketAbstractService.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/TicketService.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeTicketServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorTicketServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureTicketServiceImpl.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java delete mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/WorkTicketMessageResponse.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/mapper/WorkTicketInfoMapper.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/TicketProcessService.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/WorkTicketInfoService.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/WorkTicketInfoServiceImpl.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/SafetyMeasuresVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java create mode 100644 hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java 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/ProcessAbstractService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java new file mode 100644 index 0000000..c00872d --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/ProcessAbstractService.java @@ -0,0 +1,36 @@ +package com.hnac.hzims.ticket.processflow.strategy.abstracts; + +import com.hnac.hzims.ticket.processflow.entity.ProcessType; +import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; +import com.hnac.hzims.ticket.processflow.strategy.service.ProcessService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +/** + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/28 9:02 + */ +@Slf4j +public abstract class ProcessAbstractService implements ProcessService { + + + + @Autowired + private ProcessTypeService processTypeService; + + /** + * 查询所有的方法 + * + * @return + */ + 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/abstracts/TicketAbstractService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/TicketAbstractService.java deleted file mode 100644 index 0589fb2..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/abstracts/TicketAbstractService.java +++ /dev/null @@ -1,39 +0,0 @@ -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 lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; - -import java.util.List; - -/** - * @Author dfy - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/3/28 9:02 - */ -@Slf4j -public abstract class TicketAbstractService implements TicketService { - - - - @Autowired - private ProcessTypeService processTypeService; - - /** - * 查询所有的方法 - * - * @return - */ - public List getTicketList() { - 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/ProcessIdWorker.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java new file mode 100644 index 0000000..70aafab --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/ProcessIdWorker.java @@ -0,0 +1,215 @@ +package com.hnac.hzims.ticket.processflow.strategy.core; + +import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import lombok.Data; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.data.redis.core.ValueOperations; +import org.springframework.stereotype.Component; + +import java.text.NumberFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; + + +/** + * 生成票据编码工具类 + * + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/27 10:11 + */ +@Component +public class ProcessIdWorker { + + private static Map cacheMap = new HashMap<>(); + + + @Autowired + private StringRedisTemplate redisTemplate; + + private static NumberFormat numberFormatter; + + + static { + //初始化 + numberFormatter = NumberFormat.getInstance(); + numberFormatter.setGroupingUsed(false); + numberFormatter.setMinimumIntegerDigits(3); + numberFormatter.setMaximumFractionDigits(3); + } + + /** + * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式 + * + * @param staff AA在建站之初由接站人员填写要求唯一 + * @param typeInstrument 票据种类,第一种票,第二种票 + * @param yearMonth 开票时间年月 + */ + public String getTicketCode(String staff, String typeInstrument, String yearMonth) { + ValueOperations operations = redisTemplate.opsForValue(); + AtomicInteger atomicInteger = new AtomicInteger(1); + String key = staff + ":" + typeInstrument + ":" + yearMonth; + // TicketCode ticketCode1 = cacheMap.get(key); + TicketCode ticketCode = JSON.parseObject(operations.get(key), TicketCode.class); + if (ticketCode == null) { + ticketCode = new TicketCode(); + ticketCode.setYearMonth(yearMonth); + ticketCode.setSequencing(atomicInteger); + // cacheMap.put(key, ticketCode); + operations.set(key, JSON.toJSONString(ticketCode)); + String result = getTicketCode(staff, typeInstrument, yearMonth, atomicInteger.get()); + return result; + } + + String originalYearMonth = ticketCode.getYearMonth(); + + AtomicInteger sequencing = ticketCode.getSequencing(); + + //生成 票据排序 格式 001 010 111 + int code = getYearMonthCode(originalYearMonth, yearMonth, key, sequencing); + + String result = getTicketCode(staff, typeInstrument, yearMonth, code); + return result; + } + + + /** + * 生成的票据 编号 + */ + public String getTicketCode(String staff, String typeInstrument, String YearMonth, int sequencing) { + return staff.concat("-").concat(typeInstrument).concat("-").concat(YearMonth).concat("-").concat(numberFormatter.format(sequencing)); + } + + + /** + * 返回票据排序 + * + * @param + * @param originalYearMonth 上次的年月 年的后2位 + 月 + * @param nextYearMonth 现在的年月 年的后2位 + 月 + * @param key + * @param sequencing + * @return + */ + private int getYearMonthCode(String originalYearMonth, String nextYearMonth, String key, AtomicInteger sequencing) { + ValueOperations operations = redisTemplate.opsForValue(); + //1. 累计票据 + sequencing.incrementAndGet(); + //3. 判断年是否为空 + if (StringUtils.isEmpty(originalYearMonth) && StringUtils.isEmpty(nextYearMonth)) { + return sequencing.get(); + } + //4. 验证年 最后一位数 + String year1 = getSubstring(originalYearMonth, 1); + String year2 = getSubstring(nextYearMonth, 1); + if (!year1.equals(year2)) { + sequencing.compareAndSet(sequencing.get(), 1); + return sequencing.get(); + } + + //4. 验证倒数第二位数 + year1 = getSubstring(originalYearMonth, 2); + year2 = getSubstring(nextYearMonth, 2); + if (!year1.equals(year2)) { + sequencing.compareAndSet(sequencing.get(), 1); + return sequencing.get(); + } + + //4. 验证倒数第三位数 + year1 = getSubstring(originalYearMonth, 3); + year2 = getSubstring(nextYearMonth, 3); + if (!year1.equals(year2)) { + sequencing.compareAndSet(sequencing.get(), 1); + return sequencing.get(); + } + + + //6. sequencing 大于等于1000 的话,从头开始 + if (sequencing.get() >= 1000) { + sequencing.compareAndSet(sequencing.get(), 1); + System.out.println("sequencing >= 1000 被执行呢"); + redisTemplate.delete(key); + // cacheMap.remove(key); + return sequencing.get(); + } + + TicketCode ticketCode = new TicketCode(); + ticketCode.setYearMonth(nextYearMonth); + ticketCode.setSequencing(sequencing); + operations.set(key, JSON.toJSONString(ticketCode)); + //cacheMap.put(key, ticketCode); + + return sequencing.get(); + } + + /** + * 截取字符串 + * + * @param originalYearMonth + * @param digit 位数 + * @return + */ + private static String getSubstring(String originalYearMonth, int digit) { + return originalYearMonth.substring(originalYearMonth.length() - digit); + } + + + /** + * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式 + * @param staff AA在建站之初由接站人员填写要求唯一 + * @param typeInstrument 票据种类,第一种票,第二种票 + * @param year 年 + * @param month 月 + * @return + */ + public String getTicketCode(String staff, String typeInstrument, String year,String month){ + String yearMonth = year.substring(year.length() - 2) + month; + return getTicketCode(staff,typeInstrument,yearMonth); + } + + @Data + public static class TicketCode { + + /** + * 月份 + */ + private String yearMonth; + /** + * 记录数 + */ + private AtomicInteger sequencing = new AtomicInteger(1); + } + + public static void main(String[] args) { + + // TicketIdWorker standardTicketIdWorker = new TicketIdWorker(); + // int count = 1; + // while (count <= 1000) { + // + // System.out.println("1 ===> " + standardTicketIdWorker.getTicketCode("aa", "bb", "2304")); + // System.out.println("================================="); + // //System.out.println("2 ===》" + standardTicketIdWorker.getTicketCode("aa", "bb", "2204")); + // count++; + // + // } + + // NumberFormat numberFormatter = NumberFormat.getInstance(); + // numberFormatter.setGroupingUsed(false); + // numberFormatter.setMinimumIntegerDigits(3); + // numberFormatter.setMaximumFractionDigits(3); + // + // String format = numberFormatter.format(2); + // System.out.println(format); + + + String msg = "2021"; + String substring = msg.substring(msg.length() - 2); + System.out.println(substring); + } + + +} 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/TicketIdWorker.java deleted file mode 100644 index ef486b0..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java +++ /dev/null @@ -1,216 +0,0 @@ -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; -import org.springframework.data.redis.core.ValueOperations; -import org.springframework.stereotype.Component; - -import java.text.NumberFormat; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; - - -/** - * 生成票据编码工具类 - * - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/3/27 10:11 - */ -@Component -public class TicketIdWorker { - - private static Map cacheMap = new HashMap<>(); - - - @Autowired - private StringRedisTemplate redisTemplate; - - private static NumberFormat numberFormatter; - - - static { - //初始化 - numberFormatter = NumberFormat.getInstance(); - numberFormatter.setGroupingUsed(false); - numberFormatter.setMinimumIntegerDigits(3); - numberFormatter.setMaximumFractionDigits(3); - } - - /** - * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式 - * - * @param staff AA在建站之初由接站人员填写要求唯一 - * @param typeInstrument 票据种类,第一种票,第二种票 - * @param yearMonth 开票时间年月 - */ - public String getTicketCode(String staff, String typeInstrument, String yearMonth) { - ValueOperations operations = redisTemplate.opsForValue(); - AtomicInteger atomicInteger = new AtomicInteger(1); - String key = staff + ":" + typeInstrument + ":" + yearMonth; - // TicketCode ticketCode1 = cacheMap.get(key); - TicketCode ticketCode = JSON.parseObject(operations.get(key), TicketCode.class); - if (ticketCode == null) { - ticketCode = new TicketCode(); - ticketCode.setYearMonth(yearMonth); - ticketCode.setSequencing(atomicInteger); - // cacheMap.put(key, ticketCode); - operations.set(key, JSON.toJSONString(ticketCode)); - String result = getTicketCode(staff, typeInstrument, yearMonth, atomicInteger.get()); - return result; - } - - String originalYearMonth = ticketCode.getYearMonth(); - - AtomicInteger sequencing = ticketCode.getSequencing(); - - //生成 票据排序 格式 001 010 111 - int code = getYearMonthCode(originalYearMonth, yearMonth, key, sequencing); - - String result = getTicketCode(staff, typeInstrument, yearMonth, code); - return result; - } - - - /** - * 生成的票据 编号 - */ - public String getTicketCode(String staff, String typeInstrument, String YearMonth, int sequencing) { - return staff.concat("-").concat(typeInstrument).concat("-").concat(YearMonth).concat("-").concat(numberFormatter.format(sequencing)); - } - - - /** - * 返回票据排序 - * - * @param - * @param originalYearMonth 上次的年月 年的后2位 + 月 - * @param nextYearMonth 现在的年月 年的后2位 + 月 - * @param key - * @param sequencing - * @return - */ - private int getYearMonthCode(String originalYearMonth, String nextYearMonth, String key, AtomicInteger sequencing) { - ValueOperations operations = redisTemplate.opsForValue(); - //1. 累计票据 - sequencing.incrementAndGet(); - //3. 判断年是否为空 - if (StringUtils.isEmpty(originalYearMonth) && StringUtils.isEmpty(nextYearMonth)) { - return sequencing.get(); - } - //4. 验证年 最后一位数 - String year1 = getSubstring(originalYearMonth, 1); - String year2 = getSubstring(nextYearMonth, 1); - if (!year1.equals(year2)) { - sequencing.compareAndSet(sequencing.get(), 1); - return sequencing.get(); - } - - //4. 验证倒数第二位数 - year1 = getSubstring(originalYearMonth, 2); - year2 = getSubstring(nextYearMonth, 2); - if (!year1.equals(year2)) { - sequencing.compareAndSet(sequencing.get(), 1); - return sequencing.get(); - } - - //4. 验证倒数第三位数 - year1 = getSubstring(originalYearMonth, 3); - year2 = getSubstring(nextYearMonth, 3); - if (!year1.equals(year2)) { - sequencing.compareAndSet(sequencing.get(), 1); - return sequencing.get(); - } - - - //6. sequencing 大于等于1000 的话,从头开始 - if (sequencing.get() >= 1000) { - sequencing.compareAndSet(sequencing.get(), 1); - System.out.println("sequencing >= 1000 被执行呢"); - redisTemplate.delete(key); - // cacheMap.remove(key); - return sequencing.get(); - } - - TicketCode ticketCode = new TicketCode(); - ticketCode.setYearMonth(nextYearMonth); - ticketCode.setSequencing(sequencing); - operations.set(key, JSON.toJSONString(ticketCode)); - //cacheMap.put(key, ticketCode); - - return sequencing.get(); - } - - /** - * 截取字符串 - * - * @param originalYearMonth - * @param digit 位数 - * @return - */ - private static String getSubstring(String originalYearMonth, int digit) { - return originalYearMonth.substring(originalYearMonth.length() - digit); - } - - - /** - * 按规则生成票据编码:票据编码:AA-BB-CCCC-DDD格式 - * @param staff AA在建站之初由接站人员填写要求唯一 - * @param typeInstrument 票据种类,第一种票,第二种票 - * @param year 年 - * @param month 月 - * @return - */ - public String getTicketCode(String staff, String typeInstrument, String year,String month){ - String yearMonth = year.substring(year.length() - 2) + month; - return getTicketCode(staff,typeInstrument,yearMonth); - } - - @Data - public static class TicketCode { - - /** - * 月份 - */ - private String yearMonth; - /** - * 记录数 - */ - private AtomicInteger sequencing = new AtomicInteger(1); - } - - public static void main(String[] args) { - - // TicketIdWorker standardTicketIdWorker = new TicketIdWorker(); - // int count = 1; - // while (count <= 1000) { - // - // System.out.println("1 ===> " + standardTicketIdWorker.getTicketCode("aa", "bb", "2304")); - // System.out.println("================================="); - // //System.out.println("2 ===》" + standardTicketIdWorker.getTicketCode("aa", "bb", "2204")); - // count++; - // - // } - - // NumberFormat numberFormatter = NumberFormat.getInstance(); - // numberFormatter.setGroupingUsed(false); - // numberFormatter.setMinimumIntegerDigits(3); - // numberFormatter.setMaximumFractionDigits(3); - // - // String format = numberFormatter.format(2); - // System.out.println(format); - - - String msg = "2021"; - String substring = msg.substring(msg.length() - 2); - System.out.println(substring); - } - - -} 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/ProcessService.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java new file mode 100644 index 0000000..6dd725b --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/ProcessService.java @@ -0,0 +1,28 @@ +package com.hnac.hzims.ticket.processflow.strategy.service; + +import com.hnac.hzims.ticket.response.ProcessWorkFlowResponse; +import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; + +/** + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/27 16:39 + */ +public interface ProcessService { + + /** + * 设置执行那种实现类 + * @param flowQueue + * @return + */ + Boolean isWorkflowProcess(WorkflowQueue flowQueue); + + + /** + * 两票管理业务方法 + * @param response + */ + void calculate(ProcessWorkFlowResponse response); + +} 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/TicketService.java deleted file mode 100644 index 31ceab6..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/service/TicketService.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.hnac.hzims.ticket.processflow.strategy.service; - -import com.hnac.hzims.ticket.response.WorkTicketMessageResponse; -import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; - -/** - * @Author dfy - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/3/27 16:39 - */ -public interface TicketService { - - /** - * 设置执行那种实现类 - * @param flowQueue - * @return - */ - Boolean isWorkflowTicket(WorkflowQueue flowQueue); - - - /** - * 两票管理业务方法 - * @param response - */ - String calculate(WorkTicketMessageResponse response); - -} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java new file mode 100644 index 0000000..ea3f3e0 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeProcessServiceImpl.java @@ -0,0 +1,60 @@ +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.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; + +import java.util.List; + +/** + * 开工作票流程实现类 + * + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/28 8:47 + */ +@Slf4j +@Service +@RequiredArgsConstructor +public class MakeProcessServiceImpl extends ProcessAbstractService { + + + + private final TicketProcessService ticketProcessService; + + + /** + * 设置执行那种实现类 + * + * @param flowQueue + * @return + */ + @Override + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { + log.info("是否执行开工作票流程环节操作~~~~,流程ticket: {}", flowQueue); + if (TicketProcessConstant.STARTEVENT.equals(flowQueue.getProcessDefinitionKey())) { + log.info("已执行开工作票流程环节操作~~~~"); + return true; + } + log.info("未是否执行开工作票流程环节操作,请联系管理员~~~~"); + return false; + } + + /** + * 两票管理业务方法 + * + * @param response + */ + @Override + 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/MakeTicketServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeTicketServiceImpl.java deleted file mode 100644 index 08e05d5..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/MakeTicketServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -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.processflow.strategy.entity.WorkflowQueue; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 开工作票流程实现类 - * - * @Author dfy - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/3/28 8:47 - */ -@Slf4j -@Service -public class MakeTicketServiceImpl extends TicketAbstractService { - /** - * 设置执行那种实现类 - * - * @param flowQueue - * @return - */ - @Override - public Boolean isWorkflowTicket(WorkflowQueue flowQueue) { - log.info("是否执行开工作票流程环节操作~~~~,流程ticket: {}", flowQueue); - List ticketList = this.getTicketList(); - ProcessType properties = ticketList.get(0); - if (properties.getDeploymentId().equals(flowQueue.getDeploymentId())) { - log.info("已执行开工作票流程环节操作~~~~"); - return true; - } - log.info("未是否执行开工作票流程环节操作,请联系管理员~~~~"); - return false; - } - - /** - * 两票管理业务方法 - * - * @param response - */ - @Override - public String calculate(WorkTicketMessageResponse response) { - System.out.println("OperatorTicketServiceImpl"); - return "开票"; - - } -} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java new file mode 100644 index 0000000..84088a0 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorProcessServiceImpl.java @@ -0,0 +1,54 @@ +package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; + +import com.hnac.hzims.ticket.processflow.entity.ProcessType; +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; + +import java.util.List; + +/** + * 运行人实例类 (运行人接收) + * + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/28 8:47 + */ +@Slf4j +@Service +public class OperatorProcessServiceImpl extends ProcessAbstractService { + + + + /** + * 设置执行那种实现类 + * + * @param flowQueue + * @return + */ + @Override + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { + log.info("是否执行运行人接收操作~~~~,流程flowQueue: {}", flowQueue); + List ticketList = this.getProcessList(); + ProcessType properties = ticketList.get(2); + if (properties.getDeploymentId().equals(flowQueue.getProcessDefinitionKey())) { + log.info("已执行运行人接收操作~~~~"); + return true; + } + log.info("未执行运行人接收操作,请联系管理员~~~~"); + return false; + } + + /** + * 两票管理业务方法 + * + * @param response + */ + @Override + public void calculate(ProcessWorkFlowResponse response) { + System.out.println("OperatorTicketServiceImpl"); + } +} 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/OperatorTicketServiceImpl.java deleted file mode 100644 index e5eb803..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/OperatorTicketServiceImpl.java +++ /dev/null @@ -1,54 +0,0 @@ -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.entity.WorkflowQueue; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 运行人实例类 (运行人接收) - * - * @Author dfy - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/3/28 8:47 - */ -@Slf4j -@Service -public class OperatorTicketServiceImpl extends TicketAbstractService { - /** - * 设置执行那种实现类 - * - * @param flowQueue - * @return - */ - @Override - public Boolean isWorkflowTicket(WorkflowQueue flowQueue) { - log.info("是否执行运行人接收操作~~~~,流程flowQueue: {}", flowQueue); - List ticketList = this.getTicketList(); - ProcessType properties = ticketList.get(2); - if (properties.getDeploymentId().equals(flowQueue.getDeploymentId())) { - log.info("已执行运行人接收操作~~~~"); - return true; - } - log.info("未执行运行人接收操作,请联系管理员~~~~"); - return false; - } - - /** - * 两票管理业务方法 - * - * @param response - */ - @Override - public String calculate(WorkTicketMessageResponse response) { - System.out.println("OperatorTicketServiceImpl"); - return "运行人接收"; - - } -} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java new file mode 100644 index 0000000..4461926 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureProcessServiceImpl.java @@ -0,0 +1,53 @@ +package com.hnac.hzims.ticket.processflow.strategy.serviceimpl; + +import com.hnac.hzims.ticket.processflow.entity.ProcessType; +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; + +import java.util.List; + +/** + * 签发人实现类(签发人签发) + * + * @Author dfy + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/3/27 16:40 + */ +@Slf4j +@Service +public class SignatureProcessServiceImpl extends ProcessAbstractService { + + + /** + * 设置执行那种实现类 + * + * @param flowQueue + * @return + */ + @Override + public Boolean isWorkflowProcess(WorkflowQueue flowQueue) { + log.info("是否执行运行人接收操作~~~~,流程flowQueue: {}", flowQueue); + List ticketList = this.getProcessList(); + ProcessType properties = ticketList.get(1); + if (properties.getDeploymentId().equals(flowQueue.getProcessDefinitionKey())){ + log.info("已执行运行人接收操作~~~~"); + return true; + } + log.info("未执行运行人接收操作,请联系管理员~~~~"); + return false; + } + + /** + * 两票管理业务方法 + * + * @param response + */ + @Override + public void calculate(ProcessWorkFlowResponse response) { + System.out.println("SignatureTicketServiceImpl"); + } +} 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/SignatureTicketServiceImpl.java deleted file mode 100644 index cb36a91..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/serviceimpl/SignatureTicketServiceImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -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.processflow.strategy.entity.WorkflowQueue; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 签发人实现类(签发人签发) - * - * @Author dfy - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/3/27 16:40 - */ -@Slf4j -@Service -public class SignatureTicketServiceImpl extends TicketAbstractService { - - - /** - * 设置执行那种实现类 - * - * @param flowQueue - * @return - */ - @Override - public Boolean isWorkflowTicket(WorkflowQueue flowQueue) { - log.info("是否执行运行人接收操作~~~~,流程flowQueue: {}", flowQueue); - List ticketList = this.getTicketList(); - ProcessType properties = ticketList.get(1); - if (properties.getDeploymentId().equals(flowQueue.getDeploymentId())){ - log.info("已执行运行人接收操作~~~~"); - return true; - } - log.info("未执行运行人接收操作,请联系管理员~~~~"); - return false; - } - - /** - * 两票管理业务方法 - * - * @param response - */ - @Override - public String calculate(WorkTicketMessageResponse response) { - System.out.println("SignatureTicketServiceImpl"); - return "签发人签发"; - } -} 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/processflow/vo/SafetyMeasuresVo.java deleted file mode 100644 index 31b9d91..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.hnac.hzims.ticket.processflow.vo; - -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/4/6 13:44 - */ -@Data -public class SafetyMeasuresVo { - - /** - * 安全措施Id - */ - private String safetyId; - - - /** - * 安全措施名称 - */ - private String safetyName; - - /** - * 安全措施说明 - */ - private String safetyExplain; - - /** - * 是否执行 状态 (true √ false ×) - */ - private Boolean status; - - /** - * 执行标识 (有的话 已执行 (√) 否 null) - */ - private String statusType; - - /** - * 安全措施时间 - */ - private LocalDateTime safetyTime; - -} 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/processflow/vo/TeamGroupVo.java deleted file mode 100644 index 60f6c9e..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.hnac.hzims.ticket.processflow.vo; - -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/4/6 14:45 - */ -@Data -public class TeamGroupVo { - - - /** - * 班组Id - */ - private String groupId; - - - /** - * 班组 名称 - */ - private String groupName; - - - /** - * 变更 负责人 id - */ - private String workLeaderId; - - /** - * 变更 负责人 名称 - */ - private String workLeaderName; - - - /** - * 班组人员 - */ - private List teamGroupName; - - - /** - * 离开时间 - */ - private LocalDateTime changeGroupDepartureTime; - - - /** - * 加入时间 - */ - private LocalDateTime changeGroupAddTime; - - - /** - * 离开内容 - */ - private LocalDateTime changeContent; - - - /** - * 收工时间 (完成时间) - */ - private LocalDateTime leaveTime; - - -} 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/processflow/vo/TeamPersonnelVo.java deleted file mode 100644 index 464c49a..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.hnac.hzims.ticket.processflow.vo; - -import lombok.Data; - -import java.time.LocalDateTime; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/4/6 14:48 - */ -@Data -public class TeamPersonnelVo { - - - /** - * 人员名称 - */ - private String name; - - - /** - * 开工时间 - */ - private LocalDateTime startDateTime; - - - /** - * 收工时间 - */ - private LocalDateTime endDateTime; - - - -} 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/processflow/vo/WorkTicketVo.java deleted file mode 100644 index ff458fb..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.hnac.hzims.ticket.processflow.vo; - -import lombok.Data; - -import java.time.LocalDateTime; -import java.util.List; - -/** - * @Author WL - * @Version v1.0 - * @Serial 1.0 - * @Date 2023/4/6 11:52 - */ -@Data -public class WorkTicketVo { - - /** - * 编号 - */ - private String serialNumberId; - - - /** - * 票据名称 - */ - private String ticketName; - - - /** - * 票据模板 - */ - private String ticketTemplate; - - /** - * 开票来源 - */ - private String opensource; - - /** - * 开票任务来源 - */ - private String opensourceTask; - - - /** - * 设备 - */ - private String device; - - /** - * 单位 - */ - private String unit; - - - /** - * 班组 - */ - private List TeamGroupList; - - - /** - * 工作地点 - */ - private String workPlace; - - - /** - * 工作内容 - */ - private String workContent; - - /** - * 设备及工作地点 - */ - private String devicePlace; - - /** - * 设备及工作内容 - */ - private String deviceContent; - - - /** - * 计划开始时间 - */ - private LocalDateTime projectStartTime; - - /** - * 计划结束时间 - */ - private LocalDateTime projectEndTime; - - - /** - * 安全措施 - */ - private List safetyMeasuresList; - - - /** - * 工作签发人 - */ - private String workSigner; - - /** - * 签发人时间 - */ - private LocalDateTime workSignerTime; - - /** - * 批准工作结束时间 - */ - private LocalDateTime workEndTime; - - /** - * 值班负责人 - */ - private String WatchPrincipal; - - /** - * 许可人 - */ - private String licensorName; - - /** - * 许可人时间 - */ - private LocalDateTime licensorTime; - - - /** - * 变动时间 - */ - private String changeTime; - - - /** - * 延期时间 - */ - private LocalDateTime postponeDateTime; - - - /** - * 交底内容 - */ - private String tellContent; - - - /** - * 工作票结束时间 - */ - private LocalDateTime workTicketEndTime; - - - /** - * 备注 - */ - private String content; - - -} 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/ProcessWorkFlowResponse.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java new file mode 100644 index 0000000..8e4dcbf --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/ProcessWorkFlowResponse.java @@ -0,0 +1,51 @@ +package com.hnac.hzims.ticket.response; + +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * + * @author hx + * @version 1.0 + * @date 2023/3/14 19:13 + */ +@Data +@EqualsAndHashCode +public class ProcessWorkFlowResponse implements Serializable { + + /**当前任务ID**/ + + private String taskId; + + /**当前任务名称**/ + private String taskName; + + /**当前环节流程ID**/ + @NotNull + private String processDefinitionKey; + + + /** + * 业务Id + */ + private String businessKey; + + + /** + * 流程实例key + */ + private String processInstanceId; + + + /** + * 下一环节处理人 + */ + private String nextStepOperator; + + /**票据表单**/ + private String formData; + +} 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/WorkTicketMessageResponse.java deleted file mode 100644 index 49df219..0000000 --- a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/response/WorkTicketMessageResponse.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.hnac.hzims.ticket.response; - -import lombok.Data; -import lombok.EqualsAndHashCode; - -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 { - - /**当前任务ID**/ - @NotNull - private String taskId; - - /**当前任务名称**/ - private String taskName; - - /**当前环节流程ID**/ - @NotNull - private String taskDefinitionKey; - - - /** - * 流程实例key - */ - private String processInstanceKey; - - - /**下一环节处理人**/ - @NotNull - private String nextStepOperator; - - /**票据表单**/ - private Object 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/twoTicket/vo/process/SafetyMeasuresVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/SafetyMeasuresVo.java new file mode 100644 index 0000000..410dfb3 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/SafetyMeasuresVo.java @@ -0,0 +1,47 @@ +package com.hnac.hzims.ticket.twoTicket.vo.process; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/6 13:44 + */ +@Data +public class SafetyMeasuresVo { + + /** + * 安全措施Id + */ + private String safetyId; + + + /** + * 安全措施名称 + */ + private String safetyName; + + /** + * 安全措施说明 + */ + private String safetyExplain; + + /** + * 是否执行 状态 (true √ false ×) + */ + private Boolean status; + + /** + * 执行标识 (有的话 已执行 (√) 否 null) + */ + private String statusType; + + /** + * 安全措施时间 + */ + private LocalDateTime safetyTime; + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java new file mode 100644 index 0000000..ddb5af3 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamGroupVo.java @@ -0,0 +1,71 @@ +package com.hnac.hzims.ticket.twoTicket.vo.process; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/6 14:45 + */ +@Data +public class TeamGroupVo { + + + /** + * 班组Id + */ + private String groupId; + + + /** + * 班组 名称 + */ + private String groupName; + + + /** + * 变更 负责人 id + */ + private String workLeaderId; + + /** + * 变更 负责人 名称 + */ + private String workLeaderName; + + + /** + * 班组人员 + */ + private List teamGroupName; + + + /** + * 离开时间 + */ + private LocalDateTime changeGroupDepartureTime; + + + /** + * 加入时间 + */ + private LocalDateTime changeGroupAddTime; + + + /** + * 离开内容 + */ + private LocalDateTime changeContent; + + + /** + * 收工时间 (完成时间) + */ + private LocalDateTime leaveTime; + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java new file mode 100644 index 0000000..e39e8b6 --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/TeamPersonnelVo.java @@ -0,0 +1,36 @@ +package com.hnac.hzims.ticket.twoTicket.vo.process; + +import lombok.Data; + +import java.time.LocalDateTime; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/6 14:48 + */ +@Data +public class TeamPersonnelVo { + + + /** + * 人员名称 + */ + private String name; + + + /** + * 开工时间 + */ + private LocalDateTime startDateTime; + + + /** + * 收工时间 + */ + private LocalDateTime endDateTime; + + + +} diff --git a/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java new file mode 100644 index 0000000..8cb78cb --- /dev/null +++ b/hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/vo/process/WorkTicketVo.java @@ -0,0 +1,162 @@ +package com.hnac.hzims.ticket.twoTicket.vo.process; + +import lombok.Data; + +import java.time.LocalDateTime; +import java.util.List; + +/** + * @Author WL + * @Version v1.0 + * @Serial 1.0 + * @Date 2023/4/6 11:52 + */ +@Data +public class WorkTicketVo { + + /** + * 编号 + */ + private String serialNumberId; + + + /** + * 票据名称 + */ + private String ticketName; + + + /** + * 票据模板 + */ + private String ticketTemplate; + + /** + * 开票来源 + */ + private String opensource; + + /** + * 开票任务来源 + */ + private String opensourceTask; + + + /** + * 设备 + */ + private String device; + + /** + * 单位 + */ + private String unit; + + + /** + * 班组 + */ + private List TeamGroupList; + + + /** + * 工作地点 + */ + private String workPlace; + + + /** + * 工作内容 + */ + private String workContent; + + /** + * 设备及工作地点 + */ + private String devicePlace; + + /** + * 设备及工作内容 + */ + private String deviceContent; + + + /** + * 计划开始时间 + */ + private LocalDateTime projectStartTime; + + /** + * 计划结束时间 + */ + private LocalDateTime projectEndTime; + + + /** + * 安全措施 + */ + private List safetyMeasuresList; + + + /** + * 工作签发人 + */ + private String workSigner; + + /** + * 签发人时间 + */ + private LocalDateTime workSignerTime; + + /** + * 批准工作结束时间 + */ + private LocalDateTime workEndTime; + + /** + * 值班负责人 + */ + private String WatchPrincipal; + + /** + * 许可人 + */ + private String licensorName; + + /** + * 许可人时间 + */ + private LocalDateTime licensorTime; + + + /** + * 变动时间 + */ + private String changeTime; + + + /** + * 延期时间 + */ + private LocalDateTime postponeDateTime; + + + /** + * 交底内容 + */ + private String tellContent; + + + /** + * 工作票结束时间 + */ + private LocalDateTime workTicketEndTime; + + + /** + * 备注 + */ + private String content; + + +}