----添加流程测试demo
This commit is contained in:
@ -1,7 +1,5 @@
|
||||
package com.xjrsoft.config;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
|
||||
|
||||
@ -0,0 +1,119 @@
|
||||
package com.xjrsoft.module.dev.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.xjrsoft.common.model.result.R;
|
||||
import com.xjrsoft.common.page.ConventPage;
|
||||
import com.xjrsoft.common.page.PageOutput;
|
||||
import com.xjrsoft.common.utils.VoToColumnUtil;
|
||||
import com.xjrsoft.module.datalog.service.DatalogService;
|
||||
import com.xjrsoft.module.datalog.vo.DataChangeLogVo;
|
||||
import com.xjrsoft.module.dev.dto.Testflow001PageDto;
|
||||
import com.xjrsoft.module.dev.dto.UpdateTestflow001Dto;
|
||||
import com.xjrsoft.module.dev.entity.Testflow001;
|
||||
import com.xjrsoft.module.dev.service.ITestflow001Service;
|
||||
import com.xjrsoft.module.dev.vo.Testflow001PageVo;
|
||||
import com.xjrsoft.module.dev.vo.Testflow001Vo;
|
||||
import com.xjrsoft.module.system.client.ICodeRuleClient;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* @title: 测试流程
|
||||
* @Author 管理员
|
||||
* @Date: 2025-11-25
|
||||
* @Version 1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/dev" + "/testflow001")
|
||||
@Api(value = "/dev" + "/testflow001",tags = "测试流程代码")
|
||||
@AllArgsConstructor
|
||||
public class Testflow001Controller {
|
||||
|
||||
|
||||
private final ITestflow001Service testflow001Service;
|
||||
private final ICodeRuleClient codeRuleClient;
|
||||
private final DatalogService dataService;
|
||||
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperation(value="Testflow001列表(分页)")
|
||||
@SaCheckPermission("testflow001:list")
|
||||
public R page(@Valid Testflow001PageDto dto){
|
||||
|
||||
LambdaQueryWrapper<Testflow001> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.like(StrUtil.isNotBlank(dto.getCustomer()),Testflow001::getCustomer,dto.getCustomer())
|
||||
.like(StrUtil.isNotBlank(dto.getCustomerCode()),Testflow001::getCustomerCode,dto.getCustomerCode())
|
||||
.like(StrUtil.isNotBlank(dto.getName()),Testflow001::getName,dto.getName())
|
||||
.like(StrUtil.isNotBlank(dto.getNote()),Testflow001::getNote,dto.getNote())
|
||||
.orderByDesc(Testflow001::getId)
|
||||
.select(Testflow001.class,x -> VoToColumnUtil.fieldsToColumns(Testflow001PageVo.class).contains(x.getProperty()));
|
||||
IPage<Testflow001> page = testflow001Service.page(ConventPage.getPage(dto), queryWrapper);
|
||||
PageOutput<Testflow001PageVo> pageOutput = ConventPage.getPageOutput(page, Testflow001PageVo.class);
|
||||
return R.ok(pageOutput);
|
||||
}
|
||||
|
||||
@GetMapping(value = "/info")
|
||||
@ApiOperation(value="根据id查询Testflow001信息")
|
||||
@SaCheckPermission("testflow001:detail")
|
||||
public R info(@RequestParam Long id){
|
||||
Testflow001 testflow001 = testflow001Service.getById(id);
|
||||
if (testflow001 == null) {
|
||||
return R.error("找不到此数据!");
|
||||
}
|
||||
return R.ok(BeanUtil.toBean(testflow001, Testflow001Vo.class));
|
||||
}
|
||||
|
||||
@GetMapping(value = "/datalog")
|
||||
@ApiOperation(value="根据id查询Testflow001数据详细日志")
|
||||
@SaCheckPermission("testflow001:datalog")
|
||||
public R datalog(@RequestParam Long id){
|
||||
List<DataChangeLogVo> logs = dataService.findLogsByEntityId(UpdateTestflow001Dto.class,id);
|
||||
return R.ok(logs);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation(value = "新增Testflow001")
|
||||
@SaCheckPermission("testflow001:add")
|
||||
public R add(@Valid @RequestBody UpdateTestflow001Dto dto){
|
||||
codeRuleClient.useEncode("TestCode");
|
||||
UpdateTestflow001Dto res = dataService.insert(dto);
|
||||
return R.ok(res.getId());
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation(value = "修改Testflow001")
|
||||
@SaCheckPermission("testflow001:edit")
|
||||
public R update(@Valid @RequestBody UpdateTestflow001Dto dto){
|
||||
return R.ok(dataService.updateById(dto));
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation(value = "删除")
|
||||
@SaCheckPermission("testflow001:delete")
|
||||
public R delete(@Valid @RequestBody List<Long> ids){
|
||||
return R.ok(dataService.deleteByIds(UpdateTestflow001Dto.class, ids));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package com.xjrsoft.module.dev.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.Version;
|
||||
import com.github.yulichang.annotation.EntityMapping;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalTime;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @title: 测试流程
|
||||
* @Author 管理员
|
||||
* @Date: 2025-11-25
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("testflow_001")
|
||||
@ApiModel(value = "测试流程对象", description = "测试流程")
|
||||
public class Testflow001 implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户
|
||||
*/
|
||||
@ApiModelProperty("客户")
|
||||
private String customer;
|
||||
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
@ApiModelProperty("客户编码")
|
||||
private String customerCode;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ApiModelProperty("名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ApiModelProperty("备注")
|
||||
private String note;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Long createUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Long modifyUserId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private LocalDateTime modifyDate;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@TableLogic
|
||||
private Integer deleteMark;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Integer enabledMark;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ApiModelProperty("")
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.xjrsoft.module.dev.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import com.xjrsoft.module.dev.entity.Testflow001;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @title: mapper
|
||||
* @Author 管理员
|
||||
* @Date: 2025-11-25
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface Testflow001Mapper extends BaseMapper<Testflow001> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package com.xjrsoft.module.dev.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.github.yulichang.base.MPJBaseService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJDeepService;
|
||||
import com.github.yulichang.extension.mapping.base.MPJRelationService;
|
||||
import com.xjrsoft.module.dev.entity.Testflow001;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-11-25
|
||||
* @Version 1.0
|
||||
*/
|
||||
|
||||
public interface ITestflow001Service extends IService<Testflow001> {
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package com.xjrsoft.module.dev.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.yulichang.base.MPJBaseServiceImpl;
|
||||
import com.xjrsoft.module.dev.entity.Testflow001;
|
||||
import com.xjrsoft.module.dev.mapper.Testflow001Mapper;
|
||||
import com.xjrsoft.module.dev.service.ITestflow001Service;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
/**
|
||||
* @title: service
|
||||
* @Author 管理员
|
||||
* @Date: 2025-11-25
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class Testflow001ServiceImpl extends ServiceImpl<Testflow001Mapper, Testflow001> implements ITestflow001Service {
|
||||
}
|
||||
@ -0,0 +1,59 @@
|
||||
spring:
|
||||
cloud:
|
||||
nacos: #nacos监控
|
||||
config:
|
||||
server-addr: 10.10.2.101:8848 # nacos 配置中心地址
|
||||
namespace: ITC-MS
|
||||
group: DNE
|
||||
username: nacos
|
||||
password: Lng@123
|
||||
extension-configs:
|
||||
- data-id: global-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: discovery-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: datasource-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: seata-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: redis-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: magic-api.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sa-token.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: camunda.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
- data-id: sentinel-local.yml
|
||||
refresh: true
|
||||
group: DNE
|
||||
|
||||
discovery:
|
||||
ip: 10.0.0.2
|
||||
#network-interface: net7
|
||||
|
||||
xjrsoft:
|
||||
generate:
|
||||
apiJavaPath: F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-mdm\itc-pcitc-mdm-api
|
||||
javaPath: F:\ges-scm\code\dev\geg-gas-pcitc\itc-pcitc-mdm\itc-pcitc-mdm-service
|
||||
webPath: F:\ges-scm\code\dev\geg-gas-web
|
||||
appPath: F:\ges-scm\code\dev\uniapp\xjrsoft-uni #前端app
|
||||
|
||||
|
||||
|
||||
@ -1,5 +1,10 @@
|
||||
package com.xjrsoft;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -7,6 +12,8 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import com.xjrsoft.module.common.db.service.CommonCallService;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = ITCDemoApplication.class)
|
||||
public class CallTest {
|
||||
@ -21,5 +28,21 @@ public class CallTest {
|
||||
String out = callService.saveAfter("Ing_b_price_term", 12);
|
||||
System.out.println(out);
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String filePath = "D:\\java\\conf\\cn-ips.txt";
|
||||
boolean first = false;
|
||||
// 2. 流式读取(适合大文件,逐行处理,不占内存)
|
||||
try (Stream<String> lineStream = Files.lines(Paths.get(filePath))) {
|
||||
lineStream.forEach(line -> {
|
||||
// 逐行处理逻辑(如解析、过滤)
|
||||
if (!line.isEmpty()) { // 跳过空行
|
||||
System.out.print(";" + line);
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
System.err.println("流式读取失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user