Przeglądaj źródła

Merge branch 'develop' of http://code.dashoo.cn/dashoo/supplier_system into develop

baichengfei 4 lat temu
rodzic
commit
46486517df

+ 1 - 1
src/dashoo.cn/backend/api/business/oilsupplier/basisbuild/oilbasisbuildService.go

@@ -181,7 +181,7 @@ func (s *OilBasisBuildService) GetPagingTmpCheckedEntities(entitiesPtr interface
 			min(sub.SubClassId) as MinClassId,
 		CONCAT(
 		   if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F01) is null) or (max(goods.F01) = ''), '', '营业执照,')  , 
-		   if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), '', '企业信用信息截屏,') ,
+		   if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), '', '国家企业信用信息公示系统截屏,') ,
 		   if((max(goods.F03)='1' AND LOCATE('F03',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F03) is null) or (max(goods.F03) = ''), '', '诚信合规承诺书,') ,
 		   if((max(goods.F04)='1' AND LOCATE('F04',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F04) is null) or (max(goods.F04) = ''), '', '银行开户许可证或基本存款账户信息,') ,
 		   if((max(goods.F05)='1' AND LOCATE('F05',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F05) is null) or (max(goods.F05) = ''), '', '建筑业企业资质证书,') ,

+ 1 - 1
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -375,7 +375,7 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(entitiesPtr interf
 			COUNT(goods.GoodsLevel > sub.GoodsLevel or null) AS TwoOneCount,
 		CONCAT(
 		   if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F01) is null) or (max(goods.F01) = ''), '', '营业执照,')  , 
-		   if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), '', '企业信用信息截屏,') ,
+		   if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), '', '国家企业信用信息公示系统截屏,') ,
 		   if((max(goods.F03)='1' AND LOCATE('F03',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F03) is null) or (max(goods.F03) = ''), '', '诚信合规承诺书,') ,
 		   if((max(goods.F04)='1' AND LOCATE('F04',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F04) is null) or (max(goods.F04) = ''), '', '银行开户许可证或基本存款账户信息,') ,
 		   if((max(goods.F05)='1' AND LOCATE('F05',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F05) is null) or (max(goods.F05) = ''), '', '质量管理体系认证证书,') ,

+ 6 - 3
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfileService.go

