|
@@ -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);
|
|
@@ -1009,7 +1018,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
try {
|
|
|
//根据系统配置的员工成本计算方式,按固定时薪还是固定月薪,分情况计算。
|
|
|
User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
|
- Integer companyId =targetUser.getCompanyId();
|
|
|
+ Integer companyId = targetUser.getCompanyId();
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
//当前用户管理部门
|
|
|
List<Integer> deptIds=null;
|
|
@@ -1036,112 +1045,38 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
- if (timeType.getFixMonthcost() == 1) {
|
|
|
- //每月固定月薪的方式计算,平摊到各个项目中
|
|
|
- List<Map<String, Object>> list = projectMapper.getTimeCostReport(companyId, startDate+"-01", endDate+"-31", null,deptIds);
|
|
|
- //检查财务表中是否已经导入成本
|
|
|
- List<Finance> financeList = financeMapper.selectList(new QueryWrapper<Finance>().eq("ymonth", startDate).eq("company_id", companyId));
|
|
|
- List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
- //计算人员总工时
|
|
|
- for (Map<String, Object> map : list) {
|
|
|
- String creatorId = (String)map.get("creatorId");
|
|
|
- double cost = (double)map.get("cost");
|
|
|
- User user = userList.stream().filter(u -> u.getId().equals(creatorId)).findFirst().get();
|
|
|
- user.setTotalHours(user.getTotalHours() + cost);
|
|
|
- }
|
|
|
- //计算实际时薪
|
|
|
- for (User user : userList) {
|
|
|
- if (user.getTotalHours() != 0) {
|
|
|
- Optional<Finance> first = financeList.stream().filter(f -> f.getUserId().equals(user.getId())).findFirst();
|
|
|
- BigDecimal monthCost = null;
|
|
|
- if (first.isPresent()) {
|
|
|
- monthCost = first.get().getTotalCost();
|
|
|
- } else {
|
|
|
- monthCost = user.getMonthCost();
|
|
|
- }
|
|
|
- user.setCost(monthCost.divide(new BigDecimal(user.getTotalHours()), 6, BigDecimal.ROUND_HALF_UP));
|
|
|
- } else {
|
|
|
- user.setCost(new BigDecimal(0));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
- List<Map<String, Object>> retList = new ArrayList<>();
|
|
|
- List<Project> projectList = projectMapper.selectList(new QueryWrapper<Project>().eq("company_id", companyId).orderByAsc("id"));
|
|
|
- for (Project p : projectList) {
|
|
|
- Map<String, Object> projectMap = new HashMap<>();
|
|
|
- projectMap.put("id", p.getId());
|
|
|
- projectMap.put("name", p.getProjectName());
|
|
|
- //按照项目汇总
|
|
|
- double pTotalTime = 0;
|
|
|
- BigDecimal pTotalMoney = new BigDecimal(0);
|
|
|
- for (Map<String, Object> map : list) {
|
|
|
- String creatorId = (String)map.get("creatorId");
|
|
|
- int projectId = (int)map.get("projectId");
|
|
|
- if (projectId == p.getId()) {
|
|
|
- double costTime = (double)map.get("cost");
|
|
|
- pTotalTime += costTime;
|
|
|
- User curUser = userList.stream().filter(u->u.getId().equals(creatorId)).findFirst().get();
|
|
|
- //该人员的成本
|
|
|
- pTotalMoney = pTotalMoney.add(curUser.getCost().multiply(new BigDecimal(costTime)));
|
|
|
- }
|
|
|
- }
|
|
|
- if (pTotalTime > 0) {
|
|
|
- projectMap.put("cost", pTotalTime);
|
|
|
- projectMap.put("costMoney", pTotalMoney);
|
|
|
- retList.add(projectMap);
|
|
|
- totalMoneyCost = totalMoneyCost.add(pTotalMoney);
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- resultMap.put("costList", retList);
|
|
|
- resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
- if(functionCostList.size()==0){
|
|
|
- resultMap.put("totalCostMoney",new BigDecimal(0));
|
|
|
- list.forEach(li->{
|
|
|
- li.put("costMoney",new BigDecimal(0));
|
|
|
- });
|
|
|
- }
|
|
|
- if(functionTimeList.size()==0){
|
|
|
- retList.forEach(li->{
|
|
|
- li.put("cost",0.0);
|
|
|
- });
|
|
|
+ List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, null, userId,deptIds,null);
|
|
|
+ BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
+ if (!map.containsKey("cost")) {
|
|
|
+ map.put("cost", 0);
|
|
|
}
|
|
|
- httpRespMsg.data = resultMap;
|
|
|
-
|
|
|
- } else {
|
|
|
- List<Map<String, Object>> list = projectMapper.getTimeCost(companyId, startDate, endDate, null, userId,deptIds,null);
|
|
|
- BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
- for (Map<String, Object> map : list) {
|
|
|
- if (!map.containsKey("cost")) {
|
|
|
- map.put("cost", 0);
|
|
|
- }
|
|
|
- if (!map.containsKey("costMoney")) {
|
|
|
- map.put("costMoney", 0);
|
|
|
- } else {
|
|
|
- totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("costMoney"));
|
|
|
- }
|
|
|
+ if (!map.containsKey("costMoney")) {
|
|
|
+ map.put("costMoney", 0);
|
|
|
+ } else {
|
|
|
+ totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("costMoney"));
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
- resultMap.put("costList", list);
|
|
|
- resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
- if(functionCostList.size()==0){
|
|
|
- resultMap.put("totalCostMoney",new BigDecimal(0));
|
|
|
- list.forEach(li->{
|
|
|
- li.put("costMoney",new BigDecimal(0));
|
|
|
- });
|
|
|
- }
|
|
|
- if(functionTimeList.size()==0){
|
|
|
- list.forEach(li->{
|
|
|
- li.put("cost",0.0);
|
|
|
- });
|
|
|
- }
|
|
|
- httpRespMsg.data = resultMap;
|
|
|
+ resultMap.put("costList", list);
|
|
|
+ resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
+ if(functionCostList.size()==0){
|
|
|
+ resultMap.put("totalCostMoney",new BigDecimal(0));
|
|
|
+ list.forEach(li->{
|
|
|
+ li.put("costMoney",new BigDecimal(0));
|
|
|
+ });
|
|
|
}
|
|
|
+ if(functionTimeList.size()==0){
|
|
|
+ list.forEach(li->{
|
|
|
+ li.put("cost",0.0);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
} catch (NullPointerException e) {
|
|
|
e.printStackTrace();
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
|
|
@@ -1352,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;
|
|
@@ -1368,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;
|
|
|
}
|
|
@@ -1388,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;
|
|
|
}
|
|
@@ -1486,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;
|
|
|
}
|
|
|
//计算项目总成本
|
|
@@ -1502,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;
|
|
|
}
|
|
|
}
|
|
@@ -1537,6 +1477,8 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
try {
|
|
|
User targetUser = userMapper.selectById(request.getHeader("Token"));
|
|
|
Integer companyId = targetUser.getCompanyId();
|
|
|
+ //优先判断这个项目的所属部门,是不是当前这个人担任负责人的部门
|
|
|
+ Integer projectBelongDeptId = projectMapper.selectById(projectId).getDeptId();
|
|
|
List<Department> allDepartmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
|
|
|
List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("manager_id", targetUser.getId()).eq("company_id", companyId));
|
|
|
List<DepartmentOtherManager> departmentOtherManagerList = departmentOtherManagerMapper.selectList(new QueryWrapper<DepartmentOtherManager>().eq("other_manager_id", targetUser.getId()));
|
|
@@ -1547,98 +1489,53 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
|
|
|
//判断查看权限
|
|
|
List<Integer> deptIds=null;
|
|
|
if(functionAllList.size()==0){
|
|
|
- deptIds=new ArrayList<>();
|
|
|
- deptIds.add(-1);
|
|
|
- if(functionDpartList.size()>0){
|
|
|
- if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
- for (Department department : departmentList) {
|
|
|
- List<Integer> branchDepartment = getBranchDepartment(department.getDepartmentId(), allDepartmentList);
|
|
|
- deptIds.addAll(branchDepartment);
|
|
|
- }
|
|
|
- List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
- List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
- collect.addAll(otherCollect);
|
|
|
- for (Integer integer : collect) {
|
|
|
- List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
- deptIds.addAll(branchDepartment);
|
|
|
+ //判断是否是当前项目的所属部门的主要或者其他负责人
|
|
|
+ if (projectBelongDeptId != null && (departmentOtherManagerList.stream().anyMatch(other->other.getDepartmentId().equals(projectBelongDeptId))
|
|
|
+ || departmentList.stream().anyMatch(main->main.getDepartmentId().equals(projectBelongDeptId)))) {
|
|
|
+ //默认为空的deptIds, 不过滤
|
|
|
+ } else {
|
|
|
+ deptIds=new ArrayList<>();
|
|
|
+ deptIds.add(-1);
|
|
|
+ if(functionDpartList.size()>0){
|
|
|
+ if(functionTimeList.size()>0||functionCostList.size()>0){
|
|
|
+ for (Department department : departmentList) {
|
|
|
+ List<Integer> branchDepartment = getBranchDepartment(department.getDepartmentId(), allDepartmentList);
|
|
|
+ deptIds.addAll(branchDepartment);
|
|
|
+ }
|
|
|
+ List<Integer> collect = departmentList.stream().map(dp -> dp.getDepartmentId()).distinct().collect(Collectors.toList());
|
|
|
+ List<Integer> otherCollect = departmentOtherManagerList.stream().distinct().map(dom -> dom.getDepartmentId()).collect(Collectors.toList());
|
|
|
+ collect.addAll(otherCollect);
|
|
|
+ for (Integer integer : collect) {
|
|
|
+ List<Integer> branchDepartment = getBranchDepartment(integer, allDepartmentList);
|
|
|
+ deptIds.addAll(branchDepartment);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
//首先查看有无浏览权限
|
|
|
if (!projectMapper.selectById(projectId).getCompanyId().equals(companyId)) {
|
|
|
- httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ //httpRespMsg.setError("无权查看其他公司的项目详情");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.otherCompanyProject"));
|
|
|
} else {
|
|
|
- TimeType timeType = timeTypeMapper.selectById(companyId);
|
|
|
- if (timeType.getFixMonthcost() == 0) {
|
|
|
- Map<String, Object> resultMap = new HashMap<>();
|
|
|
- //数据下 非负责部门人员数据不展示
|
|
|
- List<Map<String, Object>> list = projectMapper.getProjectCost(companyId,startDate, endDate, projectId,stateKey, null,deptIds,null);
|
|
|
- BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
- for (Map<String, Object> map : list) {
|
|
|
- if (!map.containsKey("costMoney")) {
|
|
|
- map.put("costMoney", 0);
|
|
|
- } else {
|
|
|
- totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("costMoney"));
|
|
|
- }
|
|
|
- }
|
|
|
- resultMap.put("costList", list);
|
|
|
- resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
- httpRespMsg.data = resultMap;
|
|
|
- } else {
|
|
|
- startDate = startDate + "-01";
|
|
|
- endDate = endDate + "-31";
|
|
|
- List<Map<String, Object>> userMonthTimeCostList = projectMapper.getUserMonthTimeCost(companyId, startDate+"-01", endDate+"-31");
|
|
|
-
|
|
|
- List<Map<String, Object>> list = projectMapper.getProjectCost(companyId,startDate, endDate, projectId,stateKey, null,deptIds,null);
|
|
|
-
|
|
|
- //检查财务表中是否已经导入成本
|
|
|
- List<Finance> financeList = financeMapper.selectList(new QueryWrapper<Finance>().eq("ymonth", startDate).eq("company_id", companyId));
|
|
|
- List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
|
|
|
-
|
|
|
- //计算实际时薪
|
|
|
- for (User user : userList) {
|
|
|
- double userTotalTime = 0;
|
|
|
- for (int i=0;i<userMonthTimeCostList.size(); i++) {
|
|
|
- Map map = userMonthTimeCostList.get(i);
|
|
|
- if (map.get("creatorId").equals(user.getId())) {
|
|
|
- userTotalTime = (double)map.get("cost");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- if (userTotalTime != 0) {
|
|
|
- Optional<Finance> first = financeList.stream().filter(f -> f.getUserId().equals(user.getId())).findFirst();
|
|
|
- BigDecimal monthCost = null;
|
|
|
- if (first.isPresent()) {
|
|
|
- monthCost = first.get().getTotalCost();
|
|
|
- } else {
|
|
|
- monthCost = user.getMonthCost();
|
|
|
- }
|
|
|
- user.setCost(monthCost.divide(new BigDecimal(userTotalTime), 6, BigDecimal.ROUND_HALF_UP));
|
|
|
- } else {
|
|
|
- user.setCost(new BigDecimal(0));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, Object> resultMap = new HashMap<>();
|
|
|
- BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
-
|
|
|
- //计算人员在项目上的投入工时
|
|
|
- for (Map<String, Object> map : list) {
|
|
|
- String creatorId = (String)map.get("creatorId");
|
|
|
- double cost = (double)map.get("cost");
|
|
|
- User user = userList.stream().filter(u -> u.getId().equals(creatorId)).findFirst().get();
|
|
|
- BigDecimal costMoney = user.getCost().multiply(new BigDecimal(cost));
|
|
|
- map.put("costMoney", costMoney);
|
|
|
- totalMoneyCost = totalMoneyCost.add(costMoney);
|
|
|
+ Map<String, Object> resultMap = new HashMap<>();
|
|
|
+ //数据下 非负责部门人员数据不展示
|
|
|
+ List<Map<String, Object>> list = projectMapper.getProjectCost(companyId,startDate, endDate, projectId,stateKey, null,deptIds,null);
|
|
|
+ BigDecimal totalMoneyCost = BigDecimal.valueOf(0);
|
|
|
+ for (Map<String, Object> map : list) {
|
|
|
+ if (!map.containsKey("costMoney")) {
|
|
|
+ map.put("costMoney", 0);
|
|
|
+ } else {
|
|
|
+ totalMoneyCost = totalMoneyCost.add((BigDecimal)map.get("costMoney"));
|
|
|
}
|
|
|
- resultMap.put("costList", list);
|
|
|
- resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
- httpRespMsg.data = resultMap;
|
|
|
}
|
|
|
+ resultMap.put("costList", list);
|
|
|
+ resultMap.put("totalMoneyCost", totalMoneyCost);
|
|
|
+ httpRespMsg.data = resultMap;
|
|
|
}
|
|
|
} catch (NullPointerException e) {
|
|
|
- httpRespMsg.setError("验证失败");
|
|
|
+ //httpRespMsg.setError("验证失败");
|
|
|
+ httpRespMsg.setError(MessageUtils.message("access.verificationError"));
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
return httpRespMsg;
|
|
@@ -1651,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);
|
|
@@ -1668,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;
|
|
@@ -1682,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);
|
|
@@ -1700,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;
|
|
@@ -2877,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;
|
|
|
}
|
|
@@ -3126,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());
|
|
@@ -3382,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;
|
|
@@ -3391,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;
|
|
@@ -3489,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());
|
|
@@ -3504,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());
|
|
@@ -3539,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){
|
|
@@ -3611,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;
|
|
|
}
|
|
|
}
|
|
@@ -3981,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());
|
|
@@ -3998,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 {
|
|
|
//关闭流
|
|
@@ -4325,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;
|
|
@@ -4411,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;
|
|
@@ -4541,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;
|
|
@@ -4618,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;
|
|
@@ -5022,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;
|
|
@@ -5174,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;
|
|
@@ -5685,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);
|
|
@@ -5710,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;
|
|
@@ -5853,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;
|
|
|
}
|
|
|
|
|
@@ -5867,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);
|
|
@@ -5884,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;
|
|
@@ -6262,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()));
|
|
@@ -6271,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);
|
|
@@ -6315,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);
|
|
@@ -6353,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{
|
|
|
//关闭流
|
|
@@ -6405,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));
|
|
@@ -6497,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()));
|
|
@@ -6521,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();
|
|
@@ -6540,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));
|
|
@@ -6565,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));
|
|
|
}
|