Browse Source

测试

zhongwei
段飞宇 2 years ago
parent
commit
1ecdf17686
  1. 8
      .editorconfig
  2. 2
      hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java
  3. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java
  4. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java
  5. 17
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainSystemMonitoringController.java
  6. 11
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/SideHustleController.java
  7. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java
  8. 20
      hzims-service/ticket/pom.xml
  9. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java
  10. 34
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java
  11. 52
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java
  12. 47
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java
  13. 71
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java
  14. 36
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java
  15. 162
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java

8
.editorconfig

@ -19,3 +19,11 @@ indent_size = 2
[*.md] [*.md]
insert_final_newline = false insert_final_newline = false
trim_trailing_whitespace = false trim_trailing_whitespace = false
hzims-service/*/target/
hzims-service-api/*/target/
hzims-biz-common/*/target/
log
*.idea

2
hzims-biz-common/src/main/java/com/hnac/hzims/common/logs/consumer/SysLogConsumer.java

@ -102,7 +102,7 @@ public class SysLogConsumer implements Runnable {
log.info("日志操作数据:" + sysLogs); log.info("日志操作数据:" + sysLogs);
// TODO: 2023/4/4 添加到数据库 // TODO: 2023/4/4 添加到数据库
try { try {
// TODO: 2023/4/4 后期采取mq+elk实现,可以提高效率,操作日志数据越来越大,查询效率变大,提高性能 // TODO: 2023/4/4 后期采取kafka+elk实现,可以提高效率,操作日志数据越来越大,查询效率变大,提高性能
sysLogFeignService.saveBatch(sysLogs); sysLogFeignService.saveBatch(sysLogs);
} catch (Exception e) { } catch (Exception e) {
// TODO: 2023/4/4 出现异常呢, // TODO: 2023/4/4 出现异常呢,

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/config/controller/StAlamRecordController.java

@ -4,6 +4,9 @@ package com.hnac.hzims.operational.config.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity; import com.hnac.hzims.operational.config.entity.StAlarmRecordEntity;
import com.hnac.hzims.operational.config.service.StAlamRecordService; import com.hnac.hzims.operational.config.service.StAlamRecordService;
import com.hnac.hzims.operational.config.vo.FaultVo; import com.hnac.hzims.operational.config.vo.FaultVo;
@ -47,7 +50,8 @@ public class StAlamRecordController {
* <option value="5">遥测越限</option> * <option value="5">遥测越限</option>
* <option value="6">遥信变位</option> * <option value="6">遥信变位</option>
*/ */
@OperationAnnotation(title = "集中监控", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取当天的告警列表")
@ApiOperation("获取当天的告警列表") @ApiOperation("获取当天的告警列表")
@RequestMapping(value = "/getDaySoeList", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getDaySoeList", method = {RequestMethod.GET, RequestMethod.POST})
public R<SoeBodyVo> getDaySoeList(@ApiParam(value = "时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String date, public R<SoeBodyVo> getDaySoeList(@ApiParam(value = "时间 yyyy-MM-dd HH:mm:ss") @RequestParam(required = false) String date,
@ -61,7 +65,8 @@ public class StAlamRecordController {
} }
return stAlamRecordService.getDaySoeList(AuthUtil.getUser(), date, type,current,size,code); return stAlamRecordService.getDaySoeList(AuthUtil.getUser(), date, type,current,size,code);
} }
@OperationAnnotation(title = "集中监控", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取故障列表数据")
@ApiOperation("获取故障列表数据") @ApiOperation("获取故障列表数据")
@RequestMapping(value = "/getFaultList", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/getFaultList", method = {RequestMethod.GET, RequestMethod.POST})
public R<List<FaultVo>> getFaultList(@ApiParam(value = "站点编码") @RequestParam(required = false) String code) { public R<List<FaultVo>> getFaultList(@ApiParam(value = "站点编码") @RequestParam(required = false) String code) {
@ -75,6 +80,8 @@ public class StAlamRecordController {
@GetMapping("/listPage") @GetMapping("/listPage")
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入vo") @ApiOperation(value = "分页", notes = "传入vo")
@OperationAnnotation(title = "系统预警处理", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "分页查询")
public R<IPage<StAlarmRecordVo>> list(StAlarmRecordVo vo, Query query) { public R<IPage<StAlarmRecordVo>> list(StAlarmRecordVo vo, Query query) {
return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo)); return R.data(stAlamRecordService.doPageList(Condition.getPage(query), vo));
} }

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/HydropowerController.java

@ -1,6 +1,9 @@
package com.hnac.hzims.operational.main.controller; package com.hnac.hzims.operational.main.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.main.service.IHomePageService; import com.hnac.hzims.operational.main.service.IHomePageService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -76,6 +79,8 @@ public class HydropowerController extends BladeController {
@ApiLog @ApiLog
@ApiOperation("年计划发电完成趋势") @ApiOperation("年计划发电完成趋势")
@GetMapping("/planAactualTrend") @GetMapping("/planAactualTrend")
@OperationAnnotation(title = "演示大屏", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "年计划发电完成趋势")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
public R<List<PowerMonthVo>> planActualTrend(@ApiParam(value = "区域机构ID") Long deptId) { public R<List<PowerMonthVo>> planActualTrend(@ApiParam(value = "区域机构ID") Long deptId) {
return R.data(homePageService.planActualTrend(deptId)); return R.data(homePageService.planActualTrend(deptId));

17
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/MainSystemMonitoringController.java

@ -37,6 +37,8 @@ public class MainSystemMonitoringController {
* *
* @return * @return
*/ */
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取当时历史数据 (日发电量,月发电量,年发电量,有功功率)")
@ApiLog @ApiLog
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@ApiOperation("获取当时历史数据 (日发电量,月发电量,年发电量,有功功率)") @ApiOperation("获取当时历史数据 (日发电量,月发电量,年发电量,有功功率)")
@ -55,6 +57,8 @@ public class MainSystemMonitoringController {
@ApiLog @ApiLog
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@ApiOperation("获取当时历史数据 (日发电量,月发电量,年发电量,有功功率)") @ApiOperation("获取当时历史数据 (日发电量,月发电量,年发电量,有功功率)")
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取当时历史数据 (日发电量,月发电量,年发电量,有功功率)")
@PostMapping("/getHisDataByDeptNew") @PostMapping("/getHisDataByDeptNew")
public R<StationVo> getHisDataByDeptNew(@Valid @RequestBody RoutingParamVo vo) { public R<StationVo> getHisDataByDeptNew(@Valid @RequestBody RoutingParamVo vo) {
return mainSystemMonitoringService.getRedisHisDataByDeptNew(vo.getCycle(),vo.getDeptIds(),"0"); return mainSystemMonitoringService.getRedisHisDataByDeptNew(vo.getCycle(),vo.getDeptIds(),"0");
@ -66,6 +70,8 @@ public class MainSystemMonitoringController {
* *
* @return * @return
*/ */
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取折线图-新版")
@ApiLog @ApiLog
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@ApiOperation("获取折线图") @ApiOperation("获取折线图")
@ -80,6 +86,8 @@ public class MainSystemMonitoringController {
* *
* @return * @return
*/ */
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取折线图-旧版")
@ApiOperationSupport(order = 20) @ApiOperationSupport(order = 20)
@ApiOperation("获取折线图") @ApiOperation("获取折线图")
@PostMapping("/getTheDayHydrograph") @PostMapping("/getTheDayHydrograph")
@ -96,6 +104,8 @@ public class MainSystemMonitoringController {
*/ */
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation("获取路由") @ApiOperation("获取路由")
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "根据用户权限获取路由")
@PostMapping("/toGetTheRouting") @PostMapping("/toGetTheRouting")
public R<InDustryVo> toGetTheRouting(@Valid @RequestBody RoutingParamVo vo) { public R<InDustryVo> toGetTheRouting(@Valid @RequestBody RoutingParamVo vo) {
return R.data(mainSystemMonitoringService.getUserDataScopeHomePage(vo.getBusinessType(), vo.getStationType(), vo.getDeptIds(), vo.getRefTerminal())); return R.data(mainSystemMonitoringService.getUserDataScopeHomePage(vo.getBusinessType(), vo.getStationType(), vo.getDeptIds(), vo.getRefTerminal()));
@ -111,6 +121,8 @@ public class MainSystemMonitoringController {
@ApiOperationSupport(order = 50) @ApiOperationSupport(order = 50)
@ApiOperation("机构") @ApiOperation("机构")
@GetMapping("/dept/list") @GetMapping("/dept/list")
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "机构")
public R<List<Dept>> deptList() { public R<List<Dept>> deptList() {
return mainSystemMonitoringService.doDeptList(); return mainSystemMonitoringService.doDeptList();
@ -119,12 +131,15 @@ public class MainSystemMonitoringController {
@ApiLog @ApiLog
@GetMapping("/listByAuth") @GetMapping("/listByAuth")
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "根据用户权限查询站点")
@ApiOperation(value = "根据用户权限查询站点", notes = "") @ApiOperation(value = "根据用户权限查询站点", notes = "")
public R<List<StationEntity>> listByAuth(StationEntity entity) { public R<List<StationEntity>> listByAuth(StationEntity entity) {
return R.data(mainSystemMonitoringService.doListByAuth(entity)); return R.data(mainSystemMonitoringService.doListByAuth(entity));
} }
@ApiLog @ApiLog
@GetMapping("/listByAuthDept") @GetMapping("/listByAuthDept")
@OperationAnnotation(title = "排班计划",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action @OperationAnnotation(title = "排班计划",operatorType = OperatorType.MOBILE,businessType = BusinessType.GENCODE,action
= "根据用户权限查询站点及部门") = "根据用户权限查询站点及部门")
@ -135,6 +150,8 @@ public class MainSystemMonitoringController {
} }
@ApiLog @ApiLog
@OperationAnnotation(title = "首页工作台", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "根据用户权限获取机构")
@GetMapping("/deptByAuthUser") @GetMapping("/deptByAuthUser")
@ApiOperationSupport(order = 100) @ApiOperationSupport(order = 100)
@ApiOperation(value = "根据用户权限获取机构", notes = "") @ApiOperation(value = "根据用户权限获取机构", notes = "")

11
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/controller/SideHustleController.java

@ -1,6 +1,9 @@
package com.hnac.hzims.operational.main.controller; package com.hnac.hzims.operational.main.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.main.service.ISideHustleService; import com.hnac.hzims.operational.main.service.ISideHustleService;
import com.hnac.hzims.operational.main.vo.*; import com.hnac.hzims.operational.main.vo.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
@ -47,12 +50,16 @@ public class SideHustleController extends BladeController {
@ApiOperation("集团/区域发电占比") @ApiOperation("集团/区域发电占比")
@GetMapping("/areaPowerScale") @GetMapping("/areaPowerScale")
@ApiOperationSupport(order = 3) @ApiOperationSupport(order = 3)
@OperationAnnotation(title = "演示大屏", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "区域发电占比")
public R<List<AreaPowerScaleVo>> areaPowerScale(@ApiParam(value = "区域机构ID") Long deptId) { public R<List<AreaPowerScaleVo>> areaPowerScale(@ApiParam(value = "区域机构ID") Long deptId) {
return R.data(regionService.areaPowerScale(deptId)); return R.data(regionService.areaPowerScale(deptId));
} }
@ApiLog @ApiLog
@ApiOperation("集团/区域占比") @ApiOperation("集团/区域占比")
@GetMapping("/areaScale") @GetMapping("/areaScale")
@OperationAnnotation(title = "演示大屏", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "区域占比")
@ApiOperationSupport(order = 4) @ApiOperationSupport(order = 4)
public R<List<AreaScaleVo>> areaScale(@ApiParam(value = "区域机构ID") Long deptId) { public R<List<AreaScaleVo>> areaScale(@ApiParam(value = "区域机构ID") Long deptId) {
return R.data(regionService.areaScale(deptId)); return R.data(regionService.areaScale(deptId));
@ -69,12 +76,14 @@ public class SideHustleController extends BladeController {
@ApiOperation("获取地图标记") @ApiOperation("获取地图标记")
@GetMapping("/getMapMarker") @GetMapping("/getMapMarker")
@ApiOperationSupport(order = 6) @ApiOperationSupport(order = 6)
@OperationAnnotation(title = "演示大屏", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "获取地图标记")
public R<List<MapMarkerVo>> getMapMarker(@ApiParam(value = "区域机构ID") Long deptId,@RequestParam(value ="types") List<Integer> types) { public R<List<MapMarkerVo>> getMapMarker(@ApiParam(value = "区域机构ID") Long deptId,@RequestParam(value ="types") List<Integer> types) {
return R.data(regionService.getMapMarker(deptId,types)); return R.data(regionService.getMapMarker(deptId,types));
} }
@ApiLog @ApiLog
@ApiOperation("区域当月发电量完成情况") @ApiOperation("区域当月发电量完成情况")
@GetMapping("/powerFinishMonth") // @GetMapping("/powerFinishMonth")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
public R<PowerFinishVo> powerFinishMonth(@ApiParam(value = "区域id",required = true) @RequestParam("deptId") Long deptId) { public R<PowerFinishVo> powerFinishMonth(@ApiParam(value = "区域id",required = true) @RequestParam("deptId") Long deptId) {
PowerFinishVo response = regionService.powerFinishMonth(deptId); PowerFinishVo response = regionService.powerFinishMonth(deptId);

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/controller/DeptController.java

@ -1,5 +1,8 @@
package com.hnac.hzims.operational.report.controller; package com.hnac.hzims.operational.report.controller;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.operational.report.service.IDeptService; import com.hnac.hzims.operational.report.service.IDeptService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -27,6 +30,8 @@ public class DeptController extends BladeController {
} }
@ApiLog @ApiLog
@OperationAnnotation(title = "集中监控", operatorType = OperatorType.MOBILE,
businessType = BusinessType.GENCODE,action = "getCurrentUserDept")
@GetMapping("/getCurrentUserDept") @GetMapping("/getCurrentUserDept")
public R<List<Dept>> getCurrentUserDept(@RequestParam(required = false) String name,@RequestParam(required = false) String type){ public R<List<Dept>> getCurrentUserDept(@RequestParam(required = false) String name,@RequestParam(required = false) String type){
return R.data(deptService.getCurrentUserDept(name,type)); return R.data(deptService.getCurrentUserDept(name,type));

20
hzims-service/ticket/pom.xml

@ -271,16 +271,16 @@
<version>0.2.3-RC1</version> <version>0.2.3-RC1</version>
</dependency> </dependency>
<dependency> <!-- <dependency>-->
<groupId>redis.clients</groupId> <!-- <groupId>redis.clients</groupId>-->
<artifactId>jedis</artifactId> <!-- <artifactId>jedis</artifactId>-->
</dependency> <!-- </dependency>-->
<dependency> <!-- <dependency>-->
<groupId>com.aliyun</groupId> <!-- <groupId>com.aliyun</groupId>-->
<artifactId>aliyun-java-sdk-ecs</artifactId> <!-- <artifactId>aliyun-java-sdk-ecs</artifactId>-->
<version>4.2.0</version> <!-- <version>4.2.0</version>-->
<scope>compile</scope> <!-- <scope>compile</scope>-->
</dependency> <!-- </dependency>-->
</dependencies> </dependencies>
<repositories> <repositories>

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/consumer/StandardWorkTicketConsumer.java

@ -4,14 +4,15 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.hnac.hzims.ticket.processflow.entity.WorkflowOperationLog; import com.hnac.hzims.ticket.processflow.entity.WorkflowOperationLog;
import com.hnac.hzims.ticket.processflow.service.WorkflowOperationLogService; import com.hnac.hzims.ticket.processflow.service.WorkflowOperationLogService;
import com.hnac.hzims.ticket.response.WorkTicketMessageResponse;
import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; 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.service.TicketService;
import com.hnac.hzims.ticket.response.WorkTicketMessageResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.queue.annotation.RedisQueue; import org.springblade.queue.annotation.RedisQueue;
import org.springblade.queue.consume.IQueueConsume; import org.springblade.queue.consume.IQueueConsume;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.retry.listener.RetryListenerSupport;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -29,6 +30,7 @@ import java.util.List;
@Slf4j @Slf4j
public class StandardWorkTicketConsumer implements IQueueConsume { public class StandardWorkTicketConsumer implements IQueueConsume {
@Autowired @Autowired
private List<TicketService> ticketServiceList; private List<TicketService> ticketServiceList;

34
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/controller/ProcessTypeController.java

@ -11,21 +11,19 @@ import com.hnac.hzims.ticket.processflow.properties.WorkTicketProperties;
import com.hnac.hzims.ticket.processflow.service.ProcessTypeService; import com.hnac.hzims.ticket.processflow.service.ProcessTypeService;
import com.hnac.hzims.ticket.processflow.strategy.entity.WorkflowQueue; 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.service.TicketService;
import com.hnac.hzims.ticket.response.WorkTicketMessageResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.flow.core.entity.BladeFlow; import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.flow.core.feign.IFlowClient; import org.springblade.flow.core.feign.IFlowClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springblade.queue.produce.QueueProduceService;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -58,6 +56,10 @@ public class ProcessTypeController {
private final IFlowClient flowClient; private final IFlowClient flowClient;
private final QueueProduceService queueProduceService;
@GetMapping("/add") @GetMapping("/add")
public void add() { public void add() {
@ -90,7 +92,7 @@ public class ProcessTypeController {
@OperationAnnotation(title = "操作模块", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE,action ="获取redis数据") @OperationAnnotation(title = "操作模块", operatorType = OperatorType.MOBILE, businessType = BusinessType.GENCODE,action ="获取redis数据")
@GetMapping("/redis/{value}") @GetMapping("/redis/{value}")
public int opens(@PathVariable String value) { public int opens(@PathVariable String value) {
redisTemplate.opsForValue().set("name:hello", JSON.toJSONString(value)); redisTemplate.convertAndSend("blade:queue:flow", JSON.toJSONString(value));
return 0; return 0;
} }
@ -109,18 +111,14 @@ public class ProcessTypeController {
action ="审批流处理") action ="审批流处理")
@GetMapping("/build") @GetMapping("/build")
public void addList() { public void addList() {
Map<String,Object> params = new HashMap<String, Object>(2) {{
put("taskId", "1"); WorkTicketMessageResponse workTicketMessageResponse = new WorkTicketMessageResponse();
put("signUserIds", "admin"); workTicketMessageResponse.setTaskId("1");
}}; workTicketMessageResponse.setProcessInstanceKey("1");
R<BladeFlow> result = flowClient workTicketMessageResponse.setTaskName("1");
.startProcessInstanceContainNameByKey( workTicketMessageResponse.setFormData(1);
"newFirstWorkTicket","workTicket:task:" + "11", String qqqq = JsonUtil.toJson(workTicketMessageResponse);
"工作流处理业务", queueProduceService.sendMessage("blade:queue:flow",qqqq);
params);
System.out.println(result.getData());
} }
} }

52
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/strategy/core/TicketIdWorker.java

@ -48,21 +48,21 @@ public class TicketIdWorker {
* *
* @param staff AA在建站之初由接站人员填写要求唯一 * @param staff AA在建站之初由接站人员填写要求唯一
* @param typeInstrument 票据种类第一种票第二种票 * @param typeInstrument 票据种类第一种票第二种票
* @param YearMonth 开票时间年月 * @param yearMonth 开票时间年月
*/ */
public String getTicketCode(String staff, String typeInstrument, String YearMonth) { public String getTicketCode(String staff, String typeInstrument, String yearMonth) {
ValueOperations<String, String> operations = redisTemplate.opsForValue(); ValueOperations<String, String> operations = redisTemplate.opsForValue();
AtomicInteger atomicInteger = new AtomicInteger(1); AtomicInteger atomicInteger = new AtomicInteger(1);
String key = staff + ":" + typeInstrument + ":" + YearMonth; String key = staff + ":" + typeInstrument + ":" + yearMonth;
// TicketCode ticketCode1 = cacheMap.get(key); // TicketCode ticketCode1 = cacheMap.get(key);
TicketCode ticketCode = JSON.parseObject(operations.get(key), TicketCode.class); TicketCode ticketCode = JSON.parseObject(operations.get(key), TicketCode.class);
if (ticketCode == null) { if (ticketCode == null) {
ticketCode = new TicketCode(); ticketCode = new TicketCode();
ticketCode.setYearMonth(YearMonth); ticketCode.setYearMonth(yearMonth);
ticketCode.setSequencing(atomicInteger); ticketCode.setSequencing(atomicInteger);
// cacheMap.put(key, ticketCode); // cacheMap.put(key, ticketCode);
operations.set(key, JSON.toJSONString(ticketCode)); operations.set(key, JSON.toJSONString(ticketCode));
String result = getTicketCode(staff, typeInstrument, YearMonth, atomicInteger.get()); String result = getTicketCode(staff, typeInstrument, yearMonth, atomicInteger.get());
return result; return result;
} }
@ -71,9 +71,9 @@ public class TicketIdWorker {
AtomicInteger sequencing = ticketCode.getSequencing(); AtomicInteger sequencing = ticketCode.getSequencing();
//生成 票据排序 格式 001 010 111 //生成 票据排序 格式 001 010 111
int code = getYearMonthCode(originalYearMonth, YearMonth, key, sequencing); int code = getYearMonthCode(originalYearMonth, yearMonth, key, sequencing);
String result = getTicketCode(staff, typeInstrument, YearMonth, code); String result = getTicketCode(staff, typeInstrument, yearMonth, code);
return result; return result;
} }
@ -159,6 +159,19 @@ public class TicketIdWorker {
} }
/**
* 按规则生成票据编码票据编码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 @Data
public static class TicketCode { public static class TicketCode {
@ -174,16 +187,16 @@ public class TicketIdWorker {
public static void main(String[] args) { public static void main(String[] args) {
TicketIdWorker standardTicketIdWorker = new TicketIdWorker(); // TicketIdWorker standardTicketIdWorker = new TicketIdWorker();
int count = 1; // int count = 1;
while (count <= 1000) { // while (count <= 1000) {
//
System.out.println("1 ===> " + standardTicketIdWorker.getTicketCode("aa", "bb", "2304")); // System.out.println("1 ===> " + standardTicketIdWorker.getTicketCode("aa", "bb", "2304"));
System.out.println("================================="); // System.out.println("=================================");
//System.out.println("2 ===》" + standardTicketIdWorker.getTicketCode("aa", "bb", "2204")); // //System.out.println("2 ===》" + standardTicketIdWorker.getTicketCode("aa", "bb", "2204"));
count++; // count++;
//
} // }
// NumberFormat numberFormatter = NumberFormat.getInstance(); // NumberFormat numberFormatter = NumberFormat.getInstance();
// numberFormatter.setGroupingUsed(false); // numberFormatter.setGroupingUsed(false);
@ -192,6 +205,11 @@ public class TicketIdWorker {
// //
// String format = numberFormatter.format(2); // String format = numberFormatter.format(2);
// System.out.println(format); // System.out.println(format);
String msg = "2021";
String substring = msg.substring(msg.length() - 2);
System.out.println(substring);
} }

47
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/SafetyMeasuresVo.java

@ -0,0 +1,47 @@
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;
}

71
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamGroupVo.java

@ -0,0 +1,71 @@
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<TeamPersonnelVo> teamGroupName;
/**
* 离开时间
*/
private LocalDateTime changeGroupDepartureTime;
/**
* 加入时间
*/
private LocalDateTime changeGroupAddTime;
/**
* 离开内容
*/
private LocalDateTime changeContent;
/**
* 收工时间 (完成时间)
*/
private LocalDateTime leaveTime;
}

36
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/TeamPersonnelVo.java

@ -0,0 +1,36 @@
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;
}

162
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/processflow/vo/WorkTicketVo.java

@ -0,0 +1,162 @@
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<TeamGroupVo> TeamGroupList;
/**
* 工作地点
*/
private String workPlace;
/**
* 工作内容
*/
private String workContent;
/**
* 设备及工作地点
*/
private String devicePlace;
/**
* 设备及工作内容
*/
private String deviceContent;
/**
* 计划开始时间
*/
private LocalDateTime projectStartTime;
/**
* 计划结束时间
*/
private LocalDateTime projectEndTime;
/**
* 安全措施
*/
private List<SafetyMeasuresVo> 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;
}
Loading…
Cancel
Save