yuedefeng пре 6 година
родитељ
комит
5fc01c1730

+ 10 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -1,6 +1,7 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"encoding/json"
 	//"fmt"
 	"strconv"
@@ -308,8 +309,11 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
 	var jsonblob = this.Ctx.Input.RequestBody
 	var datamain suppliercertsub.OilSupplierCertSub
 	var dataother suppliercertsub.SupplierCertSubModel
+	var supplierCertModel suppliercert.OilSupplierCert
 	json.Unmarshal(jsonblob, &datamain)
 	json.Unmarshal(jsonblob, &dataother)
+	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
+	svcCert.GetEntityById(datamain.SupplierCertId, &supplierCertModel)
 
 	var errinfo ErrorDataInfo
 	for n := 0; ; n++ {
@@ -338,6 +342,11 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
 
 			filesvc := supplierfile.GetSupplierfileService(utils.DBE)
 			needList := filesvc.GetGoodsNeedFileList(dataother.CheckList[n].Id)
+			if supplierCertModel.InStyle == "4" {
+				var needFile supplierfile.FileList
+				needFile.FileName = "战略合作协议扫描件"
+				needList = append(needList, needFile)
+			}
 
 			var list []supplierfile.OilSupplierFile
 			where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
@@ -346,7 +355,7 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
 			for i := 0; i < len(list); i++ {
 				hasField += list[i].NeedFileType + ","
 			}
-			mustField := "营业执照,组织代码,税务登记,开户许可,银行开户许可证,承诺书,企业信息系统截图,"
+			mustField := "营业执照,组织代码,税务登记,开户许可,银行开户许可证,承诺书,企业信息系统截图,战略合作协议扫描件,"
 			for i := 0; i < len(needList); i++ {
 				var entity supplierfile.OilSupplierFile
 				entity.SupplierId = dataother.SupplierId

+ 0 - 13
src/dashoo.cn/backend/api/controllers/oilsupplier/supplierfile.go

@@ -125,19 +125,6 @@ func (this *SupplierfileController) EditSubfile() {
 	var list []supplierfile.OilSupplierFile
 	where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
 	svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
-	hasField := ""
-	for i := 0; i < len(list); i++ {
-		hasField += list[i].NeedFileType + ","
-	}
-
-	if strings.Contains(hasField, model.NeedFileType+",") {
-		//已存在,不能重复添加
-		errinfo.Message = "操作失败!不能重复添加"
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-		return
-	}
 
 	var entity supplierfile.OilSupplierFile
 	model.FileUrl = strings.Trim(model.FileUrl, "$")