|
|
@@ -368,6 +368,16 @@ func (this *OilSupplierCertSubController) AddGoodsBus() {
|
|
|
if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
|
|
|
continue
|
|
|
}
|
|
|
+ //加入对应表OilSupplierCert2File
|
|
|
+ var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
|
|
|
+ cert2File.SupplierId = dataother.SupplierId
|
|
|
+ cert2File.SupplierCertId = dataother.SupplierCertId
|
|
|
+ cert2File.SupplierTypeCode = dataother.SupplierTypeCode
|
|
|
+ cert2File.SubClassId, _ = utils.StrTo(dataother.CheckList[n].Id).Int()
|
|
|
+ cert2File.Code = dataother.CheckList[n].Code
|
|
|
+ cert2File.Name = dataother.CheckList[n].Name
|
|
|
+ cert2File.NeedFileType = needList[i].FileName
|
|
|
+ svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
|
|
|
|
|
|
if strings.Contains(mustField, needList[i].FileName+",") {
|
|
|
entity.SupplierTypeCode = "000"
|
|
|
@@ -467,7 +477,16 @@ func (this *OilSupplierCertSubController) AddTechBus() {
|
|
|
if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
|
|
|
continue
|
|
|
}
|
|
|
-
|
|
|
+ //加入对应表OilSupplierCert2File
|
|
|
+ var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
|
|
|
+ cert2File.SupplierId = dataother.SupplierId
|
|
|
+ cert2File.SupplierCertId = dataother.SupplierCertId
|
|
|
+ cert2File.SupplierTypeCode = dataother.SupplierTypeCode
|
|
|
+ cert2File.SubClassId= dataother.CheckList[n].Id
|
|
|
+ cert2File.Code = dataother.CheckList[n].Code
|
|
|
+ cert2File.Name = dataother.CheckList[n].Name
|
|
|
+ cert2File.NeedFileType = needList[i].FileName
|
|
|
+ svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
|
|
|
if strings.Contains(mustField, needList[i].FileName+",") {
|
|
|
entity.SupplierTypeCode = "000"
|
|
|
} else {
|
|
|
@@ -567,7 +586,16 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
for i := 0; i < len(needList); i++ {
|
|
|
var entity supplierfile.OilSupplierFile
|
|
|
entity.SupplierId = model.SupplierId
|
|
|
-
|
|
|
+ //加入对应表OilSupplierCert2File
|
|
|
+ var cert2File suppliercertsub.OilSupplierCert2File //创建结构体
|
|
|
+ cert2File.SupplierId = model.SupplierId
|
|
|
+ cert2File.SupplierCertId = model.SupplierCertId
|
|
|
+ cert2File.SupplierTypeCode = model.SupplierTypeCode
|
|
|
+ cert2File.SubClassId= model.SubClassId
|
|
|
+ cert2File.Code = model.Code
|
|
|
+ cert2File.Name = model.Name
|
|
|
+ cert2File.NeedFileType = needList[i].FileName
|
|
|
+ svc.InsertEntityBytbl(OilSupplierCert2FileName, &cert2File)
|
|
|
if (supplierModel.CredentialFlag == "1" || supplierModel.CredentialFlag == "2") && strings.Contains(mergerCertSkipField, needList[i].FileName+",") { //三证合一或五证合一了
|
|
|
continue
|
|
|
}
|
|
|
@@ -649,8 +677,15 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
}
|
|
|
subClassId := datamain.SubClassId //4.拿到结构体中的准入范围SubClassId
|
|
|
//根据SubClassId查出此准入范围所拥有的资质名称
|
|
|
- var needList []supplierfile.FileList //定义存储所拥有资质名称的数组
|
|
|
- needList = filesvc.GetGoodsNeedFileList(strconv.Itoa(subClassId)) //通过准入范围Id获得资质名称并填充数组
|
|
|
+ var needList []supplierfile.FileList //定义存储所拥有资质名称的数组
|
|
|
+ if datamain.SupplierTypeCode == "01" {
|
|
|
+ needList = filesvc.GetGoodsNeedFileList(strconv.Itoa(subClassId)) //通过准入范围Id获得资质名称并填充数组
|
|
|
+ } else if datamain.SupplierTypeCode == "02" {
|
|
|
+ needList = filesvc.GetBasicNeedFileList(subClassId)
|
|
|
+ } else {
|
|
|
+ needList = filesvc.GetTechNeedFileList(subClassId)
|
|
|
+ }
|
|
|
+
|
|
|
var mustField string
|
|
|
mustField = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName") //必需的资质
|
|
|
|
|
|
@@ -674,6 +709,19 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
}
|
|
|
+ where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SubClassId=" + strconv.Itoa(subClassId)
|
|
|
+ err1 := svc.DeleteEntityBytbl(OilSupplierCert2FileName, where)
|
|
|
+ if err1 == nil {
|
|
|
+ errinfo.Message = "删除成功"
|
|
|
+ errinfo.Code = 0
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ } else {
|
|
|
+ errinfo.Message = "删除失败!" + utils.AlertProcess(err1.Error())
|
|
|
+ errinfo.Code = -1
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
+ this.ServeJSON()
|
|
|
+ }
|
|
|
where = " Id= " + Id
|
|
|
err2 := svc.DeleteEntityBytbl(OilSupplierCertSubName, where) //删除OilSupplierCertSub单条准入范围
|
|
|
if err2 == nil {
|