mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	[fix] 优化合同管理功能
This commit is contained in:
		@@ -51,16 +51,16 @@ public class ContractController {
 | 
			
		||||
 | 
			
		||||
    @DeleteMapping("/delete")
 | 
			
		||||
    @Operation(summary = "删除合同")
 | 
			
		||||
    @Parameter(name = "projectId", description = "项目id", required = true)
 | 
			
		||||
    @Parameter(name = "id", description = "项目id", required = true)
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:contract:delete')")
 | 
			
		||||
    public CommonResult<Boolean> deleteContract(@RequestParam("projectId") Long projectId) {
 | 
			
		||||
        contractService.deleteContract(projectId);
 | 
			
		||||
    public CommonResult<Boolean> deleteContract(@RequestParam("id") Long id) {
 | 
			
		||||
        contractService.deleteContract(id);
 | 
			
		||||
        return success(true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/get")
 | 
			
		||||
    @Operation(summary = "获得合同")
 | 
			
		||||
    @Parameter(name = "projectId", description = "项目id", required = true, example = "1024")
 | 
			
		||||
    @Parameter(name = "projectId", description = "项目id", required = true)
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:contract:query')")
 | 
			
		||||
    public CommonResult<ContractRespVO> getContract(@RequestParam("projectId") Long projectId) {
 | 
			
		||||
        ContractRespVO contractRespVO = contractService.getContract(projectId);
 | 
			
		||||
@@ -88,4 +88,6 @@ public class ContractController {
 | 
			
		||||
                        BeanUtils.toBean(list, ContractRespVO.class));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -16,6 +16,10 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
 | 
			
		||||
@ToString(callSuper = true)
 | 
			
		||||
public class ContractPageReqVO extends PageParam {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "合同名称", example = "芋艿")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,6 @@ import lombok.*;
 | 
			
		||||
 | 
			
		||||
import java.math.BigDecimal;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
 | 
			
		||||
import com.alibaba.excel.annotation.*;
 | 
			
		||||
 | 
			
		||||
@@ -15,7 +14,6 @@ import com.alibaba.excel.annotation.*;
 | 
			
		||||
public class ContractRespVO {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "SJ24001")
 | 
			
		||||
    @ExcelProperty("项目编号")
 | 
			
		||||
    private String code;
 | 
			
		||||
@@ -28,6 +26,14 @@ public class ContractRespVO {
 | 
			
		||||
    @ExcelProperty("项目经理")
 | 
			
		||||
    private String projectManager;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "合同提示时间")
 | 
			
		||||
    @ExcelProperty("合同提示时间")
 | 
			
		||||
    private LocalDateTime reminderTime;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "暂定结算数")
 | 
			
		||||
    @ExcelProperty("暂定结算数")
 | 
			
		||||
    private BigDecimal provisionalSettlement;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "出图公司", requiredMode = Schema.RequiredMode.REQUIRED,example = "***设计院")
 | 
			
		||||
    @ExcelProperty("出图公司")
 | 
			
		||||
    private String drawingCompany;
 | 
			
		||||
@@ -36,13 +42,6 @@ public class ContractRespVO {
 | 
			
		||||
    @ExcelProperty("预计合同金额")
 | 
			
		||||
    private BigDecimal expectedContractAmount;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "分包合同商议提示", requiredMode = Schema.RequiredMode.REQUIRED,example = "2024年6月28日")
 | 
			
		||||
    @ExcelProperty("分包合同商议提示")
 | 
			
		||||
    private Date subcontractNegotiationTips;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "暂定结算数", requiredMode = Schema.RequiredMode.REQUIRED,example = "68.0000")
 | 
			
		||||
    @ExcelProperty("暂定结算数")
 | 
			
		||||
    private Double ProvisionalSettlement;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
 | 
			
		||||
    @ExcelProperty("合同名称")
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,4 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.controller.admin.contract.vo;
 | 
			
		||||
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.*;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
@@ -10,6 +9,12 @@ import java.time.LocalDateTime;
 | 
			
		||||
@Data
 | 
			
		||||
public class ContractSaveReqVO {
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED)
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "项目编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "123456")
 | 
			
		||||
    private Long projectId;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "合同名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
 | 
			
		||||
    @NotEmpty(message = "合同名称不能为空")
 | 
			
		||||
    private String name;
 | 
			
		||||
@@ -92,4 +97,19 @@ public class ContractSaveReqVO {
 | 
			
		||||
    @Schema(description = "其他费")
 | 
			
		||||
    private BigDecimal otherFee;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "创建者")
 | 
			
		||||
    private String creator;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
 | 
			
		||||
    @NotNull(message = "创建时间不能为空")
 | 
			
		||||
    private LocalDateTime createTime;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "更新者")
 | 
			
		||||
    private String updater;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
 | 
			
		||||
    @NotNull(message = "更新时间不能为空")
 | 
			
		||||
    private LocalDateTime updateTime;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,103 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany;
 | 
			
		||||
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
import org.springframework.security.access.prepost.PreAuthorize;
 | 
			
		||||
import io.swagger.v3.oas.annotations.tags.Tag;
 | 
			
		||||
import io.swagger.v3.oas.annotations.Parameter;
 | 
			
		||||
import io.swagger.v3.oas.annotations.Operation;
 | 
			
		||||
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
import jakarta.validation.*;
 | 
			
		||||
import jakarta.servlet.http.*;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import java.io.IOException;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 | 
			
		||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 | 
			
		||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
 | 
			
		||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
 | 
			
		||||
 | 
			
		||||
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.service.customerCompany.CustomerCompanyService;
 | 
			
		||||
 | 
			
		||||
@Tag(name = "管理后台 - 客户公司")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/cms/customer-company")
 | 
			
		||||
@Validated
 | 
			
		||||
public class CustomerCompanyController {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private CustomerCompanyService customerCompanyService;
 | 
			
		||||
 | 
			
		||||
    @PostMapping("/create")
 | 
			
		||||
    @Operation(summary = "创建客户公司")
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:create')")
 | 
			
		||||
    public CommonResult<Long> createCustomerCompany(@Valid @RequestBody CustomerCompanySaveReqVO createReqVO) {
 | 
			
		||||
        return success(customerCompanyService.createCustomerCompany(createReqVO));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @PutMapping("/update")
 | 
			
		||||
    @Operation(summary = "更新客户公司")
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:update')")
 | 
			
		||||
    public CommonResult<Boolean> updateCustomerCompany(@Valid @RequestBody CustomerCompanySaveReqVO updateReqVO) {
 | 
			
		||||
        customerCompanyService.updateCustomerCompany(updateReqVO);
 | 
			
		||||
        return success(true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @DeleteMapping("/delete")
 | 
			
		||||
    @Operation(summary = "删除客户公司")
 | 
			
		||||
    @Parameter(name = "id", description = "编号", required = true)
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:delete')")
 | 
			
		||||
    public CommonResult<Boolean> deleteCustomerCompany(@RequestParam("id") Long id) {
 | 
			
		||||
        customerCompanyService.deleteCustomerCompany(id);
 | 
			
		||||
        return success(true);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/get")
 | 
			
		||||
    @Operation(summary = "获得客户公司")
 | 
			
		||||
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
 | 
			
		||||
    public CommonResult<CustomerCompanyRespVO> getCustomerCompany(@RequestParam("id") Long id) {
 | 
			
		||||
        CustomerCompanyDO customerCompany = customerCompanyService.getCustomerCompany(id);
 | 
			
		||||
        return success(BeanUtils.toBean(customerCompany, CustomerCompanyRespVO.class));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/page")
 | 
			
		||||
    @Operation(summary = "获得客户公司分页")
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
 | 
			
		||||
    public CommonResult<PageResult<CustomerCompanyRespVO>> getCustomerCompanyPage(@Valid CustomerCompanyPageReqVO pageReqVO) {
 | 
			
		||||
        PageResult<CustomerCompanyDO> pageResult = customerCompanyService.getCustomerCompanyPage(pageReqVO);
 | 
			
		||||
        return success(BeanUtils.toBean(pageResult, CustomerCompanyRespVO.class));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/list")
 | 
			
		||||
    @Operation(summary = "获得客户公司列表")
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:query')")
 | 
			
		||||
    public CommonResult<List<CustomerCompanyRespVO>> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) {
 | 
			
		||||
        List<CustomerCompanyDO> list = customerCompanyService.getCustomerCompanyList(reqVO);
 | 
			
		||||
        return success(BeanUtils.toBean(list, CustomerCompanyRespVO.class));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @GetMapping("/export-excel")
 | 
			
		||||
    @Operation(summary = "导出客户公司 Excel")
 | 
			
		||||
    @PreAuthorize("@ss.hasPermission('cms:customer-company:export')")
 | 
			
		||||
    @ApiAccessLog(operateType = EXPORT)
 | 
			
		||||
    public void exportCustomerCompanyExcel(@Valid CustomerCompanyPageReqVO pageReqVO,
 | 
			
		||||
              HttpServletResponse response) throws IOException {
 | 
			
		||||
        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
 | 
			
		||||
        List<CustomerCompanyDO> list = customerCompanyService.getCustomerCompanyPage(pageReqVO).getList();
 | 
			
		||||
        // 导出 Excel
 | 
			
		||||
        ExcelUtils.write(response, "客户公司.xls", "数据", CustomerCompanyRespVO.class,
 | 
			
		||||
                        BeanUtils.toBean(list, CustomerCompanyRespVO.class));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,33 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo;
 | 
			
		||||
 | 
			
		||||
import lombok.*;
 | 
			
		||||
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 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 CustomerCompanyPageReqVO extends PageParam {
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "联系人", example = "张三")
 | 
			
		||||
    private String contacts;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "创建时间")
 | 
			
		||||
    private LocalDateTime createTime;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "公司名称", example = "电力公司")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "地址")
 | 
			
		||||
    private String address;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "电话")
 | 
			
		||||
    private String phone;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,39 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo;
 | 
			
		||||
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.*;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import org.springframework.format.annotation.DateTimeFormat;
 | 
			
		||||
import java.time.LocalDateTime;
 | 
			
		||||
import com.alibaba.excel.annotation.*;
 | 
			
		||||
 | 
			
		||||
@Schema(description = "管理后台 - 客户公司 Response VO")
 | 
			
		||||
@Data
 | 
			
		||||
@ExcelIgnoreUnannotated
 | 
			
		||||
public class CustomerCompanyRespVO {
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14907")
 | 
			
		||||
    @ExcelProperty("主键")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
 | 
			
		||||
    @ExcelProperty("联系人")
 | 
			
		||||
    private String contacts;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
 | 
			
		||||
    @ExcelProperty("创建时间")
 | 
			
		||||
    private LocalDateTime createTime;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司")
 | 
			
		||||
    @ExcelProperty("公司名称")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "地址")
 | 
			
		||||
    @ExcelProperty("地址")
 | 
			
		||||
    private String address;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "电话")
 | 
			
		||||
    @ExcelProperty("电话")
 | 
			
		||||
    private String phone;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,29 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo;
 | 
			
		||||
 | 
			
		||||
import io.swagger.v3.oas.annotations.media.Schema;
 | 
			
		||||
import lombok.*;
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import jakarta.validation.constraints.*;
 | 
			
		||||
 | 
			
		||||
@Schema(description = "管理后台 - 客户公司新增/修改 Request VO")
 | 
			
		||||
@Data
 | 
			
		||||
public class CustomerCompanySaveReqVO {
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14907")
 | 
			
		||||
    private Long id;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "联系人", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
 | 
			
		||||
    @NotEmpty(message = "联系人不能为空")
 | 
			
		||||
    private String contacts;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "电力公司")
 | 
			
		||||
    @NotEmpty(message = "公司名称不能为空")
 | 
			
		||||
    private String name;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "地址")
 | 
			
		||||
    private String address;
 | 
			
		||||
 | 
			
		||||
    @Schema(description = "电话")
 | 
			
		||||
    private String phone;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,47 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany;
 | 
			
		||||
 | 
			
		||||
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 hhyykk
 | 
			
		||||
 */
 | 
			
		||||
@TableName("cms_customer_company")
 | 
			
		||||
@KeySequence("cms_customer_company_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
 | 
			
		||||
@Data
 | 
			
		||||
@EqualsAndHashCode(callSuper = true)
 | 
			
		||||
@ToString(callSuper = true)
 | 
			
		||||
@Builder
 | 
			
		||||
@NoArgsConstructor
 | 
			
		||||
@AllArgsConstructor
 | 
			
		||||
public class CustomerCompanyDO extends BaseDO {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 主键
 | 
			
		||||
     */
 | 
			
		||||
    @TableId
 | 
			
		||||
    private Long id;
 | 
			
		||||
    /**
 | 
			
		||||
     * 联系人
 | 
			
		||||
     */
 | 
			
		||||
    private String contacts;
 | 
			
		||||
    /**
 | 
			
		||||
     * 公司名称
 | 
			
		||||
     */
 | 
			
		||||
    private String name;
 | 
			
		||||
    /**
 | 
			
		||||
     * 地址
 | 
			
		||||
     */
 | 
			
		||||
    private String address;
 | 
			
		||||
    /**
 | 
			
		||||
     * 电话
 | 
			
		||||
     */
 | 
			
		||||
    private String phone;
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -18,6 +18,7 @@ public interface ContractMapper extends BaseMapperX<ContractDO> {
 | 
			
		||||
    default PageResult<ContractDO> selectPage(ContractPageReqVO reqVO) {
 | 
			
		||||
        return selectPage(reqVO, new LambdaQueryWrapperX<ContractDO>()
 | 
			
		||||
                .likeIfPresent(ContractDO::getName, reqVO.getName())
 | 
			
		||||
                .eqIfPresent(ContractDO::getProjectId, reqVO.getProjectId())
 | 
			
		||||
                .eqIfPresent(ContractDO::getType, reqVO.getType())
 | 
			
		||||
                .eqIfPresent(ContractDO::getProgress, reqVO.getProgress())
 | 
			
		||||
                .betweenIfPresent(ContractDO::getExpectedTime, reqVO.getExpectedTime())
 | 
			
		||||
@@ -45,8 +46,6 @@ public interface ContractMapper extends BaseMapperX<ContractDO> {
 | 
			
		||||
                .eqIfPresent(ContractDO::getOtherFee, reqVO.getOtherFee())
 | 
			
		||||
 | 
			
		||||
                .orderByDesc(ContractDO::getId)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        );
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,34 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.dal.mysql.customerCompany;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
 | 
			
		||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
 | 
			
		||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
 | 
			
		||||
import cn.iocoder.yudao.module.cms.dal.dataobject.customerCompany.CustomerCompanyDO;
 | 
			
		||||
import org.apache.ibatis.annotations.Mapper;
 | 
			
		||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 客户公司 Mapper
 | 
			
		||||
 *
 | 
			
		||||
 * @author hhyykk
 | 
			
		||||
 */
 | 
			
		||||
@Mapper
 | 
			
		||||
public interface CustomerCompanyMapper extends BaseMapperX<CustomerCompanyDO> {
 | 
			
		||||
 | 
			
		||||
    default PageResult<CustomerCompanyDO> selectPage(CustomerCompanyPageReqVO reqVO) {
 | 
			
		||||
        return selectPage(reqVO, new LambdaQueryWrapperX<CustomerCompanyDO>()
 | 
			
		||||
                .likeIfPresent(CustomerCompanyDO::getContacts, reqVO.getContacts())
 | 
			
		||||
                .eqIfPresent(CustomerCompanyDO::getCreateTime, reqVO.getCreateTime())
 | 
			
		||||
                .likeIfPresent(CustomerCompanyDO::getName, reqVO.getName())
 | 
			
		||||
                .eqIfPresent(CustomerCompanyDO::getAddress, reqVO.getAddress())
 | 
			
		||||
                .eqIfPresent(CustomerCompanyDO::getPhone, reqVO.getPhone())
 | 
			
		||||
                .orderByDesc(CustomerCompanyDO::getId));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    default List<CustomerCompanyDO> selectList(CustomerCompanyPageReqVO reqVO) {
 | 
			
		||||
        return selectList(new LambdaQueryWrapperX<CustomerCompanyDO>());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -2,8 +2,10 @@ package cn.iocoder.yudao.module.cms.service.contract;
 | 
			
		||||
 | 
			
		||||
import cn.iocoder.yudao.module.cms.dal.mysql.contract.ContractMapper;
 | 
			
		||||
import cn.iocoder.yudao.module.pms.api.ProjectApi;
 | 
			
		||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectDetailRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.pms.api.dto.project.ProjectRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectDetailRespDTO;
 | 
			
		||||
import cn.iocoder.yudao.module.pms.api.project.dto.ProjectRespDTO;
 | 
			
		||||
import org.slf4j.Logger;
 | 
			
		||||
import org.slf4j.LoggerFactory;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
@@ -25,6 +27,7 @@ import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
 | 
			
		||||
@Validated
 | 
			
		||||
public class ContractServiceImpl implements ContractService {
 | 
			
		||||
 | 
			
		||||
    private static final Logger log = LoggerFactory.getLogger(ContractServiceImpl.class);
 | 
			
		||||
    @Resource
 | 
			
		||||
    private ContractMapper contractMapper;
 | 
			
		||||
 | 
			
		||||
@@ -64,7 +67,7 @@ public class ContractServiceImpl implements ContractService {
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
        public ContractRespVO getContract(Long projectId) {
 | 
			
		||||
        ContractDO contractDO = contractMapper.selectById(projectId);
 | 
			
		||||
        ContractDO contractDO = contractMapper.selectOne("project_id",projectId);
 | 
			
		||||
        ContractRespVO contractRespVO = BeanUtils.toBean(contractDO, ContractRespVO.class);
 | 
			
		||||
 | 
			
		||||
//        需要联表查询
 | 
			
		||||
 
 | 
			
		||||
@@ -1,61 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
import jakarta.validation.*;
 | 
			
		||||
import cn.iocoder.yudao.module.cms.controller.admin.customerCompany.vo.*;
 | 
			
		||||
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.PageParam;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 客户公司 Service 接口
 | 
			
		||||
 *
 | 
			
		||||
 * @author hhyykk
 | 
			
		||||
 */
 | 
			
		||||
public interface CustomerCompanyService {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 创建客户公司
 | 
			
		||||
     *
 | 
			
		||||
     * @param createReqVO 创建信息
 | 
			
		||||
     * @return 编号
 | 
			
		||||
     */
 | 
			
		||||
    Long createCustomerCompany(@Valid CustomerCompanySaveReqVO createReqVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 更新客户公司
 | 
			
		||||
     *
 | 
			
		||||
     * @param updateReqVO 更新信息
 | 
			
		||||
     */
 | 
			
		||||
    void updateCustomerCompany(@Valid CustomerCompanySaveReqVO updateReqVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 删除客户公司
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 编号
 | 
			
		||||
     */
 | 
			
		||||
    void deleteCustomerCompany(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得客户公司
 | 
			
		||||
     *
 | 
			
		||||
     * @param id 编号
 | 
			
		||||
     * @return 客户公司
 | 
			
		||||
     */
 | 
			
		||||
    CustomerCompanyDO getCustomerCompany(Long id);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得客户公司分页
 | 
			
		||||
     *
 | 
			
		||||
     * @param pageReqVO 分页查询
 | 
			
		||||
     * @return 客户公司分页
 | 
			
		||||
     */
 | 
			
		||||
    PageResult<CustomerCompanyDO> getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获得客户公司列表
 | 
			
		||||
     * @param reqVO 查询参数
 | 
			
		||||
     * @return 列表信息
 | 
			
		||||
     */
 | 
			
		||||
    List<CustomerCompanyDO> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO);
 | 
			
		||||
}
 | 
			
		||||
@@ -1,79 +0,0 @@
 | 
			
		||||
package cn.iocoder.yudao.module.cms.service.customerCompany;
 | 
			
		||||
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import jakarta.annotation.Resource;
 | 
			
		||||
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.dal.dataobject.customerCompany.CustomerCompanyDO;
 | 
			
		||||
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.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper;
 | 
			
		||||
 | 
			
		||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 | 
			
		||||
import static cn.iocoder.yudao.module.cms.enums.ErrorCodeConstants.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 客户公司 Service 实现类
 | 
			
		||||
 *
 | 
			
		||||
 * @author hhyykk
 | 
			
		||||
 */
 | 
			
		||||
@Service
 | 
			
		||||
@Validated
 | 
			
		||||
public class CustomerCompanyServiceImpl implements CustomerCompanyService {
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    private CustomerCompanyMapper customerCompanyMapper;
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public Long createCustomerCompany(CustomerCompanySaveReqVO createReqVO) {
 | 
			
		||||
        // 插入
 | 
			
		||||
        CustomerCompanyDO customerCompany = BeanUtils.toBean(createReqVO, CustomerCompanyDO.class);
 | 
			
		||||
        customerCompanyMapper.insert(customerCompany);
 | 
			
		||||
        // 返回
 | 
			
		||||
        return customerCompany.getId();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void updateCustomerCompany(CustomerCompanySaveReqVO updateReqVO) {
 | 
			
		||||
        // 校验存在
 | 
			
		||||
        validateCustomerCompanyExists(updateReqVO.getId());
 | 
			
		||||
        // 更新
 | 
			
		||||
        CustomerCompanyDO updateObj = BeanUtils.toBean(updateReqVO, CustomerCompanyDO.class);
 | 
			
		||||
        customerCompanyMapper.updateById(updateObj);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public void deleteCustomerCompany(Long id) {
 | 
			
		||||
        // 校验存在
 | 
			
		||||
        validateCustomerCompanyExists(id);
 | 
			
		||||
        // 删除
 | 
			
		||||
        customerCompanyMapper.deleteById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    private void validateCustomerCompanyExists(Long id) {
 | 
			
		||||
        if (customerCompanyMapper.selectById(id) == null) {
 | 
			
		||||
            throw exception(CUSTOMER_COMPANY_NOT_EXISTS);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public CustomerCompanyDO getCustomerCompany(Long id) {
 | 
			
		||||
        return customerCompanyMapper.selectById(id);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public PageResult<CustomerCompanyDO> getCustomerCompanyPage(CustomerCompanyPageReqVO pageReqVO) {
 | 
			
		||||
        return customerCompanyMapper.selectPage(pageReqVO);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<CustomerCompanyDO> getCustomerCompanyList(CustomerCompanyPageReqVO reqVO) {
 | 
			
		||||
        return customerCompanyMapper.selectList(reqVO);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
@@ -1,12 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 | 
			
		||||
<mapper namespace="cn.iocoder.yudao.module.cms.dal.mysql.customerCompany.CustomerCompanyMapper">
 | 
			
		||||
 | 
			
		||||
    <!--
 | 
			
		||||
        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
 | 
			
		||||
        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
 | 
			
		||||
        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
 | 
			
		||||
        文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
 | 
			
		||||
     -->
 | 
			
		||||
 | 
			
		||||
</mapper>
 | 
			
		||||
		Reference in New Issue
	
	Block a user