|
|
@@ -1882,19 +1882,21 @@ func (this *InfoChangeController) CommonAuditEntity() {
|
|
|
var info infochange.OilInfoChangeItem
|
|
|
svc := supplier.GetOilSupplierService(utils.DBE)
|
|
|
svc.GetEntityByWhere(OilInfoChangeItemName, "SelectItem = 'SupplierName' and InfoId = "+infoId, &info)
|
|
|
- // 曾用名存到主表
|
|
|
- oilSupplier.OldSupplierName = info.BeChangeInfo
|
|
|
- svc.UpdateEntityBywheretbl(OilSupplierName, &oilSupplier, []string{"OldSupplierName"}, "Id = "+strconv.Itoa(infoChangeEntityAfterUpdate.SupplierId))
|
|
|
-
|
|
|
- oldName.OldName = info.BeChangeInfo
|
|
|
- oldName.Name = info.ChangeInfo
|
|
|
- oldName.SupplierId = infoChangeEntityAfterUpdate.SupplierId
|
|
|
- oldName.GfId = 0
|
|
|
- oldName.CreateOn = info.CreateOn
|
|
|
- oldName.CreateBy = info.CreateBy
|
|
|
- oldName.CreateUserId = info.CreateUserId
|
|
|
- // 曾用名存到子表
|
|
|
- svc.InsertEntityBytbl("OilSupplierOldName", &oldName)
|
|
|
+ if info.Id > 0 {
|
|
|
+ // 曾用名存到主表
|
|
|
+ oilSupplier.OldSupplierName = info.BeChangeInfo
|
|
|
+ svc.UpdateEntityBywheretbl(OilSupplierName, &oilSupplier, []string{"OldSupplierName"}, "Id = "+strconv.Itoa(infoChangeEntityAfterUpdate.SupplierId))
|
|
|
+
|
|
|
+ oldName.OldName = info.BeChangeInfo
|
|
|
+ oldName.Name = info.ChangeInfo
|
|
|
+ oldName.SupplierId = infoChangeEntityAfterUpdate.SupplierId
|
|
|
+ oldName.GfId = 0
|
|
|
+ oldName.CreateOn = info.CreateOn
|
|
|
+ oldName.CreateBy = info.CreateBy
|
|
|
+ oldName.CreateUserId = info.CreateUserId
|
|
|
+ // 曾用名存到子表
|
|
|
+ svc.InsertEntityBytbl("OilSupplierOldName", &oldName)
|
|
|
+ }
|
|
|
|
|
|
this.updateChangeInfo(infoChangeEntityAfterUpdate.SupplierId, infoId)
|
|
|
}
|