Commit c0eb848b by guojuxing

微信菜单排序修改

parent d6f9ce4d
......@@ -215,8 +215,8 @@ public class AppletWechatMenuApiServiceImpl implements AppletWechatMenuApiServic
List<TabAppletWechatMenu> listByParentId = appletWechatMenuService.listByParentId(record.getEnterpriseId(),
record.getParentMenuId(), record.getAppKey());
if (CollectionUtils.isNotEmpty(listByParentId)) {
boolean isRightSort = sort == null || sort.intValue() < 1 || sort.intValue() >= listByParentId.size();
if (!isRightSort) {
boolean isNotRightSort = sort == null || sort.intValue() < 1 || sort.intValue() > listByParentId.size();
if (isNotRightSort) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "排序值错误");
}
for (TabAppletWechatMenu menu : listByParentId) {
......@@ -226,7 +226,7 @@ public class AppletWechatMenuApiServiceImpl implements AppletWechatMenuApiServic
appletWechatMenuService.sort(menu.getMenuId(), tempSort + 1);
}
} else {
if (tempSort >= currentSort && tempSort < sort) {
if (tempSort > currentSort && tempSort <= sort) {
appletWechatMenuService.sort(menu.getMenuId(), tempSort - 1);
}
}
......
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