|
|
@@ -2755,7 +2755,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
|
|
|
svc2.GetEntityByWhere("OilQualChangeDetail", where2, &filelist2)
|
|
|
|
|
|
if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
|
|
|
- errinfo.Message = "请上传!" + needHeader.FileName + "!"
|
|
|
+ errinfo.Message = "请上传!" + needHeader.FileName + "! 详情请点击检查资质按钮查看!"
|
|
|
errinfo.Code = 0
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
@@ -2763,7 +2763,7 @@ func (this *OilSupplierController) CheckSupplierFile() {
|
|
|
} else {
|
|
|
if filelist2.FileName == "" && fileist1.FileName == "" {
|
|
|
//缺少的资质
|
|
|
- errinfo.Message = "请上传!" + needHeader.FileName + "!"
|
|
|
+ errinfo.Message = "请上传!" + needHeader.FileName + "! 详情请点击检查资质按钮查看!"
|
|
|
errinfo.Code = 0
|
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
|
@@ -3146,8 +3146,9 @@ func (this *OilSupplierController) CheckSupplierFileList() {
|
|
|
supplierService := supplier.GetOilSupplierService(utils.DBE)
|
|
|
supplierService.GetEntityById(file.SupplierId, &supplierEntity)
|
|
|
//获取准入信息表
|
|
|
- var cert suppliercert.OilSupplierCert
|
|
|
- supplierService.GetEntityByWhere("OilSupplierCert", "Id = "+file.CertId, &cert)
|
|
|
+ var certList []suppliercert.OilSupplierCert
|
|
|
+ supplierService.GetEntitysByWhere("OilSupplierCert", "SupplierId = "+strconv.Itoa(file.SupplierId), &certList)
|
|
|
+ certsubService := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
|
|
|
// 查询出已有哪些资质
|
|
|
var tableheaderList []qualchange.OilQualChangeDetail1
|
|
|
@@ -3162,128 +3163,136 @@ func (this *OilSupplierController) CheckSupplierFileList() {
|
|
|
filesvc := supplierfile.GetSupplierfileService(utils.DBE)
|
|
|
mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
|
|
|
|
|
|
- var certSubList2 suppliercertsub.OilSupplierCertSub
|
|
|
- certSubList2.LackFile = ""
|
|
|
- certSubList2.IsQuestion = 0
|
|
|
- svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+file.CertId)
|
|
|
+ for _,cert := range certList {
|
|
|
+ if file.CertId != "0" && strconv.Itoa(cert.Id) != file.CertId {
|
|
|
+ continue
|
|
|
+ }
|
|
|
|
|
|
- //对准入范围的判断
|
|
|
- var certSubList []suppliercertsub.OilSupplierCertSub
|
|
|
- certsubService := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
- certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
|
|
|
- idString := ""
|
|
|
- idString1 := ""
|
|
|
- for i := 0; i < len(certSubList); i = i + 1000 {
|
|
|
- var ids suppliercertsub.Ids
|
|
|
- certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
|
|
|
- if ids.Id != "" {
|
|
|
- idString += "," + ids.Id
|
|
|
- } else {
|
|
|
- break
|
|
|
+ var certSubList2 suppliercertsub.OilSupplierCertSub
|
|
|
+ certSubList2.LackFile = ""
|
|
|
+ certSubList2.IsQuestion = 0
|
|
|
+ svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+strconv.Itoa(cert.Id))
|
|
|
+
|
|
|
+ //对准入范围的判断
|
|
|
+ var certSubList []suppliercertsub.OilSupplierCertSub
|
|
|
+ certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
|
|
|
+ idString := ""
|
|
|
+ idString1 := ""
|
|
|
+ for i := 0; i < len(certSubList); i = i + 1000 {
|
|
|
+ var ids suppliercertsub.Ids
|
|
|
+ certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
|
|
|
+ if ids.Id != "" {
|
|
|
+ idString += "," + ids.Id
|
|
|
+ } else {
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- var needList []supplierfile.FileList
|
|
|
- var needList1 []supplierfile.FileList
|
|
|
+ var needList []supplierfile.FileList
|
|
|
+ var needList1 []supplierfile.FileList
|
|
|
|
|
|
- if cert.SupplierTypeCode == "01" {
|
|
|
- //需要的资质
|
|
|
- needList1 = filesvc.GetGoodsNeedFileListNew(idString, "2")
|
|
|
- if file.Type == 1 { //制造商
|
|
|
- //如果是制造商,准入范围按照各项准入范围的类型判断
|
|
|
- // 制造
|
|
|
- idString = ""
|
|
|
- for i := 0; i < len(certSubList); i = i + 1000 {
|
|
|
- var ids suppliercertsub.Ids
|
|
|
- certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
|
|
|
- if ids.Id != "" {
|
|
|
- idString += "," + ids.Id
|
|
|
- } else {
|
|
|
- break
|
|
|
+ if cert.SupplierTypeCode == "01" {
|
|
|
+ //需要的资质
|
|
|
+ needList1 = filesvc.GetGoodsNeedFileListNew(idString, "2")
|
|
|
+ if file.Type == 1 { //制造商
|
|
|
+ //如果是制造商,准入范围按照各项准入范围的类型判断
|
|
|
+ // 制造
|
|
|
+ idString = ""
|
|
|
+ for i := 0; i < len(certSubList); i = i + 1000 {
|
|
|
+ var ids suppliercertsub.Ids
|
|
|
+ certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
|
|
|
+ if ids.Id != "" {
|
|
|
+ idString += "," + ids.Id
|
|
|
+ } else {
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- // 非制造
|
|
|
- for i := 0; i < len(certSubList); i = i + 1000 {
|
|
|
- var ids1 suppliercertsub.Ids
|
|
|
- certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
|
|
|
- if ids1.Id != "" {
|
|
|
- idString1 += "," + ids1.Id
|
|
|
- } else {
|
|
|
- break
|
|
|
+ // 非制造
|
|
|
+ for i := 0; i < len(certSubList); i = i + 1000 {
|
|
|
+ var ids1 suppliercertsub.Ids
|
|
|
+ certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
|
|
|
+ if ids1.Id != "" {
|
|
|
+ idString1 += "," + ids1.Id
|
|
|
+ } else {
|
|
|
+ break
|
|
|
+ }
|
|
|
}
|
|
|
+ needList = filesvc.GetGoodsNeedFileListNew(idString, "1")
|
|
|
+ needList1 = filesvc.GetGoodsNeedFileListNew(idString1, "2")
|
|
|
}
|
|
|
- needList = filesvc.GetGoodsNeedFileListNew(idString, "1")
|
|
|
- needList1 = filesvc.GetGoodsNeedFileListNew(idString1, "2")
|
|
|
- }
|
|
|
- } else if cert.SupplierTypeCode == "02" {
|
|
|
- needList = filesvc.GetBasicNeedFileListNew(idString)
|
|
|
- } else if cert.SupplierTypeCode == "03" {
|
|
|
- needList = filesvc.GetTechNeedFileListNew(idString)
|
|
|
- }
|
|
|
-
|
|
|
- for _, needHeader := range needList {
|
|
|
- if (supplierEntity.CredentialFlag == "1" || supplierEntity.CredentialFlag == "2") &&
|
|
|
- strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
|
|
|
- //三证合一或五证合一的证件,不需要验证了
|
|
|
- continue
|
|
|
+ } else if cert.SupplierTypeCode == "02" {
|
|
|
+ needList = filesvc.GetBasicNeedFileListNew(idString)
|
|
|
+ } else if cert.SupplierTypeCode == "03" {
|
|
|
+ needList = filesvc.GetTechNeedFileListNew(idString)
|
|
|
}
|
|
|
|
|
|
- if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
|
|
|
- var header tableheader.BaseTableheader
|
|
|
- where1 := "Name = '" + needHeader.FileName + "' and CategoryCode = '" + cert.SupplierTypeCode + "'"
|
|
|
- if cert.SupplierTypeCode == "01" {
|
|
|
- where1 += " and IsManuf != '2'"
|
|
|
+ for _, needHeader := range needList {
|
|
|
+ if (supplierEntity.CredentialFlag == "1" || supplierEntity.CredentialFlag == "2") &&
|
|
|
+ strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
|
|
|
+ //三证合一或五证合一的证件,不需要验证了
|
|
|
+ continue
|
|
|
}
|
|
|
- supplierService.GetEntityByWhere(BaseTableHeader, where1, &header)
|
|
|
- if header.Code != "" {
|
|
|
- where2 := header.Code + " = '1'"
|
|
|
- where2 += " and a.SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and a.SupplierTypeCode = '" + cert.SupplierTypeCode + "'"
|
|
|
|
|
|
- var certSub []suppliercertsub.OilSupplierCertSub
|
|
|
+ if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
|
|
|
+ var header tableheader.BaseTableheader
|
|
|
+ where1 := "Name = '" + needHeader.FileName + "' and CategoryCode = '" + cert.SupplierTypeCode + "'"
|
|
|
if cert.SupplierTypeCode == "01" {
|
|
|
- where2 += " and IsManufacturer != 2"
|
|
|
- supplierService.GetDeleteSub2(OilGoodsAptitudeName, where2, &certSub, header.Name)
|
|
|
- } else if cert.SupplierTypeCode == "02" {
|
|
|
- supplierService.GetDeleteSub2(OilBasisBuildName, where2, &certSub, header.Name)
|
|
|
+ where1 += " and IsManuf != '2'"
|
|
|
+ }
|
|
|
+ supplierService.GetEntityByWhere(BaseTableHeader, where1, &header)
|
|
|
+ if header.Code != "" {
|
|
|
+ where2 := header.Code + " = '1'"
|
|
|
+ where2 += " and a.SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and a.SupplierTypeCode = '" + cert.SupplierTypeCode + "'"
|
|
|
+
|
|
|
+ var certSub []suppliercertsub.OilSupplierCertSub
|
|
|
+ if cert.SupplierTypeCode == "01" {
|
|
|
+ where2 += " and IsManufacturer != 2"
|
|
|
+ supplierService.GetDeleteSub2(OilGoodsAptitudeName, where2, &certSub, header.Name)
|
|
|
+ } else if cert.SupplierTypeCode == "02" {
|
|
|
+ supplierService.GetDeleteSub2(OilBasisBuildName, where2, &certSub, header.Name)
|
|
|
+ } else {
|
|
|
+ supplierService.GetDeleteSub2(OilTechnologyServiceName, where2, &certSub, header.Name)
|
|
|
+ }
|
|
|
} else {
|
|
|
- supplierService.GetDeleteSub2(OilTechnologyServiceName, where2, &certSub, header.Name)
|
|
|
+ fmt.Print("22222")
|
|
|
}
|
|
|
- } else {
|
|
|
- fmt.Print("22222")
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- for _, needHeader := range needList1 {
|
|
|
- // 非制造
|
|
|
- if (supplierEntity.CredentialFlag == "1" || supplierEntity.CredentialFlag == "2") &&
|
|
|
- strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
|
|
|
- //三证合一或五证合一的证件,不需要验证了
|
|
|
- continue
|
|
|
- }
|
|
|
-
|
|
|
- if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
|
|
|
- var header tableheader.BaseTableheader
|
|
|
- where1 := "Name = '" + needHeader.FileName + "' and CategoryCode = '" + cert.SupplierTypeCode + "'"
|
|
|
- if cert.SupplierTypeCode == "01" {
|
|
|
- where1 += " and IsManuf != '1'"
|
|
|
+ for _, needHeader := range needList1 {
|
|
|
+ // 非制造
|
|
|
+ if (supplierEntity.CredentialFlag == "1" || supplierEntity.CredentialFlag == "2") &&
|
|
|
+ strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
|
|
|
+ //三证合一或五证合一的证件,不需要验证了
|
|
|
+ continue
|
|
|
}
|
|
|
- supplierService.GetEntityByWhere(BaseTableHeader, where1, &header)
|
|
|
- if header.Code != "" {
|
|
|
- where2 := header.Code + " = '1'"
|
|
|
- where2 += " and a.SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and a.SupplierTypeCode = '" + cert.SupplierTypeCode + "'"
|
|
|
- var certSub []suppliercertsub.OilSupplierCertSub
|
|
|
- if file.Type == 1 {
|
|
|
- where2 += " and IsManufacturer = 2"
|
|
|
+
|
|
|
+ if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
|
|
|
+ var header tableheader.BaseTableheader
|
|
|
+ where1 := "Name = '" + needHeader.FileName + "' and CategoryCode = '" + cert.SupplierTypeCode + "'"
|
|
|
+ if cert.SupplierTypeCode == "01" {
|
|
|
+ where1 += " and IsManuf != '1'"
|
|
|
+ }
|
|
|
+ supplierService.GetEntityByWhere(BaseTableHeader, where1, &header)
|
|
|
+ if header.Code != "" {
|
|
|
+ where2 := header.Code + " = '1'"
|
|
|
+ where2 += " and a.SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and a.SupplierTypeCode = '" + cert.SupplierTypeCode + "'"
|
|
|
+ var certSub []suppliercertsub.OilSupplierCertSub
|
|
|
+ if file.Type == 1 {
|
|
|
+ where2 += " and IsManufacturer = 2"
|
|
|
+ }
|
|
|
+ supplierService.GetDeleteSub2(OilGoodsAptitudeName, where2, &certSub, header.Name)
|
|
|
+ } else {
|
|
|
+ fmt.Print("22222")
|
|
|
}
|
|
|
- supplierService.GetDeleteSub2(OilGoodsAptitudeName, where2, &certSub, header.Name)
|
|
|
- } else {
|
|
|
- fmt.Print("22222")
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- var certSubList1 []suppliercertsub.OilSupplierCertSub
|
|
|
- total := certsubService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size, "Id", true, &certSubList1, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+file.CertId)
|
|
|
|
|
|
+ }
|
|
|
+ var certSubList1 []suppliercertsub.OilSupplierCertSub
|
|
|
+ total := certsubService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size, "Id", true, &certSubList1, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id))
|
|
|
+ if file.CertId != "0" {
|
|
|
+ total = certsubService.GetPagingEntitiesWithOrderBytbl("", file.CurrentPage, file.Size, "Id", true, &certSubList1, "IsQuestion = 2 and SupplierId = "+strconv.Itoa(supplierEntity.Id)+" and SupplierCertId = "+file.CertId)
|
|
|
+ }
|
|
|
var datainfo DataInfo
|
|
|
datainfo.CurrentItemCount = total
|
|
|
datainfo.PageIndex = file.CurrentPage
|