|
@@ -0,0 +1,103 @@
|
|
|
+package com.xjrsoft.module.system.controller;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
+import com.xjrsoft.common.constant.GlobalConstant;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringPool;
|
|
|
+import com.xjrsoft.common.page.ConventPage;
|
|
|
+import com.xjrsoft.common.page.PageOutput;
|
|
|
+import com.xjrsoft.common.model.result.RT;
|
|
|
+import com.xjrsoft.common.utils.VoToColumnUtil;
|
|
|
+import com.xjrsoft.module.system.dto.AddBaseMobileWorkflowConfigDto;
|
|
|
+import com.xjrsoft.module.system.dto.UpdateBaseMobileWorkflowConfigDto;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+
|
|
|
+import com.xjrsoft.module.system.dto.BaseMobileWorkflowConfigListDto;
|
|
|
+import com.xjrsoft.module.system.entity.BaseMobileWorkflowConfig;
|
|
|
+import com.xjrsoft.module.system.service.IBaseMobileWorkflowConfigService;
|
|
|
+import com.xjrsoft.module.system.vo.BaseMobileWorkflowConfigListVo;
|
|
|
+
|
|
|
+import com.xjrsoft.module.system.vo.BaseMobileWorkflowConfigVo;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.AllArgsConstructor;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.Valid;
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+* @title: APP 流程单独配置
|
|
|
+* @Author fanxp
|
|
|
+* @Date: 2023-11-06
|
|
|
+* @Version 1.0
|
|
|
+*/
|
|
|
+@RestController
|
|
|
+@RequestMapping("/system" + "/basemobileworkflowconfig")
|
|
|
+@Api(value = "/system" + "/basemobileworkflowconfig",tags = "APP 流程单独配置代码")
|
|
|
+@AllArgsConstructor
|
|
|
+public class BaseMobileWorkflowConfigController {
|
|
|
+
|
|
|
+
|
|
|
+ private final IBaseMobileWorkflowConfigService baseMobileWorkflowConfigService;
|
|
|
+
|
|
|
+ @GetMapping(value = "/list")
|
|
|
+ @ApiOperation(value="APP 流程单独配置列表(不分页)")
|
|
|
+ @SaCheckPermission("basemobileworkflowconfig:detail")
|
|
|
+ public RT<List<BaseMobileWorkflowConfigListVo>> list(@Valid BaseMobileWorkflowConfigListDto dto){
|
|
|
+
|
|
|
+ LambdaQueryWrapper<BaseMobileWorkflowConfig> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ queryWrapper
|
|
|
+ .orderByDesc(BaseMobileWorkflowConfig::getId)
|
|
|
+ .select(BaseMobileWorkflowConfig.class,x -> VoToColumnUtil.fieldsToColumns(BaseMobileWorkflowConfigListVo.class).contains(x.getProperty()));
|
|
|
+
|
|
|
+ List<BaseMobileWorkflowConfig> list = baseMobileWorkflowConfigService.list(queryWrapper);
|
|
|
+ List<BaseMobileWorkflowConfigListVo> listVos = BeanUtil.copyToList(list, BaseMobileWorkflowConfigListVo.class);
|
|
|
+ return RT.ok(listVos);
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/info")
|
|
|
+ @ApiOperation(value="根据id查询APP 流程单独配置信息")
|
|
|
+ @SaCheckPermission("basemobileworkflowconfig:detail")
|
|
|
+ public RT<BaseMobileWorkflowConfigVo> info(@RequestParam Long id){
|
|
|
+ BaseMobileWorkflowConfig baseMobileWorkflowConfig = baseMobileWorkflowConfigService.getById(id);
|
|
|
+ if (baseMobileWorkflowConfig == null) {
|
|
|
+ return RT.error("找不到此数据!");
|
|
|
+ }
|
|
|
+ return RT.ok(BeanUtil.toBean(baseMobileWorkflowConfig, BaseMobileWorkflowConfigVo.class));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation(value = "新增APP 流程单独配置")
|
|
|
+ @SaCheckPermission("basemobileworkflowconfig:add")
|
|
|
+ public RT<Boolean> add(@Valid @RequestBody AddBaseMobileWorkflowConfigDto dto){
|
|
|
+ BaseMobileWorkflowConfig baseMobileWorkflowConfig = BeanUtil.toBean(dto, BaseMobileWorkflowConfig.class);
|
|
|
+ boolean isSuccess = baseMobileWorkflowConfigService.save(baseMobileWorkflowConfig);
|
|
|
+ return RT.ok(isSuccess);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation(value = "修改APP 流程单独配置")
|
|
|
+ @SaCheckPermission("basemobileworkflowconfig:edit")
|
|
|
+ public RT<Boolean> update(@Valid @RequestBody UpdateBaseMobileWorkflowConfigDto dto){
|
|
|
+
|
|
|
+ BaseMobileWorkflowConfig baseMobileWorkflowConfig = BeanUtil.toBean(dto, BaseMobileWorkflowConfig.class);
|
|
|
+ return RT.ok(baseMobileWorkflowConfigService.updateById(baseMobileWorkflowConfig));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping
|
|
|
+ @ApiOperation(value = "删除APP 流程单独配置")
|
|
|
+ @SaCheckPermission("basemobileworkflowconfig:delete")
|
|
|
+ public RT<Boolean> delete(@Valid @RequestBody List<Long> ids){
|
|
|
+ return RT.ok(baseMobileWorkflowConfigService.removeBatchByIds(ids));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|