|
|
@@ -463,6 +463,9 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
colsName := []string{"Name"}
|
|
|
colsCode := []string{"Code"}
|
|
|
//svc.GetEntityById(id, &model)
|
|
|
+
|
|
|
+ var model2 technologyserviceclass.OilTechnologyServiceClass
|
|
|
+ svc.GetEntityByWhere(OilTechnologyServiceClassName, "Id = "+id, &model2)
|
|
|
if classall.Name1 != "" {
|
|
|
where := " Name = '" + classall.Name1 + "' and Id <> " + utils.ToStr(classall.Id1)
|
|
|
svc.GetEntitysByWhere(OilTechnologyServiceClassName, where, &classmodel)
|
|
|
@@ -489,6 +492,9 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
} else {
|
|
|
model.Name = classall.Name2
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id2, &model, colsName)
|
|
|
+ if model2.Name != model.Name && classall.Name3 == "" && classall.Name4 == "" {
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &model, []string{"Name"}, "SubClassId = " + id + " and SupplierTypeCode = '03' and Name = '" + model2.Name + "'")
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if classall.Name3 != "" {
|
|
|
@@ -503,6 +509,9 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
} else {
|
|
|
model.Name = classall.Name3
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id3, &model, colsName)
|
|
|
+ if model2.Name != model.Name && classall.Name4 == "" {
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &model, []string{"Name"}, "SubClassId = " + id + " and SupplierTypeCode = '03' and Name = '" + model2.Name + "'")
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if classall.Name4 != "" {
|
|
|
@@ -517,6 +526,9 @@ func (this *OilTechnologyServiceController) UpdateCodeEntity() {
|
|
|
} else {
|
|
|
model.Name = classall.Name4
|
|
|
err = svc.UpdateEntityBytbl(OilTechnologyServiceClassName, classall.Id4, &model, colsName)
|
|
|
+ if model2.Name != model.Name {
|
|
|
+ err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &model, []string{"Name"}, "SubClassId = " + id + " and SupplierTypeCode = '03' and Name = '" + model2.Name + "'")
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if classall.Code1 != "" {
|