|
|
|
@ -25,8 +25,8 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
|
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
|
|
|
|
import cn.estsh.impp.framework.boot.fastdfs.FastDFSClient;
|
|
|
|
|
import cn.estsh.impp.framework.boot.fastdfs.FastDFSFile;
|
|
|
|
|
import cn.estsh.impp.framework.boot.fileservice.ImppFileService;
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.bean.ImppFile;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ImppRedis;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
@ -82,7 +82,7 @@ public class SysLocaleResourceController extends CoreBaseController {
|
|
|
|
|
private EntityManager entityManager;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private FastDFSClient dfsClient;
|
|
|
|
|
private ImppFileService fileService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 新增语言资源
|
|
|
|
@ -487,10 +487,10 @@ public class SysLocaleResourceController extends CoreBaseController {
|
|
|
|
|
// 查询服务器中是否存在模板文件
|
|
|
|
|
SysFile sysFile = sysFileService.getSysFileByFileCode(importTemplateCode);
|
|
|
|
|
if(sysFile == null){
|
|
|
|
|
FastDFSFile fastDFSFile = new FastDFSFile(SysLocaleResource.class.getSimpleName() + "ImportTemplate.xls",
|
|
|
|
|
ImppFile fastDFSFile = new ImppFile(SysLocaleResource.class.getSimpleName() + "ImportTemplate.xls",
|
|
|
|
|
excelTool.importTemplate(SysLocaleResource.class), ".xls");
|
|
|
|
|
|
|
|
|
|
sysFile = dfsClient.upload(fastDFSFile,CommonEnumUtil.SOFT_TYPE.CORE.getValue());
|
|
|
|
|
sysFile = fileService.upload(fastDFSFile,CommonEnumUtil.SOFT_TYPE.CORE.getValue());
|
|
|
|
|
sysFile.setFileCode(importTemplateCode);
|
|
|
|
|
sysFileService.insertSysFile(sysFile);
|
|
|
|
|
}
|
|
|
|
@ -563,7 +563,9 @@ public class SysLocaleResourceController extends CoreBaseController {
|
|
|
|
|
@ApiOperation(value = "批量转换缺失资源")
|
|
|
|
|
public ResultBean doBatchConversionMissResource(@RequestBody List<MissResourceModel> missResourceModelList){
|
|
|
|
|
try {
|
|
|
|
|
sysLocaleResourceService.doConversionMissResourceByKeys(missResourceModelList);
|
|
|
|
|
ValidatorBean.checkNotNull(missResourceModelList,"请选择缺失数据信息");
|
|
|
|
|
|
|
|
|
|
sysLocaleResourceService.doConversionMissResourceByKeys(missResourceModelList, AuthUtil.getSessionUser().getUserName());
|
|
|
|
|
|
|
|
|
|
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
} catch (ImppBusiException busExcep) {
|
|
|
|
@ -607,7 +609,7 @@ public class SysLocaleResourceController extends CoreBaseController {
|
|
|
|
|
String fileName = "locale_" + System.currentTimeMillis() + ".xls";
|
|
|
|
|
|
|
|
|
|
File file = new File(tempDir,fileName);
|
|
|
|
|
if (file.createNewFile()) {
|
|
|
|
|
if (!file.createNewFile()) {
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.IO_EXCEPTION_FILE.getCode())
|
|
|
|
|