Commit 9d685b0e by 张新旗

代码什么时候是个头

parent eb82b202
......@@ -79,7 +79,7 @@ public class SysLoginController
@GetMapping("getRouters")
public AjaxResult getRouters()
{
Long userId = 1L;SecurityUtils.getUserId();
Long userId = SecurityUtils.getUserId();
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
return AjaxResult.success(menuService.buildMenus(menus));
}
......
......@@ -154,10 +154,10 @@ public class OrderServiceImpl implements IOrderService
if(orderDetails !=null && !orderDetails.isEmpty()){
BigDecimal bigDecimal = new BigDecimal(0);
for (OrderDetail orderDetail : orderDetails) {
bigDecimal.add(orderDetail.getRealAmount().multiply( new BigDecimal(orderDetail.getNum())));
bigDecimal = bigDecimal.add(orderDetail.getRealAmount().multiply( new BigDecimal(orderDetail.getNum())));
}
if(order.getAmount().compareTo(bigDecimal)!=0){
throw new ServiceException("价格计算出现了问题,请重新计算");
throw new ServiceException("价格计算出现了问题,请重新计算"+ bigDecimal.stripTrailingZeros().toString() );
}
order.setAmount(bigDecimal);
int i = orderMapper.insertOrder(order);
......
......@@ -154,7 +154,8 @@ public class SysMenuServiceImpl implements ISysMenuService
router.setQuery(menu.getQuery());
router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath()));
List<SysMenu> cMenus = menu.getChildren();
if (!cMenus.isEmpty() && cMenus.size() > 0 && (UserConstants.TYPE_DIR.equals(menu.getMenuType())||UserConstants.TYPE_MENU.equals(menu.getMenuType())))
//||UserConstants.TYPE_MENU.equals(menu.getMenuType())
if (!cMenus.isEmpty() && cMenus.size() > 0 && (UserConstants.TYPE_DIR.equals(menu.getMenuType())))
{
router.setAlwaysShow(true);
router.setRedirect("noRedirect");
......
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