|
@@ -1715,7 +1715,22 @@ func (this *OilSupplierController) UpdateEntity() {
|
|
|
var cert suppliercert.OilSupplierCert
|
|
var cert suppliercert.OilSupplierCert
|
|
|
svc1.GetEntityByWhere(OilSupplierCertName, "SupplierId = "+id+" and SupplierTypeCode='"+typeCode+"'", &cert)
|
|
svc1.GetEntityByWhere(OilSupplierCertName, "SupplierId = "+id+" and SupplierTypeCode='"+typeCode+"'", &cert)
|
|
|
//对资质的检查
|
|
//对资质的检查
|
|
|
- svc1.IsSupplierCertCanSubmit(string(model.Id), string(cert.Id))
|
|
|
|
|
|
|
+ //svc1.IsSupplierCertCanSubmit(strconv.Itoa(model.Id), strconv.Itoa(cert.Id))
|
|
|
|
|
+ type1 := 0
|
|
|
|
|
+ if model.OperType == "制造商" {
|
|
|
|
|
+ type1 = 1
|
|
|
|
|
+ }
|
|
|
|
|
+ if model.OperType == "代理商" || model.OperType == "贸易商" {
|
|
|
|
|
+ type1 = 2
|
|
|
|
|
+ }
|
|
|
|
|
+ result := this.CheckSupplierFileNew(model.Id, type1, instyle, "3", "")
|
|
|
|
|
+ if result != "" {
|
|
|
|
|
+ errinfo.Message = "修改失败!" + result
|
|
|
|
|
+ errinfo.Code = -1
|
|
|
|
|
+ this.Data["json"] = &errinfo
|
|
|
|
|
+ this.ServeJSON()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
//判断基本信息是否可修改
|
|
//判断基本信息是否可修改
|
|
|
updateCols := svc.GetUpdateCols(OilSupplierCertName, typeCode, model.Id)
|
|
updateCols := svc.GetUpdateCols(OilSupplierCertName, typeCode, model.Id)
|
|
@@ -2577,3 +2592,99 @@ func (this *OilSupplierController) CheckSupplierFile() {
|
|
|
this.Data["json"] = &errinfo
|
|
this.Data["json"] = &errinfo
|
|
|
this.ServeJSON()
|
|
this.ServeJSON()
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// 准入/增项/年审/信息变更保存检查资质方法
|
|
|
|
|
+func (this *OilSupplierController) CheckSupplierFileNew(supplierId int,type1 int,inStyle string, grade string, table string) string{
|
|
|
|
|
+ //获取主表信息
|
|
|
|
|
+ var supplierEntity supplier.OilSupplier
|
|
|
|
|
+ supplierService := supplier.GetOilSupplierService(utils.DBE)
|
|
|
|
|
+ supplierService.GetEntityById(supplierId, &supplierEntity)
|
|
|
|
|
+ //获取准入信息表
|
|
|
|
|
+ var supplierCertEntity []suppliercert.OilSupplierCert
|
|
|
|
|
+ supplierService.GetEntitysByWhere("OilSupplierCert", "SupplierId = " + strconv.Itoa(supplierId), &supplierCertEntity)
|
|
|
|
|
+ for _,cert := range supplierCertEntity {
|
|
|
|
|
+ //对准入范围的判断
|
|
|
|
|
+ var certSubList []suppliercertsub.OilSupplierCertSub
|
|
|
|
|
+ certsubService := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
|
|
|
|
|
+ certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
|
|
|
|
|
+
|
|
|
|
|
+ // 查询出已有哪些资质
|
|
|
|
|
+ var tableheaderList []qualchange.OilQualChangeDetail1
|
|
|
|
|
+ fileSql := "SELECT * from OilSupplierFile WHERE SupplierId = " + strconv.Itoa(supplierId)
|
|
|
|
|
+ svcHeader := tableheader.GetTableHeaderService(utils.DBE)
|
|
|
|
|
+ svcHeader.DBE.SQL(fileSql).Find(&tableheaderList)
|
|
|
|
|
+ var companyHasHeaders string
|
|
|
|
|
+ for _, tableheader := range tableheaderList {
|
|
|
|
|
+ companyHasHeaders += tableheader.NeedFileType + ","
|
|
|
|
|
+ }
|
|
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
|
|
+ filesvc := supplierfile.GetSupplierfileService(utils.DBE)
|
|
|
|
|
+ mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
|
|
|
|
|
+ for _, certSubItem := range certSubList {
|
|
|
|
|
+ if certSubItem.GoodsLevel == supplier.GOODS_LEVEL_1 && grade == supplier.GOODS_LEVEL_2{
|
|
|
|
|
+ return "二级供应商不能准入一级物资!"
|
|
|
|
|
+ }
|
|
|
|
|
+ var needList []supplierfile.FileList
|
|
|
|
|
+ //需要的资质
|
|
|
|
|
+ if cert.SupplierTypeCode == "01" {
|
|
|
|
|
+ if certSubItem.IsManufacturer == 1 && type1 == 2{
|
|
|
|
|
+ return "非制造商准入范围不能为制造商,请手动修改!"
|
|
|
|
|
+ }
|
|
|
|
|
+ needList = filesvc.GetGoodsNeedFileList(strconv.Itoa(certSubItem.SubClassId), strconv.Itoa(type1))
|
|
|
|
|
+ } else if cert.SupplierTypeCode == "02" {
|
|
|
|
|
+ needList = filesvc.GetBasicNeedFileList(strconv.Itoa(certSubItem.SubClassId))
|
|
|
|
|
+ } else if cert.SupplierTypeCode == "03" {
|
|
|
|
|
+ needList = filesvc.GetTechNeedFileList(strconv.Itoa(certSubItem.SubClassId))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if type1 == 1 { //制造商
|
|
|
|
|
+ var needFile supplierfile.FileList
|
|
|
|
|
+ // 质量管理体系认证证书
|
|
|
|
|
+ CNPCrenkezhengshu := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CNPCrenkezhengshu")
|
|
|
|
|
+ needFile.FileName = CNPCrenkezhengshu
|
|
|
|
|
+ needList = append(needList, needFile)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if inStyle == "4" {
|
|
|
|
|
+ var needFile supplierfile.FileList
|
|
|
|
|
+ //战略合作协议扫描件
|
|
|
|
|
+ needFile.FileName = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "CooperationFile")
|
|
|
|
|
+ needList = append(needList, needFile)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if inStyle == "6" {
|
|
|
|
|
+ var needFile supplierfile.FileList
|
|
|
|
|
+ //招标准入需提供招标中标结果
|
|
|
|
|
+ needFile.FileName = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "TheTender")
|
|
|
|
|
+ needList = append(needList, needFile)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ for _, needHeader := range needList {
|
|
|
|
|
+ if ( supplierEntity.CredentialFlag == "1" || supplierEntity.CredentialFlag == "2") &&
|
|
|
|
|
+ strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
|
|
|
|
|
+ //三证合一或五证合一的证件,不需要验证了
|
|
|
|
|
+ continue
|
|
|
|
|
+ }
|
|
|
|
|
+ var fileist1 supplierfile.OilSupplierFile
|
|
|
|
|
+ where1 := " SupplierId = '" + strconv.Itoa(supplierId) + "' and NeedFileType = '" + needHeader.FileName + "'"
|
|
|
|
|
+ filesvc.GetEntityByWhere("OilSupplierFile", where1, &fileist1)
|
|
|
|
|
+
|
|
|
|
|
+ if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
|
|
|
|
|
+ return "请上传" + needHeader.FileName
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if table != "" {
|
|
|
|
|
+ var filelist2 suppliercertappendsub.OilAppendChangeDetail
|
|
|
|
|
+ where2 := " SupplierId = '" + strconv.Itoa(supplierId) + "' and NeedFileType = '" +needHeader.FileName + "'"
|
|
|
|
|
+ svc2 := suppliercertappendsub.GetOilSupplierCertAppendSubService (utils.DBE)
|
|
|
|
|
+ svc2.GetEntityByWhere(table, where2, &filelist2)
|
|
|
|
|
+ if filelist2.FileName == "" && fileist1.FileName == "" {
|
|
|
|
|
+ //缺少的资质
|
|
|
|
|
+ return "请上传" + needHeader.FileName
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return ""
|
|
|
|
|
+}
|