瀏覽代碼

年审条件添加

huahaiyan 6 年之前
父節點
當前提交
c7fa2327a1
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

+ 4 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/annualaudit.go

@@ -287,7 +287,7 @@ func (this *AnnualAuditController) AddEntity() {
 	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
 	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
 	firstAudit := this.GetString("firstAudit")
 	firstAudit := this.GetString("firstAudit")
 	json.Unmarshal(jsonBlob, &model)
 	json.Unmarshal(jsonBlob, &model)
-	where := "SupplierId = " + utils.ToStr(model.SupplierId) + " and SupplierTypeName = " + model.SupplierTypeName + "and Status < 4"
+	where := "SupplierId = " + utils.ToStr(model.SupplierId) + " and SupplierTypeName = " + model.SupplierTypeName + "and Status < 5"
 	var auditentity []annualaudit.OilAnnualAudit
 	var auditentity []annualaudit.OilAnnualAudit
 	svc.GetEntitysByWhere(""+OilAnnualAuditName, where, &auditentity)
 	svc.GetEntitysByWhere(""+OilAnnualAuditName, where, &auditentity)
 	if len(auditentity) == 1 {
 	if len(auditentity) == 1 {
@@ -297,14 +297,13 @@ func (this *AnnualAuditController) AddEntity() {
 		this.ServeJSON()
 		this.ServeJSON()
 		return
 		return
 	}
 	}
-	supwhere := "a.Id = " + utils.ToStr(model.SupplierId) + " and b.SupplierTypeCode = " + model.SupplierTypeName
-	// + " and b.Status > 5"
+	supwhere := "a.Id = " + utils.ToStr(model.SupplierId) + " and b.SupplierTypeCode = " + model.SupplierTypeName+ " and b.Status = 8 "
 	supsvc := supplier.GetOilSupplierService(utils.DBE)
 	supsvc := supplier.GetOilSupplierService(utils.DBE)
 	var list []supplier.OilSupplierView
 	var list []supplier.OilSupplierView
 	total := supsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 1, "a.Id", true, &list, supwhere)
 	total := supsvc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 1, 1, "a.Id", true, &list, supwhere)
 	if total == 0 {
 	if total == 0 {
-		errinfo.Message = "请先提交准入申请再提交年审!"
-		//errinfo.Message = "请先提交准入,准入申请通过后,才可申请年审!"
+		//errinfo.Message = "请先提交准入申请再提交年审!"
+		errinfo.Message = "请先提交准入,准入申请通过后,才可申请年审!"
 		errinfo.Code = -1
 		errinfo.Code = -1
 		this.Data["json"] = &errinfo
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 		this.ServeJSON()