Преглед изворни кода

前后:导入单个公司;360浏览器兼容

dubch пре 4 година
родитељ
комит
03b7e50b97

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

@@ -754,3 +754,267 @@ func (s *TmpzcgtSession) UpdateOldCardNo() error {
 	return err
 }
 
+// 导入单个公司
+func (s *TmpzcgtSession) InsertOneSupplier(supplierName string) error {
+	sql := `INSERT INTO OilSupplier (
+	SupplierName,
+	Grade,
+	OperType,
+	Country,
+	MaunAgent,
+	ConstructTeam,
+	CommercialNo,
+	OrganCode,
+	CountryTaxNo,
+	LocalTaxNo,
+	Address,
+	ZipCode,
+	QualitySystemCert,
+	ProductQualityCert,
+	MaunLicense,
+	QualifCert,
+	QualifCertLevel,
+	SafetyLicense,
+	TechServiceLic,
+	TJInNotify,
+	SpecIndustryCert,
+	LegalPerson,
+	CategoryCode,
+	CategoryName,
+	RegCapital,
+	Currency,
+	ContactName,
+	CompanyType,
+	DepositBank,
+	BankAccount,
+	EMail,
+	BankCreditRating,
+	Mobile,
+	Telphone,
+	Fax,
+	CompanyTel,
+	QQ,
+	CompanyUrl,
+	Remark,
+	CreateBy,
+	SetupTime,
+	OilCertificateNo,
+    BusinessScope,
+	OldSupplierName
+) SELECT
+	max(企业名称) AS SupplierName,
+	max(级别) AS Grade,
+	max(经营方式) AS OperType,
+	max(国家) AS Country,
+	max(所代理制造商名称) AS MaunAgent,
+	max(施工队伍名称) AS ConstructTeam,
+	TRIM(max(工商注册号)) AS CommercialNo,
+	max(组织机构代码) AS OrganCode,
+	max(税务登记证国税编号) AS CountryTaxNo,
+	max(税务登记证地税编号) AS LocalTaxNo,
+	max(单位地址) AS Address,
+	max(邮编) AS ZipCode,
+	max(质量管理体系认证情况及认证机构) AS QualitySystemCert,
+	max(产品质量认证情况及认证机构) AS ProductQualityCert,
+	max(生产制造许可证获证情况及编号) AS MaunLicense,
+	max(企业资质证书编号) AS QualifCert,
+	max(企业资质证书级别) AS QualifCertLevel,
+	max(安全生产许可证) AS SafetyLicense,
+	max(技术服务类准入许可证) AS TechServiceLic,
+	max(外地企业进津备案通知书) AS TJInNotify,
+	max(行业特殊要求的认证证书) AS SpecIndustryCert,
+	max(法定代表人姓名) AS LegalPerson,
+	max(行业类别代码) AS CategoryCode,
+	max(行业类别名称) AS CategoryName,
+	max(注册资本) AS RegCapital,
+	max(币种) AS Currency,
+	max(联系人姓名) AS ContactName,
+	max(公司类型) AS CompanyType,
+	max(开户银行) AS DepositBank,
+	max(银行账号) AS BankAccount,
+	max(电子邮箱) AS EMail,
+	max(银行信用等级) AS BankCreditRating,
+	max(移动电话) AS Mobile,
+	max(固定电话) AS Telphone,
+	max(传真) AS Fax,
+	max(公司电话) AS CompanyTel,
+	max(QQ号码) AS QQ,
+	max(公司网址) AS CompanyUrl,
+	max(备注) AS Remark,
+	'导入' As CreateBy,
+	STR_TO_DATE(IF(max(成立时间)='', NULL, max(成立时间)),IF(LENGTH(max(成立时间))>8 or locate('-',max(成立时间)) >0, '%Y-%m-%d', '%Y%m%d')) AS SetupTime,
+    max(中石油供应商证书号) as OilCertificateNo,
+	max(推荐单位的推荐意见) as BusinessScope,
+	max(曾用名) AS OldSupplierName
+FROM 
+	T_资格预审表 WHERE `
+	sql += "企业名称 = '" + supplierName + "'"
+	sql +=  " GROUP BY 企业名称;" //WHERE 准入标识 != '取消'
+	_, err := s.DBE.Query(sql)
+
+	s.DBE.Query(" UPDATE OilSupplier a SET a.OperType='贸易商' WHERE a.OperType IN ('3', '4') AND SupplierName = '" + supplierName + "'")
+	s.DBE.Query(" UPDATE OilSupplier a SET a.OperType='代理商' WHERE a.OperType = '2' AND SupplierName = '" + supplierName + "'")
+	s.DBE.Query(" UPDATE OilSupplier a SET a.OperType='制造商' WHERE a.OperType = '1'  AND SupplierName = '" + supplierName + "'")
+	s.DBE.Query(" UPDATE OilSupplier a SET a.Grade='1' WHERE a.Grade = '一级' AND SupplierName = '" + supplierName + "'")
+	s.DBE.Query(" UPDATE OilSupplier a SET a.Grade='2' WHERE a.Grade = '二级' AND SupplierName = '" + supplierName + "'")
+
+	return err
+}
+
+func (s *TmpzcgtSession) InsertOneSupplierCert(supplierName string) error {
+	s.DBE.Query("SET unique_checks=0;")
+	sql := "INSERT INTO OilSupplierCert (SupplierId,OutsideFlog, `Status` , Step, WorkerTotal, AccessCardNo,SupplierTypeName,InFlag,EffectStartTime,EffectEndTime,AddinTime,EffectTime,ApplyTime,Remark,CreateBy,GfID,RecUnitName,MgrUnit,RecDate,OldCardNo) " +
+		"SELECT -1 As SupplierId,企业名称 AS OutsideFlog,'8' As `Status`, 3 as Step, 1 as WorkerTotal, 准入证号 As AccessCardNo,准入类别 AS SupplierTypeName,准入标识 AS InFlag, STR_TO_DATE(IF(有效期起='', NULL, 有效期起),'%Y年%m月%d日') AS EffectStartTime, STR_TO_DATE(IF(有效期止='', NULL, 有效期止),'%Y年%m月%d日') AS EffectEndTime,审核日期 as AddinTime, 有效期起 as EffectTime, (SELECT 有效期至 FROM tmp_T_在册供方查询 tmpzc WHERE tmpzc.ID = a.ID) AS ApplyTime,备注 AS Remark,'导入' As CreateBy,ID,推荐单位名称 as RecUnitName,管理单位 as MgrUnit,推荐日期,曾用准入证号 as RecDate " +
+		"FROM T_资格预审表 a where 企业名称 = '" + supplierName + "'"
+	_, err := s.DBE.Query(sql)
+	s.DBE.Query("SET unique_checks=1;")
+	return err
+}
+
+func (s *TmpzcgtSession) UpdateOneSupplierTypeCodeAndInFlag() error {
+	sql1 := "update `OilSupplierCert` set SupplierTypeCode = '01' where SupplierTypeName='物资类' and SupplierId = -1"
+	_, err := s.DBE.Query(sql1)
+	if err != nil {
+		return err
+	}
+	sql2 := "UPDATE `OilSupplierCert` SET SupplierTypeCode = '02' WHERE SupplierTypeName='基建类' and SupplierId = -1"
+	_, err = s.DBE.Query(sql2)
+	if err != nil {
+		return err
+	}
+	sql3 := "UPDATE `OilSupplierCert` SET SupplierTypeCode = '03' WHERE SupplierTypeName='服务类' and SupplierId = -1"
+	_, err = s.DBE.Query(sql3)
+	if err != nil {
+		return err
+	}
+	sql31 := "UPDATE `OilSupplierCert` SET SupplierTypeCode = '03', SupplierTypeName='服务类' WHERE SupplierTypeName='技术服务类' and SupplierId = -1"
+	_, err = s.DBE.Query(sql31)
+	if err != nil {
+		return err
+	}
+	sql4 := "UPDATE `OilSupplierCert` SET InFlag = '1' WHERE InFlag='准入' and SupplierId = -1"
+	_, err = s.DBE.Query(sql4)
+	if err != nil {
+		return err
+	}
+	sql5 := "UPDATE `OilSupplierCert` SET InFlag = '2' WHERE InFlag='暂停' and SupplierId = -1"
+	_, err = s.DBE.Query(sql5)
+	if err != nil {
+		return err
+	}
+	sql6 := "UPDATE `OilSupplierCert` SET InFlag = '3' WHERE InFlag='取消' and SupplierId = -1"
+	_, err = s.DBE.Query(sql6)
+	if err != nil {
+		return err
+	}
+	sql7 := "UPDATE `OilSupplierCert` a,(select Id from `T_资格预审表` where 内部单位 = 1 ) b SET InStyle = '5' where b.Id = a.GfId and a.SupplierId = -1"
+	_, err = s.DBE.Query(sql7)
+
+	return err
+
+}
+
+func (s *TmpzcgtSession) UpdateOneSupplierCert() error {
+	sql := "UPDATE `OilSupplierCert` b SET b.SupplierId=IFNULL((SELECT a.Id FROM OilSupplier a WHERE a.SupplierName = b.OutsideFlog AND a.Id IS NOT NULL  limit 1), 0) where b.SupplierId = -1"
+	_, err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *TmpzcgtSession) UpdateOneSupplierMgrUnit(supplierName string) error {
+	sql := " update OilSupplier a set a.MgrUnit = (select MgrUnit from OilSupplierCert b where b.SupplierId = a.Id and b.SupplierTypeCode = '01') where a.SupplierName = '" + supplierName + "'"
+	_, err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *TmpzcgtSession) InsertOneFileName(supplierName string) error {
+	sql := "INSERT INTO `OilSupplierFile` (SupplierId, SupplierCertSubId, FileUrl, Remark, NeedFileType, OtherRemark, SupplierTypeCode,CreateBy, FileExt, EffectDate, CreateOn, FileName) " +
+		"SELECT 0 AS SupplierId, 0 AS SupplierCertSubId, concat('/upfile/gfzl_2014/', f.ID_GF, '-' , f.类别编号, IFNULL(f.文件类型, ''), '|', f.类别, IFNULL(f.文件类型, '')) AS FileUrl, z.企业名称 AS Remark ,f.类别 AS NeedFileType, f.说明 AS OtherRemark, " +
+		"( CASE z.准入类别 WHEN '物资类' THEN '01' WHEN '基建类' THEN '02' WHEN '服务类' THEN '03' WHEN '技术服务类' THEN '03' else '000' END ) SupplierTypeCode, " +
+		"'导入' AS CreateBy, f.`文件类型` AS FileExt, str_to_date(f.`有效期至`, '%Y-%m-%d') AS EffectDate, str_to_date(f.`日期`, '%Y-%m-%d') AS CreateOn, concat(f.类别, IFNULL(f.文件类型, '')) AS FileName " +
+		"FROM `T_供方资料_V2014` f " +
+		"LEFT JOIN `T_资格预审表` z ON (f.ID_GF = z.ID) " +
+		"WHERE z.企业名称 = '" + supplierName + "'"
+	_, err := s.DBE.Query(sql)
+
+	return err
+}
+
+func (s *TmpzcgtSession) UpdateOneSupplierFile() error {
+	sql := "update OilSupplierFile set SupplierTypeCode = '000',IsManuf = '0' where NeedFileType in ('银行开户许可证或基本存款账户信息','营业执照','诚信合规承诺书','国家企业信用信息公示系统截屏','税务登记证','组织机构代码证') and SupplierId = 0"
+	_, err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *TmpzcgtSession) UpdateOneSupplierFileSId() error {
+	sql := "UPDATE `OilSupplierFile` b left join `OilSupplier` a ON (a.SupplierName = b.Remark AND a.Id IS NOT NULL) SET b.SupplierId = IFNULL(a.Id, 0) where b.SupplierId = 0"
+	_, err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *TmpzcgtSession) InsertOneCertSub(id string) error {
+
+	sql := "INSERT INTO `OilSupplierCertSub` (" +
+		"OldId," +
+		"AppendStatus," +
+		"`Type`," +
+		"CreateBy," +
+		"Remark," +
+		"IsManufacturer," +
+		"GoodsLevel," +
+		"`Code`," +
+		"`Name`" +
+		")  " +
+		` SELECT t.id AS OldId ,
+					'1' AS AppendStatus,
+					'1' AS Type,
+					'导入1' AS CreateBy,
+					t.备注 As Remark,
+					t.制造产品 AS IsManufacturer,
+					t.物资级别 AS GoodsLevel,
+					t.物资编码 AS code,
+					t.产品名称 AS name
+					FROM T_资格预审表_JRMX t
+					where t.id = `
+	sql += id
+	_, err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *TmpzcgtSession) UpdateOneCertSub(cert suppliercert.OilSupplierCert) error {
+	var err error
+	sql := " UPDATE OilSupplierCertSub b SET b.SupplierId = '" + strconv.Itoa(cert.SupplierId) + "'," +
+		" b.SupplierCertId='"+ strconv.Itoa(cert.Id) + "',"+
+		" b.SupplierTypeCode='" + cert.SupplierTypeCode + "'" +
+		" where b.OldId = '" + strconv.Itoa(cert.GfId) + "'"
+	_, err = s.DBE.Query(sql)
+	return err
+}
+
+func (s *TmpzcgtSession) InsertOneOilPaymentInfo(id string) error {
+	sql := "INSERT INTO `OilPaymentInfo` ( " +
+		"ID_GF," +
+		"SupplierName," +
+		"PayDate," +
+		"Amount," +
+		"IsPay," +
+		" PayType," +
+		"Remark," +
+		"PayMode," +
+		"CreateBy" +
+		")" +
+		"SELECT ID_GF, 企业名称 AS SupplierName ,IF(交费日期='', '1970-01-01', 交费日期) AS PayDate, IF(新准入='', 0, 新准入)  AS Amount, '2' AS IsPay,'1' AS PayType , 备注 AS Remark, 交款方式 AS PayMode,收款人 AS CreateBy FROM T_交费记录 WHERE 新准入 IS NOT NULL and 新准入<>'' and ID_GF = " + id +
+		" UNION" +
+		" SELECT ID_GF, 企业名称 AS SupplierName ,IF(交费日期='', '1970-01-01', 交费日期) AS PayDate, IF(换证='', 0, 换证) AS Amount , '2' AS IsPay, '4' AS PayType , 备注 AS Remark, 交款方式 AS PayMode,收款人 AS CreateBy FROM T_交费记录 WHERE 换证 IS NOT NULL and 换证<>'' and ID_GF = " + id +
+		" UNION" +
+		" SELECT ID_GF, 企业名称 AS SupplierName ,IF(交费日期='', '1970-01-01', 交费日期) AS PayDate, IF(增项='', 0, 增项) AS Amount , '2' AS IsPay, '3' AS PayType , 备注 AS Remark, 交款方式 AS PayMode,收款人 AS CreateBy FROM T_交费记录 WHERE 增项 IS NOT NULL and 增项<>'' and ID_GF = " + id +
+		" UNION" +
+		" SELECT ID_GF, 企业名称 AS SupplierName,IF(交费日期='', '1970-01-01', 交费日期) AS PayDate, IF(年审='', 0, 年审) AS Amount , '2' AS IsPay, '2' AS PayType , 备注 AS Remark, 交款方式 AS PayMode,收款人 AS CreateBy FROM T_交费记录 WHERE 年审 IS NOT NULL and 年审<>'' and ID_GF = " + id +
+		" UNION" +
+		" SELECT ID_GF, 企业名称 AS SupplierName,IF(交费日期='', '1970-01-01', 交费日期) AS PayDate, IF(罚款='', 0, 罚款) AS Amount , '2' AS IsPay, '5' AS PayType , 备注 AS Remark, 交款方式 AS PayMode,收款人 AS CreateBy FROM T_交费记录 WHERE 罚款 IS NOT NULL and 罚款<>'' and ID_GF = " + id +
+		" UNION" +
+		" SELECT ID_GF, 企业名称 AS SupplierName,IF(交费日期='', '1970-01-01', 交费日期) AS PayDate, IF(其它='', 0, 其它) AS Amount , '2' AS IsPay, '6' AS PayType , 备注 AS Remark, 交款方式 AS PayMode,收款人 AS CreateBy FROM T_交费记录 WHERE 其它 IS NOT NULL and 其它<>'' and ID_GF = " + id
+
+	_, err := s.DBE.Query(sql)
+	return err
+}
+