@@ -51,7 +51,8 @@ func (s *SupplierfileService) GetGoodsNeedFileList(classid string,IsManuf ...str
 		for _, header := range headerList {
 			curCertConfig := reflect.ValueOf(entity)
 			setValue := curCertConfig.FieldByName(header.Code).String()
-			if setValue != "" && setValue != "0" {
+			//if setValue != "" && setValue != "0" {
+			if setValue == "1" {
 				if search != "" {
 					if header.IsManuf == search || header.IsManuf == "0" {
 						needList = append(needList, FileList{FileName: header.Name})
@@ -77,7 +78,8 @@ func (s *SupplierfileService) GetBasicNeedFileList(classid string) (needList []F
 	for _, header := range headerList {
 		curCertConfig := reflect.ValueOf(entity)
 		setValue := curCertConfig.FieldByName(header.Code).String()
-		if setValue != "" && setValue != "0" {
+		//if setValue != "" && setValue != "0" {
+		if setValue == "1"  {
 			needList = append(needList, FileList{FileName: header.Name})
 		}
 	}
@@ -96,7 +98,8 @@ func (s *SupplierfileService) GetTechNeedFileList(classid string) (needList []Fi
 	for _, header := range headerList {
 		curCertConfig := reflect.ValueOf(entity)
 		setValue := curCertConfig.FieldByName(header.Code).String()
-		if setValue != "" && setValue != "0" {
+		//if setValue != "" && setValue != "0" {
+		if setValue == "1" {
 			needList = append(needList, FileList{FileName: header.Name})
 		}
 	}

+ 1 - 1
src/dashoo.cn/backend/api/business/oilsupplier/technologyservice/oiltechnologyserviceService.go

@@ -202,7 +202,7 @@ func (s *OilTechnologyServiceService) GetPagingTmpCheckedEntities(entitiesPtr in
 			min(sub.SubClassId) as MinClassId,
 		CONCAT(
 		   if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F01) is null) or (max(goods.F01) = ''), '', '营业执照,')  , 
-		   if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), '', '企业信用信息截屏,') ,
+		   if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), '', '国家企业信用信息公示系统截屏,') ,
 		   if((max(goods.F03)='1' AND LOCATE('F03',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F03) is null) or (max(goods.F03) = ''), '', '诚信合规承诺书,') ,
 		   if((max(goods.F04)='1' AND LOCATE('F04',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F04) is null) or (max(goods.F04) = ''), '', '银行开户许可证或基本存款账户信息,') ,
 		   if((max(goods.F05)='1' AND LOCATE('F05',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F05) is null) or (max(goods.F05) = ''), '', '质量管理体系认证证书,') ,

+ 1 - 1
src/dashoo.cn/backend/api/business/tmpzcgf/tmpzcgfSession.go

@@ -670,7 +670,7 @@ func (s *TmpzcgtSession) UpdateSupplierFileSId() error {
 }
 
 func (s *TmpzcgtSession) UpdateSupplierFile() error {
-	sql := "update OilSupplierFile set SupplierTypeCode = '000',IsManuf = '0' where NeedFileType in ('银行开户许可证或基本存款账户信息','营业执照','诚信合规承诺书','企业信用信息截屏','税务登记证','组织机构代码证') "
+	sql := "update OilSupplierFile set SupplierTypeCode = '000',IsManuf = '0' where NeedFileType in ('银行开户许可证或基本存款账户信息','营业执照','诚信合规承诺书','国家企业信用信息公示系统截屏','税务登记证','组织机构代码证') "
 	_, err := s.DBE.Query(sql)
 	return err
 }

+ 4 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -2813,6 +2813,8 @@ func (this *OilGoodsAptitudeController) OilCompare() {
 
 	timeUnixNano := strconv.FormatInt(int64(time.Now().UnixNano()), 10)
 	_dir := utils.Cfg.MustValue("file", "tmplateDir") + "xlsx"
+	//60.30.245.229 替换成23
+	url = strings.Replace(url, "60.30.245.229", "10.76.248.23", -1)
 	utils.DownloadFile(url, timeUnixNano+".xlsx", _dir)
 	filePath := utils.Cfg.MustValue("file", "tmplateDir") + "xlsx/" + timeUnixNano + ".xlsx"
 	xlFile, err := xlsx.OpenFile(filePath)
@@ -2832,6 +2834,7 @@ func (this *OilGoodsAptitudeController) OilCompare() {
 	var CompanyName string
 
 	for i := 2; i < len(sheet.Rows); i++ {
+		fmt.Printf("开始循环")
 		if inputcode != "" && inputcode != sheet.Rows[i].Cells[0].Value {
 			continue
 		}
@@ -2840,6 +2843,7 @@ func (this *OilGoodsAptitudeController) OilCompare() {
 		}
 		var List []supplier.OilSupplier
 		CompanyName = sheet.Rows[i].Cells[4].Value
+		fmt.Printf("CompanyName: %s\n", CompanyName)
 		where := "SupplierName = '" + CompanyName + "'"
 		svc.GetEntitysByWhere(OilSupplierName, where, &List)
 

+ 112 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -1715,7 +1715,22 @@ func (this *OilSupplierController) UpdateEntity() {
 	var cert suppliercert.OilSupplierCert
 	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)
@@ -2577,3 +2592,99 @@ func (this *OilSupplierController) CheckSupplierFile() {
 	this.Data["json"] = &errinfo
 	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 ""
+}

+ 1 - 1
src/dashoo.cn/doc/老数据导入前.sql

@@ -26,7 +26,7 @@ UPDATE `T_不良行为记录` SET `日期`='20150215' WHERE `日期`='201560215'
 DELETE from `T_供方资料_V2014` WHERE `类别` is null;
 DELETE from `T_供方资料_V2014` WHERE `类别` = '';
 UPDATE `T_供方资料_V2014` set `类别` = '银行开户许可证或基本存款账户信息' WHERE `类别` = '开户行许可证' or `类别` = '银行开户许可'  or `类别` = '银行开户许可证'  or `类别` = '开户许可证';
-UPDATE `T_供方资料_V2014` set `类别` = '企业信用信息截屏' WHERE `类别` = '企业信用信息系统截屏';
+UPDATE `T_供方资料_V2014` set `类别` = '国家企业信用信息公示系统截屏' WHERE `类别` = '企业信用信息系统截屏';
 UPDATE `T_供方资料_V2014` set `类别` = '诚信合规承诺书' WHERE `类别` = '承诺书';
 UPDATE `T_供方资料_V2014` SET 有效期至=REPLACE(`有效期至`, '/', '-'), 有效期至=REPLACE(`有效期至`, '年', '-'), 有效期至=REPLACE(`有效期至`, '月', '-'), 有效期至=REPLACE(`有效期至`, '日', ''), 日期=REPLACE(`日期`, '/', '-'), 日期=REPLACE(`日期`, '年', '-'), 日期=REPLACE(`日期`, '月', '-'), 日期=REPLACE(`日期`, '日', '');
 UPDATE `T_供方资料_V2014` SET 有效期至 = concat(有效期至, '-01') where (length(有效期至) = 6 or length(有效期至) = 7) and 有效期至 not like '%-';

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/basisedit.vue

@@ -42,7 +42,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveEntity">保存基本信息
+                <el-button type="primary" size="mini" @click="saveEntity" :loading="saveLoading">保存基本信息
                 </el-button>
               </span>
             </div>
@@ -450,6 +450,7 @@
           WorkflowId: ''
         },
         add_flat: true,
+        saveLoading: false,
         entrydetail: {
           process: 'oil_supplier_apply_1',
           business: '',
@@ -813,6 +814,7 @@
           this.formData.SetupTime = new Date(this.formData.SetupTime)
         }
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+        this.saveLoading = true
         if (!this.formData.Id || !this.certId) {
           this.addEntity()
         } else {
@@ -844,6 +846,7 @@
               message: res.data.message
             })
           }
+          this.saveLoading = false
         }).catch(err => {
           console.error(err)
         })
@@ -864,6 +867,7 @@
               message: res.data.message
             })
           }
