diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContDataController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContDataController.java new file mode 100644 index 00000000..cfd203b0 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContDataController.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.cont.controller.admin; + +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@Tag(name = "管理后台 - 数据项") +@RestController +@RequestMapping("/base/cont-data") +@Validated +public class BaseContDataController { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java new file mode 100644 index 00000000..d965c236 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/controller/admin/BaseContTempController.java @@ -0,0 +1,88 @@ +package cn.iocoder.yudao.module.cont.controller.admin; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import cn.iocoder.yudao.module.cont.service.BaseContTempService; +import cn.iocoder.yudao.module.cont.vo.BaseContTempPageReqVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempRespVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempSaveReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.validation.Valid; + +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; + +@Tag(name = "管理后台 - 合同模板") +@RestController +@RequestMapping("/base/cont-temp") +@Validated +public class BaseContTempController { + + @Resource + private BaseContTempService contTempService; + + + /** + * 合同模板分页列表查询 + * + * @param pageReqVO BaseContTempPageReqVO实体 + * @param pageNo 分页参数 + * @param pageSize 分页参数 + * @return cn.iocoder.yudao.framework.common.pojo.CommonResult> + * @author PQZ + * @date 10:46 2024/8/8 + **/ + @GetMapping("/page") + @Operation(summary = "获得合同模板分页") + @PreAuthorize("@ss.hasPermission('base:cont-temp:query')") + public CommonResult> getContTempPage(BaseContTempPageReqVO pageReqVO, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { + Page page = new Page<>(pageNo, pageSize); + return success(contTempService.getContTempPage(pageReqVO, page)); + } + + @PostMapping("/create") + @Operation(summary = "创建合同模板") + @PreAuthorize("@ss.hasPermission('base:cont-temp:create')") + public CommonResult createContTemp(@Valid @RequestBody BaseContTempSaveReqVO createReqVO) { + return success(contTempService.createContTemp(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新合同模板") + @PreAuthorize("@ss.hasPermission('base:cont-temp:update')") + public CommonResult updateContTemp(@Valid @RequestBody BaseContTempSaveReqVO updateReqVO) { + contTempService.updateContTemp(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @Operation(summary = "删除合同模板") + @Parameter(name = "id", description = "编号", required = true) + @PreAuthorize("@ss.hasPermission('base:cont-temp:delete')") + public CommonResult deleteContTemp(@RequestParam("id") String id) { + contTempService.deleteContTemp(id); + return success(true); + } + + @GetMapping("/get") + @Operation(summary = "获得合同模板") + @Parameter(name = "id", description = "编号", required = true, example = "1024") + @PreAuthorize("@ss.hasPermission('base:cont-temp:query')") + public CommonResult getContTemp(@RequestParam("id") String id) { + BaseContTemp contTemp = contTempService.getContTemp(id); + return success(BeanUtils.toBean(contTemp, BaseContTempRespVO.class)); + } + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/entity/BaseContData.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/entity/BaseContData.java new file mode 100644 index 00000000..7cf6009e --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/entity/BaseContData.java @@ -0,0 +1,51 @@ +package cn.iocoder.yudao.module.cont.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 数据项 DO + * + * @author pqz + */ +@TableName("dl_base_cont_data") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BaseContData extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 合同模板id + */ + private String mainId; + /** + * 数据项名称 + */ + private String itemName; + /** + * 数据项编码 + */ + private String itemCode; + /** + * 数据项类型 + */ + private String itemType; + /** + * 是否有效(0否1是) + */ + private String isValid; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/entity/BaseContTemp.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/entity/BaseContTemp.java new file mode 100644 index 00000000..6a8b8c7f --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/entity/BaseContTemp.java @@ -0,0 +1,59 @@ +package cn.iocoder.yudao.module.cont.entity; + +import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; +import lombok.*; +import java.util.*; +import java.time.LocalDateTime; +import java.time.LocalDateTime; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 合同模板 DO + * + * @author pqz + */ +@TableName("dl_base_cont_temp") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class BaseContTemp extends TenantBaseDO { + + /** + * 主键标识 + */ + @TableId(type = IdType.ASSIGN_UUID) + private String id; + /** + * 模板编号 + */ + private String tempCode; + /** + * 模板类型 + */ + private String tempType; + /** + * 模板用途 + */ + private String tempUse; + /** + * 模板名称 + */ + private String tempName; + /** + * 是否有效(0否;1是) + */ + private String isValid; + /** + * 状态 + */ + private String status; + /** + * 模板内容 + */ + private String tempContent; + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/mapper/BaseContDataMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/mapper/BaseContDataMapper.java new file mode 100644 index 00000000..e699f9fe --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/mapper/BaseContDataMapper.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.cont.mapper; + + +import cn.iocoder.yudao.module.cont.entity.BaseContData; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * 数据项 Mapper + * + * @author pqz + */ +@Mapper +public interface BaseContDataMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/mapper/BaseContTempMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/mapper/BaseContTempMapper.java new file mode 100644 index 00000000..ea133907 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/mapper/BaseContTempMapper.java @@ -0,0 +1,32 @@ +package cn.iocoder.yudao.module.cont.mapper; + + +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import cn.iocoder.yudao.module.cont.vo.BaseContTempPageReqVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempRespVO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 合同模板 Mapper + * + * @author pqz + */ +@Mapper +public interface BaseContTempMapper extends BaseMapper { + + + /** + * 合同模板分页列表查询 + * + * @param pageReqVO 合同模板pageReq扩展类 + * @param page 分页参数 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 10:40 2024/8/8 + **/ + IPage selectListPage(@Param("entity") BaseContTempPageReqVO pageReqVO, Page page); +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContDataService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContDataService.java new file mode 100644 index 00000000..d20a0a35 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContDataService.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.cont.service; + +import cn.iocoder.yudao.module.cont.entity.BaseContData; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * 数据项 Service 接口 + * + * @author pqz + */ +public interface BaseContDataService extends IService { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java new file mode 100644 index 00000000..9dec53e9 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/BaseContTempService.java @@ -0,0 +1,62 @@ +package cn.iocoder.yudao.module.cont.service; + +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import cn.iocoder.yudao.module.cont.vo.BaseContTempPageReqVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempRespVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempSaveReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; + +import javax.validation.Valid; + +/** + * 合同模板 Service 接口 + * + * @author pqz + */ +public interface BaseContTempService extends IService { + + /** + * 创建合同模板 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + String createContTemp(@Valid BaseContTempSaveReqVO createReqVO); + + /** + * 更新合同模板 + * + * @param updateReqVO 更新信息 + */ + void updateContTemp(@Valid BaseContTempSaveReqVO updateReqVO); + + /** + * 删除合同模板 + * + * @param id 编号 + */ + void deleteContTemp(String id); + + /** + * 获得合同模板 + * + * @param id 编号 + * @return 合同模板 + */ + BaseContTemp getContTemp(String id); + + + /** + * 合同模板分页列表查询 + * + * @param pageReqVO 请求参数 + * @param page Page分页 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 10:39 2024/8/8 + **/ + IPage getContTempPage(BaseContTempPageReqVO pageReqVO, Page page); + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContDataServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContDataServiceImpl.java new file mode 100644 index 00000000..ca179bcf --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContDataServiceImpl.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.cont.service.impl; + +import cn.iocoder.yudao.module.cont.entity.BaseContData; +import cn.iocoder.yudao.module.cont.mapper.BaseContDataMapper; +import cn.iocoder.yudao.module.cont.service.BaseContDataService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +/** + * 数据项 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class BaseContDataServiceImpl extends ServiceImpl implements BaseContDataService { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java new file mode 100644 index 00000000..6a0f7935 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/service/impl/BaseContTempServiceImpl.java @@ -0,0 +1,71 @@ +package cn.iocoder.yudao.module.cont.service.impl; + +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import cn.iocoder.yudao.module.cont.mapper.BaseContTempMapper; +import cn.iocoder.yudao.module.cont.service.BaseContTempService; +import cn.iocoder.yudao.module.cont.vo.BaseContTempPageReqVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempRespVO; +import cn.iocoder.yudao.module.cont.vo.BaseContTempSaveReqVO; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import org.springframework.validation.annotation.Validated; + +import javax.annotation.Resource; + +/** + * 合同模板 Service 实现类 + * + * @author pqz + */ +@Service +@Validated +public class BaseContTempServiceImpl extends ServiceImpl implements BaseContTempService { + + @Resource + private BaseContTempMapper contTempMapper; + + @Override + public String createContTemp(BaseContTempSaveReqVO createReqVO) { + // 插入 + BaseContTemp contTemp = BeanUtils.toBean(createReqVO, BaseContTemp.class); + contTempMapper.insert(contTemp); + // 返回 + return contTemp.getId(); + } + + @Override + public void updateContTemp(BaseContTempSaveReqVO updateReqVO) { + // 更新 + BaseContTemp updateObj = BeanUtils.toBean(updateReqVO, BaseContTemp.class); + contTempMapper.updateById(updateObj); + } + + @Override + public void deleteContTemp(String id) { + // 删除 + contTempMapper.deleteById(id); + } + + @Override + public BaseContTemp getContTemp(String id) { + return contTempMapper.selectById(id); + } + + /** + * 合同模板分页列表查询 + * + * @param pageReqVO 请求参数 + * @param page Page分页 + * @return com.baomidou.mybatisplus.core.metadata.IPage + * @author PQZ + * @date 10:39 2024/8/8 + **/ + @Override + public IPage getContTempPage(BaseContTempPageReqVO pageReqVO, Page page) { + return contTempMapper.selectListPage(pageReqVO,page); + } + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempPageReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempPageReqVO.java new file mode 100644 index 00000000..9769a24b --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempPageReqVO.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.cont.vo; + +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +@Schema(description = "管理后台 - 合同模板分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class BaseContTempPageReqVO extends BaseContTemp { + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempRespVO.java new file mode 100644 index 00000000..cab35f0b --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempRespVO.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.cont.vo; + +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 合同模板 Response VO") +@Data +@ExcelIgnoreUnannotated +public class BaseContTempRespVO extends BaseContTemp { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempSaveReqVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempSaveReqVO.java new file mode 100644 index 00000000..6e04f4bf --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/cont/vo/BaseContTempSaveReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.cont.vo; + +import cn.iocoder.yudao.module.cont.entity.BaseContTemp; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "管理后台 - 合同模板新增/修改 Request VO") +@Data +public class BaseContTempSaveReqVO extends BaseContTemp { + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/cont/BaseContData.xml b/dl-module-base/src/main/resources/mapper/cont/BaseContData.xml new file mode 100644 index 00000000..e4db33e8 --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/cont/BaseContData.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml b/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml new file mode 100644 index 00000000..0a41637c --- /dev/null +++ b/dl-module-base/src/main/resources/mapper/cont/BaseContTemp.xml @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file