|
|
@@ -219,7 +219,6 @@ func (this *OilSupplierCertAppendController) AddAppend() {
|
|
|
paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
sAddLimitMonth, _ := strconv.Atoi(paramSvc.GetBaseparameterMessage("GFGL1", "paramset", "sAddLimitMonth"))
|
|
|
fmt.Println(modeltmp[0].AuditDate)
|
|
|
-
|
|
|
ApplyDate, _ := time.Parse("2006-01-02", modeltmp[0].ApplyDate.AddDate(0, sAddLimitMonth, 0).Format("2006-01-02"))
|
|
|
nowtime, _ := time.Parse("2006-01-02", time.Now().Format("2006-01-02"))
|
|
|
fmt.Println(ApplyDate, nowtime)
|
|
|
@@ -232,6 +231,28 @@ func (this *OilSupplierCertAppendController) AddAppend() {
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
+ style, _ :=strconv.Atoi(modeltmp[0].InStyle)
|
|
|
+ if style != 6 {
|
|
|
+ id :=strconv.Itoa(modeltmp[0].SupplierId)
|
|
|
+ sqlCount := "select count(*) from OilSupplierCertAppend where SupplierId=" + id + " AND YEAR(CreateOn)=YEAR(NOW())"
|
|
|
+ var countRes, _ = svc.DBE.Query(sqlCount)
|
|
|
+ if len(countRes) > 0 {
|
|
|
+ results := countRes[0]
|
|
|
+ var count int64
|
|
|
+ for _, value := range results {
|
|
|
+ count, _ = strconv.ParseInt(string(value), 10, 64)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ if count >= 2 {
|
|
|
+ errinfo.Message = "除招标准入外,增项申请每年只能申请2次!"
|
|
|
+ errinfo.Code = -1
|
|
|
+ errinfo.Info = model.Id
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
svc.GetEntityByWhere(OilSupplierCertName, where, &cermodel)
|
|
|
|