2
3
dubch 5 жил өмнө
parent
commit
22c6089e2d

+ 3 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/technologyservice.go

@@ -2258,13 +2258,13 @@ func (this *OilTechnologyServiceController) ManualDelete() {
 	var errinfo ErrorInfo
 	var list []supplier.ManualDelete
 	var sub []suppliercertsub.OilSupplierCertSub
-	var sub1 suppliercertsub.OilSupplierCertSub
 	var class technologyserviceclass.OilTechnologyServiceClass
 	svc := technologyservice.GetOilTechnologyServiceService(utils.DBE)
 	delect := this.GetString("delete")
 	where := "1=1"
 	svc.GetEntitysByWhere("TecDifferent", where, &list)
 	for _, value := range list {
+		var sub1 suppliercertsub.OilSupplierCertSub
 		if value.Operation == "删除" {
 			if delect != "" {
 				svc.DeleteTable(OilSupplierCertSubName, "SupplierTypeCode='03' and Code = '" + value.Code + "' and Name = '" + value.Name + "'")
@@ -2281,7 +2281,8 @@ func (this *OilTechnologyServiceController) ManualDelete() {
 					s.Name = class.Name
 					s.Code = class.Code
 					s.SubClassId = class.Id
-					svc.GetEntityByWhere(OilSupplierCertSubName, "SupplierTypeCode='03' and SupplierCertId = " + strconv.Itoa(s.SupplierCertId) + " Name = '" + class.Name + "'", &sub1)
+					s.Id = 0
+					svc.GetEntityByWhere(OilSupplierCertSubName, "SupplierTypeCode='03' and SupplierCertId = " + strconv.Itoa(s.SupplierCertId) + " and Name = '" + class.Name + "'", &sub1)
 					if sub1.Id > 0 {
 						continue
 					}