parent
ea02bbfdda
commit
359f051e42
10 changed files with 415 additions and 79 deletions
@ -0,0 +1,116 @@ |
|||||||
|
package org.springblade.plugin.workbench.controller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.core.metadata.OrderItem; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import io.swagger.annotations.ApiParam; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.cache.utils.CacheUtil; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.tenant.annotation.NonDS; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.plugin.workbench.entity.AutoStartModel; |
||||||
|
import org.springblade.plugin.workbench.service.IAutoStartModelService; |
||||||
|
import org.springblade.plugin.workbench.vo.AutoStartModelVO; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import static org.springblade.core.cache.constant.CacheConstant.FLOW_CACHE; |
||||||
|
import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; |
||||||
|
|
||||||
|
/** |
||||||
|
* @Description 自动启动的工作流的原型信息 |
||||||
|
* @Author ytl |
||||||
|
* @Date 2023/2/22 0022 13:06 |
||||||
|
*/ |
||||||
|
|
||||||
|
@NonDS |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/autoProcess") |
||||||
|
@Api(value = "自动启动的工作流的原型信息", tags = "自动启动的工作流的原型信息") |
||||||
|
public class AutoStartModelController extends BladeController { |
||||||
|
private final IAutoStartModelService autoStartModelService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 分页 |
||||||
|
*/ |
||||||
|
@GetMapping("/list") |
||||||
|
@ApiOperationSupport(order = 1) |
||||||
|
@ApiOperation(value = "分页", notes = "传入autoStartModel") |
||||||
|
public R<IPage<AutoStartModelVO>> list(AutoStartModel model, Query query) { |
||||||
|
IPage<AutoStartModel> page = autoStartModelService.page(Condition.getPage(query), Condition.getQueryWrapper(model)); |
||||||
|
List<AutoStartModel> records = page.getRecords(); |
||||||
|
List<AutoStartModelVO> autoStartModelVOS = autoStartModelService.setInfo(records); |
||||||
|
IPage<AutoStartModelVO> newPage = new IPage<AutoStartModelVO>() { |
||||||
|
@Override |
||||||
|
public List<OrderItem> orders() { |
||||||
|
return page.orders(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public List<AutoStartModelVO> getRecords() { |
||||||
|
return autoStartModelVOS; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<AutoStartModelVO> setRecords(List<AutoStartModelVO> records) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public long getTotal() { |
||||||
|
return page.getTotal(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<AutoStartModelVO> setTotal(long total) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public long getSize() { |
||||||
|
return page.getSize(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<AutoStartModelVO> setSize(long size) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public long getCurrent() { |
||||||
|
return page.getCurrent(); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public IPage<AutoStartModelVO> setCurrent(long current) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
}; |
||||||
|
return R.data(newPage); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("/detail") |
||||||
|
@ApiOperationSupport(order = 2) |
||||||
|
@ApiOperation(value = "详情", notes = "详情") |
||||||
|
public R detail(@RequestParam String id){ |
||||||
|
|
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
@PostMapping("/remove") |
||||||
|
@ApiOperationSupport(order = 3) |
||||||
|
@ApiOperation(value = "逻辑删除", notes = "逻辑删除") |
||||||
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids){ |
||||||
|
CacheUtil.clear(FLOW_CACHE, Boolean.FALSE); |
||||||
|
return R.status(autoStartModelService.breakAutoStartModel(ids)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
@ -1,53 +0,0 @@ |
|||||||
package org.springblade.plugin.workbench.controller; |
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
||||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
||||||
import io.swagger.annotations.Api; |
|
||||||
import io.swagger.annotations.ApiOperation; |
|
||||||
import lombok.AllArgsConstructor; |
|
||||||
import org.springblade.core.boot.ctrl.BladeController; |
|
||||||
import org.springblade.core.mp.support.Condition; |
|
||||||
import org.springblade.core.mp.support.Query; |
|
||||||
import org.springblade.core.tenant.annotation.NonDS; |
|
||||||
import org.springblade.core.tool.api.R; |
|
||||||
import org.springblade.plugin.workbench.entity.AutoStartModel; |
|
||||||
import org.springblade.plugin.workbench.service.IAutoStartModelService; |
|
||||||
import org.springframework.web.bind.annotation.GetMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||||
import org.springframework.web.bind.annotation.RequestParam; |
|
||||||
import org.springframework.web.bind.annotation.RestController; |
|
||||||
|
|
||||||
/** |
|
||||||
* @Description 自动启动的工作流的原型信息 |
|
||||||
* @Author ytl |
|
||||||
* @Date 2023/2/22 0022 13:06 |
|
||||||
*/ |
|
||||||
|
|
||||||
@NonDS |
|
||||||
@RestController |
|
||||||
@AllArgsConstructor |
|
||||||
@RequestMapping("/autoProcess") |
|
||||||
@Api(value = "自动启动的工作流的原型信息", tags = "自动启动的工作流的原型信息") |
|
||||||
public class AutoStartProcessController extends BladeController { |
|
||||||
private final IAutoStartModelService autoStartModelService; |
|
||||||
|
|
||||||
/** |
|
||||||
* 分页 |
|
||||||
*/ |
|
||||||
@GetMapping("/list") |
|
||||||
@ApiOperationSupport(order = 1) |
|
||||||
@ApiOperation(value = "分页", notes = "传入autoStartModel") |
|
||||||
public R<IPage<AutoStartModel>> list(AutoStartModel model, Query query) { |
|
||||||
IPage<AutoStartModel> page = autoStartModelService.page(Condition.getPage(query), Condition.getQueryWrapper(model)); |
|
||||||
return R.data(page); |
|
||||||
} |
|
||||||
|
|
||||||
@GetMapping("/detail") |
|
||||||
@ApiOperationSupport(order = 2) |
|
||||||
@ApiOperation(value = "详情", notes = "详情") |
|
||||||
public R detail(@RequestParam String id){ |
|
||||||
|
|
||||||
return null; |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
Loading…
Reference in new issue