|
@@ -130,6 +130,7 @@ func UpdateSealCompanyContractId(companyContractId, sealId int) (err error) {
|
|
|
// GetSealCode 生成合同编号
|
|
|
func GetSealCode() (code string, err error) {
|
|
|
var num int
|
|
|
+ var num2 int
|
|
|
o := orm.NewOrm()
|
|
|
today := utils.GetToday(utils.FormatDate)
|
|
|
sql := `SELECT COUNT(1) AS num FROM seal where create_time>=?`
|
|
@@ -138,6 +139,10 @@ func GetSealCode() (code string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ sql = `SELECT COUNT(1) AS num FROM contract where create_time>=?` // 把正式合同的部分也算上
|
|
|
+ err = o.Raw(sql, today).QueryRow(&num2)
|
|
|
+ num += num2
|
|
|
+
|
|
|
code = "HZ" + time.Now().Format("20060102") + fmt.Sprintf("%03d", num)
|
|
|
return
|
|
|
}
|
|
@@ -145,6 +150,7 @@ func GetSealCode() (code string, err error) {
|
|
|
// GetSealCodeRai 生成权益合同编号1
|
|
|
func GetSealCodeRai() (code string, err error) {
|
|
|
var num int
|
|
|
+ var num2 int
|
|
|
o := orm.NewOrm()
|
|
|
today := utils.GetToday(utils.FormatDate)
|
|
|
sql := `SELECT COUNT(1) AS num FROM seal where create_time>=?`
|
|
@@ -153,6 +159,10 @@ func GetSealCodeRai() (code string, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ sql = `SELECT COUNT(1) AS num FROM contract where create_time>=?` // 把正式合同的部分也算上
|
|
|
+ err = o.Raw(sql, today).QueryRow(&num2)
|
|
|
+ num += num2
|
|
|
+
|
|
|
code = "HZEQ" + time.Now().Format("20060102") + fmt.Sprintf("%03d", num)
|
|
|
return
|
|
|
}
|