同步业务库代码
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.base;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* Base 模块的启动类
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin.base;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,91 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin.templtp;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.business.annotation.FileUploadController;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.base.controller.admin.templtp.vo.TmpItmPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.controller.admin.templtp.vo.TmplItmRespVO;
|
||||
import cn.iocoder.yudao.module.base.controller.admin.templtp.vo.TmplItmSaveReqVO;
|
||||
import cn.iocoder.yudao.module.base.dal.dataobject.tmpltp.TmplItmDO;
|
||||
import cn.iocoder.yudao.module.base.service.tmpltp.TmplItmService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Tag(name = "管理后台 - 模板条款")
|
||||
@RestController
|
||||
@RequestMapping("/base/tmpl-ltm")
|
||||
@Validated
|
||||
@FileUploadController(source = "bse.tmplltm")
|
||||
@RequiredArgsConstructor
|
||||
public class TmplItmController {
|
||||
private final TmplItmService tmplItmService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模板条款")
|
||||
public CommonResult<TmplItmRespVO> createTmplItm(@Valid @RequestBody TmplItmSaveReqVO createReqVO) {
|
||||
TmplItmRespVO tmplItm = tmplItmService.createTmplItm(createReqVO);
|
||||
return success(tmplItm);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模板条款")
|
||||
public CommonResult<Boolean> updateTmplItm(@Valid @RequestBody TmplItmSaveReqVO updateReqVO) {
|
||||
tmplItmService.updateTmplItm(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模板条款", description = "")
|
||||
public CommonResult<Boolean> deleteTmplItm(@RequestBody BatchDeleteReqVO req) {
|
||||
return success(tmplItmService.deleteTmplItm(req.getIds()));
|
||||
}
|
||||
|
||||
@GetMapping("/id")
|
||||
@Operation(summary = "根据id获得模板条款")
|
||||
public CommonResult<TmplItmRespVO> getTmplItm(@RequestBody String id) {
|
||||
return success(BeanUtils.toBean(tmplItmService.getById(id), TmplItmRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public CommonResult<List<TmplItmRespVO>> listTmplItm(Map<String, Object> params) {
|
||||
// 创建查询条件构造器
|
||||
QueryWrapper<TmplItmDO> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
// 遍历Map参数,动态添加查询条件
|
||||
if (params != null && !params.isEmpty()) {
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
String key = entry.getKey();
|
||||
Object value = entry.getValue();
|
||||
|
||||
// 过滤掉空值和空字符串
|
||||
if (value != null &&
|
||||
!(value instanceof String && StringUtils.isBlank((String) value))) {
|
||||
queryWrapper.eq(key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 执行带条件的查询
|
||||
List<TmplItmDO> list = tmplItmService.list(queryWrapper);
|
||||
return success(BeanUtils.toBean(list, TmplItmRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页获得模板条款")
|
||||
public CommonResult<PageResult<TmplItmRespVO>> pageTmplItm(@Validated TmpItmPageReqVO pageReqVO) {
|
||||
PageResult<TmplItmDO> pageResult = tmplItmService.pageTmplItm(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TmplItmRespVO.class));
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin.templtp;
|
||||
|
||||
import cn.iocoder.yudao.framework.business.annotation.FileUploadController;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.base.controller.admin.templtp.vo.TmplFldPageReqVO;
|
||||
import cn.iocoder.yudao.module.base.controller.admin.templtp.vo.TmplFldRespVO;
|
||||
import cn.iocoder.yudao.module.base.controller.admin.templtp.vo.TmplTpFldSaveReqVO;
|
||||
import cn.iocoder.yudao.module.base.dal.dataobject.tmpltp.TmplTpFldDO;
|
||||
import cn.iocoder.yudao.module.base.service.tmpltp.TmplTpFldService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 模板字段")
|
||||
@RestController
|
||||
@RequestMapping("/base/tmpl-fld")
|
||||
@Validated
|
||||
@FileUploadController(source = "bse.tmplfld")
|
||||
@RequiredArgsConstructor
|
||||
public class TmplTpFldController {
|
||||
private final TmplTpFldService tmplTpFldService;
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建模板字段")
|
||||
// @PreAuthorize("@ss.hasPermission('bse:tmpl-tp-fld:create')")
|
||||
public CommonResult<TmplFldRespVO> createTmplFld(@Valid @RequestBody TmplTpFldSaveReqVO tmplTpFldSaveReqVO) {
|
||||
return success(tmplTpFldService.createTmplFld(tmplTpFldSaveReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新模板字段")
|
||||
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp-fld:update')")
|
||||
public CommonResult<Boolean> updateTmplTp(@Valid @RequestBody TmplTpFldSaveReqVO updateReqVO) {
|
||||
tmplTpFldService.updateTmplFld(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除模板字段")
|
||||
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp-fld:delete')")
|
||||
public CommonResult<Boolean> deleteTmplTp(@RequestBody BatchDeleteReqVO req) {
|
||||
tmplTpFldService.deleteTmplTpByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得模板字段列表")
|
||||
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp-fld:list')")
|
||||
public CommonResult<PageResult<TmplFldRespVO>> getTmplTpList( @Valid TmplFldPageReqVO pageReqVO) {
|
||||
PageResult<TmplTpFldDO> pageResult = tmplTpFldService.tmplTpFldPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TmplFldRespVO.class));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.base.controller.admin.templtp.vo;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 部门与实例关联分页 Request VO")
|
||||
@Data
|
||||
public class DepartmentInstanceRelativityPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "部门主键", example = "2450")
|
||||
private String companyDepartmentId;
|
||||
|
||||
@Schema(description = "模板实例主键", example = "17846")
|
||||
private String templateInstanceId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDate[] createTime;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user