|
@@ -212,7 +212,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -439,7 +440,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = map;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -501,7 +503,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (id == null) {
|
|
|
//新增项目
|
|
|
if (name == null) {
|
|
|
- httpRespMsg.setError("请填写项目名称");
|
|
|
+ //httpRespMsg.setError("请填写项目名称");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("project.fillNameError"));
|
|
|
} else {
|
|
|
//检查项目编号不能重复
|
|
|
Integer count = 0;
|
|
@@ -509,7 +512,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
count = projectMapper.selectCount(new QueryWrapper<Project>().eq("company_id", companyId).eq("project_code", code));
|
|
|
}
|
|
|
if (count > 0) {
|
|
|
- httpRespMsg.setError("提交失败:项目编号已存在");
|
|
|
+ //httpRespMsg.setError("提交失败:项目编号已存在");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("project.submitFailByNoRepeat"));
|
|
|
} else {
|
|
|
Project project = new Project().setProjectName(name).setCompanyId(companyId).setProjectCode(code).setInchargerId(inchargerId)
|
|
|
.setLevel(level)
|
|
@@ -558,7 +562,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
project.setCustomerName("");
|
|
|
}
|
|
|
if (projectMapper.insert(project) == 0) {
|
|
|
- httpRespMsg.setError("操作失败");
|
|
|
+ //httpRespMsg.setError("操作失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("other.operationFail"));
|
|
|
} else {
|
|
|
if (projectBaseCostData != null) {
|
|
|
updateProjectBaseCostData(projectBaseCostData, project.getId());
|
|
@@ -609,7 +614,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
count = projectMapper.selectCount(new QueryWrapper<Project>().eq("company_id", companyId).eq("project_code", code).ne("id", id));
|
|
|
}
|
|
|
if (count > 0) {
|
|
|
- httpRespMsg.setError("提交失败:项目编号已存在");
|
|
|
+ //httpRespMsg.setError("提交失败:项目编号已存在");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("project.submitFailByNoRepeat"));
|
|
|
} else {
|
|
|
Project project = projectMapper.selectById(id);
|
|
|
Project p = new Project();
|
|
@@ -677,7 +683,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
p.setCustomerName("");
|
|
|
}
|
|
|
if (projectMapper.updateById(p) == 0) {
|
|
|
- httpRespMsg.setError("操作失败");
|
|
|
+ //httpRespMsg.setError("操作失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("other.operationFail"));
|
|
|
} else {
|
|
|
|
|
|
if (customerId == null) {
|
|
@@ -920,7 +927,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(first.isPresent()){
|
|
|
ProjectCurrentcost projectCurrentcost = first.get();
|
|
|
if(projectCurrentcost.getBaseAmount()>projectBasecost.getBaseAmount()){
|
|
|
- httpRespMsg.setError("成本基线"+projectBasecost.getBaseName()+"预算小于当前基线预算");
|
|
|
+ //httpRespMsg.setError("成本基线"+projectBasecost.getBaseName()+"预算小于当前基线预算");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("project.costBaseline",projectBasecost.getBaseName()));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
}
|
|
@@ -961,7 +969,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
deleteProData(id);
|
|
|
} else {
|
|
|
if (reportMapper.selectCount(new QueryWrapper<Report>().eq("project_id", id)) > 0) {
|
|
|
- httpRespMsg.setError("检测到该项目存在相关日报,确定要删除全部数据吗");
|
|
|
+ //httpRespMsg.setError("检测到该项目存在相关日报,确定要删除全部数据吗");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("project.dailyDataDel"));
|
|
|
httpRespMsg.code = "reconfirm";
|
|
|
} else {
|
|
|
deleteProData(id);
|
|
@@ -1066,7 +1075,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resultMap;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -1277,7 +1287,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resp;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -1293,7 +1304,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//更新进度
|
|
|
projectMapper.updateById(project);
|
|
|
} else {
|
|
|
- httpRespMsg.setError("无权操作");
|
|
|
+ //httpRespMsg.setError("无权操作");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.operationError"));
|
|
|
}
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -1313,7 +1325,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//更新状态
|
|
|
projectMapper.updateById(project);
|
|
|
} else {
|
|
|
- httpRespMsg.setError("无权操作");
|
|
|
+ //httpRespMsg.setError("无权操作");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.operationError"));
|
|
|
}
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -1411,7 +1424,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
Integer id = project.getId();
|
|
|
Double contractAmount = projectMapper.selectById(id).getContractAmount();
|
|
|
if (contractAmount == 0) {
|
|
|
- msg.setError("请先设置项目合同金额");
|
|
|
+ //msg.setError("请先设置项目合同金额");
|
|
|
+ msg.setError(MessageUtils.message("project.contractAmount"));
|
|
|
return msg;
|
|
|
}
|
|
|
//计算项目总成本
|
|
@@ -1427,7 +1441,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(first.isPresent()){
|
|
|
ProjectCurrentcost projectCurrentcost = first.get();
|
|
|
if(projectCurrentcost.getBaseAmount()>cost.getBaseAmount()){
|
|
|
- msg.setError("成本基线"+cost.getBaseName()+"预算小于当前基线预算");
|
|
|
+ //msg.setError("成本基线"+cost.getBaseName()+"预算小于当前基线预算");
|
|
|
+ msg.setError(MessageUtils.message("project.costBaseline",cost.getBaseName()));
|
|
|
return msg;
|
|
|
}
|
|
|
}
|
|
@@ -1500,7 +1515,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
//首先查看有无浏览权限
|
|
|
if (!projectMapper.selectById(projectId).getCompanyId().equals(companyId)) {
|
|
|
- httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ //httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.otherCompanyProject"));
|
|
|
} else {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
//数据下 非负责部门人员数据不展示
|
|
@@ -1518,7 +1534,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resultMap;
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -1531,7 +1548,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
|
//首先查看有无浏览权限
|
|
|
if (!projectMapper.selectById(projectId).getCompanyId().equals(companyId)) {
|
|
|
- httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ //httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.otherCompanyProject"));
|
|
|
} else {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
List<Map<String, Object>> list = projectMapper.getCostInStage(startDate, endDate, projectId);
|
|
@@ -1548,7 +1566,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resultMap;
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -1562,7 +1581,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
|
//首先查看有无浏览权限
|
|
|
if (projectId != null && !projectMapper.selectById(projectId).getCompanyId().equals(companyId)) {
|
|
|
- httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ //httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.otherCompanyProject"));
|
|
|
} else {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
List<Map<String, Object>> list = projectMapper.getAllMembCost(startDate, endDate, projectId, companyId);
|
|
@@ -1580,7 +1600,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -2757,7 +2778,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
httpRespMsg.data = resp;
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败"+e.getMessage());
|
|
|
+ //httpRespMsg.setError("验证失败"+e.getMessage());
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationErrorByParam",e.getMessage()));
|
|
|
e.printStackTrace();
|
|
|
return httpRespMsg;
|
|
|
}
|
|
@@ -3006,12 +3028,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- msg.data = "成功导入"+importCount+"条数据。";
|
|
|
+ //msg.data = "成功导入"+importCount+"条数据。";
|
|
|
+ msg.data = MessageUtils.message("data.importSucRow",importCount);
|
|
|
if (existCodeList.size() > 0) {
|
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
|
if(key==1){
|
|
|
- msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
- }else msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
+ //msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
+ msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
+ }else msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
}
|
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
@@ -3262,7 +3286,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (plate12 != null)plate12.setCellType(CellType.STRING);
|
|
|
|
|
|
if (nameCell == null) {//项目名称为空的直接跳过
|
|
|
- throw new Exception("项目名称不能为空");
|
|
|
+ //throw new Exception("项目名称不能为空");
|
|
|
+ throw new Exception(MessageUtils.message("project.emptyNameError"));
|
|
|
}
|
|
|
Project project = new Project();
|
|
|
boolean exists=false;
|
|
@@ -3271,11 +3296,13 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (code.equals("项目编号") && rowIndex == 0) {
|
|
|
//检查是否有子项目列
|
|
|
if (subNameCell!=null&&!subNameCell.getStringCellValue().trim().startsWith("子项目")&&timeType.getMainProjectState()!=1) {
|
|
|
- throw new Exception("缺少子项目列,请下载最新模板");
|
|
|
+ //throw new Exception("缺少子项目列,请下载最新模板");
|
|
|
+ throw new Exception(MessageUtils.message("Template.lackSonProject"));
|
|
|
}
|
|
|
//检查是否有主项目列
|
|
|
if (mainNameCell!=null&&!mainNameCell.getStringCellValue().trim().startsWith("主项目")&&timeType.getMainProjectState()==1) {
|
|
|
- throw new Exception("缺少主项目列,请下载最新模板");
|
|
|
+ //throw new Exception("缺少主项目列,请下载最新模板");
|
|
|
+ throw new Exception(MessageUtils.message("Template.lackMasterRow"));
|
|
|
}
|
|
|
//跳过第一行标题
|
|
|
continue;
|
|
@@ -3369,7 +3396,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(!StringUtils.isEmpty(stringCellValue)){
|
|
|
Optional<Department> first = departmentList.stream().filter(dl -> dl.getDepartmentName().equals(stringCellValue)).findFirst();
|
|
|
if(!first.isPresent()){
|
|
|
- msg.setError("部门["+stringCellValue+"]不存在");
|
|
|
+ //msg.setError("部门["+stringCellValue+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("department.notExist",stringCellValue));
|
|
|
return msg;
|
|
|
}else {
|
|
|
project.setDeptId(first.get().getDepartmentId());
|
|
@@ -3384,7 +3412,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(!StringUtils.isEmpty(cellStringCellValue)){
|
|
|
Optional<CustomerInfo> first = customerInfoList.stream().filter(ci -> ci.getCustomerName().equals(cellStringCellValue)).findFirst();
|
|
|
if(!first.isPresent()){
|
|
|
- msg.setError("客户["+cellStringCellValue+"]不存在");
|
|
|
+ //msg.setError("客户["+cellStringCellValue+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("expense.notExist",cellStringCellValue));
|
|
|
return msg;
|
|
|
}else {
|
|
|
project.setCustomerId(first.get().getId());
|
|
@@ -3419,7 +3448,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
String curProviderName = split[i1].trim();
|
|
|
Optional<ProviderInfo> first = providerInfoList.stream().filter(pd -> pd.getProviderName().equals(curProviderName)&&pd.getProviderCategoryId().equals(categoryId)).findFirst();
|
|
|
if(!first.isPresent()){
|
|
|
- msg.setError("供应商["+curProviderName+"]在供应商分类["+providerCategoryList.get(j).getProviderCategoryName()+"]不存在");
|
|
|
+ //msg.setError("供应商["+curProviderName+"]在供应商分类["+providerCategoryList.get(j).getProviderCategoryName()+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("supplier.noExist",curProviderName,providerCategoryList.get(j).getProviderCategoryName()));
|
|
|
return msg;
|
|
|
}else {
|
|
|
if(i1==split.length-1){
|
|
@@ -3491,7 +3521,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
project.setCategory(first.get().getCategoryId());
|
|
|
project.setCategoryName(first.get().getCategoryName());
|
|
|
}else {
|
|
|
- msg.setError("主项目["+mainName+"]不存在");
|
|
|
+ //msg.setError("主项目["+mainName+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("project.masterProjectNull",mainName));
|
|
|
return msg;
|
|
|
}
|
|
|
}
|
|
@@ -3861,12 +3892,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- msg.data = "成功导入"+importCount+"条数据。";
|
|
|
+ //msg.data = "成功导入"+importCount+"条数据。";
|
|
|
+ msg.data = MessageUtils.message("data.importSucRow",importCount);
|
|
|
if (existCodeList.size() > 0) {
|
|
|
String collect = existCodeList.stream().collect(Collectors.joining(","));
|
|
|
if(key==1){
|
|
|
- msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
- }else msg.data += "自动跳过"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
+ //msg.data += "自动更新"+existCodeList.size()+"条已存在项目编码:"+collect;
|
|
|
+ msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
+ }else msg.data += MessageUtils.message("data.upSkip",existCodeList.size(),collect);
|
|
|
}
|
|
|
OperationRecord operationRecord=new OperationRecord();
|
|
|
operationRecord.setCompanyId(user.getCompanyId());
|
|
@@ -3878,22 +3911,27 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("文件处理出错");
|
|
|
+ //msg.setError("文件处理出错");
|
|
|
+ msg.setError(MessageUtils.message("file.error"));
|
|
|
return msg;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("数据格式有误或存在空数据 导入失败");
|
|
|
+ //msg.setError("数据格式有误或存在空数据 导入失败");
|
|
|
+ msg.setError(MessageUtils.message("file.dataFormatError"));
|
|
|
return msg;
|
|
|
}catch (InvalidFormatException e) {
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
|
|
|
+ //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
|
|
|
+ msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
|
|
|
}catch (EncryptedDocumentException e) {
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("文件加密状态,需要先解除加密状态再上传");
|
|
|
+ //msg.setError("文件加密状态,需要先解除加密状态再上传");
|
|
|
+ msg.setError(MessageUtils.message("file.encryption"));
|
|
|
return msg;
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("上传失败:"+e.getMessage());
|
|
|
+ //msg.setError("上传失败:"+e.getMessage());
|
|
|
+ msg.setError(MessageUtils.message("file.uploadError",e.getMessage()));
|
|
|
return msg;
|
|
|
} finally {
|
|
|
//关闭流
|
|
@@ -4205,7 +4243,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resultMap;
|
|
|
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -4291,7 +4330,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resp;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -4421,10 +4461,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
project.setAssociateDegreeNames(associateDegreeNames);
|
|
|
projectMapper.update(project, new QueryWrapper<Project>().in("id", array));
|
|
|
} else {
|
|
|
- msg.setError("项目不能为空");
|
|
|
+ //msg.setError("项目不能为空");
|
|
|
+ msg.setError(MessageUtils.message("project.emptyError"));
|
|
|
}
|
|
|
} else {
|
|
|
- msg.setError("项目不能为空");
|
|
|
+ //msg.setError("项目不能为空");
|
|
|
+ msg.setError(MessageUtils.message("project.emptyError"));
|
|
|
}
|
|
|
|
|
|
return msg;
|
|
@@ -4498,10 +4540,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
updateBatchById(proUpdateList);
|
|
|
}
|
|
|
} else {
|
|
|
- msg.setError("项目不能为空");
|
|
|
+ //msg.setError("项目不能为空");
|
|
|
+ msg.setError(MessageUtils.message("project.emptyError"));
|
|
|
}
|
|
|
} else {
|
|
|
- msg.setError("项目不能为空");
|
|
|
+ //msg.setError("项目不能为空");
|
|
|
+ msg.setError(MessageUtils.message("project.emptyError"));
|
|
|
}
|
|
|
|
|
|
return msg;
|
|
@@ -4902,7 +4946,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
|
|
|
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -5054,7 +5099,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resp;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -5565,7 +5611,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//校验项目归属
|
|
|
Integer companyId = projectMapper.selectById(integer).getCompanyId();
|
|
|
if (companyId.intValue() != user.getCompanyId().intValue()) {
|
|
|
- httpRespMsg.setError("无权操作");
|
|
|
+ //httpRespMsg.setError("无权操作");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.operationError"));
|
|
|
} else {
|
|
|
for (Integer id : array) {
|
|
|
System.out.println("删除项目id=="+id);
|
|
@@ -5590,7 +5637,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
contractModifyRecord.setReason(reason);
|
|
|
contractModifyRecord.setEditUserId(user.getId());
|
|
|
if(contractModifyRecordMapper.insert(contractModifyRecord)<=0){
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -5733,7 +5781,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -5747,7 +5796,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
|
|
|
//首先查看有无浏览权限
|
|
|
if (!projectMapper.selectById(projectId).getCompanyId().equals(companyId)) {
|
|
|
- httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ //httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.otherCompanyProject"));
|
|
|
} else {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
List<Map<String, Object>> list = projectMapper.getCostByGroup(startDate, endDate, projectId);
|
|
@@ -5764,7 +5814,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
httpRespMsg.data = resultMap;
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -6142,7 +6193,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if (!StringUtils.isEmpty(code)) {
|
|
|
int cnt = projectMapper.selectCount(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
|
if (cnt <= 0) {
|
|
|
- msg.setError("项目编号["+code+"]不存在");
|
|
|
+ //msg.setError("项目编号["+code+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("project.idOrNameNoExist",code));
|
|
|
return msg;
|
|
|
}
|
|
|
List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("project_code", code).eq("company_id", user.getCompanyId()));
|
|
@@ -6151,14 +6203,16 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
if(nameCell!=null){
|
|
|
String name = nameCell.getStringCellValue();
|
|
|
if(StringUtils.isEmpty(name)){
|
|
|
- msg.setError("项目编号为["+code+"]的项目名称为["+name+"]的项目不存在");
|
|
|
+ //msg.setError("项目编号为["+code+"]的项目名称为["+name+"]的项目不存在");
|
|
|
+ msg.setError(MessageUtils.message("project.nameAndIdNoExist",code,name));
|
|
|
return msg;
|
|
|
}
|
|
|
}
|
|
|
if(groupCell!=null){
|
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("project_id", project.getId()).eq("name", groupCell.getStringCellValue()));
|
|
|
if(groupList.size()<=0){
|
|
|
- msg.setError("项目名称为["+project.getProjectName()+"]的任务分组["+groupCell.getStringCellValue()+"]不存在");
|
|
|
+ //msg.setError("项目名称为["+project.getProjectName()+"]的任务分组["+groupCell.getStringCellValue()+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("project.nameAndGroupNoExist",project.getProjectName(),groupCell.getStringCellValue()));
|
|
|
return msg;
|
|
|
}
|
|
|
TaskGroup taskGroup = groupList.get(0);
|
|
@@ -6195,13 +6249,15 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("project_name", name).eq("company_id", user.getCompanyId()));
|
|
|
Project project = projectList.get(0);
|
|
|
if(StringUtils.isEmpty(name)){
|
|
|
- msg.setError("项目名称为["+name+"]的项目不存在");
|
|
|
+ //msg.setError("项目名称为["+name+"]的项目不存在");
|
|
|
+ msg.setError(MessageUtils.message("project.idOrNameNoExist",name));
|
|
|
return msg;
|
|
|
}
|
|
|
if(groupCell!=null){
|
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().eq("project_id", project.getId()).eq("name", groupCell.getStringCellValue()));
|
|
|
if(groupList.size()<=0){
|
|
|
- msg.setError("项目名称为["+project.getProjectName()+"]的任务分组["+groupCell.getStringCellValue()+"]不存在");
|
|
|
+ //msg.setError("项目名称为["+project.getProjectName()+"]的任务分组["+groupCell.getStringCellValue()+"]不存在");
|
|
|
+ msg.setError(MessageUtils.message("project.nameAndGroupNoExist",project.getProjectName(),groupCell.getStringCellValue()));
|
|
|
return msg;
|
|
|
}
|
|
|
TaskGroup taskGroup = groupList.get(0);
|
|
@@ -6233,25 +6289,31 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- msg.data = "成功导入" + importCount + "条数据。";
|
|
|
+ //msg.data = "成功导入" + importCount + "条数据。";
|
|
|
+ msg.data = MessageUtils.message("data.importSucRow",importCount);
|
|
|
}catch(IOException e){
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("文件处理出错");
|
|
|
+ //msg.setError("文件处理出错");
|
|
|
+ msg.setError(MessageUtils.message("file.error"));
|
|
|
return msg;
|
|
|
} catch(NullPointerException e){
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("数据格式有误或存在空数据 导入失败");
|
|
|
+ //msg.setError("数据格式有误或存在空数据 导入失败");
|
|
|
+ msg.setError(MessageUtils.message("file.dataFormatError"));
|
|
|
return msg;
|
|
|
}catch(InvalidFormatException e){
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
|
|
|
+ //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
|
|
|
+ msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
|
|
|
}catch(EncryptedDocumentException e){
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("文件加密状态,需要先解除加密状态再上传");
|
|
|
+ //msg.setError("文件加密状态,需要先解除加密状态再上传");
|
|
|
+ msg.setError(MessageUtils.message("file.encryption"));
|
|
|
return msg;
|
|
|
} catch(Exception e){
|
|
|
e.printStackTrace();
|
|
|
- msg.setError("上传失败:" + e.getMessage());
|
|
|
+ //msg.setError("上传失败:" + e.getMessage());
|
|
|
+ msg.setError(MessageUtils.message("file.uploadError",e.getMessage()));
|
|
|
return msg;
|
|
|
} finally{
|
|
|
//关闭流
|
|
@@ -6285,7 +6347,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
for (Project project : projectList) {
|
|
|
project.setInchargerId(inchargerId);
|
|
|
if(projectMapper.updateById(project)<=0){
|
|
|
- httpRespMsg.setError("操作失败");
|
|
|
+ //httpRespMsg.setError("操作失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("other.operationFail"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
boolean b = participationList.stream().anyMatch(pl -> pl.getProjectId().equals(project.getId()) && pl.getUserId().equals(inchargerId));
|
|
@@ -6377,12 +6440,14 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
HttpRespMsg msg=new HttpRespMsg();
|
|
|
List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceService.list(new QueryWrapper<ThirdPartyInterface>().eq("token", token));
|
|
|
if(thirdPartyInterfaceList.size()==0){
|
|
|
- msg.setError("token错误");
|
|
|
+ //msg.setError("token错误");
|
|
|
+ msg.setError(MessageUtils.message("other.tokenError"));
|
|
|
return msg;
|
|
|
}
|
|
|
ThirdPartyInterface thirdPartyInterface = thirdPartyInterfaceList.get(0);
|
|
|
if(LocalDateTime.now().isAfter(thirdPartyInterface.getExpireTime())){
|
|
|
- msg.setError("token过期失效");
|
|
|
+ //msg.setError("token过期失效");
|
|
|
+ msg.setError(MessageUtils.message("other.tokenOverdue"));
|
|
|
return msg;
|
|
|
}
|
|
|
List<Project> allProject = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", thirdPartyInterface.getCompanyId()));
|
|
@@ -6401,7 +6466,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
inertProjectList.add(project);
|
|
|
}
|
|
|
if(saveBatch(inertProjectList)){
|
|
|
- message+="成功添加"+inertProjectList.size()+"条项目数据";
|
|
|
+ //message+="成功添加"+inertProjectList.size()+"条项目数据";
|
|
|
+ message+=MessageUtils.message("project.upDataSuc",inertProjectList.size());
|
|
|
}
|
|
|
for (Project project : inertProjectList) {
|
|
|
List<TaskGroup> taskGroupList = project.getTaskGroupList();
|
|
@@ -6420,7 +6486,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}else continue;
|
|
|
}
|
|
|
if(updateBatchById(changeProjectList)){
|
|
|
- message+="成功更新"+changeProjectList.size()+"条项目数据";
|
|
|
+ //message+="成功更新"+changeProjectList.size()+"条项目数据";
|
|
|
+ message+=MessageUtils.message("project.upDataSuc",changeProjectList.size());
|
|
|
}
|
|
|
List<Integer> idList = changeProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
List<TaskGroup> groupList = taskGroupMapper.selectList(new QueryWrapper<TaskGroup>().in("project_id", idList));
|
|
@@ -6445,7 +6512,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}else continue;
|
|
|
List<Integer> idList = deleteProjectList.stream().map(Project::getId).collect(Collectors.toList());
|
|
|
if(removeByIds(idList)){
|
|
|
- message+="成功删除"+idList.size()+"条项目数据";
|
|
|
+ //message+="成功删除"+idList.size()+"条项目数据";
|
|
|
+ message+=MessageUtils.message("project.deleteDate",idList.size());
|
|
|
}
|
|
|
taskGroupMapper.delete(new QueryWrapper<TaskGroup>().in("project_id",idList));
|
|
|
}
|