Compare commits
No commits in common. "34df03ebd9364d426f3684611aeeae4eefc35e0e" and "b48c639f27ea706ad3d5cbd783ccfa7b9471dab5" have entirely different histories.
34df03ebd9
...
b48c639f27
|
|
@ -1,22 +1,14 @@
|
||||||
package com.nflg.mobilebroken.admin.controller;
|
package com.nflg.mobilebroken.admin.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
import com.nflg.mobilebroken.common.pojo.request.TranslateWordRequest;
|
import com.nflg.mobilebroken.common.pojo.request.TranslateWordRequest;
|
||||||
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
import com.nflg.mobilebroken.common.util.AdminUserUtil;
|
||||||
import com.nflg.mobilebroken.common.util.VUtils;
|
|
||||||
import com.nflg.mobilebroken.repository.entity.Language;
|
|
||||||
import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
|
|
||||||
import com.nflg.mobilebroken.repository.service.ILanguageService;
|
|
||||||
import com.nflg.mobilebroken.starter.service.ITranslate;
|
import com.nflg.mobilebroken.starter.service.ITranslate;
|
||||||
import com.nflg.mobilebroken.starter.service.impl.DeepSeekTranslate;
|
import com.nflg.mobilebroken.starter.service.impl.DeepSeekTranslate;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 翻译相关
|
* 翻译相关
|
||||||
|
|
@ -31,9 +23,6 @@ public class TranslateController extends ControllerBase{
|
||||||
@Resource
|
@Resource
|
||||||
private DeepSeekTranslate deepSeekTranslate;
|
private DeepSeekTranslate deepSeekTranslate;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ILanguageService languageService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文字翻译
|
* 文字翻译
|
||||||
* @param request 请求参数
|
* @param request 请求参数
|
||||||
|
|
@ -50,16 +39,8 @@ public class TranslateController extends ControllerBase{
|
||||||
* @return 翻译结果
|
* @return 翻译结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("deepseek")
|
@PostMapping("deepseek")
|
||||||
public ApiResult<String> deepseek(HttpServletRequest request, @RequestParam String text) {
|
public ApiResult<String> deepseek(@RequestParam String text) {
|
||||||
String languageCode = request.getHeader("language");
|
|
||||||
if (StrUtil.isBlank(languageCode)) {
|
|
||||||
return ApiResult.success("");
|
|
||||||
}
|
|
||||||
Language language = languageService.lambdaQuery().eq(Language::getCode, languageCode).one();
|
|
||||||
if (Objects.isNull(language)) {
|
|
||||||
return ApiResult.success("");
|
|
||||||
}
|
|
||||||
text = text.replaceAll("<br>", ",");
|
text = text.replaceAll("<br>", ",");
|
||||||
return ApiResult.success(deepSeekTranslate.translateWord(text, "auto", language.getName(), "text"));
|
return ApiResult.success(deepSeekTranslate.translateWord(text, "auto", AdminUserUtil.getLanguageName(), "text"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
||||||
package com.nflg.mobilebroken.cfs.controller;
|
package com.nflg.mobilebroken.cfs.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
import com.nflg.mobilebroken.common.util.AppUserUtil;
|
import com.nflg.mobilebroken.common.util.AppUserUtil;
|
||||||
import com.nflg.mobilebroken.repository.entity.Language;
|
|
||||||
import com.nflg.mobilebroken.repository.service.ILanguageService;
|
|
||||||
import com.nflg.mobilebroken.starter.service.impl.DeepSeekTranslate;
|
import com.nflg.mobilebroken.starter.service.impl.DeepSeekTranslate;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -12,8 +9,6 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 翻译相关
|
* 翻译相关
|
||||||
|
|
@ -25,24 +20,13 @@ public class TranslateController extends ControllerBase {
|
||||||
@Resource
|
@Resource
|
||||||
private DeepSeekTranslate deepSeekTranslate;
|
private DeepSeekTranslate deepSeekTranslate;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ILanguageService languageService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deepseek翻译
|
* deepseek翻译
|
||||||
* @param text 要翻译的文本
|
* @param text 要翻译的文本
|
||||||
* @return 翻译结果
|
* @return 翻译结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("deepseek")
|
@PostMapping("deepseek")
|
||||||
public ApiResult<String> deepseek(HttpServletRequest request, @RequestParam String text) {
|
public ApiResult<String> deepseek(@RequestParam String text) {
|
||||||
String languageCode = request.getHeader("language");
|
return ApiResult.success(deepSeekTranslate.translateWord(text, "auto", AppUserUtil.getLanguageName(), "text"));
|
||||||
if (StrUtil.isBlank(languageCode)) {
|
|
||||||
return ApiResult.success("");
|
|
||||||
}
|
|
||||||
Language language = languageService.lambdaQuery().eq(Language::getCode, languageCode).one();
|
|
||||||
if (Objects.isNull(language)) {
|
|
||||||
return ApiResult.success("");
|
|
||||||
}
|
|
||||||
return ApiResult.success(deepSeekTranslate.translateWord(text, "auto", language.getName(), "text"));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,4 @@ public class SolutionMeasuresVO {
|
||||||
|
|
||||||
// 是否审核通过,默认为null,表示未审核;false:不通过,true:通过
|
// 是否审核通过,默认为null,表示未审核;false:不通过,true:通过
|
||||||
private Boolean approved;
|
private Boolean approved;
|
||||||
|
|
||||||
/**
|
|
||||||
* 部件列表
|
|
||||||
*/
|
|
||||||
private List<ComponentInfo> components;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,7 @@ public class DeviceComponentController extends ControllerBase {
|
||||||
.like(StrUtil.isNotBlank(query.getProductLine()), GongfuDeviceComponent::getProductLine, query.getProductLine())
|
.like(StrUtil.isNotBlank(query.getProductLine()), GongfuDeviceComponent::getProductLine, query.getProductLine())
|
||||||
.list();
|
.list();
|
||||||
List<GongfuDeviceComponentDetail> details = deviceComponentDetailService.list();
|
List<GongfuDeviceComponentDetail> details = deviceComponentDetailService.list();
|
||||||
|
details.forEach(d -> d.setId(d.getDeviceComponentId()));
|
||||||
List<GongFuDeviceTypeVO> datas = new ArrayList<>();
|
List<GongFuDeviceTypeVO> datas = new ArrayList<>();
|
||||||
productLines.forEach(p -> {
|
productLines.forEach(p -> {
|
||||||
GongFuDeviceTypeVO vo = datas.stream()
|
GongFuDeviceTypeVO vo = datas.stream()
|
||||||
|
|
@ -107,7 +108,6 @@ public class DeviceComponentController extends ControllerBase {
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElseGet(() -> {
|
.orElseGet(() -> {
|
||||||
GongFuDeviceTypeVO v = new GongFuDeviceTypeVO()
|
GongFuDeviceTypeVO v = new GongFuDeviceTypeVO()
|
||||||
.setId(p.getId())
|
|
||||||
.setProductLine(p.getProductLine());
|
.setProductLine(p.getProductLine());
|
||||||
datas.add(v);
|
datas.add(v);
|
||||||
return v;
|
return v;
|
||||||
|
|
|
||||||
|
|
@ -669,7 +669,6 @@ public class TicketController extends ControllerBase {
|
||||||
.setDeviceAddress(ticket.getDeviceAddress())
|
.setDeviceAddress(ticket.getDeviceAddress())
|
||||||
.setModelNo(device.getModelNo())
|
.setModelNo(device.getModelNo())
|
||||||
.setDeviceType(device.getDeviceType())
|
.setDeviceType(device.getDeviceType())
|
||||||
.setComponentId(ticket.getComponentId())
|
|
||||||
.setComponent(Objects.nonNull(part) ? part.getPartName() : "")
|
.setComponent(Objects.nonNull(part) ? part.getPartName() : "")
|
||||||
.setUseTime(ticket.getUseTime())
|
.setUseTime(ticket.getUseTime())
|
||||||
.setDescription(ticket.getDescription())
|
.setDescription(ticket.getDescription())
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@ import java.util.List;
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class GongFuDeviceTypeVO {
|
public class GongFuDeviceTypeVO {
|
||||||
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品线
|
* 产品线
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -47,5 +47,5 @@ public interface DeviceMapper extends BaseMapper<Device> {
|
||||||
|
|
||||||
List<DeviceAgentVO> getAgents();
|
List<DeviceAgentVO> getAgents();
|
||||||
|
|
||||||
List<ComponentInfo> getComponents1(String productLine, String language);
|
List<ComponentInfo> getComponents1(String modelNo, String language);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.mobilebroken.common.constant.Constant;
|
import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery;
|
import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery;
|
||||||
import com.nflg.mobilebroken.common.pojo.request.SearchDeviceRequest;
|
import com.nflg.mobilebroken.common.pojo.request.SearchDeviceRequest;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.ComponentInfo;
|
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentVO;
|
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentVO;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
|
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceVO;
|
import com.nflg.mobilebroken.common.pojo.vo.DeviceVO;
|
||||||
|
|
@ -40,7 +39,7 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
|
||||||
if (Objects.equals(vo.getType(), 0)) {
|
if (Objects.equals(vo.getType(), 0)) {
|
||||||
vo.setComponents(baseMapper.getComponents(vo.getModelNo(), MultilingualUtil.getLanguage()));
|
vo.setComponents(baseMapper.getComponents(vo.getModelNo(), MultilingualUtil.getLanguage()));
|
||||||
} else {
|
} else {
|
||||||
vo.setComponents(baseMapper.getComponents1(vo.getProductLine(), MultilingualUtil.getLanguage()));
|
vo.setComponents(baseMapper.getComponents1(vo.getModelNo(), MultilingualUtil.getLanguage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Optional.ofNullable(vo).orElse(new DeviceInfoVO());
|
return Optional.ofNullable(vo).orElse(new DeviceInfoVO());
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
import com.nflg.mobilebroken.common.constant.TicketState;
|
import com.nflg.mobilebroken.common.constant.TicketState;
|
||||||
import com.nflg.mobilebroken.common.pojo.dto.TicketDTO;
|
import com.nflg.mobilebroken.common.pojo.dto.TicketDTO;
|
||||||
import com.nflg.mobilebroken.common.pojo.request.SolutionMeasuresSaveRequest;
|
import com.nflg.mobilebroken.common.pojo.request.SolutionMeasuresSaveRequest;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
|
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.SolutionMeasuresDataItemVO;
|
import com.nflg.mobilebroken.common.pojo.vo.SolutionMeasuresDataItemVO;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.SolutionMeasuresItemVO;
|
import com.nflg.mobilebroken.common.pojo.vo.SolutionMeasuresItemVO;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.SolutionMeasuresVO;
|
import com.nflg.mobilebroken.common.pojo.vo.SolutionMeasuresVO;
|
||||||
|
|
@ -57,9 +56,6 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
|
||||||
@Resource
|
@Resource
|
||||||
private IFileUploadRecordService fileUploadRecordService;
|
private IFileUploadRecordService fileUploadRecordService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IDeviceService deviceService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SolutionMeasuresVO getSolutionMeasures(Long ticketId) {
|
public SolutionMeasuresVO getSolutionMeasures(Long ticketId) {
|
||||||
TicketDTO ticket = ticketService.getDto(ticketId);
|
TicketDTO ticket = ticketService.getDto(ticketId);
|
||||||
|
|
@ -133,12 +129,6 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
vo.setMeasures(items);
|
vo.setMeasures(items);
|
||||||
if (Objects.equals(ticket.getType(), 1)) {
|
|
||||||
DeviceInfoVO deviceInfoVO = deviceService.getByDeviceNo(ticket.getDeviceNo());
|
|
||||||
if (Objects.nonNull(deviceInfoVO)) {
|
|
||||||
vo.setComponents(deviceInfoVO.getComponents());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return vo;
|
return vo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,6 @@
|
||||||
inner join gongfu_device_component dc ON dc.id = dcd.device_component_id
|
inner join gongfu_device_component dc ON dc.id = dcd.device_component_id
|
||||||
INNER JOIN gongfu_device_part p ON dcd.model_part_id = p.id
|
INNER JOIN gongfu_device_part p ON dcd.model_part_id = p.id
|
||||||
LEFT JOIN gongfu_device_part_language_data ld ON dcd.model_part_id = ld.source_id
|
LEFT JOIN gongfu_device_part_language_data ld ON dcd.model_part_id = ld.source_id
|
||||||
WHERE p.enable=1 AND dc.`enable` = 1 AND dc.product_line=#{productLine} AND ld.language_code=#{language}
|
WHERE p.enable=1 AND dc.`enable` = 1 AND dc.model_no=#{modelNo} AND ld.language_code=#{language}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue