Merge branch 'prod/20260407' into test
This commit is contained in:
commit
faee173200
|
|
@ -11,6 +11,7 @@ import com.nflg.mobilebroken.admin.annotation.ApiMark;
|
|||
import com.nflg.mobilebroken.admin.publisher.TicketEventPublisher;
|
||||
import com.nflg.mobilebroken.admin.service.ShengWangService;
|
||||
import com.nflg.mobilebroken.admin.service.SsePushService;
|
||||
import com.nflg.mobilebroken.admin.service.impl.AliYunTranslate;
|
||||
import com.nflg.mobilebroken.common.constant.*;
|
||||
import com.nflg.mobilebroken.common.exception.NflgException;
|
||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
|
|
@ -155,6 +156,9 @@ public class TicketController extends ControllerBase {
|
|||
@Resource
|
||||
private ILanguageService languageService;
|
||||
|
||||
@Resource
|
||||
private AliYunTranslate aliYunTranslate;
|
||||
|
||||
/**
|
||||
* 获取问题类型
|
||||
* @return 问题类型列表
|
||||
|
|
@ -180,7 +184,17 @@ public class TicketController extends ControllerBase {
|
|||
@GetMapping("getFavorites")
|
||||
@ApiMark(moduleName = "工单管理", apiName = "获取收藏夹", isPublic = true)
|
||||
public ApiResult<FavoritesVO> getFavorites(@RequestParam(defaultValue = "0") Integer id) {
|
||||
return ApiResult.success(ticketFavoritesService.getMBList(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id));
|
||||
FavoritesVO vo = ticketFavoritesService.getMBList(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id);
|
||||
if (id == 0) {
|
||||
String languageCode = MultilingualUtil.getLanguage();
|
||||
if (!StrUtil.equals(languageCode, Constant.DEFAULT_LANGUAGE_CODE)) {
|
||||
Language language = languageService.lambdaQuery().eq(Language::getCode, languageCode).one();
|
||||
if (Objects.nonNull(language)) {
|
||||
vo.setName(aliYunTranslate.translateWord(vo.getName(), language.getTranslateCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -190,7 +204,17 @@ public class TicketController extends ControllerBase {
|
|||
*/
|
||||
@GetMapping("getFavoritesTree")
|
||||
public ApiResult<FavoritesVO> getFavoritesTree(@RequestParam(defaultValue = "0") Integer id) {
|
||||
return ApiResult.success(ticketFavoritesService.getTree(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id));
|
||||
FavoritesVO vo = ticketFavoritesService.getTree(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id);
|
||||
if (id == 0) {
|
||||
String languageCode = MultilingualUtil.getLanguage();
|
||||
if (!StrUtil.equals(languageCode, Constant.DEFAULT_LANGUAGE_CODE)) {
|
||||
Language language = languageService.lambdaQuery().eq(Language::getCode, languageCode).one();
|
||||
if (Objects.nonNull(language)) {
|
||||
vo.setName(aliYunTranslate.translateWord(vo.getName(), language.getTranslateCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import com.nflg.mobilebroken.gongfu.pojo.vo.SolutionImageVO;
|
|||
import com.nflg.mobilebroken.gongfu.publisher.TicketEventPublisher;
|
||||
import com.nflg.mobilebroken.gongfu.service.ShengWangService;
|
||||
import com.nflg.mobilebroken.gongfu.service.SsePushService;
|
||||
import com.nflg.mobilebroken.gongfu.service.impl.AliYunTranslate;
|
||||
import com.nflg.mobilebroken.repository.entity.*;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
||||
|
|
@ -144,9 +145,13 @@ public class TicketController extends ControllerBase {
|
|||
|
||||
@Resource
|
||||
private DeepSeekTranslate deepSeekTranslate;
|
||||
|
||||
@Resource
|
||||
private ILanguageService languageService;
|
||||
|
||||
@Resource
|
||||
private AliYunTranslate aliYunTranslate;
|
||||
|
||||
/**
|
||||
* 获取问题类型
|
||||
* @return 问题类型列表
|
||||
|
|
@ -172,7 +177,17 @@ public class TicketController extends ControllerBase {
|
|||
@GetMapping("getFavorites")
|
||||
@ApiMark(moduleName = "工单管理", apiName = "获取收藏夹", isPublic = true)
|
||||
public ApiResult<FavoritesVO> getFavorites(@RequestParam(defaultValue = "0") Integer id) {
|
||||
return ApiResult.success(ticketFavoritesService.getGFList(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id));
|
||||
FavoritesVO vo = ticketFavoritesService.getGFList(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id);
|
||||
if (id == 0) {
|
||||
String languageCode = MultilingualUtil.getLanguage();
|
||||
if (!StrUtil.equals(languageCode, Constant.DEFAULT_LANGUAGE_CODE)) {
|
||||
Language language = languageService.lambdaQuery().eq(Language::getCode, languageCode).one();
|
||||
if (Objects.nonNull(language)) {
|
||||
vo.setName(aliYunTranslate.translateWord(vo.getName(), language.getTranslateCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -182,7 +197,17 @@ public class TicketController extends ControllerBase {
|
|||
*/
|
||||
@GetMapping("getFavoritesTree")
|
||||
public ApiResult<FavoritesVO> getFavoritesTree(@RequestParam(defaultValue = "0") Integer id) {
|
||||
return ApiResult.success(ticketFavoritesService.getTree(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id));
|
||||
FavoritesVO vo = ticketFavoritesService.getTree(AdminUserUtil.getUserId(), Constant.FROM_ADMIN, id);
|
||||
if (id == 0) {
|
||||
String languageCode = MultilingualUtil.getLanguage();
|
||||
if (!StrUtil.equals(languageCode, Constant.DEFAULT_LANGUAGE_CODE)) {
|
||||
Language language = languageService.lambdaQuery().eq(Language::getCode, languageCode).one();
|
||||
if (Objects.nonNull(language)) {
|
||||
vo.setName(aliYunTranslate.translateWord(vo.getName(), language.getTranslateCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue