|
|
@@ -311,9 +311,20 @@ func (this *OilSupplierCertAppendController) DeleteEntity() {
|
|
|
defer session.Close()
|
|
|
err := session.Begin()
|
|
|
|
|
|
- //首先删除子表信息
|
|
|
where := "SupplierCertAppendId = " + Id
|
|
|
- err = svcSub.DeleteEntityBytbl(OilSupplierCertAppendSubName, where)
|
|
|
+ //删除资质表信息
|
|
|
+ var submodel []suppliercertsub.OilSupplierCertSub
|
|
|
+ svc.GetEntitysByWhere(OilSupplierCertSubName,where,&submodel)
|
|
|
+ if len(submodel) > 0 {
|
|
|
+ filewhere := " SupplierId = "+ utils.ToStr(submodel[0].SupplierId) + " and SupType = 2 and SupplierTypeCode = '"+ submodel[0].SupplierTypeCode +"'"
|
|
|
+ err = svcSub.DeleteEntityBytbl(OilSupplierFileName, filewhere)
|
|
|
+ if err != nil {
|
|
|
+ //回滚操作
|
|
|
+ session.Rollback()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //删除准入范围表信息
|
|
|
+ err = svcSub.DeleteEntityBytbl(OilSupplierCertSubName, where)
|
|
|
if err != nil {
|
|
|
//回滚操作
|
|
|
session.Rollback()
|
|
|
@@ -322,7 +333,6 @@ func (this *OilSupplierCertAppendController) DeleteEntity() {
|
|
|
//最后删除主表信息
|
|
|
var model suppliercertappend.OilSupplierCertAppend
|
|
|
var entityempty suppliercertappend.OilSupplierCertAppend
|
|
|
-
|
|
|
opdesc := "删除-" + Id
|
|
|
err = svc.DeleteOperationAndWriteLogBytbl(OilSupplierCertAppendName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "增项信息")
|
|
|
if err != nil {
|