物料分包bug测试

This commit is contained in:
苏尹岚
2020-05-07 16:07:49 +08:00
parent 1aad81bac2
commit 187a0df82f
2 changed files with 9 additions and 8 deletions

View File

@@ -107,12 +107,12 @@ func (s *StoreManager) OnCourierStoreStatusChanged(ctx *jxcontext.Context, vendo
db := dao.GetDB() db := dao.GetDB()
_, err2 := dao.GetStoreDetail2(db, 0, vendorStoreID, vendorID) _, err2 := dao.GetStoreDetail2(db, 0, vendorStoreID, vendorID)
if err = err2; err == nil { if err = err2; err == nil {
status := model.StoreStatusOpened // status := model.StoreStatusOpened
if auditStatus != model.StoreAuditStatusOnline { // if auditStatus != model.StoreAuditStatusOnline {
status = model.StoreStatusDisabled // status = model.StoreStatusDisabled
} // }
_, err = dao.UpdateEntityLogically(db, &model.StoreCourierMap{}, map[string]interface{}{ _, err = dao.UpdateEntityLogically(db, &model.StoreCourierMap{}, map[string]interface{}{
model.FieldStatus: status, // model.FieldStatus: status,
"AuditStatus": auditStatus, "AuditStatus": auditStatus,
}, ctx.GetUserName(), map[string]interface{}{ }, ctx.GetUserName(), map[string]interface{}{
model.FieldVendorStoreID: vendorStoreID, model.FieldVendorStoreID: vendorStoreID,

View File

@@ -1498,7 +1498,7 @@ func tryToSplitMatterOrder(jxOrder *JxOrderInfo) (outOrders []*JxOrderInfo, frei
skus = jxOrder.Skus skus = jxOrder.Skus
weightList []*JxSkuInfo2 weightList []*JxSkuInfo2
) )
//我的思路为把所有商品依次按重量销量从大到小排列然后第一个包尽量分出3kg后面分出5kg //我的思路为把所有商品依次按重量销量从大到小排列然后第一个包尽量分出3kg后面分出4.5kg
//但是我把JxSkuInfo放进list的时候想根据一个参数GroupSign判断是否这个商品已经分出去了 //但是我把JxSkuInfo放进list的时候想根据一个参数GroupSign判断是否这个商品已经分出去了
//但是在list中同一个商品通过以下方式放进去的地址是一样的我改了一个商品的GroupSign所有的都变了所以只有分出一个JxSkuInfo2去弄。。 //但是在list中同一个商品通过以下方式放进去的地址是一样的我改了一个商品的GroupSign所有的都变了所以只有分出一个JxSkuInfo2去弄。。
//要做优化的话更好 //要做优化的话更好
@@ -1524,6 +1524,8 @@ func tryToSplitMatterOrder(jxOrder *JxOrderInfo) (outOrders []*JxOrderInfo, frei
} }
} }
weight := jxOrder.Weight weight := jxOrder.Weight
globals.SugarLogger.Debugf("Testweight", weight)
globals.SugarLogger.Debugf("Testweight", utils.Format4Output(weightList, false))
for { for {
//每拿出一组就删掉list里的值 //每拿出一组就删掉list里的值
outOrders = append(outOrders, loop2(weightList, jxOrder.StoreID, &weight)) outOrders = append(outOrders, loop2(weightList, jxOrder.StoreID, &weight))
@@ -1547,7 +1549,6 @@ func tryToSplitMatterOrder(jxOrder *JxOrderInfo) (outOrders []*JxOrderInfo, frei
freightPrice += utils.Float64TwoInt64(500 + math.Ceil((utils.Int2Float64(v.Weight)-3000)/1000)*200) freightPrice += utils.Float64TwoInt64(500 + math.Ceil((utils.Int2Float64(v.Weight)-3000)/1000)*200)
} }
} }
globals.SugarLogger.Debugf("outOrders", utils.Format4Output(outOrders, false))
return outOrders, freightPrice, err return outOrders, freightPrice, err
} }