合同模块,缺内容,先上线
This commit is contained in:
parent
054e30c1b8
commit
fad1ab81b5
|
@ -0,0 +1,110 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("contract")
|
||||
@ApiModel(value="ContractEntity对象", description="合同表")
|
||||
public class ContractEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 782007452634989148L;
|
||||
|
||||
@ExcelProperty("合同id")
|
||||
@ApiModelProperty("合同id")
|
||||
@TableId(value = "contract_id", type = IdType.ASSIGN_ID)
|
||||
private String contractId;
|
||||
|
||||
@ExcelProperty("客户名称")
|
||||
@ApiModelProperty("客户名称")
|
||||
@TableField("customer")
|
||||
private String customer;
|
||||
|
||||
@ExcelProperty("合同编号")
|
||||
@ApiModelProperty("合同编号")
|
||||
@TableField("code")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("项目id")
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
|
||||
@ExcelProperty("业务员id")
|
||||
@ApiModelProperty("业务员id")
|
||||
@TableField("salesperson_id")
|
||||
private String salespersonId;
|
||||
|
||||
@ExcelProperty("部门id")
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField("department_id")
|
||||
private String departmentId;
|
||||
|
||||
@ExcelProperty("签订日期")
|
||||
@ApiModelProperty("签订日期")
|
||||
@TableField("sign_date")
|
||||
private Date signDate;
|
||||
|
||||
@ExcelProperty("期限")
|
||||
@ApiModelProperty("期限")
|
||||
@TableField("duration")
|
||||
private String duration;
|
||||
|
||||
@ExcelProperty("类型")
|
||||
@ApiModelProperty("类型")
|
||||
@TableField("type")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty("产品或服务")
|
||||
@ApiModelProperty("产品或服务")
|
||||
@TableField("product_service")
|
||||
private String productService;
|
||||
|
||||
@ExcelProperty("付款日期/交付日期")
|
||||
@ApiModelProperty("付款日期/交付日期")
|
||||
@TableField("payment_date")
|
||||
private Date paymentDate;
|
||||
|
||||
@ExcelProperty("付款地址/交付地址")
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
@TableField("payment_address")
|
||||
private String paymentAddress;
|
||||
|
||||
@ExcelProperty("金额")
|
||||
@ApiModelProperty("金额")
|
||||
@TableField("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ExcelProperty("收款账号")
|
||||
@ApiModelProperty("收款账号")
|
||||
@TableField("account_number")
|
||||
private String accountNumber;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
@ApiModelProperty("备注")
|
||||
@TableField("notes")
|
||||
private String notes;
|
||||
|
||||
@ExcelProperty("合同状态")
|
||||
@ApiModelProperty("合同状态")
|
||||
@TableField("contract_status")
|
||||
private String contractStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
package com.dite.znpt.domain.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.dite.znpt.domain.AuditableEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同结算表实体类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("contract_settlement")
|
||||
@ApiModel(value="ContractSettlementEntity对象", description="合同结算表")
|
||||
public class ContractSettlementEntity extends AuditableEntity implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -59751771276704650L;
|
||||
|
||||
@ExcelProperty("合同结算id")
|
||||
@ApiModelProperty("合同结算id")
|
||||
@TableId(value = "settlement_id", type = IdType.ASSIGN_ID)
|
||||
private String settlementId;
|
||||
|
||||
@ExcelProperty("合同id")
|
||||
@ApiModelProperty("合同id")
|
||||
@TableField("contract_id")
|
||||
private String contractId;
|
||||
|
||||
@ExcelProperty("客户/供应商名称")
|
||||
@ApiModelProperty("客户/供应商名称")
|
||||
@TableField("customer")
|
||||
private String customer;
|
||||
|
||||
@ExcelProperty("合同结算编号")
|
||||
@ApiModelProperty("合同结算编号")
|
||||
@TableField("code")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty("项目id")
|
||||
@ApiModelProperty("项目id")
|
||||
@TableField("project_id")
|
||||
private String projectId;
|
||||
|
||||
@ExcelProperty("业务员id")
|
||||
@ApiModelProperty("业务员id")
|
||||
@TableField("salesperson_id")
|
||||
private String salespersonId;
|
||||
|
||||
@ExcelProperty("部门id")
|
||||
@ApiModelProperty("部门id")
|
||||
@TableField("department_id")
|
||||
private String departmentId;
|
||||
|
||||
@ExcelProperty("账期")
|
||||
@ApiModelProperty("账期")
|
||||
@TableField("payment_period")
|
||||
private Date paymentPeriod;
|
||||
|
||||
@ExcelProperty("日期")
|
||||
@ApiModelProperty("日期")
|
||||
@TableField("payment_date")
|
||||
private Date paymentDate;
|
||||
|
||||
@ExcelProperty("期限")
|
||||
@ApiModelProperty("期限")
|
||||
@TableField("duration")
|
||||
private String duration;
|
||||
|
||||
@ExcelProperty("产品或服务")
|
||||
@ApiModelProperty("产品或服务")
|
||||
@TableField("product_service")
|
||||
private String productService;
|
||||
|
||||
@ExcelProperty("金额")
|
||||
@ApiModelProperty("金额")
|
||||
@TableField("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ExcelProperty("收款账号")
|
||||
@ApiModelProperty("收款账号")
|
||||
@TableField("account_number")
|
||||
private String accountNumber;
|
||||
|
||||
@ExcelProperty("备注")
|
||||
@ApiModelProperty("备注")
|
||||
@TableField("notes")
|
||||
private String notes;
|
||||
|
||||
@ExcelProperty("合同结算状态")
|
||||
@ApiModelProperty("合同结算状态")
|
||||
@TableField("settlement_status")
|
||||
private String settlementStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同表导入请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="Contract导入请求对象", description="合同表")
|
||||
public class ContractImportReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 416194686656143643L;
|
||||
|
||||
|
||||
@ExcelProperty(value = "客户名称")
|
||||
private String customer;
|
||||
|
||||
@ExcelProperty(value = "合同编号")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ExcelProperty(value = "业务员名称")
|
||||
private String salespersonName;
|
||||
|
||||
@ExcelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
|
||||
@ExcelProperty(value = "签订日期")
|
||||
private Date signDate;
|
||||
|
||||
@ExcelProperty(value = "期限")
|
||||
private String duration;
|
||||
|
||||
@ExcelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ExcelProperty(value = "产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ExcelProperty(value = "付款日期/交付日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ExcelProperty(value = "付款地址/交付地址")
|
||||
private String paymentAddress;
|
||||
|
||||
@ExcelProperty(value = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ExcelProperty(value = "收款账号")
|
||||
private String accountNumber;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
private String notes;
|
||||
|
||||
@ExcelProperty(value = "合同状态")
|
||||
private String contractStatus;
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("合同列表请求实体")
|
||||
public class ContractListReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 188906332887614727L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("合同Id")
|
||||
private String contractId;
|
||||
|
||||
@ApiModelProperty("客户名称")
|
||||
private String customer;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("业务员id")
|
||||
private String salespersonId;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty("签订日期")
|
||||
private Date signDate;
|
||||
|
||||
@ApiModelProperty("期限")
|
||||
private String duration;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ApiModelProperty("付款日期/交付日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
private String paymentAddress;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("收款账号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
@ApiModelProperty("合同状态")
|
||||
private String contractStatus;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同表请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="Contract请求对象", description="合同表")
|
||||
public class ContractReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -42338861509205617L;
|
||||
|
||||
@ApiModelProperty("合同id")
|
||||
private String contractId;
|
||||
|
||||
@ApiModelProperty("客户名称")
|
||||
private String customer;
|
||||
|
||||
@ApiModelProperty("合同编号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("业务员id")
|
||||
private String salespersonId;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty("签订日期")
|
||||
private Date signDate;
|
||||
|
||||
@ApiModelProperty("期限")
|
||||
private String duration;
|
||||
|
||||
@ApiModelProperty("类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty("产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ApiModelProperty("付款日期/交付日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("付款地址/交付地址")
|
||||
private String paymentAddress;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("收款账号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
@ApiModelProperty("合同状态")
|
||||
private String contractStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
* @Description: 合同响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("合同响应实体")
|
||||
public class ContractResp extends ContractEntity {
|
||||
|
||||
@ApiModelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ApiModelProperty("业务员姓名")
|
||||
private String salespersonName;
|
||||
|
||||
@ApiModelProperty("部门名称")
|
||||
private String salespersonDeptName;
|
||||
|
||||
@ApiModelProperty("已结算金额")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@ApiModelProperty("已收款金额")
|
||||
private BigDecimal receivedAmount;
|
||||
}
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同结算表导入请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ContractSettlement导入请求对象", description="合同结算表")
|
||||
public class ContractSettlementImportReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 148613402074177824L;
|
||||
|
||||
|
||||
@ExcelProperty(value = "合同名称(不能为空,长度32以内)")
|
||||
private String contractName;
|
||||
|
||||
@ExcelProperty(value = "客户/供应商名称")
|
||||
private String customer;
|
||||
|
||||
@ExcelProperty(value = "合同结算编号")
|
||||
private String code;
|
||||
|
||||
@ExcelProperty(value = "项目名称")
|
||||
private String projectName;
|
||||
|
||||
@ExcelProperty(value = "业务员名称")
|
||||
private String salespersonName;
|
||||
|
||||
@ExcelProperty(value = "部门名称")
|
||||
private String departmentName;
|
||||
|
||||
@ExcelProperty(value = "账期")
|
||||
private Date paymentPeriod;
|
||||
|
||||
@ExcelProperty(value = "日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ExcelProperty(value = "期限")
|
||||
private String duration;
|
||||
|
||||
@ExcelProperty(value = "产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ExcelProperty(value = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ExcelProperty(value = "收款账号")
|
||||
private String accountNumber;
|
||||
|
||||
@ExcelProperty(value = "备注")
|
||||
private String notes;
|
||||
|
||||
@ExcelProperty(value = "合同结算状态")
|
||||
private String settlementStatus;
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同结算请求实体
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("合同结算列表请求实体")
|
||||
public class ContractSettlementListReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -36243842073737072L;
|
||||
|
||||
@ApiModelProperty("查询关键字")
|
||||
private String keyword;
|
||||
|
||||
@ApiModelProperty("合同结算Id")
|
||||
private String settlementId;
|
||||
|
||||
@ApiModelProperty("合同id")
|
||||
private String contractId;
|
||||
|
||||
@ApiModelProperty("客户/供应商名称")
|
||||
private String customer;
|
||||
|
||||
@ApiModelProperty("合同结算编号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("业务员id")
|
||||
private String salespersonId;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty("账期")
|
||||
private Date paymentPeriod;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("期限")
|
||||
private String duration;
|
||||
|
||||
@ApiModelProperty("产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("收款账号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
@ApiModelProperty("合同结算状态")
|
||||
private String settlementStatus;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
|
||||
import com.dite.znpt.util.ValidationGroup;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:13
|
||||
* @Description: 合同结算表请求类
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ContractSettlement请求对象", description="合同结算表")
|
||||
public class ContractSettlementReq implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = -44768849127704946L;
|
||||
|
||||
@ApiModelProperty("合同结算id")
|
||||
private String settlementId;
|
||||
|
||||
@NotBlank(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, message = "合同id不能为空")
|
||||
@Size(groups = {ValidationGroup.Insert.class, ValidationGroup.Update.class}, max = 32, message = "合同id长度不能超过32字符")
|
||||
@ApiModelProperty("合同id")
|
||||
private String contractId;
|
||||
|
||||
@ApiModelProperty("客户/供应商名称")
|
||||
private String customer;
|
||||
|
||||
@ApiModelProperty("合同结算编号")
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty("业务员id")
|
||||
private String salespersonId;
|
||||
|
||||
@ApiModelProperty("部门id")
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty("账期")
|
||||
private Date paymentPeriod;
|
||||
|
||||
@ApiModelProperty("日期")
|
||||
private Date paymentDate;
|
||||
|
||||
@ApiModelProperty("期限")
|
||||
private String duration;
|
||||
|
||||
@ApiModelProperty("产品或服务")
|
||||
private String productService;
|
||||
|
||||
@ApiModelProperty("金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@ApiModelProperty("收款账号")
|
||||
private String accountNumber;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
private String notes;
|
||||
|
||||
@ApiModelProperty("合同结算状态")
|
||||
private String settlementStatus;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.dite.znpt.domain.vo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import com.dite.znpt.domain.entity.ContractSettlementEntity;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
* @Description: 合同结算响应实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel("合同结算响应实体")
|
||||
public class ContractSettlementResp extends ContractSettlementEntity {
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
import com.dite.znpt.domain.vo.ContractListReq;
|
||||
import com.dite.znpt.domain.vo.ContractResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
* @Description: 合同表数据库访问层
|
||||
*/
|
||||
public interface ContractMapper extends BaseMapper<ContractEntity> {
|
||||
List<ContractResp> queryBySelective(ContractListReq contractReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package com.dite.znpt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dite.znpt.domain.entity.ContractSettlementEntity;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementListReq;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementResp;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
* @Description: 合同结算表数据库访问层
|
||||
*/
|
||||
public interface ContractSettlementMapper extends BaseMapper<ContractSettlementEntity> {
|
||||
List<ContractSettlementResp> queryBySelective(ContractSettlementListReq contractSettlementReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
import com.dite.znpt.domain.vo.ContractListReq;
|
||||
import com.dite.znpt.domain.vo.ContractResp;
|
||||
import com.dite.znpt.domain.vo.ContractReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
* @Description: 合同表服务接口
|
||||
*/
|
||||
public interface ContractService extends IService<ContractEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询合同列表
|
||||
*
|
||||
* @param contractReq 合同
|
||||
* @return {@link List }<{@link ContractResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
List<ContractResp> selectList(ContractListReq contractReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条合同
|
||||
*
|
||||
* @param contractId 合同Id
|
||||
* @return {@link ContractResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
ContractResp selectById(String contractId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增合同
|
||||
*
|
||||
* @param contractReq 合同
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
void saveData(ContractReq contractReq);
|
||||
|
||||
/**
|
||||
* 功能描述:更新合同
|
||||
*
|
||||
* @param contractReq 合同
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
void updateData(ContractReq contractReq);
|
||||
|
||||
/**
|
||||
* 功能描述:删除合同
|
||||
*
|
||||
* @param contractId 合同Id
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
void deleteById(String contractId);
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.dite.znpt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dite.znpt.domain.entity.ContractSettlementEntity;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementListReq;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementResp;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
* @Description: 合同结算表服务接口
|
||||
*/
|
||||
public interface ContractSettlementService extends IService<ContractSettlementEntity> {
|
||||
|
||||
/**
|
||||
* 功能描述:查询合同结算列表
|
||||
*
|
||||
* @param contractSettlementReq 合同结算
|
||||
* @return {@link List }<{@link ContractSettlementResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
**/
|
||||
List<ContractSettlementResp> selectList(ContractSettlementListReq contractSettlementReq);
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条合同结算
|
||||
*
|
||||
* @param settlementId 合同结算Id
|
||||
* @return {@link ContractSettlementResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
**/
|
||||
ContractSettlementResp selectById(String settlementId);
|
||||
|
||||
/**
|
||||
* 功能描述:新增合同结算
|
||||
*
|
||||
* @param contractSettlementReq 合同结算
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
**/
|
||||
void saveData(ContractSettlementReq contractSettlementReq);
|
||||
}
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
import com.dite.znpt.domain.vo.ContractListReq;
|
||||
import com.dite.znpt.domain.vo.ContractResp;
|
||||
import com.dite.znpt.domain.vo.ContractReq;
|
||||
import com.dite.znpt.service.ContractService;
|
||||
import com.dite.znpt.mapper.ContractMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
* @Description: 合同表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ContractServiceImpl extends ServiceImpl<ContractMapper, ContractEntity> implements ContractService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询合同列表
|
||||
*
|
||||
* @param contractReq 合同信息
|
||||
* @return {@link List }<{@link ContractResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
@Override
|
||||
public List<ContractResp> selectList(ContractListReq contractReq) {
|
||||
PageUtil.startPage();
|
||||
List<ContractResp> contractList= this.baseMapper.queryBySelective(contractReq);
|
||||
contractList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return contractList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条合同
|
||||
*
|
||||
* @param contractId 合同Id
|
||||
* @return {@link ContractResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
@Override
|
||||
public ContractResp selectById(String contractId) {
|
||||
ContractListReq contractReq = new ContractListReq();
|
||||
contractReq.setContractId(contractId);
|
||||
|
||||
List<ContractResp> list = selectList(contractReq);
|
||||
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ContractResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增合同
|
||||
*
|
||||
* @param contractReq 合同
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
@Override
|
||||
public void saveData(ContractReq contractReq) {
|
||||
// todo 校验
|
||||
ContractEntity entity = BeanUtil.copyProperties(contractReq, ContractEntity.class);
|
||||
save(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:更新合同
|
||||
*
|
||||
* @param contractReq 合同
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
@Override
|
||||
public void updateData(ContractReq contractReq) {
|
||||
// todo 校验
|
||||
ContractEntity entity = BeanUtil.copyProperties(contractReq, ContractEntity.class);
|
||||
updateById(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:删除合同
|
||||
*
|
||||
* @param contractId 合同Id
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
**/
|
||||
@Override
|
||||
public void deleteById(String contractId) {
|
||||
// todo 校验
|
||||
removeById(contractId);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.dite.znpt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dite.znpt.domain.entity.ContractSettlementEntity;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementListReq;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementResp;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementReq;
|
||||
import com.dite.znpt.service.ContractSettlementService;
|
||||
import com.dite.znpt.mapper.ContractSettlementMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import com.dite.znpt.util.PageUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
* @Description: 合同结算表服务实现类
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ContractSettlementServiceImpl extends ServiceImpl<ContractSettlementMapper, ContractSettlementEntity> implements ContractSettlementService {
|
||||
|
||||
/**
|
||||
* 功能描述:查询合同结算列表
|
||||
*
|
||||
* @param contractSettlementReq 合同结算信息
|
||||
* @return {@link List }<{@link ContractSettlementResp }>
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
**/
|
||||
@Override
|
||||
public List<ContractSettlementResp> selectList(ContractSettlementListReq contractSettlementReq) {
|
||||
PageUtil.startPage();
|
||||
List<ContractSettlementResp> contractSettlementList= this.baseMapper.queryBySelective(contractSettlementReq);
|
||||
contractSettlementList.forEach(resp -> {
|
||||
|
||||
});
|
||||
return contractSettlementList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:查询单条合同结算
|
||||
*
|
||||
* @param settlementId 合同结算Id
|
||||
* @return {@link ContractSettlementResp }
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
**/
|
||||
@Override
|
||||
public ContractSettlementResp selectById(String settlementId) {
|
||||
ContractSettlementListReq contractSettlementReq = new ContractSettlementListReq();
|
||||
contractSettlementReq.setSettlementId(settlementId);
|
||||
|
||||
List<ContractSettlementResp> list = selectList(contractSettlementReq);
|
||||
return CollUtil.isNotEmpty(list) ? CollUtil.getFirst(list) : new ContractSettlementResp();
|
||||
}
|
||||
|
||||
/**
|
||||
* 功能描述:新增合同结算
|
||||
*
|
||||
* @param contractSettlementReq 合同结算
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:10
|
||||
**/
|
||||
@Override
|
||||
public void saveData(ContractSettlementReq contractSettlementReq) {
|
||||
// todo 校验
|
||||
ContractSettlementEntity entity = BeanUtil.copyProperties(contractSettlementReq, ContractSettlementEntity.class);
|
||||
save(entity);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
<?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="com.dite.znpt.mapper.ContractMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.contract_id, a.customer, a.code, a.project_id,
|
||||
a.salesperson_id, a.department_id, a.sign_date, a.duration,
|
||||
a.type, a.product_service, a.payment_date, a.payment_address,
|
||||
a.amount, a.account_number, a.notes, a.contract_status,
|
||||
a.create_time, a.create_by, a.update_time, a.update_by
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ContractResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
u.name as salespersonName, d.dept_name as salespersonDeptName,
|
||||
p.project_name, (select sum(cs.amount) from contract_settlement cs where a.contract_id=cs.contract_id) as settlementAmount
|
||||
from contract a
|
||||
left join user u on a.salesperson_id = u.user_id
|
||||
left join dept d on a.department_id=d.dept_id
|
||||
left join project p on a.project_id=p.project_id
|
||||
<where>
|
||||
<if test="contractId != null and contractId != ''">
|
||||
and a.contract_id like concat ('%', #{contractId}, '%')
|
||||
</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
and a.customer like concat ('%', #{customer}, '%')
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
and a.code like concat ('%', #{code}, '%')
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
</if>
|
||||
<if test="salespersonId != null and salespersonId != ''">
|
||||
and a.salesperson_id like concat ('%', #{salespersonId}, '%')
|
||||
</if>
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and a.department_id like concat ('%', #{departmentId}, '%')
|
||||
</if>
|
||||
<if test="signDate != null">
|
||||
and a.sign_date = #{signDate}
|
||||
</if>
|
||||
<if test="duration != null and duration != ''">
|
||||
and a.duration like concat ('%', #{duration}, '%')
|
||||
</if>
|
||||
<if test="type != null and type != ''">
|
||||
and a.type like concat ('%', #{type}, '%')
|
||||
</if>
|
||||
<if test="productService != null and productService != ''">
|
||||
and a.product_service like concat ('%', #{productService}, '%')
|
||||
</if>
|
||||
<if test="paymentDate != null">
|
||||
and a.payment_date = #{paymentDate}
|
||||
</if>
|
||||
<if test="paymentAddress != null and paymentAddress != ''">
|
||||
and a.payment_address like concat ('%', #{paymentAddress}, '%')
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
and a.amount = #{amount}
|
||||
</if>
|
||||
<if test="accountNumber != null and accountNumber != ''">
|
||||
and a.account_number like concat ('%', #{accountNumber}, '%')
|
||||
</if>
|
||||
<if test="notes != null">
|
||||
and a.notes = #{notes}
|
||||
</if>
|
||||
<if test="contractStatus != null and contractStatus != ''">
|
||||
and a.contract_status like concat ('%', #{contractStatus}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
<?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="com.dite.znpt.mapper.ContractSettlementMapper">
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
a.settlement_id, a.contract_id, a.customer, a.code,
|
||||
a.project_id, a.salesperson_id, a.department_id, a.payment_period,
|
||||
a.payment_date, a.duration, a.product_service, a.amount,
|
||||
a.account_number, a.notes, a.settlement_status, a.create_time,
|
||||
a.create_by, a.update_time, a.update_by
|
||||
</sql>
|
||||
|
||||
<select id="queryBySelective" resultType="com.dite.znpt.domain.vo.ContractSettlementResp">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from contract_settlement a
|
||||
<where>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
<!-- and (a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%') or a.TODO like concat('%', #{keyword,jdbcType=VARCHAR}, '%')) -->
|
||||
</if>
|
||||
<if test="settlementId != null and settlementId != ''">
|
||||
and a.settlement_id like concat ('%', #{settlementId}, '%')
|
||||
</if>
|
||||
<if test="contractId != null and contractId != ''">
|
||||
and a.contract_id like concat ('%', #{contractId}, '%')
|
||||
</if>
|
||||
<if test="customer != null and customer != ''">
|
||||
and a.customer like concat ('%', #{customer}, '%')
|
||||
</if>
|
||||
<if test="code != null and code != ''">
|
||||
and a.code like concat ('%', #{code}, '%')
|
||||
</if>
|
||||
<if test="projectId != null and projectId != ''">
|
||||
and a.project_id like concat ('%', #{projectId}, '%')
|
||||
</if>
|
||||
<if test="salespersonId != null and salespersonId != ''">
|
||||
and a.salesperson_id like concat ('%', #{salespersonId}, '%')
|
||||
</if>
|
||||
<if test="departmentId != null and departmentId != ''">
|
||||
and a.department_id like concat ('%', #{departmentId}, '%')
|
||||
</if>
|
||||
<if test="paymentPeriod != null">
|
||||
and a.payment_period = #{paymentPeriod}
|
||||
</if>
|
||||
<if test="paymentDate != null">
|
||||
and a.payment_date = #{paymentDate}
|
||||
</if>
|
||||
<if test="duration != null and duration != ''">
|
||||
and a.duration like concat ('%', #{duration}, '%')
|
||||
</if>
|
||||
<if test="productService != null and productService != ''">
|
||||
and a.product_service like concat ('%', #{productService}, '%')
|
||||
</if>
|
||||
<if test="amount != null">
|
||||
and a.amount = #{amount}
|
||||
</if>
|
||||
<if test="accountNumber != null and accountNumber != ''">
|
||||
and a.account_number like concat ('%', #{accountNumber}, '%')
|
||||
</if>
|
||||
<if test="notes != null">
|
||||
and a.notes = #{notes}
|
||||
</if>
|
||||
<if test="settlementStatus != null and settlementStatus != ''">
|
||||
and a.settlement_status like concat ('%', #{settlementStatus}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.ContractEntity;
|
||||
import com.dite.znpt.domain.vo.ContractListReq;
|
||||
import com.dite.znpt.domain.vo.ContractReq;
|
||||
import com.dite.znpt.domain.vo.ContractResp;
|
||||
import com.dite.znpt.service.ContractService;
|
||||
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 20:29
|
||||
*/
|
||||
@Api(tags = "合同")
|
||||
@RestController
|
||||
@RequestMapping("/contract")
|
||||
public class ContractController {
|
||||
@Resource
|
||||
private ContractService contractService;
|
||||
|
||||
@ApiOperation(value = "获取合同列表", httpMethod = "GET")
|
||||
@GetMapping("/list")
|
||||
public PageResult<ContractResp> list(ContractListReq contractReq) {
|
||||
return PageResult.ok(contractService.selectList(contractReq));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "根据合同Id获取详细信息", httpMethod = "GET")
|
||||
@GetMapping("/{contractId}")
|
||||
public Result<ContractResp> getInfo(@PathVariable String contractId) {
|
||||
return Result.ok(contractService.selectById(contractId));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增合同", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody ContractReq contractReq) {
|
||||
contractService.saveData(contractReq);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改合同", httpMethod = "PUT")
|
||||
@PutMapping
|
||||
public Result<Object> edit(@RequestBody ContractReq contractReq) {
|
||||
contractService.updateData(contractReq);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除合同", httpMethod = "DELETE")
|
||||
@DeleteMapping("/{contractId}")
|
||||
public Result<Object> remove(@PathVariable String contractId) {
|
||||
contractService.deleteById(contractId);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导出合同", httpMethod = "GET")
|
||||
@GetMapping("/export")
|
||||
@ResponseExcel(name = "合同")
|
||||
public List<ContractResp> export(ContractListReq contractReq) {
|
||||
return contractService.selectList(contractReq);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "导入合同", httpMethod = "POST")
|
||||
@PostMapping("/import")
|
||||
public Result<Object> importData(@RequestExcel List<ContractEntity> dataList, BindingResult bindingResult) {
|
||||
// JSR 303 校验通用校验获取失败的数据
|
||||
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
||||
if (errorMessageList != null && !errorMessageList.isEmpty()) {
|
||||
return Result.error(Constants.SERVICE_EXCEPTION, "导入失败");
|
||||
}
|
||||
return Result.okM("导入"+dataList.size()+"条数据");
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.dite.znpt.web.controller;
|
||||
|
||||
|
||||
import com.dite.znpt.constant.Constants;
|
||||
import com.dite.znpt.domain.PageResult;
|
||||
import com.dite.znpt.domain.Result;
|
||||
import com.dite.znpt.domain.entity.ContractSettlementEntity;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementListReq;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementReq;
|
||||
import com.dite.znpt.domain.vo.ContractSettlementResp;
|
||||
import com.dite.znpt.service.ContractSettlementService;
|
||||
import com.pig4cloud.plugin.excel.annotation.RequestExcel;
|
||||
import com.pig4cloud.plugin.excel.annotation.ResponseExcel;
|
||||
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author huise23
|
||||
* @date 2025/07/21 21:11
|
||||
*/
|
||||
@Api(tags = "合同结算")
|
||||
@RestController
|
||||
@RequestMapping("/contract-settlement")
|
||||
public class ContractSettlementController {
|
||||
@Resource
|
||||
private ContractSettlementService contractSettlementService;
|
||||
|
||||
@ApiOperation(value = "新增合同结算", httpMethod = "POST")
|
||||
@PostMapping
|
||||
public Result<Object> add(@RequestBody ContractSettlementReq contractSettlementReq) {
|
||||
contractSettlementService.saveData(contractSettlementReq);
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue