Merge branch 'prod/20260407' into test
This commit is contained in:
commit
846efe55bc
|
|
@ -125,22 +125,6 @@
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>5.2.3</version>
|
<version>5.2.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.aliyun</groupId>
|
|
||||||
<artifactId>alimt20181012</artifactId>
|
|
||||||
<version>1.5.0</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.aliyun</groupId>
|
|
||||||
<artifactId>tea-openapi</artifactId>
|
|
||||||
<version>0.3.9</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>dom4j</artifactId>
|
|
||||||
<groupId>org.dom4j</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.mwiede</groupId>
|
<groupId>com.github.mwiede</groupId>
|
||||||
<artifactId>jsch</artifactId>
|
<artifactId>jsch</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.nflg.mobilebroken.admin.config;
|
||||||
|
|
||||||
|
import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
|
import com.nflg.mobilebroken.repository.service.ILanguageService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SystemConfig {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILanguageService languageService;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void initData() {
|
||||||
|
languageService.list().forEach(language -> {
|
||||||
|
Constant.LANGUAGE_ALIYUN_MAP.put(language.getCode(),language.getTranslateCode());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -71,4 +71,12 @@ public class TestController extends ControllerBase{
|
||||||
public ApiResult<String> deepseekTranslate(@RequestParam String text, @RequestParam String targetLanguage) {
|
public ApiResult<String> deepseekTranslate(@RequestParam String text, @RequestParam String targetLanguage) {
|
||||||
return ApiResult.success(deepSeekTranslate.translateWord(text, "auto", targetLanguage, "html"));
|
return ApiResult.success(deepSeekTranslate.translateWord(text, "auto", targetLanguage, "html"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抛错
|
||||||
|
*/
|
||||||
|
@GetMapping("throwError")
|
||||||
|
public void throwError() {
|
||||||
|
VUtils.trueThrowBusinessError(true).throwMessage("抛错");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@ import com.nflg.mobilebroken.admin.annotation.ApiMark;
|
||||||
import com.nflg.mobilebroken.admin.publisher.TicketEventPublisher;
|
import com.nflg.mobilebroken.admin.publisher.TicketEventPublisher;
|
||||||
import com.nflg.mobilebroken.admin.service.ShengWangService;
|
import com.nflg.mobilebroken.admin.service.ShengWangService;
|
||||||
import com.nflg.mobilebroken.admin.service.SsePushService;
|
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.constant.*;
|
||||||
import com.nflg.mobilebroken.common.exception.NflgException;
|
import com.nflg.mobilebroken.common.exception.NflgException;
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
|
|
@ -24,6 +23,7 @@ import com.nflg.mobilebroken.repository.entity.*;
|
||||||
import com.nflg.mobilebroken.repository.service.*;
|
import com.nflg.mobilebroken.repository.service.*;
|
||||||
import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
import com.nflg.mobilebroken.starter.annotation.MethodInfoMark;
|
||||||
import com.nflg.mobilebroken.starter.service.UniPushService;
|
import com.nflg.mobilebroken.starter.service.UniPushService;
|
||||||
|
import com.nflg.mobilebroken.starter.service.impl.AliYunTranslate;
|
||||||
import com.nflg.mobilebroken.starter.service.impl.DeepSeekTranslate;
|
import com.nflg.mobilebroken.starter.service.impl.DeepSeekTranslate;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.nflg.mobilebroken.cfs.config;
|
||||||
|
|
||||||
|
import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
|
import com.nflg.mobilebroken.repository.service.ILanguageService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class SystemConfig {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILanguageService languageService;
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void initData() {
|
||||||
|
languageService.list().forEach(language -> {
|
||||||
|
Constant.LANGUAGE_ALIYUN_MAP.put(language.getCode(),language.getTranslateCode());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
package com.nflg.mobilebroken.common.constant;
|
package com.nflg.mobilebroken.common.constant;
|
||||||
|
|
||||||
|
import cn.hutool.setting.Setting;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class Constant {
|
public class Constant {
|
||||||
|
|
||||||
public static final String FROM_APP = "app";
|
public static final String FROM_APP = "app";
|
||||||
|
|
@ -83,7 +88,6 @@ public class Constant {
|
||||||
public static final String DICTIONARY_ITEM_EMAIL_TITLE_TICKET_CLOSE_GONGFU = "TitleTicketCloseGongfu";
|
public static final String DICTIONARY_ITEM_EMAIL_TITLE_TICKET_CLOSE_GONGFU = "TitleTicketCloseGongfu";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 事业部部长
|
* 事业部部长
|
||||||
*/
|
*/
|
||||||
|
|
@ -173,4 +177,5 @@ public class Constant {
|
||||||
public static final Integer TICKET_TYPE_MOBILE_BROKEN = 0;
|
public static final Integer TICKET_TYPE_MOBILE_BROKEN = 0;
|
||||||
public static final Integer TICKET_TYPE_GONGFU = 1;
|
public static final Integer TICKET_TYPE_GONGFU = 1;
|
||||||
|
|
||||||
|
public static final Map<String, String> LANGUAGE_ALIYUN_MAP = new HashMap<>();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,13 @@ import com.nflg.mobilebroken.repository.entity.Device;
|
||||||
import com.nflg.mobilebroken.repository.entity.GongfuDevice;
|
import com.nflg.mobilebroken.repository.entity.GongfuDevice;
|
||||||
import com.nflg.mobilebroken.repository.service.IDeviceService;
|
import com.nflg.mobilebroken.repository.service.IDeviceService;
|
||||||
import com.nflg.mobilebroken.repository.service.IGongfuDeviceService;
|
import com.nflg.mobilebroken.repository.service.IGongfuDeviceService;
|
||||||
|
import com.nflg.mobilebroken.repository.service.ILanguageService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
|
@ -24,6 +26,9 @@ public class SystemConfig {
|
||||||
@Resource
|
@Resource
|
||||||
private IGongfuDeviceService deviceService;
|
private IGongfuDeviceService deviceService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ILanguageService languageService;
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void initData() {
|
public void initData() {
|
||||||
log.info("初始化产品线列表");
|
log.info("初始化产品线列表");
|
||||||
|
|
@ -46,5 +51,8 @@ public class SystemConfig {
|
||||||
.collect(Collectors.toSet())
|
.collect(Collectors.toSet())
|
||||||
);
|
);
|
||||||
log.info("产品线列表:{}", StrUtil.join(",", Constant1.PRODUCT_LINE));
|
log.info("产品线列表:{}", StrUtil.join(",", Constant1.PRODUCT_LINE));
|
||||||
|
languageService.list().forEach(language -> {
|
||||||
|
Constant.LANGUAGE_ALIYUN_MAP.put(language.getCode(),language.getTranslateCode());
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,11 @@ public class TicketSolutionAudit implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Long ticketId;
|
private Long ticketId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 部门id
|
||||||
|
*/
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门名称
|
* 部门名称
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.mobilebroken.repository.service.impl;
|
package com.nflg.mobilebroken.repository.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.nflg.mobilebroken.common.constant.Constant;
|
import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
|
|
@ -75,10 +76,16 @@ public class TicketSolutionAuditServiceImpl extends ServiceImpl<TicketSolutionAu
|
||||||
List<TicketSolutionAudit> forAdd = new ArrayList<>();
|
List<TicketSolutionAudit> forAdd = new ArrayList<>();
|
||||||
List<TicketSolutionAudit> forUpdate = new ArrayList<>();
|
List<TicketSolutionAudit> forUpdate = new ArrayList<>();
|
||||||
Ticket ticket = ticketService.getById(request.getTicketId());
|
Ticket ticket = ticketService.getById(request.getTicketId());
|
||||||
|
List<DictionaryItem> dictionaryItems = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_SOLUTION_REVIEW_DEPARTMENT);
|
||||||
request.getDepartments().forEach(detp -> {
|
request.getDepartments().forEach(detp -> {
|
||||||
TicketSolutionAudit audit = new TicketSolutionAudit();
|
TicketSolutionAudit audit = new TicketSolutionAudit();
|
||||||
if (Objects.isNull(detp.getId())) {
|
if (Objects.isNull(detp.getId())) {
|
||||||
|
DictionaryItem dept = dictionaryItems.stream()
|
||||||
|
.filter(item -> StrUtil.equals(item.getName(), detp.getDeptName()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
audit.setTicketId(Long.valueOf(request.getTicketId()));
|
audit.setTicketId(Long.valueOf(request.getTicketId()));
|
||||||
|
audit.setDeptId(Objects.isNull(dept) ? null : dept.getId().longValue());
|
||||||
audit.setDeptName(detp.getDeptName());
|
audit.setDeptName(detp.getDeptName());
|
||||||
audit.setUserId(detp.getUserId());
|
audit.setUserId(detp.getUserId());
|
||||||
audit.setCreateTime(LocalDateTime.now());
|
audit.setCreateTime(LocalDateTime.now());
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,22 @@
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>alimt20181012</artifactId>
|
||||||
|
<version>1.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>tea-openapi</artifactId>
|
||||||
|
<version>0.3.9</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>dom4j</artifactId>
|
||||||
|
<groupId>org.dom4j</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@ import com.nflg.mobilebroken.common.constant.Constant;
|
||||||
import com.nflg.mobilebroken.common.constant.STATE;
|
import com.nflg.mobilebroken.common.constant.STATE;
|
||||||
import com.nflg.mobilebroken.common.exception.NflgException;
|
import com.nflg.mobilebroken.common.exception.NflgException;
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
|
import com.nflg.mobilebroken.common.util.MultilingualUtil;
|
||||||
|
import com.nflg.mobilebroken.starter.service.impl.AliYunTranslate;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
|
@ -19,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import javax.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
import javax.validation.ConstraintViolationException;
|
import javax.validation.ConstraintViolationException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
|
|
@ -30,6 +33,9 @@ import java.util.stream.Collectors;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class GlobalRestControllerAdvice {
|
public class GlobalRestControllerAdvice {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AliYunTranslate aliYunTranslate;
|
||||||
|
|
||||||
@Value("${spring.servlet.multipart.max-file-size}")
|
@Value("${spring.servlet.multipart.max-file-size}")
|
||||||
private DataSize maxFileSize;
|
private DataSize maxFileSize;
|
||||||
|
|
||||||
|
|
@ -52,6 +58,13 @@ public class GlobalRestControllerAdvice {
|
||||||
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(ex.getMessage());
|
return ResponseEntity.status(HttpStatus.UNAUTHORIZED).body(ex.getMessage());
|
||||||
} else {
|
} else {
|
||||||
log.error("业务错误: ", ex);
|
log.error("业务错误: ", ex);
|
||||||
|
String languageCode = MultilingualUtil.getLanguage();
|
||||||
|
if (!StrUtil.equals(languageCode, Constant.DEFAULT_LANGUAGE_CODE)) {
|
||||||
|
String aliyunCode = Constant.LANGUAGE_ALIYUN_MAP.get(languageCode);
|
||||||
|
if (StrUtil.isNotBlank(aliyunCode)) {
|
||||||
|
return ResponseEntity.ok().body(ApiResult.error(ex.getState(), aliYunTranslate.translateWord(ex.getMessage(), aliyunCode)));
|
||||||
|
}
|
||||||
|
}
|
||||||
return ResponseEntity.ok().body(ApiResult.error(ex.getState(), ex.getMessage()));
|
return ResponseEntity.ok().body(ApiResult.error(ex.getState(), ex.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.nflg.mobilebroken.admin.service.impl;
|
package com.nflg.mobilebroken.starter.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
Loading…
Reference in New Issue