Browse Source

删掉无用代码

zhongwei
Jone 1 year ago
parent
commit
a5c85cec05
  1. 1
      hzims-service/hzims-middle/pom.xml
  2. 110
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java
  3. 75
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessType.java
  4. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessTypeMapper.java
  5. 16
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessTypeService.java
  6. 20
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessTypeServiceImpl.java
  7. 17
      hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java

1
hzims-service/hzims-middle/pom.xml

@ -24,7 +24,6 @@
<dependency> <dependency>
<groupId>org.springblade</groupId> <groupId>org.springblade</groupId>
<artifactId>blade-common</artifactId> <artifactId>blade-common</artifactId>
<version>${bladex.projet.common.version}</version>
</dependency> </dependency>
<dependency> <dependency>

110
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/controller/ProcessTypeController.java

@ -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);
}
}

75
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/entity/ProcessType.java

@ -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;
}

16
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/mapper/ProcessTypeMapper.java

@ -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> {
}

16
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/ProcessTypeService.java

@ -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> {
}

20
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/service/impl/ProcessTypeServiceImpl.java

@ -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 {
}

17
hzims-service/hzims-middle/src/main/java/com/hnac/hzims/middle/processflow/strategy/abstracts/ProcessAbstractService.java

@ -1,7 +1,5 @@
package com.hnac.hzims.middle.processflow.strategy.abstracts; package com.hnac.hzims.middle.processflow.strategy.abstracts;
import com.hnac.hzims.middle.processflow.entity.ProcessType;
import com.hnac.hzims.middle.processflow.service.ProcessTypeService;
import com.hnac.hzims.middle.processflow.strategy.service.ProcessService; import com.hnac.hzims.middle.processflow.strategy.service.ProcessService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -18,19 +16,4 @@ import java.util.List;
public abstract class ProcessAbstractService implements ProcessService { public abstract class ProcessAbstractService implements ProcessService {
@Autowired
private ProcessTypeService processTypeService;
/**
* 查询所有的方法
*
* @return
*/
public List<ProcessType> getProcessList() {
log.info("实例化:" + processTypeService);
List<ProcessType> workTickets = processTypeService.list();
return workTickets;
}
} }

Loading…
Cancel
Save