1.删除无效文件
This commit is contained in:
parent
8871203cc5
commit
a8a34b1612
|
@ -1,133 +0,0 @@
|
||||||
package com.example.liteflow.mysql;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.example.liteflow.mysql.model.BaseCenter;
|
|
||||||
import com.example.liteflow.mysql.model.CostCenter;
|
|
||||||
import com.example.liteflow.mysql.model.ProfitCenter;
|
|
||||||
import com.yomahub.liteflow.core.FlowExecutor;
|
|
||||||
import com.yomahub.liteflow.flow.LiteflowResponse;
|
|
||||||
import org.assertj.core.util.Lists;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class LiteFlowCommand
|
|
||||||
// implements CommandLineRunner
|
|
||||||
{
|
|
||||||
|
|
||||||
private final Logger log = LoggerFactory.getLogger(this.getClass());
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private FlowExecutor flowExecutor;
|
|
||||||
|
|
||||||
private final List<String> chainNameList = Lists.newArrayList("cost01AndCost02", "cost01", "cost02", "profit01AndProfit02", "profit01", "profit02");
|
|
||||||
private final List<String> profitCenterList = Lists.newArrayList("profit01AndProfit02", "profit01", "profit02");
|
|
||||||
private final List<String> costCenterList = Lists.newArrayList("cost01AndCost02", "cost01", "cost02");
|
|
||||||
|
|
||||||
// @Override
|
|
||||||
public void run1(String... args) throws Exception {
|
|
||||||
// 事实对象
|
|
||||||
// CostCenter costCenter = new CostCenter();
|
|
||||||
// costCenter.setSectionClassification("成本科目1");
|
|
||||||
// costCenter.setBusinessType("货代");
|
|
||||||
// costCenter.setSalesman("仓干配物流部(物流)");
|
|
||||||
// costCenter.setBusinessCategory("全货船业务");
|
|
||||||
//
|
|
||||||
// ProfitCenter profitCenter = new ProfitCenter();
|
|
||||||
// profitCenter.setBusinessType("货代");
|
|
||||||
// profitCenter.setSalesman("商品车物流部(物流)");
|
|
||||||
// profitCenter.setBusinessCategory("运输业务");
|
|
||||||
// profitCenter.setSectionClassification("银行科目");
|
|
||||||
// 数据库匹配
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("costCenter", costCenter, CostCenterContext.class);
|
|
||||||
// xml匹配
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("mainChain", costCenter, CostCenterContext.class);
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("cost01AndCost02", costCenter);
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("cost01", costCenter);
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("cost02", costCenter);
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("profit01AndProfit02", profitCenter);
|
|
||||||
// LiteflowResponse response = flowExecutor.execute2Resp("profit01", profitCenter);
|
|
||||||
|
|
||||||
List<BaseCenter> list = this.generateCostCenterTestData();
|
|
||||||
log.info("before-list = {}", JSONUtil.toJsonStr(list));
|
|
||||||
list.forEach(item -> {
|
|
||||||
int randomInt = RandomUtil.randomInt(0, 5);
|
|
||||||
String s = chainNameList.get(randomInt);
|
|
||||||
System.out.println("s = " + s);
|
|
||||||
LiteflowResponse response = flowExecutor.execute2Resp("costAndProfit", item);
|
|
||||||
// response = flowExecutor.execute2Resp("profit01AndProfit02", item);
|
|
||||||
|
|
||||||
// if (costCenterList.contains(s)) {
|
|
||||||
// randomInt = RandomUtil.randomInt(0, 2);
|
|
||||||
// response = flowExecutor.execute2Resp(profitCenterList.get(randomInt), item);
|
|
||||||
// } else {
|
|
||||||
// randomInt = RandomUtil.randomInt(0, 2);
|
|
||||||
// response = flowExecutor.execute2Resp(costCenterList.get(randomInt), item);
|
|
||||||
// }
|
|
||||||
if (response.isSuccess()) {
|
|
||||||
log.info("执行成功");
|
|
||||||
} else {
|
|
||||||
log.info("执行失败");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
log.info("after-list = {}", JSONUtil.toJsonStr(list));
|
|
||||||
|
|
||||||
// log.info("costCenter = {}", JSONUtil.toJsonStr(costCenter));
|
|
||||||
// log.info("profitCenter = {}", JSONUtil.toJsonStr(profitCenter));
|
|
||||||
|
|
||||||
|
|
||||||
// CostCenterContext costCenterContext = response.getFirstContextBean();
|
|
||||||
// String code = costCenterContext.getCode();
|
|
||||||
// String name = costCenterContext.getName();
|
|
||||||
// String generateCode = costCenterContext.getGenerateCode();
|
|
||||||
// costCenter.setCode(code);
|
|
||||||
// costCenter.setName(name);
|
|
||||||
// costCenter.setGenerateCode(generateCode);
|
|
||||||
// log.info(JSONUtil.toJsonStr(costCenter));
|
|
||||||
// if (response.isSuccess()) {
|
|
||||||
// log.info("执行成功");
|
|
||||||
// } else {
|
|
||||||
// log.info("执行失败");
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<BaseCenter> generateCostCenterTestData() {
|
|
||||||
List<BaseCenter> list = new ArrayList<>();
|
|
||||||
CostCenter costCenter = new CostCenter();
|
|
||||||
costCenter.setSectionClassification("成本科目");
|
|
||||||
costCenter.setBusinessType("货代");
|
|
||||||
costCenter.setSalesman("仓干配物流部(物流)");
|
|
||||||
costCenter.setBusinessCategory("全货船业务");
|
|
||||||
list.add(costCenter);
|
|
||||||
|
|
||||||
costCenter = new CostCenter();
|
|
||||||
costCenter.setBusinessType("货代");
|
|
||||||
costCenter.setSalesman("仓干配物流部(物流)");
|
|
||||||
list.add(costCenter);
|
|
||||||
|
|
||||||
costCenter = new CostCenter();
|
|
||||||
costCenter.setBusinessType("货代");
|
|
||||||
list.add(costCenter);
|
|
||||||
|
|
||||||
ProfitCenter profitCenter = new ProfitCenter();
|
|
||||||
profitCenter.setSectionClassification("银行科目");
|
|
||||||
profitCenter.setBusinessType("货代");
|
|
||||||
profitCenter.setSalesman("商品车物流部(物流)");
|
|
||||||
profitCenter.setBusinessCategory("运输业务");
|
|
||||||
list.add(profitCenter);
|
|
||||||
|
|
||||||
profitCenter = new ProfitCenter();
|
|
||||||
profitCenter.setBusinessType("货代");
|
|
||||||
profitCenter.setSalesman("商品车物流部(物流)");
|
|
||||||
list.add(profitCenter);
|
|
||||||
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.example.liteflow.mysql.model;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author: 陈韦龙
|
|
||||||
* @date: 2022年07月06日 12:08
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class CostCenter extends BaseCenter {
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.example.liteflow.mysql.model;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 陈韦龙
|
|
||||||
* @date 2022/07/01/ 15:41
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ProfitCenter extends BaseCenter {
|
|
||||||
}
|
|
|
@ -11,12 +11,10 @@ import com.example.liteflow.mysql.entity.BaseNodeEntity;
|
||||||
import com.example.liteflow.mysql.entity.BaseTemplateEntity;
|
import com.example.liteflow.mysql.entity.BaseTemplateEntity;
|
||||||
import com.example.liteflow.mysql.enums.EnableMarkEnum;
|
import com.example.liteflow.mysql.enums.EnableMarkEnum;
|
||||||
import com.example.liteflow.mysql.enums.NodeEnum;
|
import com.example.liteflow.mysql.enums.NodeEnum;
|
||||||
|
import com.example.liteflow.mysql.mapper.BaseChainMapper;
|
||||||
import com.example.liteflow.mysql.model.BaseCenter;
|
import com.example.liteflow.mysql.model.BaseCenter;
|
||||||
import com.example.liteflow.mysql.model.CommonResult;
|
import com.example.liteflow.mysql.model.CommonResult;
|
||||||
import com.example.liteflow.mysql.model.CostCenter;
|
|
||||||
import com.example.liteflow.mysql.model.ProfitCenter;
|
|
||||||
import com.example.liteflow.mysql.service.BaseChainService;
|
import com.example.liteflow.mysql.service.BaseChainService;
|
||||||
import com.example.liteflow.mysql.mapper.BaseChainMapper;
|
|
||||||
import com.example.liteflow.mysql.service.BaseNodeService;
|
import com.example.liteflow.mysql.service.BaseNodeService;
|
||||||
import com.example.liteflow.mysql.service.BaseTemplateService;
|
import com.example.liteflow.mysql.service.BaseTemplateService;
|
||||||
import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
|
import com.yomahub.liteflow.builder.LiteFlowNodeBuilder;
|
||||||
|
@ -32,14 +30,14 @@ import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author 75349
|
* @author 75349
|
||||||
* @description 针对表【base_chain】的数据库操作Service实现
|
* @description 针对表【base_chain】的数据库操作Service实现
|
||||||
* @createDate 2022-12-14 15:25:39
|
* @createDate 2022-12-14 15:25:39
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BaseChainServiceImpl extends ServiceImpl<BaseChainMapper, BaseChainEntity>
|
public class BaseChainServiceImpl extends ServiceImpl<BaseChainMapper, BaseChainEntity>
|
||||||
implements BaseChainService{
|
implements BaseChainService {
|
||||||
@Resource
|
@Resource
|
||||||
private BaseTemplateService baseTemplateService;
|
private BaseTemplateService baseTemplateService;
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -295,30 +293,30 @@ public class BaseChainServiceImpl extends ServiceImpl<BaseChainMapper, BaseChain
|
||||||
|
|
||||||
private List<BaseCenter> generateCostCenterTestData() {
|
private List<BaseCenter> generateCostCenterTestData() {
|
||||||
List<BaseCenter> list = new ArrayList<>();
|
List<BaseCenter> list = new ArrayList<>();
|
||||||
CostCenter costCenter = new CostCenter();
|
BaseCenter costCenter = new BaseCenter();
|
||||||
costCenter.setSectionClassification("成本科目");
|
costCenter.setSectionClassification("成本科目");
|
||||||
costCenter.setBusinessType("货代");
|
costCenter.setBusinessType("货代");
|
||||||
costCenter.setSalesman("仓干配物流部(物流)");
|
costCenter.setSalesman("仓干配物流部(物流)");
|
||||||
costCenter.setBusinessCategory("全货船业务");
|
costCenter.setBusinessCategory("全货船业务");
|
||||||
list.add(costCenter);
|
list.add(costCenter);
|
||||||
|
|
||||||
costCenter = new CostCenter();
|
costCenter = new BaseCenter();
|
||||||
costCenter.setBusinessType("货代");
|
costCenter.setBusinessType("货代");
|
||||||
costCenter.setSalesman("仓干配物流部(物流)");
|
costCenter.setSalesman("仓干配物流部(物流)");
|
||||||
list.add(costCenter);
|
list.add(costCenter);
|
||||||
|
|
||||||
costCenter = new CostCenter();
|
costCenter = new BaseCenter();
|
||||||
costCenter.setBusinessType("货代");
|
costCenter.setBusinessType("货代");
|
||||||
list.add(costCenter);
|
list.add(costCenter);
|
||||||
|
|
||||||
ProfitCenter profitCenter = new ProfitCenter();
|
BaseCenter profitCenter = new BaseCenter();
|
||||||
profitCenter.setSectionClassification("银行科目");
|
profitCenter.setSectionClassification("银行科目");
|
||||||
profitCenter.setBusinessType("货代");
|
profitCenter.setBusinessType("货代");
|
||||||
profitCenter.setSalesman("商品车物流部(物流)");
|
profitCenter.setSalesman("商品车物流部(物流)");
|
||||||
profitCenter.setBusinessCategory("运输业务");
|
profitCenter.setBusinessCategory("运输业务");
|
||||||
list.add(profitCenter);
|
list.add(profitCenter);
|
||||||
|
|
||||||
profitCenter = new ProfitCenter();
|
profitCenter = new BaseCenter();
|
||||||
profitCenter.setBusinessType("货代");
|
profitCenter.setBusinessType("货代");
|
||||||
profitCenter.setSalesman("商品车物流部(物流)");
|
profitCenter.setSalesman("商品车物流部(物流)");
|
||||||
list.add(profitCenter);
|
list.add(profitCenter);
|
||||||
|
|
Loading…
Reference in New Issue