|
|
@@ -1524,6 +1524,11 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
//row := sheet.AddRow()
|
|
|
//cell := row.AddCell()
|
|
|
//cell.Value = strconv.Itoa(suppliercert.SupplierId)
|
|
|
+
|
|
|
+ var supplier supplier.OilSupplier
|
|
|
+ wheres := " Id=" + strconv.Itoa(suppliercert.SupplierId)
|
|
|
+ supsvc.GetEntity(&supplier, wheres)
|
|
|
+
|
|
|
log.Println(suppliercert.SupplierId)
|
|
|
var supplierCertSubList []suppliercertsub.OilSupplierCertSub
|
|
|
wheresup := "SupplierId = " + strconv.Itoa(suppliercert.SupplierId) + " and SupplierTypeCode='01' AND Type IN ('1', '3')"
|
|
|
@@ -1571,10 +1576,14 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
|
|
|
whereg := "ClassId = " + strconv.Itoa(goodsaptitudeClass.Id)
|
|
|
supsvc.GetEntity(&goodsAptitude, whereg)
|
|
|
if goodsAptitude.GoodsLevel != supplierCertSub.GoodsLevel {
|
|
|
- var entity suppliercertsub.OilSupplierCertSub
|
|
|
- entity.GoodsLevel = goodsAptitude.GoodsLevel
|
|
|
- where := "Id = " + strconv.Itoa(supplierCertSub.Id)
|
|
|
- supsvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &entity, colsLevel, where)
|
|
|
+ if goodsAptitude.GoodsLevel == "1" && supplier.Grade == "2" {
|
|
|
+ supsvc.InsertEntityBytbl(TmpOilSupplierCertSubName, supplierCertSub)
|
|
|
+ } else {
|
|
|
+ var entity suppliercertsub.OilSupplierCertSub
|
|
|
+ entity.GoodsLevel = goodsAptitude.GoodsLevel
|
|
|
+ where := "Id = " + strconv.Itoa(supplierCertSub.Id)
|
|
|
+ supsvc.UpdateEntityBywheretbl(OilSupplierCertSubName, &entity, colsLevel, where)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
break
|