+ 174 - 0
src/dashoo.cn/backend/api/controllers/tmpzcgf/tmpzcgf.go

@@ -2,11 +2,16 @@ package tmpzcgf
 
 import (
 	"dashoo.cn/backend/api/business/oilsupplier/basisbuild"
+	"dashoo.cn/backend/api/business/oilsupplier/goodsaptitude"
 	"dashoo.cn/backend/api/business/oilsupplier/goodsaptitudeclass"
+	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappend"
 	"dashoo.cn/backend/api/business/oilsupplier/technologyserviceclass"
+	"dashoo.cn/backend/api/business/paymentinfo"
+	"encoding/json"
 	"fmt"
 	"strconv"
+	"strings"
 	"time"
 
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
@@ -1039,6 +1044,175 @@ func (this *TmpzcgfController) InsertSubAll() {
 		svc.UpdateEntityBywheretbl("OilSupplierCertSub", certsub, colssub, "")
 	}()
 
+	var errinfo ErrorInfo
+	errinfo.Message = "导入命令下达成功,详情请看后台运行日志,注意不要重复点击!"
+	errinfo.Code = 0
+	this.Data["json"] = &errinfo
+	this.ServeJSON()
+}
+
+// @Title 一键执行某个公司导入
+// @Description get user by token
+// @Success 200 {object}
+// @router /insertOneSup [post]
+func (this *TmpzcgfController) InsertOneSup() {
+	var model supplier.OilSupplier
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+	go func() {
+		svc := tmpzcgf.GetTmpzcgtService(utils.DBE)
+		err := svc.InsertOneSupplier(model.SupplierName)
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.InsertOneSupplierCert(model.SupplierName)
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.UpdateOneSupplierTypeCodeAndInFlag()
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.UpdateOneSupplierCert()
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.UpdateOneSupplierMgrUnit(model.SupplierName)
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.InsertOneFileName(model.SupplierName)
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.UpdateOneSupplierFile()
+		if err != nil {
+			fmt.Println(err)
+		}
+		err = svc.UpdateOneSupplierFileSId()
+		if err != nil {
+			fmt.Println(err)
+		}
+		var certList []suppliercert.OilSupplierCert
+		svc.GetEntityByWhere(OilSupplierName,"SupplierName = '" + model.SupplierName + "'", &model)
+		svc.GetEntitysByWhere(OilSupplierCertName,"SupplierId = " + strconv.Itoa(model.Id), &certList)
+		for _,cert := range certList {
+			err = svc.InsertOneOilPaymentInfo(strconv.Itoa(cert.GfId))
+			if err != nil {
+				fmt.Println(err)
+			}
+			var pay paymentinfo.OilPaymentInfo
+			pay.SupplierId = cert.SupplierId
+			pay.SupplierCertId = cert.Id
+			pay.IsInvoice = "1"
+			payCols := []string{
+				"SupplierId",
+				"SupplierCertId",
+				"IsInvoice",
+			}
+			err = svc.UpdateEntityBywheretbl("OilPaymentInfo", pay, payCols, "ID_GF = " + strconv.Itoa(cert.GfId))
+			if err != nil {
+				fmt.Println(err)
+			}
+
+			err = svc.InsertOneCertSub(strconv.Itoa(cert.GfId))
+			if err != nil {
+				fmt.Println(err)
+			}
+			err = svc.UpdateOneCertSub(cert)
+			if err != nil {
+				fmt.Println(err)
+			}
+		}
+		var certSubList []suppliercertsub.OilSupplierCertSub
+		svc.GetEntitysByWhere(OilSupplierCertSubName,"SupplierId = " + strconv.Itoa(model.Id), &certSubList)
+		//准入范围修改
+		for _,certSub := range certSubList {
+			certSub.Remark = ""
+			certSub.ModifiedBy = ""
+			if certSub.SupplierTypeCode == "01" {
+				cols := []string{
+					"Remark",
+					"ModifiedBy",
+					"SubClassId",
+					"GoodsLevel",
+					"Name",
+				}
+				var goodsAptitudeClass goodsaptitude.GoodsBusiness1
+				goodsSvc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+				goodsSvc.GetEntityJoin2(OilGoodsAptitudeName, OilGoodsAptitudeClassName, &goodsAptitudeClass, "Code = '" + certSub.Code + "'")
+
+				certSub.GoodsLevel = goodsAptitudeClass.GoodsLevel
+				certSub.Name = goodsAptitudeClass.Name
+				certSub.SubClassId = goodsAptitudeClass.Id
+				if goodsAptitudeClass.Id > 0 {
+					if goodsAptitudeClass.GoodsLevel == "2" {
+						// 1降2修改
+						err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSub, cols, "Id = " + strconv.Itoa(certSub.Id))
+					} else {
+						err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSub, cols, "(GoodsLevel = '1' or GoodsLevel is null) and Id = " + strconv.Itoa(certSub.Id))
+						//2升1删除
+						err = goodsSvc.DeleteTable(OilSupplierCertSubName, "GoodsLevel = '2' and Id = " + strconv.Itoa(certSub.Id))
+					}
+				} else {
+					err = goodsSvc.DeleteTable(OilSupplierCertSubName, "Id = " + strconv.Itoa(certSub.Id))
+				}
+			} else if certSub.SupplierTypeCode == "02" {
+				cols := []string{
+					"Remark",
+					"ModifiedBy",
+					"SubClassId",
+				}
+				var basisBuild goodsaptitude.GoodsBusiness2
+				svc.GetEntityByWhere(OilBasisBuildName,"Name = '" + certSub.Name + "'", &basisBuild)
+				if basisBuild.Id > 0 {
+					certSub.SubClassId = basisBuild.Id
+					err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, certSub, cols, "Id = " + strconv.Itoa(certSub.Id))
+				} else {
+					err = svc.DeleteEntityBytbl(OilSupplierCertSubName, "Id = " + strconv.Itoa(certSub.Id))
+				}
+			} else {
+				cols := []string{"Remark", "ModifiedBy", "SubClassId"}
+				var class technologyserviceclass.OilTechnologyServiceClass
+				var technologyServiceClass goodsaptitude.GoodsBusiness2
+				svc.GetEntityByWhere(OilTechnologyServiceClassName,"Name = '" + certSub.Name + "'", &technologyServiceClass)
+				if technologyServiceClass.Id > 0 {
+					certSub.SubClassId = technologyServiceClass.Id
+					err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, certSub, cols, "Id = " + strconv.Itoa(certSub.Id))
+				} else {
+					var del supplier.ManualDelete
+					svc.GetEntityByWhere("TecDifferent", "Code = '"+certSub.Code+"' and Name = '"+certSub.Name+"'", &del)
+					if del.Operation == "删除" || del.Operation == "" || del.Operation == "维持不动" {
+						err = svc.DeleteEntityBytbl(OilSupplierCertSubName, "Id = " + strconv.Itoa(certSub.Id))
+					} else if strings.Index(del.Operation, ",") > 0 {
+						//151508,151509
+						id := certSub.Id
+						code := strings.Split(del.Operation, ",")
+						for _, c := range code {
+							svc.GetEntityByWhere(OilTechnologyServiceClassName, "Code = '"+c+"'", &class)
+							certSub.Name = class.Name
+							certSub.Code = class.Code
+							certSub.SubClassId = class.Id
+							svc.InsertEntityBytbl(OilSupplierCertSubName, &certSub)
+						}
+						err = svc.DeleteEntityBytbl(OilSupplierCertSubName, "Id = " + strconv.Itoa(id))
+					} else {
+						//151507
+						svc.GetEntityByWhere(OilTechnologyServiceClassName, "Code = '"+del.Operation+"'", &class)
+						cols := []string{"Remark","ModifiedBy","Name", "Code", "SubClassId"}
+						certSub.Name = class.Name
+						certSub.Code = class.Code
+						certSub.SubClassId = class.Id
+						svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSub, cols, "Id = " + strconv.Itoa(certSub.Id))
+					}
+				}
+			}
+			if err != nil {
+				fmt.Println(err)
+			}
+		}
+	}()
+
 	var errinfo ErrorInfo
 	errinfo.Message = "导入命令下达成功,详情请看后台运行日志,注意不要重复点击!"
 	errinfo.Code = 0

