|
|
@@ -2092,11 +2092,19 @@ func (this *OilGoodsAptitudeController) FindInconformity() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- var certsub suppliercertsub.OilSupplierCertSub
|
|
|
- certsub.GoodsLevel = model.GoodsLevel
|
|
|
- cols := []string{"GoodsLevel"}
|
|
|
- where := "Id=" + strconv.Itoa(CertSub.Id)
|
|
|
- svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &certsub, cols, where)
|
|
|
+
|
|
|
+ var entity supplier.OilSupplier
|
|
|
+ wherec := "Id=" + strconv.Itoa(CertSub.SupplierId)
|
|
|
+ svc.GetEntity(&entity, wherec)
|
|
|
+ if model.GoodsLevel == "1" && entity.Grade == "2" {
|
|
|
+ svc.InsertEntityBytbl(""+TmpOilSupplierCertSubName, &companygood)
|
|
|
+ } else {
|
|
|
+ var certsub suppliercertsub.OilSupplierCertSub
|
|
|
+ certsub.GoodsLevel = model.GoodsLevel
|
|
|
+ cols := []string{"GoodsLevel"}
|
|
|
+ where := "Id=" + strconv.Itoa(CertSub.Id)
|
|
|
+ svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &certsub, cols, where)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if err == nil {
|