|
|
@@ -984,8 +984,9 @@ func (this *OilSupplierCertSubController) AddBusiness() {
|
|
|
func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
Id := this.Ctx.Input.Param(":Id")
|
|
|
//SupplierCertId := this.GetString("SupplierCertId")
|
|
|
+ SupplierId := this.GetString("SupplierId")
|
|
|
var errinfo ErrorInfo
|
|
|
- if Id == "" {
|
|
|
+ if Id == "" || SupplierId == "" {
|
|
|
errinfo.Message = "操作失败!请求信息不完整"
|
|
|
errinfo.Code = -2
|
|
|
this.Data["json"] = &errinfo
|
|
|
@@ -995,10 +996,16 @@ func (this *OilSupplierCertSubController) BusinessDelete() {
|
|
|
|
|
|
//根据Id查出OilSupplierCertSub的SubClassId
|
|
|
svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE) //获得数据库引擎
|
|
|
- where := "delete from " + OilSupplierCertSubName + " where Id in (" + Id + ")" // 没有删除的准入范围
|
|
|
+ var certSub []suppliercertsub.OilSupplierCertSub
|
|
|
+ svc.GetEntitysByWhere(OilSupplierCertSubName, "SupplierId = " + SupplierId + " and Id in (" + Id + ")", &certSub)
|
|
|
+ where := "delete from " + OilSupplierCertSubName + " where SupplierId = " + SupplierId + " and Id in (" + Id + ")" // 没有删除的准入范围
|
|
|
svc.DBE.Exec(where)
|
|
|
|
|
|
- // TODO: 删除准入范围和资质对应关系表
|
|
|
+ for _, sub := range certSub {
|
|
|
+ svc.InsertEntityBytbl(TmpOilSupplierCertSubName, &sub)
|
|
|
+ }
|
|
|
+
|
|
|
+ // TODO: 删除准入范围和资质对应关系表
|
|
|
/*whereCert2File := "delete from " + OilSupplierCert2FileName + " where SupplierCertSubId in (" + Id + ")" // 没有删除的准入范围
|
|
|
svc.DBE.Exec(whereCert2File)*/
|
|
|
|