|
|
@@ -1,6 +1,7 @@
|
|
|
package oilsupplier
|
|
|
|
|
|
import (
|
|
|
+ "bytes"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplier"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
"dashoo.cn/business/parameter"
|
|
|
@@ -354,14 +355,19 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
var list []supplierfile.OilSupplierFile
|
|
|
where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
- /*hasField := ""
|
|
|
+
|
|
|
+ buffer := bytes.NewBufferString("")
|
|
|
for i := 0; i < len(list); i++ {
|
|
|
- hasField += list[i].NeedFileType + ","
|
|
|
- }*/
|
|
|
+ buffer.WriteString(list[i].NeedFileType)
|
|
|
+ buffer.WriteString(",")
|
|
|
+ }
|
|
|
+ hasField := buffer.String()
|
|
|
+
|
|
|
//三证合一或五证合一不需要的字段
|
|
|
mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
|
|
|
+
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
var entity supplierfile.OilSupplierFile
|
|
|
entity.SupplierId = dataother.SupplierId
|
|
|
@@ -381,21 +387,10 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
entity.CreateBy = this.User.Realname
|
|
|
entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
entity.SupType = 1
|
|
|
- /*if strings.Contains(hasField, needList[i].FileName+",") {
|
|
|
+ if strings.Contains(hasField, needList[i].FileName+",") {
|
|
|
//已存在,不能重复添加
|
|
|
continue
|
|
|
- }*/
|
|
|
- isRepeat := false
|
|
|
- for idx := 0; idx < len(list); idx++ {
|
|
|
- if list[idx].NeedFileType == needList[i].FileName {
|
|
|
- isRepeat = true
|
|
|
- break
|
|
|
- }
|
|
|
}
|
|
|
- if isRepeat == true {
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|
|
|
}
|
|
|
|
|
|
@@ -455,10 +450,13 @@ func (this *OilSupplierCertSubController) AddTechBus() {
|
|
|
var list []supplierfile.OilSupplierFile
|
|
|
where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
- /*hasField := ""
|
|
|
+
|
|
|
+ var buffer bytes.Buffer
|
|
|
for i := 0; i < len(list); i++ {
|
|
|
- hasField += list[i].NeedFileType + ","
|
|
|
- }*/
|
|
|
+ buffer.WriteString(list[i].NeedFileType)
|
|
|
+ buffer.WriteString(",")
|
|
|
+ }
|
|
|
+ hasField := buffer.String()
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
@@ -476,19 +474,9 @@ func (this *OilSupplierCertSubController) AddTechBus() {
|
|
|
entity.CreateBy = this.User.Realname
|
|
|
entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
entity.SupType = 1
|
|
|
- /*if strings.Contains(hasField, needList[i].FileName+",") {
|
|
|
+ if strings.Contains(hasField, needList[i].FileName+",") {
|
|
|
//已存在,不能重复添加
|
|
|
continue
|
|
|
- }*/
|
|
|
- isRepeat := false
|
|
|
- for idx := 0; idx < len(list); idx++ {
|
|
|
- if list[idx].NeedFileType == needList[i].FileName {
|
|
|
- isRepeat = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if isRepeat == true {
|
|
|
- continue
|
|
|
}
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|
|
|
}
|
|
|
@@ -553,10 +541,12 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
- /*hasField := ""
|
|
|
+ var buffer bytes.Buffer
|
|
|
for i := 0; i < len(list); i++ {
|
|
|
- hasField += list[i].NeedFileType + ","
|
|
|
- }*/
|
|
|
+ buffer.WriteString(list[i].NeedFileType)
|
|
|
+ buffer.WriteString(",")
|
|
|
+ }
|
|
|
+ hasField := buffer.String()
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
@@ -574,19 +564,9 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
entity.CreateBy = this.User.Realname
|
|
|
entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
|
|
|
entity.SupType = 1
|
|
|
- /*if strings.Contains(hasField, needList[i].FileName+",") {
|
|
|
+ if strings.Contains(hasField, needList[i].FileName+",") {
|
|
|
//已存在,不能重复添加
|
|
|
continue
|
|
|
- }*/
|
|
|
- isRepeat := false
|
|
|
- for idx := 0; idx < len(list); idx++ {
|
|
|
- if list[idx].NeedFileType == needList[i].FileName {
|
|
|
- isRepeat = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- if isRepeat == true {
|
|
|
- continue
|
|
|
}
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|
|
|
}
|