【优化】修复工单解决方案和部门未应用多语言的问题
This commit is contained in:
parent
0fe7284ae8
commit
75ad55a211
|
|
@ -929,7 +929,7 @@ public class TicketController extends ControllerBase {
|
|||
@GetMapping("getSolutionMeasures")
|
||||
@ApiMark(moduleName = "工单管理", apiName = "获取工单解决方案措施")
|
||||
public ApiResult<SolutionMeasuresVO> getSolutionMeasures(@Valid @RequestParam @NotNull Long ticketId) {
|
||||
return ApiResult.success(ticketSolutionService.getSolutionMeasures(ticketId, Constant.DEFAULT_LANGUAGE_CODE));
|
||||
return ApiResult.success(ticketSolutionService.getSolutionMeasures(ticketId, MultilingualUtil.getLanguage()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ import java.util.List;
|
|||
*/
|
||||
public interface TicketSolutionAuditMapper extends BaseMapper<TicketSolutionAudit> {
|
||||
|
||||
List<SolutionReviewDepartmentVO> getByTicket(Long ticketId);
|
||||
List<SolutionReviewDepartmentVO> getByTicket(Long ticketId,String languageCode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ package com.nflg.mobilebroken.repository.mapper;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.mobilebroken.repository.entity.TicketSolution;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
|
|
@ -13,4 +15,5 @@ import com.nflg.mobilebroken.repository.entity.TicketSolution;
|
|||
*/
|
||||
public interface TicketSolutionMapper extends BaseMapper<TicketSolution> {
|
||||
|
||||
List<TicketSolution> getList(Long ticketId, String language);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
|
|||
@Override
|
||||
public List<SolutionReviewDepartmentVO> getByTicket(Long ticketId,String languageCode) {
|
||||
List<DictionaryItem> items = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_REVIEW_DEPARTMENT, languageCode);
|
||||
List<SolutionReviewDepartmentVO> vos = baseMapper.getByTicket(ticketId);
|
||||
List<SolutionReviewDepartmentVO> vos = baseMapper.getByTicket(ticketId,languageCode);
|
||||
items.forEach(item -> {
|
||||
if (vos.stream().noneMatch(vo -> vo.getDeptName().equals(item.getName()))) {
|
||||
SolutionReviewDepartmentVO vo = new SolutionReviewDepartmentVO();
|
||||
|
|
|
|||
|
|
@ -61,14 +61,15 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
|
|||
private IDeviceService deviceService;
|
||||
|
||||
@Override
|
||||
public SolutionMeasuresVO getSolutionMeasures(Long ticketId,String language) {
|
||||
public SolutionMeasuresVO getSolutionMeasures(Long ticketId, String language) {
|
||||
TicketDTO ticket = ticketService.getDto(ticketId);
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(ticket)).throwMessage("工单不存在");
|
||||
List<DictionaryItem> initial = new ArrayList<>();
|
||||
if (Objects.equals(ticket.getState(), TicketState.Processing.getState()) || Objects.equals(ticket.getState(), TicketState.ProcessingCompleted.getState())) {
|
||||
initial = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_MEASURES, language);
|
||||
}
|
||||
List<TicketSolution> solutions = lambdaQuery().eq(TicketSolution::getTicketId, ticketId).orderByAsc(TicketSolution::getId).list();
|
||||
// List<TicketSolution> solutions = lambdaQuery().eq(TicketSolution::getTicketId, ticketId).orderByAsc(TicketSolution::getId).list();
|
||||
List<TicketSolution> solutions = baseMapper.getList(ticketId, language);
|
||||
Map<Integer, List<TicketSolution>> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemId, LinkedHashMap::new, Collectors.toList()));
|
||||
SolutionMeasuresVO vo = new SolutionMeasuresVO();
|
||||
if (SaTokenAdminUtil.isLogin()) {
|
||||
|
|
|
|||
|
|
@ -2,20 +2,13 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.TicketSolutionAuditMapper">
|
||||
<select id="getByTicket" resultType="com.nflg.mobilebroken.common.pojo.vo.SolutionReviewDepartmentVO">
|
||||
SELECT tsa.id,
|
||||
tsa.dept_name,
|
||||
tsa.user_id,
|
||||
au.user_name,
|
||||
tsa.state,
|
||||
d.dept_name AS user_dept_name,
|
||||
p.position_name AS user_title,
|
||||
au.user_code,
|
||||
tsa.reason,
|
||||
tsa.create_time
|
||||
SELECT tsa.id,dit.value as dept_name,tsa.user_id,au.user_name,tsa.state,d.dept_name AS user_dept_name
|
||||
,p.position_name AS user_title,au.user_code,tsa.reason,tsa.create_time
|
||||
FROM ticket_solution_audit tsa
|
||||
LEFT JOIN admin_user au ON tsa.user_id = au.id
|
||||
LEFT JOIN t_base_department d ON d.id = au.department_id
|
||||
LEFT JOIN t_base_position p ON p.id = au.title_id
|
||||
left join dictionary_item_translate dit on tsa.dept_id=dit.dictionary_item_id and dit.language_code=#{languageCode}
|
||||
WHERE tsa.ticket_id = #{ticketId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,11 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.TicketSolutionMapper">
|
||||
|
||||
<select id="getList" resultType="com.nflg.mobilebroken.repository.entity.TicketSolution">
|
||||
select dit.value as dictionary_item_name,ts.*
|
||||
from ticket_solution ts
|
||||
left join dictionary_item di on ts.dictionary_item_id=di.id
|
||||
left join dictionary_item_translate dit on di.id=dit.dictionary_item_id and dit.language_code=#{language}
|
||||
where ts.ticket_id=#{ticketId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue