|
@@ -9,30 +9,32 @@ import (
|
|
|
|
|
|
//Seal 用印结构体
|
|
|
type Seal struct {
|
|
|
- SealId int `orm:"column(seal_id);pk"`
|
|
|
- Code string `description:"用印编号,长度32位"`
|
|
|
- UserId int `description:"申请人id"`
|
|
|
- UserName string `description:"申请人名称"`
|
|
|
- Use string `description:"用印用途,枚举值:'销售合同', '渠道合同', '付款通知函', '招投标', '战略合作协议';默认:销售合同"`
|
|
|
- CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
- UseCompanyName string `description:"实际使用方客户名称,长度32位"`
|
|
|
- CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
- ServiceType string `description:"业务类型,枚举值:'新签合同','续约合同','补充协议';默认:新签合同"`
|
|
|
- SealType string `description:"加盖印章类型,枚举值:'合同章', '公章', '法人章';默认:合同章"`
|
|
|
- Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废'"`
|
|
|
- Remark string `description:"补充内容,长度255位"`
|
|
|
- ApprovalRemark string `description:"审核备注"`
|
|
|
- FileUrl string `description:"文件附件地址"`
|
|
|
- FileNum int `description:"文件附件份数"`
|
|
|
- ContractId int `description:"系统合同id"`
|
|
|
- IsDelete int `json:"-" description:"是否已经删除,0:未删除,1:已删除"`
|
|
|
- ApproveTime time.Time `description:"审批时间"`
|
|
|
- InvalidTime time.Time `description:"作废时间"`
|
|
|
- ModifyTime time.Time `description:"最近一次修改时间"`
|
|
|
- CreateTime time.Time `description:"添加时间"`
|
|
|
+ SealId int `orm:"column(seal_id);pk"`
|
|
|
+ Code string `description:"用印编号,长度32位"`
|
|
|
+ UserId int `description:"申请人id"`
|
|
|
+ UserName string `description:"申请人名称"`
|
|
|
+ Use string `description:"用印用途,枚举值:'销售合同', '渠道合同', '付款通知函', '招投标', '战略合作协议';默认:销售合同"`
|
|
|
+ CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
+ UseCompanyName string `description:"实际使用方客户名称,长度32位"`
|
|
|
+ CreditCode string `description:"社会统一信用代码,长度64位"`
|
|
|
+ ServiceType string `description:"业务类型,枚举值:'新签合同','续约合同','补充协议';默认:新签合同"`
|
|
|
+ SealType string `description:"加盖印章类型,枚举值:'合同章', '公章', '法人章';默认:合同章"`
|
|
|
+ Status string `description:"合同状态,枚举值:'待提交','待审批','已撤回','已审批','已驳回','已作废','已签回'"`
|
|
|
+ Remark string `description:"补充内容,长度255位"`
|
|
|
+ ApprovalRemark string `description:"审核备注"`
|
|
|
+ FileUrl string `description:"文件附件地址"`
|
|
|
+ CheckBackFileUrl string `description:"已签回的文件地址"`
|
|
|
+ FileNum int `description:"文件附件份数"`
|
|
|
+ ContractId int `description:"系统合同id"`
|
|
|
+ IsDelete int `json:"-" description:"是否已经删除,0:未删除,1:已删除"`
|
|
|
+ ApproveTime time.Time `description:"审批时间"`
|
|
|
+ InvalidTime time.Time `description:"作废时间"`
|
|
|
+ ModifyTime time.Time `description:"最近一次修改时间"`
|
|
|
+ CreateTime time.Time `description:"添加时间"`
|
|
|
+ CheckBackFileTime time.Time `description:"签回用印附件时间"`
|
|
|
}
|
|
|
|
|
|
-//GetSealInfoById 根据合同id获取合同信息
|
|
|
+//GetSealInfoById 根据用印id获取合同信息
|
|
|
func GetSealInfoById(sealId int) (sealInfo *Seal, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
sql := `select * from seal where seal_id = ? `
|
|
@@ -40,6 +42,14 @@ func GetSealInfoById(sealId int) (sealInfo *Seal, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+//GetSealInfoByContractId 根据合同id获取合同信息
|
|
|
+func GetSealInfoByContractId(sealId int) (sealInfo *Seal, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := `select * from seal where contract_id = ? and status in ("已审批","已签回") order by seal_id asc limit 1`
|
|
|
+ err = o.Raw(sql, sealId).QueryRow(&sealInfo)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
//AddSeal 用印添加
|
|
|
func AddSeal(sealInfo *Seal) (err error) {
|
|
|
o := orm.NewOrm()
|