|
|
@@ -1,7 +1,6 @@
|
|
|
package oilsupplier
|
|
|
|
|
|
import (
|
|
|
- "bytes"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/supplier"
|
|
|
"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
|
|
|
"dashoo.cn/business/parameter"
|
|
|
@@ -356,13 +355,6 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
- buffer := bytes.NewBufferString("")
|
|
|
- for i := 0; i < len(list); i++ {
|
|
|
- buffer.WriteString(list[i].NeedFileType)
|
|
|
- buffer.WriteString(",")
|
|
|
- }
|
|
|
- hasField := buffer.String()
|
|
|
-
|
|
|
//三证合一或五证合一不需要的字段
|
|
|
mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
@@ -387,8 +379,15 @@ 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+",") {
|
|
|
- //已存在,不能重复添加
|
|
|
+
|
|
|
+ isRepeat := false
|
|
|
+ for j := 0; j < len(list); j++ {
|
|
|
+ if list[j].NeedFileType == needList[i].FileName{
|
|
|
+ isRepeat = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isRepeat == true {
|
|
|
continue
|
|
|
}
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|
|
|
@@ -451,12 +450,6 @@ func (this *OilSupplierCertSubController) AddTechBus() {
|
|
|
where := "SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
- var buffer bytes.Buffer
|
|
|
- for i := 0; i < len(list); i++ {
|
|
|
- buffer.WriteString(list[i].NeedFileType)
|
|
|
- buffer.WriteString(",")
|
|
|
- }
|
|
|
- hasField := buffer.String()
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
@@ -474,10 +467,18 @@ 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+",") {
|
|
|
- //已存在,不能重复添加
|
|
|
+
|
|
|
+ isRepeat := false
|
|
|
+ for j := 0; j < len(list); j++ {
|
|
|
+ if list[j].NeedFileType == needList[i].FileName{
|
|
|
+ isRepeat = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isRepeat == true {
|
|
|
continue
|
|
|
}
|
|
|
+
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|
|
|
}
|
|
|
|
|
|
@@ -541,12 +542,6 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
|
|
|
svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
|
|
|
|
|
|
- var buffer bytes.Buffer
|
|
|
- for i := 0; i < len(list); i++ {
|
|
|
- buffer.WriteString(list[i].NeedFileType)
|
|
|
- buffer.WriteString(",")
|
|
|
- }
|
|
|
- hasField := buffer.String()
|
|
|
//"营业执照,组织代码,组织机构代码证,税务登记证,税务登记,开户许可,银行开户许可证,承诺书,诚信合规承诺书,企业信息系统截图,战略合作协议扫描件,"
|
|
|
mustField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName")
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
@@ -564,8 +559,15 @@ 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+",") {
|
|
|
- //已存在,不能重复添加
|
|
|
+
|
|
|
+ isRepeat := false
|
|
|
+ for j := 0; j < len(list); j++ {
|
|
|
+ if list[j].NeedFileType == needList[i].FileName{
|
|
|
+ isRepeat = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if isRepeat == true {
|
|
|
continue
|
|
|
}
|
|
|
svc.InsertEntityBytbl(OilSupplierFileName, &entity)
|