+ 10 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/basisdataopera.vue

@@ -513,7 +513,7 @@
             </el-card>
             <el-card class="box-card" style="margin-top: 10px; margin-bottom: 10px">
               <div slot="header">
-                <span><i class="icon icon-table2"></i> 准入范围<span v-if="needPayAmount > 0 && !['7', '8', '11'].includes(formData.Status)" style="font-size: 12px; font-weight: normal; color: red">&nbsp;(需交费:{{needPayAmount}}元)</span></span>
+                <span><i class="icon icon-table2"></i> 准入范围<span v-if="needPayAmount > 0 && isStatus" style="font-size: 12px; font-weight: normal; color: red">&nbsp;(需交费:{{needPayAmount}}元)</span></span>
                 <div style="float:right; margin-right: -45px">
                   <el-input size="mini" v-model="addAccessCodeSearch" style="width:50%;" clearable placeholder="准入编码"></el-input>
                   &nbsp;
@@ -815,6 +815,7 @@
         dialogVisibleBack: false,
         firOptions: [],
         btnloading: false,
+        isStatus: false,
         btnLoading: false,
         activeName: '0',
         supplierId: '',
@@ -1123,11 +1124,19 @@
       // this.changeOrgUnit(this.selectDept)
     },
     methods: {
+      getStatus () {
+        if (this.formData.Status != '7' && this.formData.Status != '8' && this.formData.Status != '11') {
+          this.isStatus = true
+        } else {
+          this.isStatus = false
+        }
+      },
       // 获取需要修改的增项信息
       getEntityById () {
         let _this = this
         api2.getEntityById(_this.AppendId, _this.$axios).then(res => {
           _this.formData = res.data
+          this.getStatus()
           this.entrydetail.process = this.formData.ProcessKey
           this.entrydetail.business = _this.AppendId
           this.entrydetail.instance = this.formData.WorkFlowId

+ 10 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/goodsdataopera.vue

@@ -583,7 +583,7 @@
             </el-card>
             <el-card class="box-card" style="margin-top: 10px; margin-bottom: 10px">
               <div slot="header">
-                <span><i class="icon icon-table2"></i> 准入范围<span v-if="needPayAmount > 0 && !['7', '8', '11'].includes(formData.Status)" style="font-size: 12px; font-weight: normal; color: red">&nbsp;(需交费:{{needPayAmount}}元)</span></span>
+                <span><i class="icon icon-table2"></i> 准入范围<span v-if="needPayAmount > 0 && isStatus" style="font-size: 12px; font-weight: normal; color: red">&nbsp;(需交费:{{needPayAmount}}元)</span></span>
                 <div style="float:right; margin-right: -45px">
                   <el-input size="mini" v-model="addAccessCodeSearch" style="width:50%;" clearable placeholder="准入编码"></el-input>
                   &nbsp;
@@ -897,6 +897,7 @@
         dialogVisibleBack: false,
         firOptions: [],
         btnloading: false,
+        isStatus: false,
         btnLoading: false,
         activeName: '0',
         supplierId: '',
@@ -1207,11 +1208,19 @@
       // this.changeOrgUnit(this.selectDept)
     },
     methods: {
+      getStatus () {
+        if (this.formData.Status != '7' && this.formData.Status != '8' && this.formData.Status != '11') {
+          this.isStatus = true
+        } else {
+          this.isStatus = false
+        }
+      },
       // 获取需要修改的增项信息
       getEntityById () {
         let _this = this
         api2.getEntityById(_this.AppendId, _this.$axios).then(res => {
           _this.formData = res.data
+          this.getStatus()
           this.entrydetail.process = this.formData.ProcessKey
           this.entrydetail.business = _this.AppendId
           this.entrydetail.instance = this.formData.WorkFlowId

+ 10 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/techdataopera.vue

@@ -497,7 +497,7 @@
             </el-card>
             <el-card class="box-card" style="margin-top: 10px; margin-bottom: 10px">
               <div slot="header">
-                <span><i class="icon icon-table2"></i> 准入范围<span v-if="needPayAmount > 0 && !['7', '8', '11'].includes(formData.Status)" style="font-size: 12px; font-weight: normal; color: red">&nbsp;(需交费:{{needPayAmount}}元)</span></span>
+                <span><i class="icon icon-table2"></i> 准入范围<span v-if="needPayAmount > 0 && isStatus" style="font-size: 12px; font-weight: normal; color: red">&nbsp;(需交费:{{needPayAmount}}元)</span></span>
                 <div style="float:right; margin-right: -45px">
                   <el-input size="mini" v-model="addAccessCodeSearch" style="width:50%;" clearable placeholder="准入编码"></el-input>
                   &nbsp;
@@ -797,6 +797,7 @@
         firOptions: [],
         btnloading: false,
         btnLoading: false,
+        isStatus: false,
         activeName: '0',
         supplierId: '',
         backRemark: '',
@@ -1126,11 +1127,19 @@
       // this.changeOrgUnit(this.selectDept)
     },
     methods: {
+      getStatus () {
+        if (this.formData.Status != '7' && this.formData.Status != '8' && this.formData.Status != '11') {
+          this.isStatus = true
+        } else {
+          this.isStatus = false
+        }
+      },
       // 获取需要修改的增项信息
       getEntityById () {
         let _this = this
         api2.getEntityById(_this.AppendId, _this.$axios).then(res => {
           _this.formData = res.data
+          this.getStatus()
           this.entrydetail.process = this.formData.ProcessKey
           this.entrydetail.business = _this.AppendId
           this.entrydetail.instance = this.formData.WorkFlowId

+ 2 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -1080,6 +1080,7 @@
         lostTableData: [],
         firOptions: [],
         btnloading: false,
+        loading: false,
         fileList: [],
         myitemsshow: false,
         selectDept: 100000662,
@@ -3116,6 +3117,7 @@
       },
       // 确认撤回按钮
       recallApplyConfirm () {
+        this.loading = true
         if (!this.auditform.AuditRemark) {
           this.$message({
             type: 'warning',