|
@@ -10,39 +10,43 @@ import (
|
|
|
|
|
|
//合同
|
|
|
type Contract struct {
|
|
|
- ContractId int `orm:"column(contract_id);pk"`
|
|
|
- ContractCode string `description:"合同编号,长度32位"`
|
|
|
- SellerId int `description:"所属销售id"`
|
|
|
- SellerName string `description:"所属销售名称"`
|
|
|
- ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
- ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议'"`
|
|
|
- Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废','已签回','已解约'"`
|
|
|
- StartDate time.Time `description:"合同开始日期"`
|
|
|
- EndDate time.Time `description:"合同结束日期"`
|
|
|
- OriginalPrice float64 `description:"合同原金额,优惠前的金额"`
|
|
|
- Price float64 `description:"实际金额,优惠后的金额"`
|
|
|
- PayRemark string `description:"付款方式说明,长度255位"`
|
|
|
- CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
- CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
- ProvinceId int `description:"省级id"`
|
|
|
- Province string `description:"省级名称,长度16位"`
|
|
|
- CityId int `description:"市级id"`
|
|
|
- City string `description:"市级名称,长度32位"`
|
|
|
- Address string `description:"详细地址"`
|
|
|
- Fax string `description:"传真,长度32位"`
|
|
|
- Phone string `description:"电话,长度32位"`
|
|
|
- Postcode string `description:"邮编,长度16位"`
|
|
|
- Remark string `description:"补充内容,长度255位"`
|
|
|
- ModifyContent string `description:"修改内容"`
|
|
|
- ApprovalRemark string `description:"审核备注"`
|
|
|
- FileUrl string `description:"合同文件地址"`
|
|
|
- CheckBackFileUrl string `description:"签回合同文件地址"`
|
|
|
- RescindFileUrl string `description:"解约合同文件地址"`
|
|
|
- TemplateId int `description:"模板id"`
|
|
|
- SourceId int `description:"来源合同id,默认是0;如果是通过其他合同复制过来的,那么就是原合同的id"`
|
|
|
- IsDelete int `description:"是否已经删除,0:未删除,1:已删除",json:"-"`
|
|
|
- ModifyTime time.Time `description:"合同最近一次修改时间"`
|
|
|
- CreateTime time.Time `description:"合同添加时间"`
|
|
|
+ ContractId int `orm:"column(contract_id);pk"`
|
|
|
+ ContractCode string `description:"合同编号,长度32位"`
|
|
|
+ SellerId int `description:"所属销售id"`
|
|
|
+ SellerName string `description:"所属销售名称"`
|
|
|
+ ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
+ ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议'"`
|
|
|
+ Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废','已签回','已解约'"`
|
|
|
+ StartDate time.Time `description:"合同开始日期"`
|
|
|
+ EndDate time.Time `description:"合同结束日期"`
|
|
|
+ OriginalPrice float64 `description:"合同原金额,优惠前的金额"`
|
|
|
+ Price float64 `description:"实际金额,优惠后的金额"`
|
|
|
+ PayRemark string `description:"付款方式说明,长度255位"`
|
|
|
+ CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
+ CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
+ ProvinceId int `description:"省级id"`
|
|
|
+ Province string `description:"省级名称,长度16位"`
|
|
|
+ CityId int `description:"市级id"`
|
|
|
+ City string `description:"市级名称,长度32位"`
|
|
|
+ Address string `description:"详细地址"`
|
|
|
+ Fax string `description:"传真,长度32位"`
|
|
|
+ Phone string `description:"电话,长度32位"`
|
|
|
+ Postcode string `description:"邮编,长度16位"`
|
|
|
+ Remark string `description:"补充内容,长度255位"`
|
|
|
+ ModifyContent string `description:"修改内容"`
|
|
|
+ ApprovalRemark string `description:"审核备注"`
|
|
|
+ FileUrl string `description:"合同文件地址"`
|
|
|
+ CheckBackFileUrl string `description:"签回合同文件地址"`
|
|
|
+ RescindFileUrl string `description:"解约合同文件地址"`
|
|
|
+ TemplateId int `description:"模板id"`
|
|
|
+ SourceId int `description:"来源合同id,默认是0;如果是通过其他合同复制过来的,那么就是原合同的id"`
|
|
|
+ IsDelete int `description:"是否已经删除,0:未删除,1:已删除",json:"-"`
|
|
|
+ ApproveTime time.Time `description:"审批时间"`
|
|
|
+ InvalidTime time.Time `description:"作废时间"`
|
|
|
+ CheckBackFileTime time.Time `description:"合同签回时间"`
|
|
|
+ RescindTime time.Time `description:"解约时间"`
|
|
|
+ ModifyTime time.Time `description:"合同最近一次修改时间"`
|
|
|
+ CreateTime time.Time `description:"合同添加时间"`
|
|
|
}
|
|
|
|
|
|
//更新合同基础信息
|
|
@@ -62,46 +66,54 @@ func GetContractById(contractId int) (contractInfo *Contract, err error) {
|
|
|
|
|
|
//合同详情信息(包含服务信息等)
|
|
|
type ContractDetail struct {
|
|
|
- ContractId int `description:"合同唯一id"`
|
|
|
- ContractCode string `description:"合同编号,长度32位"`
|
|
|
- SellerId int `description:"所属销售id"`
|
|
|
- SellerName string `description:"所属销售名称"`
|
|
|
- ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
- ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议'"`
|
|
|
- Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废','已解约'"`
|
|
|
- StartDate time.Time `description:"合同开始日期"`
|
|
|
- EndDate time.Time `description:"合同结束日期"`
|
|
|
- OriginalPrice float64 `description:"合同原金额,优惠前的金额"`
|
|
|
- Price float64 `description:"实际金额,优惠后的金额"`
|
|
|
- PayRemark string `description:"付款方式说明,长度255位"`
|
|
|
- CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
- CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
- ProvinceId int `description:"省级id"`
|
|
|
- Province string `description:"省级名称,长度16位"`
|
|
|
- CityId int `description:"市级id"`
|
|
|
- City string `description:"市级名称,长度32位"`
|
|
|
- Address string `description:"详细地址"`
|
|
|
- Fax string `description:"传真,长度32位"`
|
|
|
- Phone string `description:"电话,长度32位"`
|
|
|
- Postcode string `description:"邮编,长度16位"`
|
|
|
- Remark string `description:"补充内容,长度255位"`
|
|
|
- SellerRemark string `description:"销售备注,长度255位"`
|
|
|
- ModifyContent string `description:"修改内容"`
|
|
|
- ApprovalRemark string `description:"审核备注"`
|
|
|
- FileUrl string `description:"合同文件地址"`
|
|
|
- CheckBackFileUrl string `description:"签回合同文件地址"`
|
|
|
- RescindFileUrl string `description:"解约合同文件地址"`
|
|
|
- TemplateId int `description:"模板id"`
|
|
|
- SourceId int `description:"来源合同id,默认是0;如果是通过其他合同复制过来的,那么就是原合同的id"`
|
|
|
- IsDelete int `json:"-";description:"是否已经删除,0:未删除,1:已删除"`
|
|
|
- ModifyTime time.Time `description:"合同最近一次修改时间"`
|
|
|
- CreateTime time.Time `description:"合同添加时间"`
|
|
|
+ ContractId int `description:"合同唯一id"`
|
|
|
+ ContractCode string `description:"合同编号,长度32位"`
|
|
|
+ SellerId int `description:"所属销售id"`
|
|
|
+ SellerName string `description:"所属销售名称"`
|
|
|
+ ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
+ ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议'"`
|
|
|
+ Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废','已解约'"`
|
|
|
+ StartDate time.Time `description:"合同开始日期"`
|
|
|
+ EndDate time.Time `description:"合同结束日期"`
|
|
|
+ OriginalPrice float64 `description:"合同原金额,优惠前的金额"`
|
|
|
+ Price float64 `description:"实际金额,优惠后的金额"`
|
|
|
+ PayRemark string `description:"付款方式说明,长度255位"`
|
|
|
+ CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
+ CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
+ ProvinceId int `description:"省级id"`
|
|
|
+ Province string `description:"省级名称,长度16位"`
|
|
|
+ CityId int `description:"市级id"`
|
|
|
+ City string `description:"市级名称,长度32位"`
|
|
|
+ Address string `description:"详细地址"`
|
|
|
+ Fax string `description:"传真,长度32位"`
|
|
|
+ Phone string `description:"电话,长度32位"`
|
|
|
+ Postcode string `description:"邮编,长度16位"`
|
|
|
+ Remark string `description:"补充内容,长度255位"`
|
|
|
+ SellerRemark string `description:"销售备注,长度255位"`
|
|
|
+ ModifyContent string `description:"修改内容"`
|
|
|
+ ApprovalRemark string `description:"审核备注"`
|
|
|
+ FileUrl string `description:"合同文件地址"`
|
|
|
+ CheckBackFileUrl string `description:"签回合同文件地址"`
|
|
|
+ RescindFileUrl string `description:"解约合同文件地址"`
|
|
|
+ TemplateId int `description:"模板id"`
|
|
|
+ SourceId int `description:"来源合同id,默认是0;如果是通过其他合同复制过来的,那么就是原合同的id"`
|
|
|
+ IsDelete int `json:"-";description:"是否已经删除,0:未删除,1:已删除"`
|
|
|
+ ModifyTime time.Time `description:"合同最近一次修改时间"`
|
|
|
+ CreateTime time.Time `description:"合同添加时间"`
|
|
|
+ ApproveTime time.Time `description:"审批时间"`
|
|
|
+ InvalidTime time.Time `description:"作废时间"`
|
|
|
+ CheckBackFileTime time.Time `description:"合同签回时间"`
|
|
|
+ RescindTime time.Time `description:"解约时间"`
|
|
|
|
|
|
- StartDateStr string `description:"合同起始时间"`
|
|
|
- EndDateStr string `description:"合同结束时间"`
|
|
|
- ModifyTimeStr string `description:"最近一次更新时间"`
|
|
|
- CreateTimeStr string `description:"合同添加时间"`
|
|
|
- Service []*contract.ContractServiceAndDetail
|
|
|
+ StartDateStr string `description:"合同起始时间"`
|
|
|
+ EndDateStr string `description:"合同结束时间"`
|
|
|
+ ModifyTimeStr string `description:"最近一次更新时间"`
|
|
|
+ CreateTimeStr string `description:"合同添加时间"`
|
|
|
+ ApproveTimeStr string `description:"审批时间"`
|
|
|
+ InvalidTimeStr string `description:"作废时间"`
|
|
|
+ CheckBackFileTimeStr string `description:"合同签回时间"`
|
|
|
+ RescindTimeStr string `description:"解约时间"`
|
|
|
+ Service []*contract.ContractServiceAndDetail
|
|
|
}
|
|
|
|
|
|
//根据合同id获取合同详情信息
|
|
@@ -172,46 +184,54 @@ func AddContract(contractInfo *Contract, contractServiceAndDetailList []*contrac
|
|
|
}
|
|
|
|
|
|
type ContractList struct {
|
|
|
- ContractId int `description:"合同唯一id"`
|
|
|
- ContractCode string `description:"合同编号,长度32位"`
|
|
|
- SellerId int `description:"所属销售id"`
|
|
|
- SellerName string `description:"所属销售名称"`
|
|
|
- ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
- ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议'"`
|
|
|
- Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废'"`
|
|
|
- StartDate time.Time `json:"-";description:"合同开始日期"`
|
|
|
- EndDate time.Time `json:"-";description:"合同结束日期"`
|
|
|
- OriginalPrice float64 `description:"合同原金额,优惠前的金额"`
|
|
|
- Price float64 `description:"实际金额,优惠后的金额"`
|
|
|
- PayRemark string `description:"付款方式说明,长度255位"`
|
|
|
- CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
- UseCompanyName string `description:"使用方名称,长度32位"`
|
|
|
- CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
- ProvinceId int `description:"省级id"`
|
|
|
- Province string `description:"省级名称,长度16位"`
|
|
|
- CityId int `description:"市级id"`
|
|
|
- City string `description:"市级名称,长度32位"`
|
|
|
- Address string `description:"详细地址"`
|
|
|
- Fax string `description:"传真,长度32位"`
|
|
|
- Phone string `description:"电话,长度32位"`
|
|
|
- Postcode string `description:"邮编,长度16位"`
|
|
|
- Remark string `json:"-";description:"补充内容,长度255位"`
|
|
|
- SellerRemark string `description:"销售备注,长度255位"`
|
|
|
- ApprovalRemark string `description:"审核备注"`
|
|
|
- ModifyContent string `description:"修改内容"`
|
|
|
- FileUrl string `description:"合同文件地址"`
|
|
|
- CheckBackFileUrl string `description:"签回合同文件地址"`
|
|
|
- TemplateId int `description:"模板id"`
|
|
|
- SourceId int `description:"来源合同id,默认是0;如果是通过其他合同复制过来的,那么就是原合同的id"`
|
|
|
- IsDelete int `json:"-";description:"是否已经删除,0:未删除,1:已删除"`
|
|
|
- ModifyTime time.Time `json:"-";description:"合同最近一次修改时间"`
|
|
|
- CreateTime time.Time `json:"-";description:"合同添加时间"`
|
|
|
+ ContractId int `description:"合同唯一id"`
|
|
|
+ ContractCode string `description:"合同编号,长度32位"`
|
|
|
+ SellerId int `description:"所属销售id"`
|
|
|
+ SellerName string `description:"所属销售名称"`
|
|
|
+ ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
+ ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议'"`
|
|
|
+ Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废'"`
|
|
|
+ StartDate time.Time `json:"-";description:"合同开始日期"`
|
|
|
+ EndDate time.Time `json:"-";description:"合同结束日期"`
|
|
|
+ OriginalPrice float64 `description:"合同原金额,优惠前的金额"`
|
|
|
+ Price float64 `description:"实际金额,优惠后的金额"`
|
|
|
+ PayRemark string `description:"付款方式说明,长度255位"`
|
|
|
+ CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
+ UseCompanyName string `description:"使用方名称,长度32位"`
|
|
|
+ CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
+ ProvinceId int `description:"省级id"`
|
|
|
+ Province string `description:"省级名称,长度16位"`
|
|
|
+ CityId int `description:"市级id"`
|
|
|
+ City string `description:"市级名称,长度32位"`
|
|
|
+ Address string `description:"详细地址"`
|
|
|
+ Fax string `description:"传真,长度32位"`
|
|
|
+ Phone string `description:"电话,长度32位"`
|
|
|
+ Postcode string `description:"邮编,长度16位"`
|
|
|
+ Remark string `json:"-";description:"补充内容,长度255位"`
|
|
|
+ SellerRemark string `description:"销售备注,长度255位"`
|
|
|
+ ApprovalRemark string `description:"审核备注"`
|
|
|
+ ModifyContent string `description:"修改内容"`
|
|
|
+ FileUrl string `description:"合同文件地址"`
|
|
|
+ CheckBackFileUrl string `description:"签回合同文件地址"`
|
|
|
+ TemplateId int `description:"模板id"`
|
|
|
+ SourceId int `description:"来源合同id,默认是0;如果是通过其他合同复制过来的,那么就是原合同的id"`
|
|
|
+ IsDelete int `json:"-";description:"是否已经删除,0:未删除,1:已删除"`
|
|
|
+ ModifyTime time.Time `json:"-";description:"合同最近一次修改时间"`
|
|
|
+ CreateTime time.Time `json:"-";description:"合同添加时间"`
|
|
|
+ ApproveTime time.Time `description:"审批时间"`
|
|
|
+ InvalidTime time.Time `description:"作废时间"`
|
|
|
+ CheckBackFileTime time.Time `description:"合同签回时间"`
|
|
|
+ RescindTime time.Time `description:"解约时间"`
|
|
|
|
|
|
- StartDateStr string `description:"合同起始时间"`
|
|
|
- EndDateStr string `description:"合同结束时间"`
|
|
|
- ModifyTimeStr string `description:"最近一次更新时间"`
|
|
|
- CreateTimeStr string `description:"合同添加时间"`
|
|
|
- Service []*contract.ContractServiceAndDetail
|
|
|
+ StartDateStr string `description:"合同起始时间"`
|
|
|
+ EndDateStr string `description:"合同结束时间"`
|
|
|
+ ModifyTimeStr string `description:"最近一次更新时间"`
|
|
|
+ CreateTimeStr string `description:"合同添加时间"`
|
|
|
+ ApproveTimeStr string `description:"审批时间"`
|
|
|
+ InvalidTimeStr string `description:"作废时间"`
|
|
|
+ CheckBackFileTimeStr string `description:"合同签回时间"`
|
|
|
+ RescindTimeStr string `description:"解约时间"`
|
|
|
+ Service []*contract.ContractServiceAndDetail
|
|
|
}
|
|
|
|
|
|
//获取合同列表数据数量
|
|
@@ -345,8 +365,9 @@ func InvalidContract(contractInfo *Contract) (err error) {
|
|
|
|
|
|
contractInfo.Status = "已作废"
|
|
|
contractInfo.ModifyTime = time.Now()
|
|
|
+ contractInfo.InvalidTime = time.Now()
|
|
|
//合同数据入库
|
|
|
- _, err = o.Update(contractInfo, "Status", "ModifyTime")
|
|
|
+ _, err = o.Update(contractInfo, "Status", "ModifyTime", "InvalidTime")
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|