|
@@ -34,10 +34,6 @@ type Seal struct {
|
|
|
CreateTime time.Time `description:"添加时间"`
|
|
|
CheckBackFileTime time.Time `description:"签回用印附件时间"`
|
|
|
AffiliatedCompany string `description:"归属公司"`
|
|
|
- ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
- CompanyId int `description:"客户id"`
|
|
|
- StartDate string `description:"开始日期"`
|
|
|
- EndDate string `description:"结束日期"`
|
|
|
}
|
|
|
|
|
|
var EnumUse = []string{"销售合同", "渠道合同", "付款通知函", "招投标", "战略合作协议", "代付合同", "总对总协议"}
|
|
@@ -130,21 +126,6 @@ func GetSealCode() (code string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetSealCodeRai 生成权益合同编号
|
|
|
-func GetSealCodeRai() (code string, err error) {
|
|
|
- var num int
|
|
|
- o := orm.NewOrm()
|
|
|
- today := utils.GetToday(utils.FormatDate)
|
|
|
- sql := `SELECT COUNT(1) AS num FROM seal where create_time>=?`
|
|
|
- err = o.Raw(sql, today).QueryRow(&num)
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- code = "HZEQ" + time.Now().Format("20060102") + fmt.Sprintf("%03d", num)
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
type CompanyNameList struct {
|
|
|
CompanyName string `description:"客户名称,甲方名称,长度32位"`
|
|
|
}
|
|
@@ -194,25 +175,25 @@ func GetList(condition string, pars []interface{}, startSize, pageSize int) (lis
|
|
|
}
|
|
|
|
|
|
type SealApprovalItem struct {
|
|
|
- ContractApprovalId int `description:"审批单ID"`
|
|
|
- ContractId int `description:"合同ID"`
|
|
|
- ContractApprovalRecordId int `description:"审批流ID"`
|
|
|
- Code string `description:"合同编号"`
|
|
|
- Use string `description:"用印用途,枚举值:'销售合同','渠道合同','付款通知函','招投标','战略合作协议'"`
|
|
|
- ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议','代付合同'"`
|
|
|
- Status string `description:"合同状态,枚举值:待审批','已审批','已驳回','已撤回','已签回',默认待审批"`
|
|
|
- ApproveStatus string `json:"-" description:"审批单状态,枚举值:待审批','已审批','已驳回','已撤回',默认待审批"`
|
|
|
- ApplyContent string `description:"申请内容"`
|
|
|
- ApplyUserId int `description:"申请人ID"`
|
|
|
- ApplyUserName string `description:"申请人名称"`
|
|
|
- ContractDetail string `json:"-" description:"提交审批时的合同信息;用印快照"`
|
|
|
- ContractInfo contract.ContractDetail `json:"-" description:"提交审批时的合同信息;用印快照"`
|
|
|
- ApproveRemark string `description:"审核备注"`
|
|
|
- SealType string `description:"用印类型"`
|
|
|
- CompanyName string `description:"客户名称"`
|
|
|
- FileUrl string `description:"合同下载地址"`
|
|
|
- CurrNodeId int `description:"当前审批节点id"`
|
|
|
- StartNodeId int `description:"开始审批节点id"`
|
|
|
+ ContractApprovalId int `description:"审批单ID"`
|
|
|
+ ContractId int `description:"合同ID"`
|
|
|
+ ContractApprovalRecordId int `description:"审批流ID"`
|
|
|
+ //ContractCode string `description:"合同编号"`
|
|
|
+ Use string `description:"用印用途,枚举值:'销售合同','渠道合同','付款通知函','招投标','战略合作协议'"`
|
|
|
+ ContractType string `description:"合同类型,枚举值:'新签合同','续约合同','补充协议','代付合同'"`
|
|
|
+ Status string `description:"合同状态,枚举值:待审批','已审批','已驳回','已撤回','已签回',默认待审批"`
|
|
|
+ ApproveStatus string `json:"-" description:"审批单状态,枚举值:待审批','已审批','已驳回','已撤回',默认待审批"`
|
|
|
+ ApplyContent string `description:"申请内容"`
|
|
|
+ ApplyUserId int `description:"申请人ID"`
|
|
|
+ ApplyUserName string `description:"申请人名称"`
|
|
|
+ ContractDetail string `json:"-" description:"提交审批时的合同信息;用印快照"`
|
|
|
+ ContractInfo contract.ContractDetail `json:"-" description:"提交审批时的合同信息;用印快照"`
|
|
|
+ ApproveRemark string `description:"审核备注"`
|
|
|
+ SealType string `description:"用印类型"`
|
|
|
+ CompanyName string `description:"客户名称"`
|
|
|
+ FileUrl string `description:"合同下载地址"`
|
|
|
+ CurrNodeId int `description:"当前审批节点id"`
|
|
|
+ StartNodeId int `description:"开始审批节点id"`
|
|
|
//UserId int `description:"申请人id"`
|
|
|
//UserName string `description:"申请人名称"`
|
|
|
SealId int `description:"用印审批ID"`
|
|
@@ -230,14 +211,13 @@ type SealApprovalItem struct {
|
|
|
CheckBackFileTimeStr string `description:"签回用印附件时间(字符串)"`
|
|
|
ContractCode string `description:"合同编码"`
|
|
|
AffiliatedCompany string `description:"归属公司"`
|
|
|
- ProductId int `description:"产品id,1:ficc;2:权益"`
|
|
|
}
|
|
|
|
|
|
// GetSealApprovalListByWhere 获取用印审批列表-分页
|
|
|
func GetSealApprovalListByWhere(condition, joinCondition string, pars []interface{}, startSize, pageSize int) (list []*SealApprovalItem, total int, err error) {
|
|
|
o := orm.NewOrm()
|
|
|
fields := `a.contract_approval_id,c.contract_id,a.apply_content,a.approve_remark,a.apply_user_id,a.apply_user_name,a.curr_node_id,a.start_node_id,c.create_time,a.modify_time,a.status approval_status,
|
|
|
- c.status,c.seal_id,c.seal_type,c.service_type contract_type,c.use,c.company_name,c.file_url,c.approve_time,c.invalid_time,c.code,c.credit_code,c.check_back_file_time,c.check_back_file_url,c.product_id,c.affiliated_company `
|
|
|
+ c.status,c.seal_id,c.seal_type,c.service_type contract_type,c.use,c.company_name,c.file_url,c.approve_time,c.invalid_time,c.code,c.credit_code,c.check_back_file_time,c.check_back_file_url,c.affiliated_company `
|
|
|
sql := `SELECT ` + fields + ` from contract_approval a JOIN ( SELECT max( contract_approval_id ) max_id,contract_id FROM contract_approval where 1=1 and approval_type = "seal" `
|
|
|
sql += ` GROUP BY contract_id ) b on a.contract_approval_id=b.max_id
|
|
|
JOIN seal c ON c.seal_id = a.contract_id
|