+          this.saveLoading = false
         }).catch(err => {
           console.error(err)
         })

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/goodsedit.vue

@@ -28,7 +28,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveEntity">保存基本信息
+                <el-button type="primary" size="mini" @click="saveEntity" :loading="saveLoading">保存基本信息
                 </el-button>
               </span>
             </div>
@@ -450,6 +450,7 @@
           Status: 0
         },
         add_flat: true,
+        saveLoading: false,
         newadd_flat: true,
         entrydetail: {
           process: 'oil_supplier_apply_1',
@@ -823,6 +824,7 @@
           this.formData.SetupTime = new Date(this.formData.SetupTime)
         }
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+        this.saveLoading = true
         if (!this.formData.Id || !this.certId) {
           this.addEntity()
         } else {
@@ -854,6 +856,7 @@
               message: res.data.message
             })
           }
+          this.saveLoading = false
         }).catch(err => {
           console.error(err)
         })
@@ -874,6 +877,7 @@
               message: res.data.message
             })
           }
+          this.saveLoading = false
         }).catch(err => {
           console.error(err)
         })

+ 5 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/techedit.vue

@@ -39,7 +39,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveEntity">保存基本信息
+                <el-button type="primary" size="mini" @click="saveEntity" :loading="saveLoading">保存基本信息
                 </el-button>
               </span>
             </div>
@@ -453,6 +453,7 @@
           WorkflowId: ''
         },
         add_flat: true,
+        saveLoading: false,
         newadd_flat: true,
         entrydetail: {
           process: 'oil_supplier_apply_1',
@@ -808,6 +809,7 @@
           this.formData.SetupTime = new Date(this.formData.SetupTime)
         }
         // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+        this.saveLoading = true
         if (!this.formData.Id || !this.certId) {
           this.addEntity()
         } else {
@@ -839,6 +841,7 @@
               message: res.data.message
             })
           }
+          this.saveLoading = false
         }).catch(err => {
           console.error(err)
         })
@@ -859,6 +862,7 @@
               message: res.data.message
             })
           }
+          this.saveLoading = false
         }).catch(err => {
           console.error(err)
         })