|
@@ -24,11 +24,13 @@ import com.xy.utils.R;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestHeader;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -44,6 +46,7 @@ import static com.xy.utils.Beans.tree;
|
|
|
* @author lijin
|
|
|
* @since 2022-12-09
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Api(tags = "菜单管理")
|
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
@@ -103,7 +106,7 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
|
|
|
@PostMapping("workMenuList")
|
|
|
@ApiOperation("用户菜单集合")
|
|
|
- public R<List<SysMenuDto.MenuVo>> workMenuList(@RequestBody @Validated SysMenuDto.WorkMenuList workMenu) {
|
|
|
+ public R<List<SysMenuDto.MenuVo>> workMenuList(@RequestHeader(value = "lang", required = false) String lang, @RequestBody @Validated SysMenuDto.WorkMenuList workMenu) {
|
|
|
List<SysMenuDto.MenuVo> menuVos = new ArrayList<>();
|
|
|
List<Long> sysIds = workMenu.getSysId();
|
|
|
List<SysSystem> sysSystems = sysSystemMapper.selectList(new LambdaQueryWrapper<SysSystem>().in(SysSystem::getId, sysIds));
|
|
@@ -114,6 +117,16 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
? RedisCache.getMenu(sysId, workMenu.getClientType())
|
|
|
: RedisCache.getMenu(sysId);
|
|
|
menus.forEach(sysMenuJoinSysRoleMenu -> list.add(copy(SysMenuDto.Vo.class, sysMenuJoinSysRoleMenu)));
|
|
|
+ if ("en".equals(lang)) {
|
|
|
+ //英文菜单
|
|
|
+ list.forEach(sm -> {
|
|
|
+ String enName = sm.getEnName();
|
|
|
+ if (StrUtil.isNotEmpty(enName)) {
|
|
|
+ sm.setName(enName);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
SysSystem sysSystem = sysSystemJMap.get(sysId);
|
|
|
if (sysSystem == null) {
|
|
|
continue;
|
|
@@ -124,6 +137,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
|
|
|
.setName(sysSystem.getName())
|
|
|
.setIcon(sysSystem.getIcon())
|
|
|
.setMenu(list);
|
|
|
+ if ("en".equals(lang) && "xy_merc_mini".equals(sysSystem.getCode())) {
|
|
|
+ //商管端
|
|
|
+ menuVo.setName("Business Management Platform");
|
|
|
+ }
|
|
|
menuVos.add(menuVo);
|
|
|
}
|
|
|
return R.ok(menuVos);
|