Commit 625acc73 by caiyt

修复商品分类排序调整问题

parent 1cac5c58
...@@ -137,20 +137,20 @@ public class GoodsCategoryServiceImpl implements IGoodsCategoryService ...@@ -137,20 +137,20 @@ public class GoodsCategoryServiceImpl implements IGoodsCategoryService
int size = goodsCategories.size(); int size = goodsCategories.size();
for(int i=0;i<size;i++){ for(int i=0;i<size;i++){
GoodsCategory goodsCategory = goodsCategories.get(i); GoodsCategory goodsCategory = goodsCategories.get(i);
if(id.equals(goodsCategory.getId())){ if (id.equals(goodsCategory.getId().toString())) {
if("1".equals(pointer)){ if ("1".equals(pointer)) {
int index = i-1; int lastIdx = i - 1;
if(index<0){ if (lastIdx < 0) {
lastId =id; lastId = id;
}else{ } else {
lastId = goodsCategories.get(index).getId().toString(); lastId = goodsCategories.get(lastIdx).getId().toString();
} }
}else if("2".equals(pointer)){ } else if ("2".equals(pointer)) {
int index=i+1; int lastIdx = i + 1;
if(index>=size){ if (lastIdx >= size) {
lastId =id; lastId = id;
}else{ } else {
lastId = goodsCategories.get(index).getId().toString(); lastId = goodsCategories.get(lastIdx).getId().toString();
} }
} }
} }
......
...@@ -262,8 +262,6 @@ public class MachineApiServiceImpl { ...@@ -262,8 +262,6 @@ public class MachineApiServiceImpl {
} }
machine.setState(status); machine.setState(status);
return machineMapper.updateMachine(machine); return machineMapper.updateMachine(machine);
} }
public void updateOrder(Order order) { public void updateOrder(Order order) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment