Jone
1 year ago
7 changed files with 1 additions and 256 deletions
@ -1,110 +0,0 @@
|
||||
package com.hnac.hzims.middle.processflow.controller; |
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
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.middle.process.to.ProcessWorkFlowResponse; |
||||
import com.hnac.hzims.middle.processflow.entity.ProcessType; |
||||
import com.hnac.hzims.middle.processflow.properties.TicketProperties; |
||||
import com.hnac.hzims.middle.processflow.properties.WorkTicketProperties; |
||||
import com.hnac.hzims.middle.processflow.service.ProcessTypeService; |
||||
import com.hnac.hzims.middle.processflow.strategy.entity.WorkflowQueue; |
||||
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService; |
||||
import lombok.RequiredArgsConstructor; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.jackson.JsonUtil; |
||||
import org.springblade.queue.produce.QueueProduceService; |
||||
import org.springframework.data.redis.core.RedisTemplate; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.PathVariable; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 工作流审批类型 前端控制器 |
||||
* </p> |
||||
* |
||||
* @author dfy |
||||
* @since 2023-03-29 |
||||
*/ |
||||
@RequiredArgsConstructor |
||||
@RestController |
||||
@RequestMapping("/processflow/process-type") |
||||
public class ProcessTypeController { |
||||
|
||||
|
||||
private final TicketProperties ticketProperties; |
||||
|
||||
|
||||
private final ProcessTypeService processTypeService; |
||||
|
||||
|
||||
private final List<ProcessService> ticketServiceList; |
||||
|
||||
|
||||
private final RedisTemplate redisTemplate; |
||||
|
||||
private final QueueProduceService queueProduceService; |
||||
|
||||
|
||||
@GetMapping("/add") |
||||
public void add() { |
||||
List<WorkTicketProperties> workTickets = ticketProperties.getWorkTickets(); |
||||
List<ProcessType> processTypeList = workTickets.stream().map(item -> { |
||||
ProcessType processType = new ProcessType(); |
||||
processType.setDeploymentId(item.getFlowId()); |
||||
processType.setDeploymentName(item.getSegment()); |
||||
processType.setSegment("新工作票"); |
||||
processType.setSequence(item.getStatus()); |
||||
return processType; |
||||
}).collect(Collectors.toList()); |
||||
processTypeService.saveBatch(processTypeList); |
||||
} |
||||
|
||||
|
||||
@GetMapping("/list/{key}") |
||||
public String list(@PathVariable String key) { |
||||
//判断执行具体的实现类
|
||||
WorkflowQueue workflowQueue = new WorkflowQueue(); |
||||
workflowQueue.setProcessDefinitionKey(key); |
||||
ProcessService ticketService = ticketServiceList.stream().filter(item -> item.isWorkflowProcess(workflowQueue)).findFirst().orElse(null); |
||||
ticketService.calculate(null); |
||||
return "key"; |
||||
} |
||||
|
||||
|
||||
@GetMapping("/redis/{value}") |
||||
public int opens(@PathVariable String value) { |
||||
redisTemplate.convertAndSend("blade:queue:flow", JSON.toJSONString(value)); |
||||
return 0; |
||||
} |
||||
|
||||
|
||||
|
||||
@GetMapping("/list") |
||||
public R list() { |
||||
List<ProcessType> list = processTypeService.list(); |
||||
System.out.println(1 / 0); |
||||
return R.data(list); |
||||
} |
||||
|
||||
|
||||
@GetMapping("/build") |
||||
public void addList() { |
||||
ProcessWorkFlowResponse workTicketMessageResponse = new ProcessWorkFlowResponse(); |
||||
workTicketMessageResponse.setTaskId("1"); |
||||
workTicketMessageResponse.setProcessDefinitionKey("newFirstWorkTicket"); |
||||
workTicketMessageResponse.setTaskName("签发人签发"); |
||||
workTicketMessageResponse.setVariables("1"); |
||||
String qqqq = JsonUtil.toJson(workTicketMessageResponse); |
||||
queueProduceService.sendMessage("blade:queue:flow", qqqq); |
||||
} |
||||
|
||||
|
||||
} |
||||
|
@ -1,75 +0,0 @@
|
||||
package com.hnac.hzims.middle.processflow.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import java.time.LocalDateTime; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import java.io.Serializable; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.experimental.Accessors; |
||||
|
||||
/** |
||||
* <p> |
||||
* 工作流审批类型 |
||||
* </p> |
||||
* |
||||
* @author dfy |
||||
* @since 2023-03-29 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = false) |
||||
@Accessors(chain = true) |
||||
@TableName("hzims_process_type") |
||||
public class ProcessType implements Serializable { |
||||
|
||||
private static final long serialVersionUID=1L; |
||||
|
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Long id; |
||||
|
||||
/** |
||||
* 序号 |
||||
*/ |
||||
@TableField("sequence") |
||||
private Integer sequence; |
||||
|
||||
/** |
||||
* 当前环节流程key |
||||
*/ |
||||
@TableField("deployment_id") |
||||
private String deploymentId; |
||||
|
||||
/** |
||||
* 当前流程名称 |
||||
*/ |
||||
@TableField("deployment_name") |
||||
private String deploymentName; |
||||
|
||||
/** |
||||
* 一个流程图的名称 |
||||
*/ |
||||
@TableField("segment") |
||||
private String segment; |
||||
|
||||
/** |
||||
* 创建时间 |
||||
*/ |
||||
@TableField("create_time") |
||||
private LocalDateTime createTime; |
||||
|
||||
/** |
||||
* 更新时间 |
||||
*/ |
||||
@TableField("update_time") |
||||
private LocalDateTime updateTime; |
||||
|
||||
/** |
||||
* 逻辑删除 |
||||
*/ |
||||
@TableField("is_deleted") |
||||
private Integer isDeleted; |
||||
|
||||
|
||||
} |
@ -1,16 +0,0 @@
|
||||
package com.hnac.hzims.middle.processflow.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.hnac.hzims.middle.processflow.entity.ProcessType; |
||||
|
||||
/** |
||||
* <p> |
||||
* 工作流审批类型 Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author dfy |
||||
* @since 2023-03-29 |
||||
*/ |
||||
public interface ProcessTypeMapper extends BaseMapper<ProcessType> { |
||||
|
||||
} |
@ -1,16 +0,0 @@
|
||||
package com.hnac.hzims.middle.processflow.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import com.hnac.hzims.middle.processflow.entity.ProcessType; |
||||
|
||||
/** |
||||
* <p> |
||||
* 工作流审批类型 服务类 |
||||
* </p> |
||||
* |
||||
* @author dfy |
||||
* @since 2023-03-29 |
||||
*/ |
||||
public interface ProcessTypeService extends IService<ProcessType> { |
||||
|
||||
} |
@ -1,20 +0,0 @@
|
||||
package com.hnac.hzims.middle.processflow.service.impl; |
||||
|
||||
import com.hnac.hzims.middle.processflow.entity.ProcessType; |
||||
import com.hnac.hzims.middle.processflow.mapper.ProcessTypeMapper; |
||||
import com.hnac.hzims.middle.processflow.service.ProcessTypeService; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 工作流审批类型 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author dfy |
||||
* @since 2023-03-29 |
||||
*/ |
||||
@Service |
||||
public class ProcessTypeServiceImpl extends ServiceImpl<ProcessTypeMapper, ProcessType> implements ProcessTypeService { |
||||
|
||||
} |
Loading…
Reference in new issue