mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-02-15 10:04:59 +08:00
[feat] 增加外包合同管理功能
This commit is contained in:
parent
73d09ffea0
commit
ca58994bd6
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contractouts;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.contractouts.ContractOutsService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 外包合同关联")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms/contract-outs")
|
||||||
|
@Validated
|
||||||
|
public class ContractOutsController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ContractOutsService contractOutsService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建外包合同关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract-outs:create')")
|
||||||
|
public CommonResult<Long> createContractOuts(@Valid @RequestBody ContractOutsSaveReqVO createReqVO) {
|
||||||
|
return success(contractOutsService.createContractOuts(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新外包合同关联")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract-outs:update')")
|
||||||
|
public CommonResult<Boolean> updateContractOuts(@Valid @RequestBody ContractOutsSaveReqVO updateReqVO) {
|
||||||
|
contractOutsService.updateContractOuts(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除外包合同关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract-outs:delete')")
|
||||||
|
public CommonResult<Boolean> deleteContractOuts(@RequestParam("id") Long id) {
|
||||||
|
contractOutsService.deleteContractOuts(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得外包合同关联")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract-outs:query')")
|
||||||
|
public CommonResult<ContractOutsRespVO> getContractOuts(@RequestParam("id") Long id) {
|
||||||
|
ContractOutsDO contractOuts = contractOutsService.getContractOuts(id);
|
||||||
|
return success(BeanUtils.toBean(contractOuts, ContractOutsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得外包合同关联分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract-outs:query')")
|
||||||
|
public CommonResult<PageResult<ContractOutsRespVO>> getContractOutsPage(@Valid ContractOutsPageReqVO pageReqVO) {
|
||||||
|
PageResult<ContractOutsDO> pageResult = contractOutsService.getContractOutsPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, ContractOutsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出外包合同关联 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:contract-outs:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportContractOutsExcel(@Valid ContractOutsPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<ContractOutsDO> list = contractOutsService.getContractOutsPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "外包合同关联.xls", "数据", ContractOutsRespVO.class,
|
||||||
|
BeanUtils.toBean(list, ContractOutsRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同关联分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ContractOutsPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "合同id", example = "16187")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "外包合同id", example = "9277")
|
||||||
|
private Long outsContractId;
|
||||||
|
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] cteateTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private String updator;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除")
|
||||||
|
private Boolean delete;
|
||||||
|
|
||||||
|
@Schema(description = "租户id", example = "15943")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同关联 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ContractOutsRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7688")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187")
|
||||||
|
@ExcelProperty("合同id")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277")
|
||||||
|
@ExcelProperty("外包合同id")
|
||||||
|
private Long outsContractId;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime cteateTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("更新人")
|
||||||
|
private String updator;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
@ExcelProperty("更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("是否删除")
|
||||||
|
private Boolean delete;
|
||||||
|
|
||||||
|
@Schema(description = "租户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15943")
|
||||||
|
@ExcelProperty("租户id")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同关联新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class ContractOutsSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "7688")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "16187")
|
||||||
|
@NotNull(message = "合同id不能为空")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "外包合同id", requiredMode = Schema.RequiredMode.REQUIRED, example = "9277")
|
||||||
|
@NotNull(message = "外包合同id不能为空")
|
||||||
|
private Long outsContractId;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "创建人不能为空")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
private LocalDateTime cteateTime;
|
||||||
|
|
||||||
|
@Schema(description = "更新人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "更新人不能为空")
|
||||||
|
private String updator;
|
||||||
|
|
||||||
|
@Schema(description = "更新时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "是否删除不能为空")
|
||||||
|
private Boolean delete;
|
||||||
|
|
||||||
|
@Schema(description = "租户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15943")
|
||||||
|
@NotNull(message = "租户id不能为空")
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.outscontract.OutsContractService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 外包合同")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms/outs-contract")
|
||||||
|
@Validated
|
||||||
|
public class OutsContractController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OutsContractService outsContractService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建外包合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract:create')")
|
||||||
|
public CommonResult<Long> createOutsContract(@Valid @RequestBody OutsContractSaveReqVO createReqVO) {
|
||||||
|
return success(outsContractService.createOutsContract(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新外包合同")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract:update')")
|
||||||
|
public CommonResult<Boolean> updateOutsContract(@Valid @RequestBody OutsContractSaveReqVO updateReqVO) {
|
||||||
|
outsContractService.updateOutsContract(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除外包合同")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract:delete')")
|
||||||
|
public CommonResult<Boolean> deleteOutsContract(@RequestParam("id") Long id) {
|
||||||
|
outsContractService.deleteOutsContract(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得外包合同")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract:query')")
|
||||||
|
public CommonResult<OutsContractRespVO> getOutsContract(@RequestParam("id") Long id) {
|
||||||
|
OutsContractDO outsContract = outsContractService.getOutsContract(id);
|
||||||
|
return success(BeanUtils.toBean(outsContract, OutsContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得外包合同分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract:query')")
|
||||||
|
public CommonResult<PageResult<OutsContractRespVO>> getOutsContractPage(@Valid OutsContractPageReqVO pageReqVO) {
|
||||||
|
PageResult<OutsContractDO> pageResult = outsContractService.getOutsContractPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, OutsContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出外包合同 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportOutsContractExcel(@Valid OutsContractPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<OutsContractDO> list = outsContractService.getOutsContractPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "外包合同.xls", "数据", OutsContractRespVO.class,
|
||||||
|
BeanUtils.toBean(list, OutsContractRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class OutsContractPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "项目id", example = "27415")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "主合同id", example = "19816")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "2")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "专业")
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "结算数")
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class OutsContractRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2034")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27415")
|
||||||
|
@ExcelProperty("项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "主合同id", example = "19816")
|
||||||
|
@ExcelProperty("主合同id")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "2")
|
||||||
|
@ExcelProperty(value = "类型", converter = DictConvert.class)
|
||||||
|
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
@ExcelProperty("合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "编号")
|
||||||
|
@ExcelProperty("编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "专业")
|
||||||
|
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||||
|
@DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@ExcelProperty("签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "结算数")
|
||||||
|
@ExcelProperty("结算数")
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("合同文件url")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class OutsContractSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2034")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "27415")
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "张三")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "主合同id", example = "19816")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "2")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "专业")
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "结算数")
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,93 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryRespVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.service.outscontracthistory.OutsContractHistoryService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 外包合同历史")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/cms/outs-contract-history")
|
||||||
|
@Validated
|
||||||
|
public class OutsContractHistoryController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OutsContractHistoryService outsContractHistoryService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建外包合同历史")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:create')")
|
||||||
|
public CommonResult<Long> createOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO createReqVO) {
|
||||||
|
return success(outsContractHistoryService.createOutsContractHistory(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新外包合同历史")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:update')")
|
||||||
|
public CommonResult<Boolean> updateOutsContractHistory(@Valid @RequestBody OutsContractHistorySaveReqVO updateReqVO) {
|
||||||
|
outsContractHistoryService.updateOutsContractHistory(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除外包合同历史")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:delete')")
|
||||||
|
public CommonResult<Boolean> deleteOutsContractHistory(@RequestParam("id") Long id) {
|
||||||
|
outsContractHistoryService.deleteOutsContractHistory(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得外包合同历史")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||||
|
public CommonResult<OutsContractHistoryRespVO> getOutsContractHistory(@RequestParam("id") Long id) {
|
||||||
|
OutsContractHistoryDO outsContractHistory = outsContractHistoryService.getOutsContractHistory(id);
|
||||||
|
return success(BeanUtils.toBean(outsContractHistory, OutsContractHistoryRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得外包合同历史分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:query')")
|
||||||
|
public CommonResult<PageResult<OutsContractHistoryRespVO>> getOutsContractHistoryPage(@Valid OutsContractHistoryPageReqVO pageReqVO) {
|
||||||
|
PageResult<OutsContractHistoryDO> pageResult = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, OutsContractHistoryRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出外包合同历史 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('cms:outs-contract-history:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportOutsContractHistoryExcel(@Valid OutsContractHistoryPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<OutsContractHistoryDO> list = outsContractHistoryService.getOutsContractHistoryPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "外包合同历史.xls", "数据", OutsContractHistoryRespVO.class,
|
||||||
|
BeanUtils.toBean(list, OutsContractHistoryRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同历史分页 Request VO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class OutsContractHistoryPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "项目id", example = "31803")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "主合同id", example = "19949")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "1")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "专业")
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "流程实体id", example = "32397")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "结算数")
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "流程状态", example = "2")
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
|
@Schema(description = "外包合同id", example = "24736")
|
||||||
|
private Long outsContractId;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,84 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||||
|
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同历史 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class OutsContractHistoryRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803")
|
||||||
|
@ExcelProperty("项目id")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
@ExcelProperty("合同名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "主合同id", example = "19949")
|
||||||
|
@ExcelProperty("主合同id")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "1")
|
||||||
|
@ExcelProperty(value = "类型", converter = DictConvert.class)
|
||||||
|
@DictFormat("contract_billing_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
@ExcelProperty("合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "编号")
|
||||||
|
@ExcelProperty("编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "专业")
|
||||||
|
@ExcelProperty(value = "专业", converter = DictConvert.class)
|
||||||
|
@DictFormat("major") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "流程实体id", example = "32397")
|
||||||
|
@ExcelProperty("流程实体id")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
@ExcelProperty("签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "结算数")
|
||||||
|
@ExcelProperty("结算数")
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("合同文件url")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "流程状态", example = "2")
|
||||||
|
@ExcelProperty("流程状态")
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
|
@Schema(description = "外包合同id", example = "24736")
|
||||||
|
@ExcelProperty("外包合同id")
|
||||||
|
private Long outsContractId;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
@ExcelProperty("版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,60 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 外包合同历史新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class OutsContractHistorySaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16040")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "项目id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31803")
|
||||||
|
@NotNull(message = "项目id不能为空")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@Schema(description = "合同名称", example = "芋艿")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "主合同id", example = "19949")
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
@Schema(description = "类型", example = "1")
|
||||||
|
private String countType;
|
||||||
|
|
||||||
|
@Schema(description = "合同金额")
|
||||||
|
private BigDecimal amount;
|
||||||
|
|
||||||
|
@Schema(description = "编号")
|
||||||
|
private String code;
|
||||||
|
|
||||||
|
@Schema(description = "专业")
|
||||||
|
private String major;
|
||||||
|
|
||||||
|
@Schema(description = "流程实体id", example = "32397")
|
||||||
|
private String processInstanceId;
|
||||||
|
|
||||||
|
@Schema(description = "签订时间")
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
|
||||||
|
@Schema(description = "结算数")
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
|
||||||
|
@Schema(description = "合同文件url", example = "https://www.iocoder.cn")
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
@Schema(description = "流程状态", example = "2")
|
||||||
|
private String processStatus;
|
||||||
|
|
||||||
|
@Schema(description = "外包合同id", example = "24736")
|
||||||
|
private Long outsContractId;
|
||||||
|
|
||||||
|
@Schema(description = "版本")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.contractouts;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同关联 DO
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@TableName("cms_contract_outs")
|
||||||
|
@KeySequence("cms_contract_outs_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ContractOutsDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 合同id
|
||||||
|
*/
|
||||||
|
private Long contractId;
|
||||||
|
/**
|
||||||
|
* 外包合同id
|
||||||
|
*/
|
||||||
|
private Long outsContractId;
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime cteateTime;
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
private String updator;
|
||||||
|
/**
|
||||||
|
* 是否删除
|
||||||
|
*/
|
||||||
|
private Boolean delete;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户id
|
||||||
|
*/
|
||||||
|
private String tenantId;
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.outscontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同 DO
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@TableName("cms_outs_contract")
|
||||||
|
@KeySequence("cms_outs_contract_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OutsContractDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 主合同id
|
||||||
|
*/
|
||||||
|
private Long contractId;
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*
|
||||||
|
* 枚举
|
||||||
|
*/
|
||||||
|
private String countType;
|
||||||
|
/**
|
||||||
|
* 合同金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 专业
|
||||||
|
*
|
||||||
|
* 枚举
|
||||||
|
*/
|
||||||
|
private String major;
|
||||||
|
/**
|
||||||
|
* 签订时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
/**
|
||||||
|
* 结算数
|
||||||
|
*/
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
/**
|
||||||
|
* 合同文件url
|
||||||
|
*/
|
||||||
|
private String contractFileUrl;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,94 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同历史 DO
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@TableName("cms_outs_contract_history")
|
||||||
|
@KeySequence("cms_outs_contract_history_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class OutsContractHistoryDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 项目id
|
||||||
|
*/
|
||||||
|
private Long projectId;
|
||||||
|
/**
|
||||||
|
* 合同名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 主合同id
|
||||||
|
*/
|
||||||
|
private Long contractId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*
|
||||||
|
* 枚举 {@link // TODO contract_billing_type 对应的类}
|
||||||
|
*/
|
||||||
|
private String countType;
|
||||||
|
/**
|
||||||
|
* 合同金额
|
||||||
|
*/
|
||||||
|
private BigDecimal amount;
|
||||||
|
/**
|
||||||
|
* 编号
|
||||||
|
*/
|
||||||
|
private String code;
|
||||||
|
/**
|
||||||
|
* 专业
|
||||||
|
*
|
||||||
|
* 枚举 {@link //TODO major 对应的类}
|
||||||
|
*/
|
||||||
|
private String major;
|
||||||
|
/**
|
||||||
|
* 流程实体id
|
||||||
|
*/
|
||||||
|
private String processInstanceId;
|
||||||
|
/**
|
||||||
|
* 签订时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime signingTime;
|
||||||
|
/**
|
||||||
|
* 结算数
|
||||||
|
*/
|
||||||
|
private BigDecimal settlementAmount;
|
||||||
|
/**
|
||||||
|
* 合同文件url
|
||||||
|
*/
|
||||||
|
private String contractFileUrl;
|
||||||
|
/**
|
||||||
|
* 流程状态
|
||||||
|
*/
|
||||||
|
private String processStatus;
|
||||||
|
/**
|
||||||
|
* 外包合同id
|
||||||
|
*/
|
||||||
|
private Long outsContractId;
|
||||||
|
/**
|
||||||
|
* 版本
|
||||||
|
*/
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.mysql.contractouts;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同关联 Mapper
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface ContractOutsMapper extends BaseMapperX<ContractOutsDO> {
|
||||||
|
|
||||||
|
default PageResult<ContractOutsDO> selectPage(ContractOutsPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<ContractOutsDO>()
|
||||||
|
.eqIfPresent(ContractOutsDO::getContractId, reqVO.getContractId())
|
||||||
|
.eqIfPresent(ContractOutsDO::getOutsContractId, reqVO.getOutsContractId())
|
||||||
|
.eqIfPresent(ContractOutsDO::getCreator, reqVO.getCreator())
|
||||||
|
.betweenIfPresent(ContractOutsDO::getCteateTime, reqVO.getCteateTime())
|
||||||
|
.eqIfPresent(ContractOutsDO::getUpdator, reqVO.getUpdator())
|
||||||
|
.betweenIfPresent(ContractOutsDO::getUpdateTime, reqVO.getUpdateTime())
|
||||||
|
.eqIfPresent(ContractOutsDO::getDelete, reqVO.getDelete())
|
||||||
|
.eqIfPresent(ContractOutsDO::getTenantId, reqVO.getTenantId())
|
||||||
|
.orderByDesc(ContractOutsDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,34 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.mysql.outscontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同 Mapper
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface OutsContractMapper extends BaseMapperX<OutsContractDO> {
|
||||||
|
|
||||||
|
default PageResult<OutsContractDO> selectPage(OutsContractPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractDO>()
|
||||||
|
.eqIfPresent(OutsContractDO::getProjectId, reqVO.getProjectId())
|
||||||
|
.likeIfPresent(OutsContractDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(OutsContractDO::getContractId, reqVO.getContractId())
|
||||||
|
.eqIfPresent(OutsContractDO::getCountType, reqVO.getCountType())
|
||||||
|
.eqIfPresent(OutsContractDO::getAmount, reqVO.getAmount())
|
||||||
|
.eqIfPresent(OutsContractDO::getCode, reqVO.getCode())
|
||||||
|
.eqIfPresent(OutsContractDO::getMajor, reqVO.getMajor())
|
||||||
|
.betweenIfPresent(OutsContractDO::getSigningTime, reqVO.getSigningTime())
|
||||||
|
.eqIfPresent(OutsContractDO::getSettlementAmount, reqVO.getSettlementAmount())
|
||||||
|
.eqIfPresent(OutsContractDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||||
|
.betweenIfPresent(OutsContractDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.orderByDesc(OutsContractDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同历史 Mapper
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface OutsContractHistoryMapper extends BaseMapperX<OutsContractHistoryDO> {
|
||||||
|
|
||||||
|
default PageResult<OutsContractHistoryDO> selectPage(OutsContractHistoryPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<OutsContractHistoryDO>()
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getProjectId, reqVO.getProjectId())
|
||||||
|
.likeIfPresent(OutsContractHistoryDO::getName, reqVO.getName())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getContractId, reqVO.getContractId())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getCountType, reqVO.getCountType())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getAmount, reqVO.getAmount())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getCode, reqVO.getCode())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getMajor, reqVO.getMajor())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getProcessInstanceId, reqVO.getProcessInstanceId())
|
||||||
|
.betweenIfPresent(OutsContractHistoryDO::getSigningTime, reqVO.getSigningTime())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getSettlementAmount, reqVO.getSettlementAmount())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getContractFileUrl, reqVO.getContractFileUrl())
|
||||||
|
.betweenIfPresent(OutsContractHistoryDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getProcessStatus, reqVO.getProcessStatus())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getOutsContractId, reqVO.getOutsContractId())
|
||||||
|
.eqIfPresent(OutsContractHistoryDO::getVersion, reqVO.getVersion())
|
||||||
|
.orderByDesc(OutsContractHistoryDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.cms.service.contract;
|
package cn.iocoder.yudao.module.cms.service.contract;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.extContract.ExtContractMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.extcontract.ExtContractMapper;
|
||||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
import cn.iocoder.yudao.module.pms.api.ProjectApi;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
|
||||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.contractouts;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同关联 Service 接口
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
public interface ContractOutsService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建外包合同关联
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createContractOuts(@Valid ContractOutsSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新外包合同关联
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateContractOuts(@Valid ContractOutsSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除外包合同关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteContractOuts(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外包合同关联
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 外包合同关联
|
||||||
|
*/
|
||||||
|
ContractOutsDO getContractOuts(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外包合同关联分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 外包合同关联分页
|
||||||
|
*/
|
||||||
|
PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.contractouts;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.contractouts.vo.ContractOutsSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.contractouts.ContractOutsDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.contractouts.ContractOutsMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.CONTRACT_OUTS_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同关联 Service 实现类
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class ContractOutsServiceImpl implements ContractOutsService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ContractOutsMapper contractOutsMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createContractOuts(ContractOutsSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
ContractOutsDO contractOuts = BeanUtils.toBean(createReqVO, ContractOutsDO.class);
|
||||||
|
contractOutsMapper.insert(contractOuts);
|
||||||
|
// 返回
|
||||||
|
return contractOuts.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateContractOuts(ContractOutsSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateContractOutsExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
ContractOutsDO updateObj = BeanUtils.toBean(updateReqVO, ContractOutsDO.class);
|
||||||
|
contractOutsMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteContractOuts(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateContractOutsExists(id);
|
||||||
|
// 删除
|
||||||
|
contractOutsMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateContractOutsExists(Long id) {
|
||||||
|
if (contractOutsMapper.selectById(id) == null) {
|
||||||
|
throw exception(CONTRACT_OUTS_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ContractOutsDO getContractOuts(Long id) {
|
||||||
|
return contractOutsMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ContractOutsDO> getContractOutsPage(ContractOutsPageReqVO pageReqVO) {
|
||||||
|
return contractOutsMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -3,13 +3,10 @@ package cn.iocoder.yudao.module.cms.service.customerCompany;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
|
||||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
|
||||||
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
import cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.outscontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同 Service 接口
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
public interface OutsContractService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建外包合同
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createOutsContract(@Valid OutsContractSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新外包合同
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateOutsContract(@Valid OutsContractSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除外包合同
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteOutsContract(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外包合同
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 外包合同
|
||||||
|
*/
|
||||||
|
OutsContractDO getOutsContract(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外包合同分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 外包合同分页
|
||||||
|
*/
|
||||||
|
PageResult<OutsContractDO> getOutsContractPage(OutsContractPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.outscontract;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontract.vo.OutsContractSaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontract.OutsContractDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.outscontract.OutsContractMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.OUTS_CONTRACT_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同 Service 实现类
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class OutsContractServiceImpl implements OutsContractService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OutsContractMapper outsContractMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createOutsContract(OutsContractSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
OutsContractDO outsContract = BeanUtils.toBean(createReqVO, OutsContractDO.class);
|
||||||
|
outsContractMapper.insert(outsContract);
|
||||||
|
// 返回
|
||||||
|
return outsContract.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOutsContract(OutsContractSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateOutsContractExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
OutsContractDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractDO.class);
|
||||||
|
outsContractMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOutsContract(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateOutsContractExists(id);
|
||||||
|
// 删除
|
||||||
|
outsContractMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateOutsContractExists(Long id) {
|
||||||
|
if (outsContractMapper.selectById(id) == null) {
|
||||||
|
throw exception(OUTS_CONTRACT_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OutsContractDO getOutsContract(Long id) {
|
||||||
|
return outsContractMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OutsContractDO> getOutsContractPage(OutsContractPageReqVO pageReqVO) {
|
||||||
|
return outsContractMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同历史 Service 接口
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
public interface OutsContractHistoryService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建外包合同历史
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
Long createOutsContractHistory(@Valid OutsContractHistorySaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新外包合同历史
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateOutsContractHistory(@Valid OutsContractHistorySaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除外包合同历史
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteOutsContractHistory(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外包合同历史
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 外包合同历史
|
||||||
|
*/
|
||||||
|
OutsContractHistoryDO getOutsContractHistory(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得外包合同历史分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 外包合同历史分页
|
||||||
|
*/
|
||||||
|
PageResult<OutsContractHistoryDO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,70 @@
|
|||||||
|
package cn.iocoder.yudao.module.cms.service.outscontracthistory;
|
||||||
|
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistoryPageReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.controller.admin.outscontracthistory.vo.OutsContractHistorySaveReqVO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.dataobject.outscontracthistory.OutsContractHistoryDO;
|
||||||
|
import cn.iocoder.yudao.module.cms.dal.mysql.outscontracthistory.OutsContractHistoryMapper;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
|
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.OUTS_CONTRACT_HISTORY_NOT_EXISTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外包合同历史 Service 实现类
|
||||||
|
*
|
||||||
|
* @author zqc
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class OutsContractHistoryServiceImpl implements OutsContractHistoryService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OutsContractHistoryMapper outsContractHistoryMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long createOutsContractHistory(OutsContractHistorySaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
OutsContractHistoryDO outsContractHistory = BeanUtils.toBean(createReqVO, OutsContractHistoryDO.class);
|
||||||
|
outsContractHistoryMapper.insert(outsContractHistory);
|
||||||
|
// 返回
|
||||||
|
return outsContractHistory.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateOutsContractHistory(OutsContractHistorySaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateOutsContractHistoryExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
OutsContractHistoryDO updateObj = BeanUtils.toBean(updateReqVO, OutsContractHistoryDO.class);
|
||||||
|
outsContractHistoryMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteOutsContractHistory(Long id) {
|
||||||
|
// 校验存在
|
||||||
|
validateOutsContractHistoryExists(id);
|
||||||
|
// 删除
|
||||||
|
outsContractHistoryMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void validateOutsContractHistoryExists(Long id) {
|
||||||
|
if (outsContractHistoryMapper.selectById(id) == null) {
|
||||||
|
throw exception(OUTS_CONTRACT_HISTORY_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OutsContractHistoryDO getOutsContractHistory(Long id) {
|
||||||
|
return outsContractHistoryMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<OutsContractHistoryDO> getOutsContractHistoryPage(OutsContractHistoryPageReqVO pageReqVO) {
|
||||||
|
return outsContractHistoryMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user