浏览代码

Merge branch 'master' of http://47.100.37.243:10080/wutt/manHourHousekeeper into master

seyason 2 年之前
父节点
当前提交
e6ceb55198
共有 31 个文件被更改,包括 950 次插入317 次删除
  1. 5 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java
  2. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java
  3. 13 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/CustomerInfoServiceImpl.java
  4. 15 7
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java
  5. 16 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java
  6. 23 11
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java
  7. 31 15
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceImportServiceImpl.java
  8. 27 13
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  9. 5 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/GroupTemplateServiceImpl.java
  10. 7 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/InformationServiceImpl.java
  11. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java
  12. 17 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/PermissionServiceImpl.java
  13. 7 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectAddcostRecordServiceImpl.java
  14. 5 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectLevelServiceImpl.java
  15. 9 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectMainServiceImpl.java
  16. 19 9
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectPercentageServiceImpl.java
  17. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectProfessionServiceImpl.java
  18. 138 70
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  19. 13 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProviderInfoServiceImpl.java
  20. 13 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportExtraDegreeServiceImpl.java
  21. 101 54
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  22. 17 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java
  23. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/SubProjectServiceImpl.java
  24. 3 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskProgressServiceImpl.java
  25. 21 10
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java
  26. 9 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TimeCalculationServiceImpl.java
  27. 100 50
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  28. 9 8
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java
  29. 157 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties
  30. 157 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties
  31. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

+ 5 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/BusinessTripServiceImpl.java

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.DepartmentService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
@@ -162,7 +163,8 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
 
             int count = businessTripMapper.selectCount(queryWrapper);
             if (count > 0) {
-                msg.setError("该时间段已有出差申请,不能重复提交");
+                //msg.setError("该时间段已有出差申请,不能重复提交");
+                msg.setError(MessageUtils.message("leave.businessRepeat"));
             } else {
                 businessTripMapper.insert(sheet);
             }
@@ -178,7 +180,8 @@ public class BusinessTripServiceImpl extends ServiceImpl<BusinessTripMapper, Bus
         HttpRespMsg msg=new HttpRespMsg();
         Integer cut = bustripProjectMapper.selectCount(new QueryWrapper<BustripProject>().eq("bustrip_id", id));
         if(cut>0){
-            msg.setError("请清空项目关联信息");
+            //msg.setError("请清空项目关联信息");
+            msg.setError(MessageUtils.message("project.ClearInfo"));
             return msg;
         }
         businessTripMapper.deleteById(id);

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/CompanyServiceImpl.java

@@ -6,6 +6,7 @@ import com.management.platform.entity.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import com.mysql.cj.util.StringUtils;
 import org.springframework.stereotype.Service;
 
@@ -105,7 +106,8 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
             Optional<User> inchargerUser = oldUserList.stream().filter(ou -> ou.getId().equals(pro.getInchargerId())).findFirst();
             boolean flag = targetUserList.stream().anyMatch(tu -> tu.getDingdingUserid().equals(inchargerUser.get().getDingdingUserid()));
             if(!flag){
-                msg.setError("当前项目["+pro.getProjectName()+"]负责人["+inchargerUser.get().getName()+"]不存在");
+                //msg.setError("当前项目["+pro.getProjectName()+"]负责人["+inchargerUser.get().getName()+"]不存在");
+                msg.setError(MessageUtils.message("project.masterNull",pro.getProjectName(),inchargerUser.get().getName()));
                 return msg;
             }else {
                 Optional<User> targetInchargerUser = targetUserList.stream().filter(tu -> tu.getDingdingUserid().equals(inchargerUser.get().getDingdingUserid())).findFirst();

+ 13 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/CustomerInfoServiceImpl.java

@@ -8,6 +8,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.CustomerInfoService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
@@ -66,7 +67,8 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
             if (rowNum == 0) {
-                msg.setError("请填写客户数据");
+                //msg.setError("请填写客户数据");
+                msg.setError(MessageUtils.message("customer.info"));
                 return msg;
             }
             List<String> nameList=new ArrayList<>();
@@ -81,11 +83,13 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
                     continue;
                 }
                     if (row.getCell(1) == null) {
-                        msg.setError("第"+dataCount+"行缺少客户名称");
+                        //msg.setError("第"+dataCount+"行缺少客户名称");
+                        msg.setError(MessageUtils.message("customer.nameNull",dataCount));
                         return msg;
                     }
                     if(nameList.contains(row.getCell(1).toString())){
-                        msg.setError("当前导入数据存在重复客户名称["+row.getCell(1).toString()+"]");
+                        //msg.setError("当前导入数据存在重复客户名称["+row.getCell(1).toString()+"]");
+                        msg.setError(MessageUtils.message("customer.exportNameRepeat",row.getCell(1).toString()));
                         return msg;
                     }
                     nameList.add(row.getCell(1).toString());
@@ -115,15 +119,18 @@ public class CustomerInfoServiceImpl extends ServiceImpl<CustomerInfoMapper, Cus
             return msg;
         } catch (IOException e){
             e.printStackTrace();
-            msg.setError("文件处理出错");
+            //msg.setError("文件处理出错");
+            msg.setError(MessageUtils.message("file.error"));
             return msg;
         } catch (InvalidFormatException e) {
             e.printStackTrace();
-            msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
             return msg;
         } catch (EncryptedDocumentException e) {
             e.printStackTrace();
-            msg.setError("文件加密状态,需要先解除加密状态再上传");
+            //msg.setError("文件加密状态,需要先解除加密状态再上传");
+            msg.setError(MessageUtils.message("file.encryption"));
             return msg;
         }finally {
             //关闭流

+ 15 - 7
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DepartmentServiceImpl.java

@@ -11,6 +11,7 @@ import com.management.platform.service.DepartmentService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.ListUtil;
+import com.management.platform.util.MessageUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -77,7 +78,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                         .setCompanyId(companyId)
                         .setReportAuditUserid(reportAuditUserid);
                 if (departmentMapper.insert(department) == 0) {
-                    httpRespMsg.setError("添加失败");
+                    //httpRespMsg.setError("添加失败");
+                    httpRespMsg.setError(MessageUtils.message("other.addFail"));
                 } else {
                     //修改负责人的部门
                     if (managerId != null) {
@@ -100,10 +102,12 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                     }
                 }
             } else {
-                httpRespMsg.setError("无所选父级部门");
+                //httpRespMsg.setError("无所选父级部门");
+                httpRespMsg.setError(MessageUtils.message("department.ParentNull"));
             }
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -117,7 +121,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             Integer companyId = userMapper.selectById(request.getHeader("Token")).getCompanyId();
             Department department = departmentMapper.selectById(departmentId);
             if (!department.getCompanyId().equals(companyId)) {
-                httpRespMsg.setError("不能修改其他公司的部门");
+                //httpRespMsg.setError("不能修改其他公司的部门");
+                httpRespMsg.setError(MessageUtils.message("department.modifyOtherError"));
             } else {
                 boolean deptNameChanged = false;
                 if (!departmentName.equals(department.getDepartmentName())) {
@@ -129,7 +134,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
                 department.setReportAuditUserid(reportAuditUserid);
 
                 if (departmentMapper.updateById(department) == 0) {
-                    httpRespMsg.setError("修改失败");
+                    //httpRespMsg.setError("修改失败");
+                    httpRespMsg.setError(MessageUtils.message("other.modifyFail"));
                 } else {
                     if (deptNameChanged) {
                         AuditWorkflowTimeSetting setting = new AuditWorkflowTimeSetting();
@@ -211,7 +217,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
             }
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -720,7 +727,8 @@ public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Departm
         //加上未分配的部门
         DepartmentVO unAssignedDept = new DepartmentVO();
         unAssignedDept.setId(0);
-        unAssignedDept.setLabel("未分配");
+        //unAssignedDept.setLabel("未分配");
+        unAssignedDept.setLabel(MessageUtils.message("department.noDistribution"));
         list.add(unAssignedDept);
 
         //获取公司全部人员

+ 16 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/DingDingServiceImpl.java

@@ -134,14 +134,17 @@ public class DingDingServiceImpl implements DingDingService {
         System.out.println("========接收到initSystem请求===corpid="+corpid);
         HttpRespMsg msg = new HttpRespMsg();
         if (!isPrivateDeploy) {
-            msg.setError("请配置isPrivateDeploy: true");
+            //msg.setError("请配置isPrivateDeploy: true");
+            msg.setError(MessageUtils.message("config.isPrivateDeploy"));
         } else {
             //查找公司对应的记录是否已经添加
             CompanyDingding dingding = companyDingdingMapper.selectById(corpid);
             if (dingding == null) {
-                msg.setError("请在company_dingding表中增加corpid:" + corpid);
+                //msg.setError("请在company_dingding表中增加corpid:" + corpid);
+                msg.setError(MessageUtils.message("config.ddCorpId"));
             } else if (dingding.getCompanyId() != null) {
-                msg.setError("companyId已存在,如需重新初始化请先重置company_dingding中该条数据的companyId为null");
+                //msg.setError("companyId已存在,如需重新初始化请先重置company_dingding中该条数据的companyId为null");
+                msg.setError(MessageUtils.message("config.companyIdExist"));
             } else {
 
                 Company company = new Company().setCompanyName(dingding.getCorpName())
@@ -551,12 +554,14 @@ public class DingDingServiceImpl implements DingDingService {
                 //一个钉钉用户可能有多个企业,他们的dingding_userid是一样的,此处需要结合companyId来组合判断
                 List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("dingding_userid", dduid).eq("company_id", companyDingding.getCompanyId()).orderByDesc("create_time"));
                 if (userList.size() == 0) {
-                    httpRespMsg.setError("您尚无权使用系统,请联系管理员。");
+                    //httpRespMsg.setError("您尚无权使用系统,请联系管理员。");
+                    httpRespMsg.setError(MessageUtils.message("user.NoPermission"));
                     return httpRespMsg;
                 }
                 User user = userList.get(0);
                 if (user.getIsActive() == 0) {
-                    httpRespMsg.setError("该账户已停用,无法登陆。请联系管理员");
+                    //httpRespMsg.setError("该账户已停用,无法登陆。请联系管理员");
+                    httpRespMsg.setError(MessageUtils.message("user.inactive"));
                 } else {
                     //查看该公司非会员公司,只能允许试用三天,超时不可登录
 
@@ -566,12 +571,14 @@ public class DingDingServiceImpl implements DingDingService {
                         if (0 == company.getSetMeal()) {
                             //未办理会员
                             if (company.getExpirationDate().isBefore(LocalDateTime.now())) {
-                                httpRespMsg.setError("账号试用已到期,请联系客服。");
+                                //httpRespMsg.setError("账号试用已到期,请联系客服。");
+                                httpRespMsg.setError(MessageUtils.message("user.accountExpired"));
                                 return httpRespMsg;
                             }
                         } else {
                             if (company.getExpirationDate().isBefore(LocalDateTime.now())) {
-                                httpRespMsg.setError("账号会员已到期,请联系客服。");
+                                //httpRespMsg.setError("账号会员已到期,请联系客服。");
+                                httpRespMsg.setError(MessageUtils.message("user.memberExpired"));
                                 return httpRespMsg;
                             }
                         }
@@ -1631,7 +1638,8 @@ public class DingDingServiceImpl implements DingDingService {
         Integer companyId = dingding.getCompanyId();
         User user = userMapper.selectOne(new QueryWrapper<User>().eq("name", name).eq("company_id", companyId));
         if (user == null) {
-            msg.setError("该用户不存在: " + name);
+            //msg.setError("该用户不存在: " + name);
+            msg.setError(MessageUtils.message("user.notExistsByParam",name));
         } else {
             SysRole role = sysRoleMapper.selectOne(new QueryWrapper<SysRole>().eq("company_id", companyId).eq("rolename", "超级管理员"));
             user.setPhone(user.getName());

+ 23 - 11
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -13,6 +13,7 @@ import com.management.platform.service.ExpenseItemService;
 import com.management.platform.service.ExpenseSheetService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.CellType;
@@ -75,7 +76,8 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
             //检查code不能重复
             Integer num = expenseSheetMapper.selectCount(new QueryWrapper<ExpenseSheet>().eq("company_id", user.getCompanyId()).eq("code", sheet.getCode()));
             if (num > 0) {
-                msg.setError("票据编号已存在");
+                //msg.setError("票据编号已存在");
+                msg.setError(MessageUtils.message("other.billNoExist"));
                 return msg;
             }
         }
@@ -233,7 +235,8 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 //由于第一行需要指明报销人列对应的标题
                 XSSFRow firstRow = sheet.getRow(2);
                 if (firstRow == null) {
-                    msg.setError("错误数据,导入失败");
+                    //msg.setError("错误数据,导入失败");
+                    msg.setError(MessageUtils.message("file.dataFormatError"));
                     return msg;
                 }
                 //报销人 填报日期 费用类型 备注
@@ -247,13 +250,16 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 if (expenseTypeCell != null) expenseTypeCell.setCellType(CellType.STRING);
                 if (remarksCell != null) remarksCell.setCellType(CellType.STRING);
                 if (reimburserCell == null) {//报销人为空的直接跳过
-                    throw new Exception("报销人名称不能为空");
+                    //throw new Exception("报销人名称不能为空");
+                    throw new Exception(MessageUtils.message("Reimbursement.nameNull"));
                 }
                 if (expenseTypeCell == null) {
-                    throw new Exception("费用类型不能为空");
+                    //throw new Exception("费用类型不能为空");
+                    throw new Exception(MessageUtils.message("Reimbursement.costTypeNull"));
                 }
                 if (reportDateCell == null) {
-                    throw new Exception("填报日期不能为空");
+                    //throw new Exception("填报日期不能为空");
+                    throw new Exception(MessageUtils.message("Reimbursement.dataNull"));
                 }
                 ExpenseSheet expenseSheet = new ExpenseSheet();
                 if(functionList.size()>0){
@@ -286,7 +292,8 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                     expenseSheet.setOwnerId(first.get().getId());
                     expenseSheet.setOwnerName(first.get().getName());
                 } else {
-                    throw new Exception("报销人[" +reimburserCell+"]不存在");
+                    //throw new Exception("报销人[" +reimburserCell+"]不存在");
+                    throw new Exception(MessageUtils.message("Reimbursement.PeopleNull",reimburserCell));
                 }
                 expenseSheet.setOperatorId(user.getId());
                 expenseSheet.setRemark(remarksCell.getStringCellValue());
@@ -367,7 +374,8 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                     if(subExpenseTypeCell!=null){
                         List<String> stringList = expenseTypeList.stream().filter(et -> et.getMainType().equals(expenseSheet.getType())).map(et -> et.getTypeName()).collect(Collectors.toList());
                         if(!stringList.contains(subExpenseTypeCell.getStringCellValue())){
-                            msg.setError("当前费用类型["+expenseTypeCell.getStringCellValue()+"]中不存在["+subExpenseTypeCell.getStringCellValue()+"]类型");
+                            //msg.setError("当前费用类型["+expenseTypeCell.getStringCellValue()+"]中不存在["+subExpenseTypeCell.getStringCellValue()+"]类型");
+                            msg.setError(MessageUtils.message("Reimbursement.TypeError",expenseTypeCell.getStringCellValue(),subExpenseTypeCell.getStringCellValue()));
                             return msg;
                         }
                         expenseItem.setExpenseType(subExpenseTypeCell.getStringCellValue());
@@ -403,18 +411,22 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 e.printStackTrace();
             } 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 {
                 //关闭流

+ 31 - 15
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceImportServiceImpl.java

@@ -7,6 +7,7 @@ import com.management.platform.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import com.management.platform.util.UserNotFoundException;
 import org.apache.commons.io.FileUtils;
 import org.apache.poi.ss.usermodel.*;
@@ -71,7 +72,8 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
         FinanceImport oldItem = financeImportMapper.selectOne(new QueryWrapper<FinanceImport>().eq("company_id", companyId).eq("ymonth", yearMonth).orderByDesc("indate").last("limit 1"));
         if (oldItem != null) {
             if (oldItem.getState() == 1) {
-                msg.setError(yearMonth+"月薪资已审核通过,无法上传。");
+                //msg.setError(yearMonth+"月薪资已审核通过,无法上传。");
+                msg.setError(MessageUtils.message("salary.uploadErrorByAdopt"));
                 return msg;
             } else {
                 if (oldItem.getState() == 0) {
@@ -141,14 +143,16 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                         updateUserList.add(localUser);
                     }
                 } else {
-                    msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
+                    //msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
+                    msg.setError(MessageUtils.message("group.userNull",name));
                     return msg;
                 }
                 finance.setYmonth(yearMonth);
                 financeList.add(finance);
             }
             if (financeList.size() == 0) {
-                msg.setError("请填写数据再上传");
+                //msg.setError("请填写数据再上传");
+                msg.setError(MessageUtils.message("file.dateNull"));
                 return msg;
             }
 
@@ -161,14 +165,16 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                         if (!first.isPresent()) {
                             String notFillUser = userMapper.selectById(r.getCreatorId()).getName();
                             System.out.println("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
-                            throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                            //throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                            throw new UserNotFoundException(MessageUtils.message("salary.lackAndUpAgain",notFillUser));
                         }
                     }
                 }
             }
         } catch (IOException e) {
             e.printStackTrace();
-            msg.setError("文件处理出错");
+            //msg.setError("文件处理出错");
+            msg.setError(MessageUtils.message("file.error"));
             return msg;
         } catch (UserNotFoundException e) {
             e.printStackTrace();
@@ -176,11 +182,13 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
             return msg;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            msg.setError("数据格式有误或存在空数据 导入失败");
+            //msg.setError("数据格式有误或存在空数据 导入失败");
+            msg.setError(MessageUtils.message("file.dataFormatError"));
             return msg;
         } catch (Exception e) {
             e.printStackTrace();
-            msg.setError("发生其他错误");
+            //msg.setError("发生其他错误");
+            msg.setError(MessageUtils.message("other.error"));
             return msg;
         } finally {
             //关闭流
@@ -256,7 +264,8 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
 
         FinanceImport oldItem = financeImportMapper.selectById(id);
         if (oldItem == null) {
-            msg.setError("该数据不存在");
+            //msg.setError("该数据不存在");
+            msg.setError(MessageUtils.message("file.dateNoExist"));
             return msg;
         }
         if (oldItem.getState() == 0) {
@@ -462,7 +471,8 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                             updateUserList.add(localUser);
                         }
                     } else {
-                        msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
+                        //msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
+                        msg.setError(MessageUtils.message("group.userNull",name));
                         return msg;
                     }
                     finance.setYmonth(yearMonth);
@@ -470,7 +480,8 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
 
                 }
                 if (financeList.size() == 0) {
-                    msg.setError("请填写数据再上传");
+                    //msg.setError("请填写数据再上传");
+                    msg.setError(MessageUtils.message("file.dateNull"));
                     return msg;
                 }
                 //批量插入
@@ -511,7 +522,8 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                             if (!first.isPresent()) {
                                 String notFillUser = userMapper.selectById(r.getCreatorId()).getName();
                                 System.out.println("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
-                                throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                                //throw new UserNotFoundException("缺少[" + notFillUser + "]的薪资成本, 请修改数据重新上传");
+                                throw new UserNotFoundException(MessageUtils.message("salary.lackAndUpAgain",notFillUser));
                             }
                             BigDecimal hourCost = first.get().getCost();
                             r.setCost(hourCost.multiply(new BigDecimal(r.getWorkingTime())));
@@ -526,7 +538,8 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                 financeImportMapper.updateById(curItem);
             } catch (IOException e) {
                 e.printStackTrace();
-                msg.setError("文件处理出错");
+                //msg.setError("文件处理出错");
+                msg.setError(MessageUtils.message("file.error"));
                 return msg;
             } catch (UserNotFoundException e) {
                 e.printStackTrace();
@@ -534,16 +547,19 @@ public class FinanceImportServiceImpl extends ServiceImpl<FinanceImportMapper, F
                 return msg;
             } catch (NullPointerException e) {
                 e.printStackTrace();
-                msg.setError("数据格式有误或存在空数据 导入失败");
+                //msg.setError("数据格式有误或存在空数据 导入失败");
+                msg.setError(MessageUtils.message("file.dataFormatError"));
                 return msg;
             } catch (Exception e) {
                 e.printStackTrace();
-                msg.setError("发生其他错误");
+                //msg.setError("发生其他错误");
+                msg.setError(MessageUtils.message("other.error"));
                 return msg;
             } finally {
             }
         } else {
-            msg.setError("只有待审核状态才可以操作");
+            //msg.setError("只有待审核状态才可以操作");
+            msg.setError(MessageUtils.message("finance.operationStateError"));
         }
         return msg;
     }

+ 27 - 13
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -9,6 +9,7 @@ import com.management.platform.mapper.*;
 import com.management.platform.service.*;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import com.management.platform.util.UserNotFoundException;
 import org.apache.commons.io.FileUtils;
 import org.apache.log4j.LogManager;
@@ -345,9 +346,11 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     }
                 } else {
                     if (includeJobNumber) {
-                        msg.setError("用户["+name+","+finance.getJobNumber()+"]不存在,请在组织结构中添加该成员");
+                        //msg.setError("用户["+name+","+finance.getJobNumber()+"]不存在,请在组织结构中添加该成员");
+                        msg.setError(MessageUtils.message("group.userNullById",name,finance.getJobNumber()));
                     } else {
-                        msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
+                        //msg.setError("用户["+name+"]不存在,请在组织结构中添加该成员");
+                        msg.setError(MessageUtils.message("group.userNull",name));
                     }
                     return msg;
                 }
@@ -355,7 +358,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 financeList.add(finance);
             }
             if (financeList.size() == 0) {
-                msg.setError("请填写数据再上传");
+                //msg.setError("请填写数据再上传");
+                msg.setError(MessageUtils.message("file.dateNull"));
                 return msg;
             }
 
@@ -421,10 +425,12 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             financeImportMapper.insert(log);
         }catch (IOException e){
             e.printStackTrace();
-            msg.setError("文件处理错误");
+            //msg.setError("文件处理错误");
+            msg.setError(MessageUtils.message("file.error"));
         }catch (InvalidFormatException e) {
             e.printStackTrace();
-            msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
         } finally {
             //关闭流
             try {
@@ -550,7 +556,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     }
                     f.setCategoryName(name);
                 } else {
-                    httpRespMsg.setError("项目["+f.getProjectName()+"]已不存在");
+                    //httpRespMsg.setError("项目["+f.getProjectName()+"]已不存在");
+                    httpRespMsg.setError(MessageUtils.message("project.nonExistentByParam",f.getProjectName()));
                 }
             });
             if (httpRespMsg.code.equals("error")) {
@@ -562,7 +569,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 //检查是否已经设置好分配规则
                 percentage = projectPercentageMapper.selectOne(new QueryWrapper<ProjectPercentage>().eq("company_id", companyId).eq("ymonth", yearMonth));
                 if (percentage == null) {
-                    httpRespMsg.setError("请先设置无项目工时人员的分配比例");
+                    //httpRespMsg.setError("请先设置无项目工时人员的分配比例");
+                    httpRespMsg.setError(MessageUtils.message("project.setPersonnelAllotment"));
                     return httpRespMsg;
                 } else {
                     //获取设置的项目
@@ -849,7 +857,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                             User us = userList.stream().filter(u->u.getId().equals(creatorId)).findFirst().get();
                             Optional<Finance> first = finances.stream().filter(f -> f.getUserId().equals(creatorId)).findFirst();
                             if (!first.isPresent()) {
-                                logger.info("用户["+us.getName()+"]在财务报表中不存在,请重新导入");
+                                //logger.info("用户["+us.getName()+"]在财务报表中不存在,请重新导入");
+                                logger.info(MessageUtils.message("report.userNull",us.getName()));
                                 continue;
                             }
                             Finance userFinance = first.get();
@@ -1058,7 +1067,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             httpRespMsg.data = resp;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败:"+e.getMessage());
+            //httpRespMsg.setError("验证失败:"+e.getMessage());
+            httpRespMsg.setError(MessageUtils.message("access.verificationErrorByParam",e.getMessage()));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -1168,7 +1178,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             if (assignNoProUser != null && assignNoProUser && noProjectItem.project != null) {
                 List<FinanceProjects> financeProjects = financeProjectsMapper.selectList(new QueryWrapper<FinanceProjects>().eq("company_id", companyId).eq("ymonth", yearMonth));
                 if (financeProjects.size() == 0) {
-                    httpRespMsg.setError("缺少待分摊项目,请重新设置并保存分摊比例设置");
+                    //httpRespMsg.setError("缺少待分摊项目,请重新设置并保存分摊比例设置");
+                    httpRespMsg.setError(MessageUtils.message("project.lackApportion"));
                     return httpRespMsg;
                 }
                 //检查是否已经设置好分配规则
@@ -1176,7 +1187,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 List<Map> noPUserDataList = new ArrayList<>();
                 //构造各个项目的分配比例
                 if (percentage == null) {
-                    httpRespMsg.setError("请先设置无项目工时人员的分配比例");
+                    //httpRespMsg.setError("请先设置无项目工时人员的分配比例");
+                    httpRespMsg.setError(MessageUtils.message("project.setPersonnelAllotment"));
                     return httpRespMsg;
                 } else {
                     //获取设置的项目
@@ -1255,7 +1267,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             httpRespMsg.data = resultMap;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -1460,7 +1473,8 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
             httpRespMsg.data = resp;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;

+ 5 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/GroupTemplateServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.GroupTmpstagesService;
 import com.management.platform.service.GtemplateTaskService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -51,11 +52,13 @@ public class GroupTemplateServiceImpl extends ServiceImpl<GroupTemplateMapper, G
         templateQueryWrapper.eq("company_id", user.getCompanyId()).eq("name", name);
         int count = groupTemplateMapper.selectCount(templateQueryWrapper);
         if (count > 0) {
-            msg.setError("该模板名称已存在");
+            //msg.setError("该模板名称已存在");
+            msg.setError(MessageUtils.message("Template.AlreadyExists"));
         } else {
             List<Stages> stagesList = stagesMapper.selectList(new QueryWrapper<Stages>().eq("group_id", groupId).orderByAsc("sequence"));
             if (stagesList.size() == 0) {
-                msg.setError("任务列表为空,无法保存");
+                //msg.setError("任务列表为空,无法保存");
+                msg.setError(MessageUtils.message("Stages.ListNull"));
             } else {
                 GroupTemplate template = new GroupTemplate();
                 template.setIsSystem(0);

+ 7 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/InformationServiceImpl.java

@@ -7,6 +7,7 @@ import com.management.platform.mapper.InformationMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.InformationService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -37,7 +38,8 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
             httpRespMsg.data = informationMapper.selectList(new QueryWrapper<Information>()
                     .eq("user_id", userId).orderByDesc("time").last("LIMIT 10"));
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -51,10 +53,12 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
             if (information != null) {
                 informationMapper.updateById(information);
             } else {
-                httpRespMsg.setError("未检查到相关信息");
+                //httpRespMsg.setError("未检查到相关信息");
+                httpRespMsg.setError(MessageUtils.message("other.infoEmpty"));
             }
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/LeaveSheetServiceImpl.java

@@ -15,6 +15,7 @@ import com.management.platform.service.LeaveSheetService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -88,7 +89,8 @@ public class LeaveSheetServiceImpl extends ServiceImpl<LeaveSheetMapper, LeaveSh
 
             int count = leaveSheetMapper.selectCount(queryWrapper);
             if (count > 0) {
-                msg.setError("该时间段已有请假申请,不能重复请假");
+                //msg.setError("该时间段已有请假申请,不能重复请假");
+                msg.setError(MessageUtils.message("leave.repeatedLeave"));
             } else {
                 //校验当前的指定的项目审核人
                 //获取第一个审批人

+ 17 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/PermissionServiceImpl.java

@@ -11,6 +11,7 @@ import com.management.platform.service.PermissionService;
 import com.management.platform.service.SysRoleFunctionService;
 import com.management.platform.service.SysRoleModuleService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.*;
 import org.apache.poi.ss.util.CellRangeAddress;
@@ -112,14 +113,16 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
         if (id == null) {
             long cnt = sysRoleMapper.selectCount(new QueryWrapper<SysRole>().eq("rolename", name).eq("company_id", companyId));
             if (cnt > 0) {
-                msg.setError("角色名称不能重复");
+                //msg.setError("角色名称不能重复");
+                msg.setError(MessageUtils.message("user.roleNameRepeat"));
             } else {
                 sysRoleMapper.insert(sysRole);
             }
         } else {
             long cnt = sysRoleMapper.selectCount(new QueryWrapper<SysRole>().eq("rolename", name).ne("id", id).eq("company_id", companyId));
             if (cnt > 0) {
-                msg.setError("角色名称不能重复");
+                //msg.setError("角色名称不能重复");
+                msg.setError(MessageUtils.message("user.roleNameRepeat"));
             } else {
                 sysRoleMapper.updateById(sysRole);
                 //更新相关的用户的角色名称
@@ -137,13 +140,17 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
         //检查有无正在使用的人
         SysRole role = sysRoleMapper.selectById(id);
         if (role == null) {
-            httpRespMsg.setError("该角色不存在");
+            //httpRespMsg.setError("该角色不存在");
+            httpRespMsg.setError(MessageUtils.message("role.noExist"));
         } else if (role.getRolename().equals("超级管理员")) {
-            httpRespMsg.setError("不可删除超级管理员");
+            //httpRespMsg.setError("不可删除超级管理员");
+            httpRespMsg.setError(MessageUtils.message("role.deleteRootError"));
         } else if (role.getIsDefault() == 1) {
-            httpRespMsg.setError("该角色为新增员工时的默认角色,请设置其他角色为默认后再尝试删除");
+            //httpRespMsg.setError("该角色为新增员工时的默认角色,请设置其他角色为默认后再尝试删除");
+            httpRespMsg.setError(MessageUtils.message("role.deleteErrorByDefault"));
         } else if (userMapper.selectCount(new QueryWrapper<User>().eq("role_id", id)) > 0) {
-            httpRespMsg.setError("该角色存在相关人员,请将他们修改为其他角色后再尝试删除");
+            //httpRespMsg.setError("该角色存在相关人员,请将他们修改为其他角色后再尝试删除");
+            httpRespMsg.setError(MessageUtils.message("role.deleteErrorByHavePeople"));
         } else {
             sysRoleFunctionMapper.delete(new QueryWrapper<SysRoleFunction>().eq("role_id", id));
             sysRoleModuleMapper.delete(new QueryWrapper<SysRoleModule>().eq("role_id", id));
@@ -294,10 +301,12 @@ public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permiss
                 .eq("function_id", id);
         if (sysRoleFunctionMapper.selectCount(queryWrapper) > 0) {
             sysRoleFunctionMapper.delete(queryWrapper);
-            httpRespMsg.data = "权限取消成功";
+            //httpRespMsg.data = "权限取消成功";
+            httpRespMsg.data = MessageUtils.message("access.cancelSuc");
         } else {
             sysRoleFunctionMapper.insert(new SysRoleFunction().setRoleId(role).setFunctionId(id));
-            httpRespMsg.data = "权限加入成功";
+            //httpRespMsg.data = "权限加入成功";
+            httpRespMsg.data = MessageUtils.message("access.addSuc");
         }
         return httpRespMsg;
     }

+ 7 - 3
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectAddcostRecordServiceImpl.java

@@ -9,6 +9,7 @@ import com.management.platform.service.ProjectAddcostRecordService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.ProjectCurrentcostService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -65,7 +66,8 @@ public class ProjectAddcostRecordServiceImpl extends ServiceImpl<ProjectAddcostR
                 }
                 if (addItem.getBaseAmount() > (available - curAmount)) {
                     HttpRespMsg msg = new HttpRespMsg();
-                    msg.setError(addItem.getBaseName()+"可下拨额度不足"+df.format(addItem.getBaseAmount())+"元, 请校正总成本预算。");
+                    //msg.setError(addItem.getBaseName()+"可下拨额度不足"+df.format(addItem.getBaseAmount())+"元, 请校正总成本预算。");
+                    msg.setError(MessageUtils.message("project.quotaNoEnough",addItem.getBaseName(),df.format(addItem.getBaseAmount())));
                     return msg;
                 }
             }
@@ -118,7 +120,8 @@ public class ProjectAddcostRecordServiceImpl extends ServiceImpl<ProjectAddcostR
         HttpRespMsg msg = new HttpRespMsg();
         ProjectAddcostRecord record = projectAddcostRecordMapper.selectById(id);
         if (record == null) {
-            msg.setError("该记录不存在");
+            //msg.setError("该记录不存在");
+            msg.setError(MessageUtils.message("other.recordNoExist"));
         } else {
             //检查是否是最新的一条
             List<ProjectAddcostRecord> latestItem = projectAddcostRecordMapper.selectList(new QueryWrapper<ProjectAddcostRecord>().eq("project_id", record.getProjectId()).orderByDesc("id").last("limit 1"));
@@ -141,7 +144,8 @@ public class ProjectAddcostRecordServiceImpl extends ServiceImpl<ProjectAddcostR
                 projectAddcostItemMapper.delete(new QueryWrapper<ProjectAddcostItem>().eq("record_id", id));
                 projectAddcostRecordMapper.deleteById(id);
             } else {
-                msg.setError("只有最新的一次下拨可以撤销");
+                //msg.setError("只有最新的一次下拨可以撤销");
+                msg.setError(MessageUtils.message("project.revokeErrByNoNew"));
             }
         }
         return msg;

+ 5 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectLevelServiceImpl.java

@@ -7,6 +7,7 @@ import com.management.platform.mapper.ProjectLevelMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.ProjectLevelService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -37,7 +38,8 @@ public class ProjectLevelServiceImpl extends ServiceImpl<ProjectLevelMapper, Pro
             Integer count = projectLevelMapper.selectCount(new QueryWrapper<ProjectLevel>().eq("company_id", projectLevel.getCompanyId())
                     .eq("project_level_name", projectLevel.getProjectLevelName()).ne("id", projectLevel.getId()));
             if(count>0){
-                httpRespMsg.setError("名称已存在");
+                //httpRespMsg.setError("名称已存在");
+                httpRespMsg.setError(MessageUtils.message("name.nameRepeat"));
                 return httpRespMsg;
             }
             projectLevelMapper.updateById(projectLevel);
@@ -45,7 +47,8 @@ public class ProjectLevelServiceImpl extends ServiceImpl<ProjectLevelMapper, Pro
             Integer count = projectLevelMapper.selectCount(new QueryWrapper<ProjectLevel>().eq("company_id", projectLevel.getCompanyId())
                     .eq("project_level_name", projectLevel.getProjectLevelName()));
             if(count>0){
-                httpRespMsg.setError("名称已存在");
+                //httpRespMsg.setError("名称已存在");
+                httpRespMsg.setError(MessageUtils.message("name.nameRepeat"));
                 return httpRespMsg;
             }
             projectLevelMapper.insert(projectLevel);

+ 9 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectMainServiceImpl.java

@@ -9,6 +9,7 @@ import com.management.platform.mapper.ProjectMainMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.ProjectMainService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -45,11 +46,13 @@ public class ProjectMainServiceImpl extends ServiceImpl<ProjectMainMapper, Proje
             Integer count1 = projectMainMapper.selectCount(new QueryWrapper<ProjectMain>().eq("company_id", projectMain.getCompanyId())
                     .eq("name", projectMain.getName()).ne("id", projectMain.getId()));
             if(count>0){
-                httpRespMsg.setError("编号已存在");
+                //httpRespMsg.setError("编号已存在");
+                httpRespMsg.setError(MessageUtils.message("other.NumAlreadyExists"));
                 return httpRespMsg;
             }
             if(count1>0){
-                httpRespMsg.setError("名称已存在");
+                //httpRespMsg.setError("名称已存在");
+                httpRespMsg.setError(MessageUtils.message("name.nameRepeat"));
                 return httpRespMsg;
             }
             projectMainMapper.updateById(projectMain);
@@ -59,11 +62,13 @@ public class ProjectMainServiceImpl extends ServiceImpl<ProjectMainMapper, Proje
             Integer count3 = projectMainMapper.selectCount(new QueryWrapper<ProjectMain>().eq("company_id", projectMain.getCompanyId())
                     .eq("name", projectMain.getName()));
             if(count2>0){
-                httpRespMsg.setError("编号已存在");
+                //httpRespMsg.setError("编号已存在");
+                httpRespMsg.setError(MessageUtils.message("other.NumAlreadyExists"));
                 return httpRespMsg;
             }
             if(count3>0){
-                httpRespMsg.setError("名称已存在");
+                //httpRespMsg.setError("名称已存在");
+                httpRespMsg.setError(MessageUtils.message("name.nameRepeat"));
                 return httpRespMsg;
             }
             projectMainMapper.insert(projectMain);

+ 19 - 9
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectPercentageServiceImpl.java

@@ -16,6 +16,7 @@ import com.management.platform.service.FinanceProjectsService;
 import com.management.platform.service.ProjectPercentageService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
@@ -162,7 +163,8 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
             if (rowNum == 0) {
-                msg.setError("请填写项目数据");
+                //msg.setError("请填写项目数据");
+                msg.setError(MessageUtils.message("project.fillDataError"));
                 return msg;
             }
             //保存data数据
@@ -201,7 +203,8 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
                     }
                     if (projectNotExists) {
                         //返回错误提示
-                        msg.setError("项目["+neProjectName+"]不存在,请先在项目管理中添加或导入。");
+                        //msg.setError("项目["+neProjectName+"]不存在,请先在项目管理中添加或导入。");
+                        msg.setError(MessageUtils.message("project.noExist",neProjectName));
                         return msg;
                     }
                 }else {
@@ -213,14 +216,16 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
                         }
                     }
                     if (row.getCell(0) == null) {
-                        msg.setError("第"+dataCount+"行缺少员工姓名");
+                        //msg.setError("第"+dataCount+"行缺少员工姓名");
+                        msg.setError(MessageUtils.message("staff.nameNullByRow",dataCount));
                         return msg;
                     }
                     String username = row.getCell(0).getStringCellValue().trim();
                     //检查人员是否存在
                     Optional<User> any = allUserList.stream().filter(u -> u.getName().equals(username)).findAny();
                     if (!any.isPresent()) {
-                        msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");
+                        //msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");
+                        msg.setError(MessageUtils.message("staff.peopleNullAndAdd",username));
                         return msg;
                     }
                     //人员存在
@@ -259,14 +264,16 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
                         dataString+=dataStringOne+"]";
                     }
                     if(s!=100){
-                        msg.setError("人员["+username+"]"+"分摊比例不满足100%,当前比例["+s+"%],请检查");
+                        //msg.setError("人员["+username+"]"+"分摊比例不满足100%,当前比例["+s+"%],请检查");
+                        msg.setError(MessageUtils.message("staff.proportionError",username,s));
                         return msg;
                     }
                 }
             }
             ProjectPercentage percentageServiceOne = projectPercentageService.getOne(new QueryWrapper<ProjectPercentage>().eq("company_id", companyId).eq("ymonth",ymonth));
             if(percentageServiceOne!=null&&percentageServiceOne.getData().equals(dataString)){
-                msg.setError("请勿导入重复数据");
+                //msg.setError("请勿导入重复数据");
+                msg.setError(MessageUtils.message("data.importRepeat"));
                 return msg;
             }
             ProjectPercentage projectPercentage=new ProjectPercentage();
@@ -296,15 +303,18 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
             return msg;
         }catch (IOException e){
             e.printStackTrace();
-            msg.setError("文件处理出错");
+            //msg.setError("文件处理出错");
+            msg.setError(MessageUtils.message("file.error"));
             return msg;
         } catch (InvalidFormatException e) {
             e.printStackTrace();
-            msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
             return msg;
         }catch (EncryptedDocumentException e) {
             e.printStackTrace();
-            msg.setError("文件加密状态,需要先解除加密状态再上传");
+            //msg.setError("文件加密状态,需要先解除加密状态再上传");
+            msg.setError(MessageUtils.message("file.encryption"));
             return msg;
         }finally {
             //关闭流

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectProfessionServiceImpl.java

@@ -9,6 +9,7 @@ import com.management.platform.service.PpMembsService;
 import com.management.platform.service.ProjectProfessionService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -66,7 +67,8 @@ public class ProjectProfessionServiceImpl extends ServiceImpl<ProjectProfessionM
             long cnt = reportProfessionProgressMapper.selectCount(new QueryWrapper<ReportProfessionProgress>().eq("project_id", projectId).in("profession_id", removedProfessionIds).eq("audit_state", 0));
             if (cnt > 0) {
                 HttpRespMsg msg = new HttpRespMsg();
-                msg.setError("尚存在日报在该专业上待审核,审核通过后才能移除");
+                //msg.setError("尚存在日报在该专业上待审核,审核通过后才能移除");
+                msg.setError(MessageUtils.message("profession.toReviewed"));
                 return msg;
             }
         }

+ 138 - 70
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java

@@ -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));
             }

+ 13 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProviderInfoServiceImpl.java

@@ -9,6 +9,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.ProviderInfoService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
@@ -72,7 +73,8 @@ public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, Pro
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
             if (rowNum == 0) {
-                msg.setError("请填写供应商数据");
+                //msg.setError("请填写供应商数据");
+                msg.setError(MessageUtils.message("supplier.addSupplier"));
                 return msg;
             }
             List<String> nameList=new ArrayList<>();
@@ -87,11 +89,13 @@ public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, Pro
                     continue;
                 }
                 if (row.getCell(1) == null) {
-                    msg.setError("第"+dataCount+"行缺少供应商名称");
+                    //msg.setError("第"+dataCount+"行缺少供应商名称");
+                    msg.setError(MessageUtils.message("supplier.lackNameOnRow",dataCount));
                     return msg;
                 }
                 if(nameList.contains(row.getCell(1).toString())){
-                    msg.setError("当前导入数据存在重复供应商名称["+row.getCell(1).toString()+"]");
+                    //msg.setError("当前导入数据存在重复供应商名称["+row.getCell(1).toString()+"]");
+                    msg.setError(MessageUtils.message("supplier.nameRepeat",row.getCell(1).toString()));
                     return msg;
                 }
                 nameList.add(row.getCell(1).toString());
@@ -122,15 +126,18 @@ public class ProviderInfoServiceImpl extends ServiceImpl<ProviderInfoMapper, Pro
             return msg;
         } catch (IOException e){
             e.printStackTrace();
-            msg.setError("文件处理出错");
+            //msg.setError("文件处理出错");
+            msg.setError(MessageUtils.message("file.error"));
             return msg;
         } catch (InvalidFormatException e) {
             e.printStackTrace();
-            msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
             return msg;
         } catch (EncryptedDocumentException e) {
             e.printStackTrace();
-            msg.setError("文件加密状态,需要先解除加密状态再上传");
+            //msg.setError("文件加密状态,需要先解除加密状态再上传");
+            msg.setError(MessageUtils.message("file.encryption"));
             return msg;
         }finally {
             //关闭流

+ 13 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportExtraDegreeServiceImpl.java

@@ -11,6 +11,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.ReportExtraDegreeService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.Row;
@@ -76,7 +77,8 @@ public class ReportExtraDegreeServiceImpl extends ServiceImpl<ReportExtraDegreeM
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
             if (rowNum == 0) {
-                msg.setError("请填写研究中心数据");
+                //msg.setError("请填写研究中心数据");
+                msg.setError(MessageUtils.message("research.addData"));
                 return msg;
             }
             List<String> nameList=new ArrayList<>();
@@ -91,11 +93,13 @@ public class ReportExtraDegreeServiceImpl extends ServiceImpl<ReportExtraDegreeM
                     continue;
                 }
                 if (row.getCell(0) == null) {
-                    msg.setError("第"+dataCount+"行缺少中心名称");
+                    //msg.setError("第"+dataCount+"行缺少中心名称");
+                    msg.setError(MessageUtils.message("research.nameNull",dataCount));
                     return msg;
                 }
                 if(nameList.contains(row.getCell(0).toString())){
-                    msg.setError("当前导入数据存在重复中心名称["+row.getCell(0).toString()+"]");
+                    //msg.setError("当前导入数据存在重复中心名称["+row.getCell(0).toString()+"]");
+                    msg.setError(MessageUtils.message("research.nameRepeat",row.getCell(0).toString()));
                     return msg;
                 }
                 nameList.add(row.getCell(0).toString());
@@ -115,15 +119,18 @@ public class ReportExtraDegreeServiceImpl extends ServiceImpl<ReportExtraDegreeM
             return msg;
         } catch (IOException e){
             e.printStackTrace();
-            msg.setError("文件处理出错");
+            //msg.setError("文件处理出错");
+            msg.setError(MessageUtils.message("file.error"));
             return msg;
         } catch (InvalidFormatException e) {
             e.printStackTrace();
-            msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            //msg.setError("文件格式错误,如果安装了加密软件需要先解密再上传");
+            msg.setError(MessageUtils.message("file.FormatErrorAndDecrypt"));
             return msg;
         }catch (EncryptedDocumentException e) {
             e.printStackTrace();
-            msg.setError("文件加密状态,需要先解除加密状态再上传");
+            //msg.setError("文件加密状态,需要先解除加密状态再上传");
+            msg.setError(MessageUtils.message("file.encryption"));
             return msg;
         }finally {
             //关闭流

+ 101 - 54
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -9,10 +9,7 @@ import com.management.platform.entity.*;
 import com.management.platform.entity.vo.*;
 import com.management.platform.mapper.*;
 import com.management.platform.service.*;
-import com.management.platform.util.ExcelUtil;
-import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.ListUtil;
-import com.management.platform.util.WorkDayCalculateUtils;
+import com.management.platform.util.*;
 import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage;
 import me.chanjar.weixin.mp.api.WxMpService;
 import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl;
@@ -455,7 +452,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("Company.validationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -651,10 +649,12 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             httpRespMsg.data = resultMap;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("Company.validationError"));
             return httpRespMsg;
         } catch (DateTimeParseException e) {
-            httpRespMsg.setError("日期格式有误");
+            //httpRespMsg.setError("日期格式有误");
+            httpRespMsg.setError(MessageUtils.message("date.formatError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -856,11 +856,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     String msg = null;
                     if (report.getFillUserid()==null) {
                         //自己填写自己的
-                        msg = reportOwner+"提交了日报";
+                        //msg = reportOwner+"提交了日报";
+                        msg = MessageUtils.message("profession.submit",reportOwner);
                     } else {
                         //代填的
                         first = userList.stream().filter(u -> u.getId().equals(log.getOperatorId())).findFirst();
-                        msg = first.get().getName()+"为" + reportOwner+"代填了日报";
+                        //msg = first.get().getName()+"为" + reportOwner+"代填了日报";
+                        msg = MessageUtils.message("profession.submitReplace",first.get().getName(),reportOwner);
                     }
                     log.setMsg(msg);
                     log.setCompanyId(companyId);
@@ -1031,7 +1033,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
         }
         if (reportMapper.delete(queryWrapper) == 0) {
-            httpRespMsg.setError("操作失败");
+            //httpRespMsg.setError("操作失败");
+            httpRespMsg.setError(MessageUtils.message("other.operationFail"));
         } else {
             //删除日报的日志
             reportLogMapper.delete(new QueryWrapper<ReportLog>().eq("creator_id", userId).eq("create_date", date));
@@ -1195,7 +1198,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -1216,7 +1220,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             if (isDepartment != null) {
                 //进行的是部门审核, 需要专业审核都通过才能进行部门审核
                 if (list.size() > 0) {
-                    httpRespMsg.setError("只有专业审核全部通过才能进行操作");
+                    //httpRespMsg.setError("只有专业审核全部通过才能进行操作");
+                    httpRespMsg.setError(MessageUtils.message("finance.professional"));
                     return httpRespMsg;
                 } else {
                     Report report = reportMapper.selectById(ids.get(0));
@@ -1239,7 +1244,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                     List<ProjectProfession> myProfessionList = projectProfessionMapper.selectList(new QueryWrapper<ProjectProfession>().eq("incharger_id", user.getId()).in("project_id", projectIds));
                     if (myProfessionList.size() == 0) {
-                        httpRespMsg.setError("只有专业负责人才能进行专业审核");
+                        //httpRespMsg.setError("只有专业负责人才能进行专业审核");
+                        httpRespMsg.setError(MessageUtils.message("finance.masterProfessional"));
                     } else {
                         List<Integer> collect = myProfessionList.stream().map(ProjectProfession::getProfessionId).collect(Collectors.toList());
 
@@ -1303,7 +1309,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 Optional<Project> first = projectList.stream().filter(p -> StringUtils.isEmpty(p.getInchargerId())).findFirst();
                 if (first.isPresent()) {
                     String projectName = first.get().getProjectName();
-                    httpRespMsg.setError("请给["+projectName+"]项目设置项目负责人");
+                    //httpRespMsg.setError("请给["+projectName+"]项目设置项目负责人");
+                    httpRespMsg.setError(MessageUtils.message("project.masterError",projectName));
                     return httpRespMsg;
                 }
                 for (Report r : reportList) {
@@ -1655,7 +1662,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<ReportProfessionProgress> list = reportProfessionProgressService.list(new QueryWrapper<ReportProfessionProgress>().in("report_id", ids).eq("audit_state", 0));
             if (isDepartment != null) {
                 if (list.size() > 0) {
-                    httpRespMsg.setError("只有专业审核全部通过才可操作");
+                    //httpRespMsg.setError("只有专业审核全部通过才可操作");
+                    httpRespMsg.setError(MessageUtils.message("finance.professional"));
                     return httpRespMsg;
                 } else {
                     Report report = oneReport;
@@ -1674,7 +1682,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                     List<ProjectProfession> myProfessionList = projectProfessionMapper.selectList(new QueryWrapper<ProjectProfession>().eq("incharger_id", user.getId()).in("project_id", projectIds));
                     if (myProfessionList.size() == 0) {
-                        httpRespMsg.setError("只有专业负责人才能进行专业审核");
+                        //httpRespMsg.setError("只有专业负责人才能进行专业审核");
+                        httpRespMsg.setError(MessageUtils.message("finance.masterProfessional"));
                     } else {
                         List<Integer> collect = myProfessionList.stream().map(ProjectProfession::getProfessionId).collect(Collectors.toList());
                         //专业待审核的状态,进行专业审核驳回
@@ -1966,7 +1975,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         final List<Integer> ids = ListUtil.convertIntegerIdsArrayToList(reportIds);
         if (ids.size() == 0) {
-            httpRespMsg.setError("请选择需要审核的日报");
+            //httpRespMsg.setError("请选择需要审核的日报");
+            httpRespMsg.setError(MessageUtils.message("finance.choiceDaily"));
             return httpRespMsg;
         }
         if (company.getPackageEngineering() == 1) {
@@ -1974,7 +1984,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<ReportProfessionProgress> list = reportProfessionProgressService.list(new QueryWrapper<ReportProfessionProgress>().in("report_id", ids).eq("audit_state", 0));
             if (isDepartment != null) {
                 if (list.size() > 0) {
-                    httpRespMsg.setError("只有专业审核全部通过才能操作");
+                    //httpRespMsg.setError("只有专业审核全部通过才能操作");
+                    httpRespMsg.setError(MessageUtils.message("finance.professional"));
                     return httpRespMsg;
                 } else {
                     Report report = reportMapper.selectById(ids.get(0));
@@ -1996,7 +2007,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                     List<ProjectProfession> myProfessionList = projectProfessionMapper.selectList(new QueryWrapper<ProjectProfession>().eq("incharger_id", user.getId()).in("project_id", projectIds));
                     if (myProfessionList.size() == 0) {
-                        httpRespMsg.setError("只能专业负责人才能进行专业审核");
+                        //httpRespMsg.setError("只能专业负责人才能进行专业审核");
+                        httpRespMsg.setError(MessageUtils.message("finance.masterProfessional"));
                     } else {
                         List<Integer> collect = myProfessionList.stream().map(ProjectProfession::getProfessionId).collect(Collectors.toList());
 
@@ -2066,7 +2078,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 Optional<Project> first = projectList.stream().filter(p -> StringUtils.isEmpty(p.getInchargerId())).findFirst();
                 if (first.isPresent()) {
                     String projectName = first.get().getProjectName();
-                    httpRespMsg.setError("请给["+projectName+"]项目设置项目负责人");
+                    //httpRespMsg.setError("请给["+projectName+"]项目设置项目负责人");
+                    httpRespMsg.setError(MessageUtils.message("project.masterError",projectName));
                     return httpRespMsg;
                 }
                 for (Report r : reportList) {
@@ -2385,7 +2398,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<ReportProfessionProgress> list = reportProfessionProgressService.list(new QueryWrapper<ReportProfessionProgress>().in("report_id", ids).eq("audit_state", 0));
             if (isDepartment != null) {
                 if (list.size() > 0) {
-                    httpRespMsg.setError("只有专业审核全部通过才能操作");
+                    //httpRespMsg.setError("只有专业审核全部通过才能操作");
+                    httpRespMsg.setError(MessageUtils.message("finance.professional"));
                     return httpRespMsg;
                 } else {
                     Report report = reportMapper.selectById(ids.get(0));
@@ -2404,7 +2418,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
                     List<ProjectProfession> myProfessionList = projectProfessionMapper.selectList(new QueryWrapper<ProjectProfession>().eq("incharger_id", user.getId()).in("project_id", projectIds));
                     if (myProfessionList.size() == 0) {
-                        httpRespMsg.setError("只能专业负责人才能进行专业审核");
+                        //httpRespMsg.setError("只能专业负责人才能进行专业审核");
+                        httpRespMsg.setError(MessageUtils.message("finance.masterProfessional"));
                     } else {
                         List<Integer> collect = myProfessionList.stream().map(ProjectProfession::getProfessionId).collect(Collectors.toList());
                         //专业待审核的状态,进行专业审核驳回
@@ -2531,7 +2546,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 
         }
         if (cnt == 0) {
-            msg.setError("只有待审核状态的报告才能撤回");
+            //msg.setError("只有待审核状态的报告才能撤回");
+            msg.setError(MessageUtils.message("finance.revokeReport"));
         } else {
             //记录撤销操作
             saveCancelLog(reportIds, user);
@@ -2637,7 +2653,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("Company.validationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -2730,7 +2747,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
             httpRespMsg.data = nameList;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("Company.validationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -2996,7 +3014,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         if (company.getPackageProject() == 1) {
             Integer alarmSettingCnt = projectBasecostSettingMapper.selectCount(new QueryWrapper<ProjectBasecostSetting>().eq("company_id", companyId).eq("alarm_type", 1));
             if (alarmSettingCnt > 0) {
-                msg.setError("已设置工时预警类型的成本预算,暂不支持导入工时");
+                //msg.setError("已设置工时预警类型的成本预算,暂不支持导入工时");
+                msg.setError(MessageUtils.message("report.warningType"));
                 return msg;
             }
         }
@@ -3027,7 +3046,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
             if (rowNum == 0) {
-                msg.setError("请填写工时数据");
+                //msg.setError("请填写工时数据");
+                msg.setError(MessageUtils.message("report.data"));
                 return msg;
             }
             List<String> projectList = new ArrayList<>();
@@ -3075,12 +3095,14 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
                     if (projectNotExists) {
                         //返回错误提示
-                        msg.setError("项目["+neProjectName+"]不存在,请先在项目管理中添加或导入。");
+                        //msg.setError("项目["+neProjectName+"]不存在,请先在项目管理中添加或导入。");
+                        msg.setError(MessageUtils.message("project.noExist",neProjectName));
                         return msg;
                     }
                     if (subPNotExists) {
                         //返回错误提示
-                        msg.setError("子项目["+neSubPName+"]不存在,请先在项目管理中添加或导入。");
+                        //msg.setError("子项目["+neSubPName+"]不存在,请先在项目管理中添加或导入。");
+                        msg.setError(MessageUtils.message("project.sonNoExist",neSubPName));
                         return msg;
                     }
                 } else {
@@ -3093,20 +3115,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     }
 
                     if (row.getCell(0) == null) {
-                        msg.setError("第"+dataCount+"行缺少日期");
+                        //msg.setError("第"+dataCount+"行缺少日期");
+                        msg.setError(MessageUtils.message("data.NullErrorByRow",dataCount));
                         return msg;
                     }
                     boolean isDateFormat = row.getCell(0).getCellTypeEnum() == CellType.NUMERIC;
                     String reportDate = isDateFormat?sdf.format(row.getCell(0).getDateCellValue()):row.getCell(0).getStringCellValue();
                     if (StringUtils.isEmpty(reportDate)) {
-                        msg.setError("第"+dataCount+"行缺少日期");
+                        //msg.setError("第"+dataCount+"行缺少日期");
+                        msg.setError(MessageUtils.message("data.NullErrorByRow",dataCount));
                         return msg;
                     }
                     String username = withCheckIn==null?row.getCell(1).getStringCellValue().trim():row.getCell(2).getStringCellValue().trim();
                     //检查人员是否存在
                     Optional<User> any = allUserList.stream().filter(u -> u.getName().equals(username)).findAny();
                     if (!any.isPresent()) {
-                        msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");
+                        //msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");
+                        msg.setError(MessageUtils.message("staff.peopleNullAndAdd",username));
                         return msg;
                     }
                     User reportCreator = any.get();
@@ -3149,7 +3174,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                                 report.setCost(reportCreator.getCost()==null?new BigDecimal(0) : reportCreator.getCost().multiply(new BigDecimal(time)));
                                 reportList.add(report);
                             } else if (time < 0) {
-                                msg.setError(username + "的工时存在负数,请检查修改");
+                                //msg.setError(username + "的工时存在负数,请检查修改");
+                                msg.setError(MessageUtils.message("report.negativeError",username));
                                 return msg;
                             }
                         }
@@ -3183,14 +3209,16 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         });
                         String str = sb.toString();
                         str = str.substring(0, str.length()-1);
-                        msg.msg = "跳过以下已审核数据:"+str+"。";
+                        //msg.msg = "跳过以下已审核数据:"+str+"。";
+                        msg.msg = MessageUtils.message("finance.skipData",str);
                     }
                 }
 
                 //存储
                 if (reportList.size() == 0) {
                     //全部是重复的,本次没有需要导入的
-                    msg.setError("本次数据全部已审核通过,无法导入。");
+                    //msg.setError("本次数据全部已审核通过,无法导入。");
+                    msg.setError(MessageUtils.message("finance.importErrorByAllAdopt"));
                     return msg;
                 } else {
                     reportService.saveBatch(reportList);
@@ -3217,27 +3245,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                     reportImportLogMapper.insert(log);
                 }
             } else {
-                msg.setError("工时数据不能为空");
+                //msg.setError("工时数据不能为空");
+                msg.setError(MessageUtils.message("report.dataNullError"));
             }
         } 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"));
             return msg;
         }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("other.errorByParameter",e.getMessage()));
             return msg;
         } finally {
             //关闭流
@@ -3468,7 +3502,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //HSSFRow条数范围限制0..65535
             if (allReportByDate.size() > 60000) {
                 HttpRespMsg msg = new HttpRespMsg();
-                msg.setError("数据量过大,请分时间段导出");
+                //msg.setError("数据量过大,请分时间段导出");
+                msg.setError(MessageUtils.message("data.OversizeError"));
                 return msg;
             }
             DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
@@ -3606,11 +3641,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             //返回生成的文件地址/upload文件夹下
             httpRespMsg.data = "/upload/" + fileUrlSuffix;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败或缺少数据");
+            //httpRespMsg.setError("验证失败或缺少数据");
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
             e.printStackTrace();
             return httpRespMsg;
         } catch (IOException e) {
-            httpRespMsg.setError("文件生成错误");
+            //httpRespMsg.setError("文件生成错误");
+            httpRespMsg.setError(MessageUtils.message("file.generateError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -3666,7 +3703,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             for (Report report : reportList) {
                 //获取一下信息
                 if (report.getWorkingTime() <= 0.0) {
-                    httpRespMsg.setError("工作时长必须大于零");
+                    //httpRespMsg.setError("工作时长必须大于零");
+                    httpRespMsg.setError(MessageUtils.message("profession.workTimeZeroError"));
                     return httpRespMsg;
                 }
                 //获取员工当天总工作时长
@@ -3747,7 +3785,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             result.put("record", auditReportList);
             httpRespMsg.data = result;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -4012,7 +4051,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             String createDate = DateTimeFormatter.ofPattern("yyyy-MM-dd").format(log.getCreateDate());
             if (log.getState() != 1) {
                 //只有已通过的历史记录才能撤销
-                httpRespMsg.setError("只有审核通过状态才可撤销审核");
+                //httpRespMsg.setError("只有审核通过状态才可撤销审核");
+                httpRespMsg.setError(MessageUtils.message("finance.revokeStateError"));
                 return httpRespMsg;
             }
             User user = userMapper.selectById(request.getHeader("Token"));
@@ -4024,16 +4064,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<Report> list = reportMapper.selectList(eq);
             Report oneReport = null;
             if (list.size() == 0) {
-                httpRespMsg.setError("日报已不存在");
+                //httpRespMsg.setError("日报已不存在");
+                httpRespMsg.setError(MessageUtils.message("profession.alreadyNull"));
                 return httpRespMsg;
             } else  {
                 if (list.get(0).getState() == 3) {
                     //只有已通过的历史记录才能撤销
-                    httpRespMsg.setError("操作错误,日报状态不对:"+list.get(0).getState());
+                    //httpRespMsg.setError("操作错误,日报状态不对:"+list.get(0).getState());
+                    httpRespMsg.setError(MessageUtils.message("profession.TypeError",list.get(0).getState()));
                     return httpRespMsg;
                 } else if (list.get(0).getState() == 2) {
                     //只有已通过的历史记录才能撤销
-                    httpRespMsg.setError("该日报已被撤销,无法重复操作");
+                    //httpRespMsg.setError("该日报已被撤销,无法重复操作");
+                    httpRespMsg.setError(MessageUtils.message("profession.alreadyRevoke"));
                     return httpRespMsg;
                 }
             }
@@ -4090,7 +4133,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             }
 
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -4107,19 +4151,22 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         LocalDate openDate = LocalDate.parse(startDate, df);
         LocalDate closeDate = LocalDate.parse(endDate, df);
         if(Duration.between(openDate.atTime(LocalTime.now()),closeDate.atTime(LocalTime.now())).toDays()>31){
-            msg.setError("获取数据时间段不得超过一个月");
+            //msg.setError("获取数据时间段不得超过一个月");
+            msg.setError(MessageUtils.message("data.exceedMonthError"));
             return msg;
         }
         List<ThirdPartyInterface> thirdPartyInterfaceList = thirdPartyInterfaceMapper.selectList(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);
         List<ReportLog> reportLogList = reportLogMapper.selectList(new QueryWrapper<ReportLog>().eq("company_id", thirdPartyInterface.getCompanyId()).ge("operate_date",openDate.atTime(LocalTime.now())).orderByAsc("operate_date"));
         List<User> userList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", thirdPartyInterface.getCompanyId()));
         if(LocalDateTime.now().isAfter(thirdPartyInterface.getExpireTime())){
-            msg.setError("token过期失效");
+            //msg.setError("token过期失效");
+            msg.setError(MessageUtils.message("other.tokenOverdue"));
             return msg;
         }
         if(token.equals(thirdPartyInterface.getToken())){

+ 17 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/SimpleReportServiceImpl.java

@@ -14,6 +14,7 @@ import com.management.platform.service.SimpleProjectimeService;
 import com.management.platform.service.SimpleReportService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.log4j.LogManager;
 import org.apache.log4j.Logger;
 import org.apache.poi.EncryptedDocumentException;
@@ -104,7 +105,8 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
             //第二个表是员工薪资表
 
             if (workbook.getNumberOfSheets() < 2) {
-                msg.setError("表格格式不正确,需要月度工时和月薪薪资两个sheet="+workbook.getNumberOfSheets());
+                //msg.setError("表格格式不正确,需要月度工时和月薪薪资两个sheet="+workbook.getNumberOfSheets());
+                msg.setError(MessageUtils.message("report.typeErrorByHourAndSalary",workbook.getNumberOfSheets()));
             } else {
                 //导入员工薪资表
                 XSSFSheet sheet = workbook.getSheetAt(1);
@@ -299,7 +301,8 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
                     return !financeList.stream().filter(f->f.getName().equals(r.getUsername())).findAny().isPresent();
                 }).map(SimpleReport::getUsername).collect(Collectors.toList()).toArray(new String[0]);
                 if (notFoundNames.length > 0) {
-                    msg.setError(convertNameArray(notFoundNames)+" 不存在于薪资表中,请检查后提交");
+                    //msg.setError(convertNameArray(notFoundNames)+" 不存在于薪资表中,请检查后提交");
+                    msg.setError(MessageUtils.message("report.noExist",convertNameArray(notFoundNames)));
                 } else {
 //                    notFoundNames = financeList.stream().filter(r->{
 //                        return !reportList.stream().filter(f->f.getUsername().equals(r.getName())).findAny().isPresent();
@@ -312,7 +315,8 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
                     //每个人的总工时不能为零
                     String[] names = reportList.stream().filter(r->r.getTimeCost() == 0).map(SimpleReport::getUsername).collect(Collectors.toList()).toArray(new String[0]);
                     if (names.length > 0) {
-                        msg.setError(convertNameArray(names)+" 工时为零,请检查");
+                        //msg.setError(convertNameArray(names)+" 工时为零,请检查");
+                        msg.setError(MessageUtils.message("report.hoursZero",convertNameArray(names)));
                     } else {
                         //人员检查通过,更新finance表中的时薪,方便后续计算
                         financeList.forEach(f->{
@@ -346,23 +350,28 @@ public class SimpleReportServiceImpl extends ServiceImpl<SimpleReportMapper, Sim
             }
         } 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"));
             return msg;
         }catch (EncryptedDocumentException e) {
             e.printStackTrace();
-            msg.setError("文件加密状态,需要先解除加密状态再上传");
+            //msg.setError("文件加密状态,需要先解除加密状态再上传");
+            msg.setError(MessageUtils.message("file.encryption"));
             return msg;
         } catch (Exception e) {
             e.printStackTrace();
-            msg.setError("发生其他错误");
+            //msg.setError("发生其他错误");
+            msg.setError(MessageUtils.message("other.error"));
             return msg;
         } finally {
             //关闭流

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/SubProjectServiceImpl.java

@@ -6,6 +6,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.SubProjectService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -50,7 +51,8 @@ public class SubProjectServiceImpl extends ServiceImpl<SubProjectMapper, SubProj
             resultMap.put("totalMoneyCost", totalMoneyCost);
             httpRespMsg.data = resultMap;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;

+ 3 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskProgressServiceImpl.java

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.management.platform.service.TprogressPaticipatorsService;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.ListUtil;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.StringUtils;
@@ -96,7 +97,8 @@ public class TaskProgressServiceImpl extends ServiceImpl<TaskProgressMapper, Tas
             taskProgressMapper.deleteById(id);
             tprogressPaticipatorsMapper.delete(new QueryWrapper<TprogressPaticipators>().eq("progress_id", id));
         } else {
-            msg.setError("只有创建人和项目经理可以删除");
+            //msg.setError("只有创建人和项目经理可以删除");
+            msg.setError(MessageUtils.message("other.deleteErrorByAccess"));
         }
 
         return msg;

+ 21 - 10
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TaskServiceImpl.java

@@ -11,6 +11,7 @@ import com.management.platform.service.CompanyDingdingService;
 import com.management.platform.service.TaskExecutorService;
 import com.management.platform.service.TaskService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.apache.poi.hssf.usermodel.*;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.xssf.usermodel.XSSFCell;
@@ -179,10 +180,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
             //返回生成的文件地址/upload文件夹下
             httpRespMsg.data = "/upload/" + fileUrlSuffix;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败或缺少数据");
+            //httpRespMsg.setError("验证失败或缺少数据");
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
             return httpRespMsg;
         } catch (IOException e) {
-            httpRespMsg.setError("文件生成错误");
+            //httpRespMsg.setError("文件生成错误");
+            httpRespMsg.setError(MessageUtils.message("file.generateError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -282,11 +285,13 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
             httpRespMsg.data = "/upload/" + fileUrlSuffix;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败或缺少数据");
+            //httpRespMsg.setError("验证失败或缺少数据");
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
             return httpRespMsg;
         } catch (IOException e) {
             e.printStackTrace();
-            httpRespMsg.setError("文件生成错误");
+            //httpRespMsg.setError("文件生成错误");
+            httpRespMsg.setError(MessageUtils.message("file.generateError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -389,7 +394,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                                 executorColorString+=find.getColor()+",";
                             }
                         }else {
-                            httpRespMsg.setError("执行人["+executorName+"]不存在");
+                            //httpRespMsg.setError("执行人["+executorName+"]不存在");
+                            httpRespMsg.setError(MessageUtils.message("other.ExecutorNull",executorName));
                         }
                     }
                     task.setExecutorId(executorIdString);
@@ -399,7 +405,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
                 //获取当前导入的任务列表
                 List<Stages> stagesList = stagesMapper.selectList(new QueryWrapper<Stages>().eq("project_id",projectId).eq("group_id",groupId));
                 if(!stagesList.stream().anyMatch(sg->sg.getStagesName().equals(stagesCell.getStringCellValue()))){
-                    httpRespMsg.setError("任务列表["+stagesCell.getStringCellValue()+"]不存在");
+                    //httpRespMsg.setError("任务列表["+stagesCell.getStringCellValue()+"]不存在");
+                    httpRespMsg.setError(MessageUtils.message("Stages.ListNotExist",stagesCell.getStringCellValue()));
                     return httpRespMsg;
                 }
                 Optional<Stages> theFirst = stagesList.stream().filter(sg -> sg.getStagesName().equals(stagesCell.getStringCellValue())).findFirst();
@@ -467,15 +474,18 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
 
         } catch (IOException e) {
             e.printStackTrace();
-            httpRespMsg.setError("文件处理出错");
+            //httpRespMsg.setError("文件处理出错");
+            httpRespMsg.setError(MessageUtils.message("file.error"));
             return httpRespMsg;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("数据格式有误或存在空数据 导入失败");
+            //httpRespMsg.setError("数据格式有误或存在空数据 导入失败");
+            httpRespMsg.setError(MessageUtils.message("file.dataFormatError"));
             return httpRespMsg;
         } catch (Exception e) {
             e.printStackTrace();
-            httpRespMsg.setError("发生其他错误");
+            //httpRespMsg.setError("发生其他错误");
+            httpRespMsg.setError(MessageUtils.message("other.error"));
             return httpRespMsg;
         } finally {
             //关闭流
@@ -499,7 +509,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
         //至少保留一个分组
         int count = taskGroupMapper.selectCount(new QueryWrapper<TaskGroup>().eq("project_id", item.getProjectId()));
         if (count == 1) {
-            msg.setError("至少保留一个任务分组");
+            //msg.setError("至少保留一个任务分组");
+            msg.setError(MessageUtils.message("Stages.leastOneGroup"));
         } else {
             taskGroupMapper.deleteById(item.getId());
             //删除相关的阶段和任务

+ 9 - 4
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/TimeCalculationServiceImpl.java

@@ -10,6 +10,7 @@ import com.management.platform.mapper.TimeCalculationShowMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.service.TimeCalculationService;
 import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -83,7 +84,8 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
             resultMap.put("total", timeCalculationMapper.countDeviance(userId, actionCode, date, companyId));
             httpRespMsg.data = resultMap;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -134,7 +136,8 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
             }
             httpRespMsg.data = resultList;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -207,10 +210,12 @@ public class TimeCalculationServiceImpl extends ServiceImpl<TimeCalculationMappe
             }
             httpRespMsg.data = resultList;
         } catch (DateTimeParseException e) {
-            httpRespMsg.setError("日期格式有误");
+            //httpRespMsg.setError("日期格式有误");
+            httpRespMsg.setError(MessageUtils.message("date.formatError"));
             return httpRespMsg;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;

+ 100 - 50
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -223,7 +223,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             ThirdPartyInterface thirdPartyInterface = thirdPartyInterfaceList.get(0);
             if(thirdPartyInterface.getExpireTime().isBefore(LocalDateTime.now())){
                 httpRespMsg=new HttpRespMsg();
-                httpRespMsg.setError("token失效");
+                //httpRespMsg.setError("token失效");
+                httpRespMsg.setError(MessageUtils.message("other.tokenOverdue"));
                 return httpRespMsg;
             }
             Integer companyId = thirdPartyInterface.getCompanyId();
@@ -232,12 +233,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 httpRespMsg=loginAdmin(user.getPhone(),user.getPassword(),1);
             }else{
                 httpRespMsg=new HttpRespMsg();
-                httpRespMsg.setError("工号为"+jobNumber+"的员工在工时系统中不存在");
+                //httpRespMsg.setError("工号为"+jobNumber+"的员工在工时系统中不存在");
+                httpRespMsg.setError(MessageUtils.message("staff.workingHoursNull",jobNumber));
                 return httpRespMsg;
             }
         }else{
             httpRespMsg=new HttpRespMsg();
-            httpRespMsg.setError("token错误");
+            //httpRespMsg.setError("token错误");
+            httpRespMsg.setError(MessageUtils.message("other.tokenError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -508,7 +511,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             resultMap.put("total", total);
             httpRespMsg.data = resultMap;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -523,28 +527,34 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             User requester = userMapper.selectById(request.getHeader("Token"));
             User target = userMapper.selectById(userId);
             if (target == null) {
-                httpRespMsg.setError("未找到用户");
+                //httpRespMsg.setError("未找到用户");
+                httpRespMsg.setError(MessageUtils.message("user.notFind"));
             } else {
                 if (!requester.getCompanyId().equals(target.getCompanyId())) {
-                    httpRespMsg.setError("只能删除同一公司人员的账号");
+                    //httpRespMsg.setError("只能删除同一公司人员的账号");
+                    httpRespMsg.setError(MessageUtils.message("access.otherCompanyPeople"));
                 } else if ("超级管理员".equals(target.getRoleName())) {
                     //超级管理员账号不能删除
-                    httpRespMsg.setError("超级管理员不可删除");
+                    //httpRespMsg.setError("超级管理员不可删除");
+                    httpRespMsg.setError(MessageUtils.message("role.deleteRootError"));
                 } else {
                     //检测是否该人员已填日报,已填写日报的不能删除
                     Integer userReportNum = reportMapper.selectCount(new QueryWrapper<Report>().eq("creator_id", target.getId()));
                     if (userReportNum > 0) {
-                        httpRespMsg.setError("该员工存在填写的日报,无法删除。");
+                        //httpRespMsg.setError("该员工存在填写的日报,无法删除。");
+                        httpRespMsg.setError(MessageUtils.message("staff.deleteErrorByDaily"));
                     } else {
                         //检测是否有已参与的任务
                         Integer taskNum = taskMapper.selectCount(new QueryWrapper<Task>().like("executor_id", userId));
                         if (taskNum > 0) {
-                            httpRespMsg.setError("该员工存在参与的任务,无法删除");
+                            //httpRespMsg.setError("该员工存在参与的任务,无法删除");
+                            httpRespMsg.setError(MessageUtils.message("staff.deleteErrorByTask"));
                         } else {
                             //检测是否担任项目负责人
                             Integer projectNum = projectMapper.selectCount(new QueryWrapper<Project>().eq("incharger_id", userId));
                             if (projectNum > 0) {
-                                httpRespMsg.setError("该员工存在负责的项目,无法删除");
+                                //httpRespMsg.setError("该员工存在负责的项目,无法删除");
+                                httpRespMsg.setError(MessageUtils.message("staff.deleteErrorByProject"));
                             } else {
                                 userMapper.deleteById(userId);
                                 userSalaryMapper.delete(new QueryWrapper<UserSalary>().eq("user_id", userId));
@@ -556,7 +566,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 }
             }
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("access.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -572,11 +583,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             if (MD5Util.getPassword(originPassword).equals(requester.getPassword())) {
                 requester.setPassword(MD5Util.getPassword(newPassword));
                 if (userMapper.updateById(requester) == 0) {
-                    httpRespMsg.setError("操作失败");
+                    //httpRespMsg.setError("操作失败");
+                    httpRespMsg.setError(MessageUtils.message("other.operationFail"));
                 }
             }
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败");
+            //httpRespMsg.setError("验证失败");
+            httpRespMsg.setError(MessageUtils.message("Company.validationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -592,16 +605,19 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
         Integer exists = userVcodeMapper.selectCount(new QueryWrapper<UserVcode>().eq("mobile", phone).gt("indate", now).eq("vcode", vcode));
         if (exists == 0) {
-            httpRespMsg.setError("验证码不正确");
+            //httpRespMsg.setError("验证码不正确");
+            httpRespMsg.setError(MessageUtils.message("register.codeError"));
             return httpRespMsg;
         }
         //首先检测用户名是否重复
         if (userMapper.selectList(new QueryWrapper<User>().eq("phone", phone)).size() > 0) {
-            httpRespMsg.setError("该电话号码已注册");
+            //httpRespMsg.setError("该电话号码已注册");
+            httpRespMsg.setError(MessageUtils.message("register.phoneExist"));
         } else {
             //检查公司名称是否已经存在
             if (companyMapper.selectCount(new QueryWrapper<Company>().eq("company_name", companyName)) > 0) {
-                httpRespMsg.setError("该公司已注册,请联系管理员为您添加账号");
+                //httpRespMsg.setError("该公司已注册,请联系管理员为您添加账号");
+                httpRespMsg.setError(MessageUtils.message("register.companyExist"));
                 return httpRespMsg;
             }
             //首先生成一个新公司,增加会员的15天试用期
@@ -708,7 +724,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             }
             expenseTypeService.saveBatch(expenseTypeList);
             if (userMapper.insert(user) == 0) {
-                httpRespMsg.setError("操作失败");
+                //httpRespMsg.setError("操作失败");
+                httpRespMsg.setError(MessageUtils.message("other.operationFail"));
             } else {
                 httpRespMsg.data = user;
             }
@@ -736,17 +753,20 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 //新增
                 //电话号码列 检测重名
                 if (!StringUtils.isEmpty(phone) && userMapper.selectList(new QueryWrapper<User>().eq("phone", phone)).size() > 0) {
-                    httpRespMsg.setError("该电话号码已存在");
+                    //httpRespMsg.setError("该电话号码已存在");
+                    httpRespMsg.setError(MessageUtils.message("register.phoneError"));
                 } else {
                     //只计算活跃的用户
                     if (userMapper.selectCount(new QueryWrapper<User>()
                             .eq("company_id", creator.getCompanyId()).eq("is_active", 1)) >=
                             (companyMapper.selectById(creator.getCompanyId()).getStaffCountMax())) {
-                        httpRespMsg.setError("公司人员已达上限");
+                        //httpRespMsg.setError("公司人员已达上限");
+                        httpRespMsg.setError(MessageUtils.message("register.peopleFull"));
                     } else {
                         //检查本公司内工号是否重复
                         if (!StringUtils.isEmpty(jobNumber) && userMapper.selectList(new QueryWrapper<User>().eq("company_id", creator.getCompanyId()).eq("job_number", jobNumber)).size() > 0) {
-                            httpRespMsg.setError("该工号已存在");
+                            //httpRespMsg.setError("该工号已存在");
+                            httpRespMsg.setError(MessageUtils.message("register.jobNoExist"));
                             return httpRespMsg;
                         }
                         Long id = SnowFlake.nextId();
@@ -779,7 +799,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                             user.setInductionDate(LocalDate.parse(inductionDate,dtf));
                         }
                         if (userMapper.insert(user) == 0) {
-                            httpRespMsg.setError("操作失败");
+                            //httpRespMsg.setError("操作失败");
+                            httpRespMsg.setError(MessageUtils.message("other.operationFail"));
                         } else {
                             //插入人员历史成本表
                             UserSalary userSalary = UserSalary.copyFromUser(user);
@@ -798,12 +819,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             } else {
                 //修改
                 if (!StringUtils.isEmpty(phone) && userMapper.selectList(new QueryWrapper<User>().eq("phone", phone).ne("id", targetId)).size() > 0) {
-                    httpRespMsg.setError("该电话号码已存在");
+                    //httpRespMsg.setError("该电话号码已存在");
+                    httpRespMsg.setError(MessageUtils.message("register.phoneError"));
                     return httpRespMsg;
                 }
                 //检查本公司内工号是否重复
                 if (!StringUtils.isEmpty(jobNumber) && userMapper.selectList(new QueryWrapper<User>().eq("company_id", creator.getCompanyId()).eq("job_number", jobNumber).ne("id", targetId)).size() > 0) {
-                    httpRespMsg.setError("该工号已存在");
+                    //httpRespMsg.setError("该工号已存在");
+                    httpRespMsg.setError(MessageUtils.message("register.jobNoExist"));
                     return httpRespMsg;
                 }
                 User oldUser = userMapper.selectById(targetId);
@@ -916,7 +939,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             }
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("数据有误 验证失败");
+            //httpRespMsg.setError("数据有误 验证失败");
+            httpRespMsg.setError(MessageUtils.message("data.verificationError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -968,7 +992,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         int maxCnt = company.getStaffCountMax();
         long cnt = userMapper.selectCount(new QueryWrapper<User>().eq("company_id", companyId).eq("is_active", 1));
         if (cnt >= maxCnt) {
-            httpRespMsg.setError("人数已达上限,无法导入.请联系客服提高人数上限。");
+            //httpRespMsg.setError("人数已达上限,无法导入.请联系客服提高人数上限。");
+            httpRespMsg.setError(MessageUtils.message("register.peopleFullAndCallRoot"));
             return httpRespMsg;
         }
         int canImportNum = (int)(maxCnt - cnt);
@@ -1033,7 +1058,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 
                 if (name.equals("姓名") && phone.equals("手机号") && rowIndex == 0) {
                     if (!"部门".equals(dept)) {
-                        httpRespMsg.setError("缺少部门列,请下载最新模板进行导入");
+                        //httpRespMsg.setError("缺少部门列,请下载最新模板进行导入");
+                        httpRespMsg.setError(MessageUtils.message("Template.lackDepartment"));
                         return httpRespMsg;
                     }
                     continue;
@@ -1051,7 +1077,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 } else {
                     final String tmpDept = dept;
                     if (!deptList.stream().filter(d->d.getDepartmentName().equals(tmpDept)).findFirst().isPresent()) {
-                        httpRespMsg.setError("部门["+dept+"]不存在,请先创建该部门");
+                        //httpRespMsg.setError("部门["+dept+"]不存在,请先创建该部门");
+                        httpRespMsg.setError(MessageUtils.message("department.notExistAndCreat",dept));
                         return httpRespMsg;
                     } else {
                         deptId = deptList.stream().filter(d->d.getDepartmentName().equals(tmpDept)).findFirst().get().getDepartmentId();
@@ -1110,7 +1137,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 //            }
             //检查本次导入人数是否超过上限
             if (userList.size() > canImportNum) {
-                httpRespMsg.setError("仅剩余"+canImportNum+"人可添加,请减少本次导入的人员数量或者联系客服提高人数上限。");
+                //httpRespMsg.setError("仅剩余"+canImportNum+"人可添加,请减少本次导入的人员数量或者联系客服提高人数上限。");
+                httpRespMsg.setError(MessageUtils.message("register.peopleNoEnough",canImportNum));
             } else {
                 //校验是否有重复账号
                 if (userMapper.selectCount(new QueryWrapper<User>().in("phone", phoneList)) == 0) {
@@ -1120,21 +1148,25 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 } else {
                     List<User> existList = userMapper.selectList(new QueryWrapper<User>().in("phone", phoneList));
                     String duplicatePhoneStr = existList.stream().map(User::getPhone).collect(Collectors.joining(","));
-                    httpRespMsg.setError("手机号有重复 批量新建账号失败:" + duplicatePhoneStr);
+                    //httpRespMsg.setError("手机号有重复 批量新建账号失败:" + duplicatePhoneStr);
+                    httpRespMsg.setError(MessageUtils.message("register.phoneRepeat",duplicatePhoneStr));
                     /*这里以后可能需要返回重复的手机号的具体信息*/
                 }
             }
         } catch (IOException e) {
             e.printStackTrace();
-            httpRespMsg.setError("文件处理出错");
+            //httpRespMsg.setError("文件处理出错");
+            httpRespMsg.setError(MessageUtils.message("file.error"));
             return httpRespMsg;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("数据格式有误或存在空数据 导入失败");
+            //httpRespMsg.setError("数据格式有误或存在空数据 导入失败");
+            httpRespMsg.setError(MessageUtils.message("file.dataFormatError"));
             return httpRespMsg;
         } catch (Exception e) {
             e.printStackTrace();
-            httpRespMsg.setError("发生其他错误");
+            //httpRespMsg.setError("发生其他错误");
+            httpRespMsg.setError(MessageUtils.message("other.error"));
             return httpRespMsg;
         } finally {
             //关闭流
@@ -1188,7 +1220,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         if (isActive == 1 && userMapper.selectCount(new QueryWrapper<User>()
                 .eq("company_id", user.getCompanyId()).eq("is_active", 1)) >=
                 (companyMapper.selectById(user.getCompanyId()).getStaffCountMax())) {
-            msg.setError("公司人员已达上限,无法启用");
+            //msg.setError("公司人员已达上限,无法启用");
+            msg.setError(MessageUtils.message("register.fullError"));
         } else {
             User setUser = new User();
             setUser.setId(id);
@@ -1430,11 +1463,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             httpRespMsg.data = "/upload/" + fileUrlSuffix;
         } catch (NullPointerException e) {
             e.printStackTrace();
-            httpRespMsg.setError("验证失败或缺少数据");
+            //httpRespMsg.setError("验证失败或缺少数据");
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
             return httpRespMsg;
         } catch (IOException e) {
             e.printStackTrace();
-            httpRespMsg.setError("文件生成错误");
+            //httpRespMsg.setError("文件生成错误");
+            httpRespMsg.setError(MessageUtils.message("file.generateError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -1450,7 +1485,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         if (list.size() > 0) {
             long lastTimeSec = list.get(0).getIndate().toEpochSecond(ZoneOffset.of("+8"));
             if (now.toEpochSecond(ZoneOffset.of("+8")) - lastTimeSec < 60) {
-                msg.setError("请求过于频繁,请稍后再试");
+                //msg.setError("请求过于频繁,请稍后再试");
+                msg.setError(MessageUtils.message("request.frequently"));
                 return msg;
             }
         }
@@ -1519,7 +1555,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                             boolean result = push(u, date);
                             if (!result) {
                                 System.out.println("!!!!!!!!!!!==================");
-                                msg.setError("推送失败,请检查日志");
+                                //msg.setError("推送失败,请检查日志");
+                                msg.setError(MessageUtils.message("other.pushFail"));
                             }
                         }
                 }
@@ -1586,10 +1623,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             //返回生成的文件地址/upload文件夹下
             httpRespMsg.data = "/upload/" + fileUrlSuffix;
         } catch (NullPointerException e) {
-            httpRespMsg.setError("验证失败或缺少数据");
+            //httpRespMsg.setError("验证失败或缺少数据");
+            httpRespMsg.setError(MessageUtils.message("access.verErrorOrDataLack"));
             return httpRespMsg;
         } catch (IOException e) {
-            httpRespMsg.setError("文件生成错误");
+            //httpRespMsg.setError("文件生成错误");
+            httpRespMsg.setError(MessageUtils.message("file.generateError"));
             return httpRespMsg;
         }
         return httpRespMsg;
@@ -1610,11 +1649,13 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("TOKEN"));
         if (!"超级管理员".equals(user.getRoleName())) {
-            msg.setError("无权操作");
+            //msg.setError("无权操作");
+            msg.setError(MessageUtils.message("access.operationError"));
         } else {
             User toUser = userMapper.selectById(toUserId);
             if (toUser.getIsActive() == 0) {
-                msg.setError(toUser.getName()+"已停用,请先启用该员工再转让。");
+                //msg.setError(toUser.getName()+"已停用,请先启用该员工再转让。");
+                msg.setError(MessageUtils.message("access.staffStop",toUser.getName()));
             } else {
                 SysRole smanager = sysRoleMapper.selectOne(
                         new QueryWrapper<SysRole>().eq("company_id", user.getCompanyId()).eq("rolename", "超级管理员"));
@@ -1715,16 +1756,19 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
     public HttpRespMsg loginByUserId(String userId, HttpServletRequest request) {
         HttpRespMsg httpRespMsg = new HttpRespMsg();
         if (StringUtils.isEmpty(userId) || userId.length() > 50) {
-            httpRespMsg.setError("账号不存在");
+            //httpRespMsg.setError("账号不存在");
+            httpRespMsg.setError(MessageUtils.message("user.accountNoExist"));
             return httpRespMsg;
         }
         User user = userMapper.selectById(userId);
         if (user == null) {
-            httpRespMsg.setError("账号不存在");
+            //httpRespMsg.setError("账号不存在");
+            httpRespMsg.setError(MessageUtils.message("user.accountNoExist"));
             return httpRespMsg;
         }
         if (user.getIsActive() == 0) {
-            httpRespMsg.setError("该账号已停用");
+            //httpRespMsg.setError("该账号已停用");
+            httpRespMsg.setError(MessageUtils.message("user.accountDeactivation"));
             return httpRespMsg;
         }
         //查看该公司非会员公司,只能允许试用三天,超时不可登录
@@ -1734,12 +1778,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             if (0 == company.getSetMeal()) {
                 //未办理会员
                 if (company.getExpirationDate().isBefore(LocalDateTime.now())) {
-                    httpRespMsg.setError("账号试用已到期,请联系客服。");
+                    //httpRespMsg.setError("账号试用已到期,请联系客服。");
+                    httpRespMsg.setError(MessageUtils.message("user.accountExpired"));
                     return httpRespMsg;
                 }
             } else {
                 if (company.getExpirationDate().isBefore(LocalDateTime.now())) {
-                    httpRespMsg.setError("账号会员已到期,请联系客服。");
+                    //httpRespMsg.setError("账号会员已到期,请联系客服。");
+                    httpRespMsg.setError(MessageUtils.message("user.memberExpired"));
                     return httpRespMsg;
                 }
             }
@@ -1794,10 +1840,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 }
                 updateBatchById(userList);
             } else {
-                msg.setError("人员不能为空");
+                //msg.setError("人员不能为空");
+                msg.setError(MessageUtils.message("other.peopleNull"));
             }
         } else {
-            msg.setError("人员不能为空");
+            //msg.setError("人员不能为空");
+            msg.setError(MessageUtils.message("other.peopleNull"));
         }
 
         return msg;
@@ -1820,10 +1868,12 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 }
                 updateBatchById(userList);
             } else {
-                msg.setError("人员不能为空");
+                //msg.setError("人员不能为空");
+                msg.setError(MessageUtils.message("other.peopleNull"));
             }
         } else {
-            msg.setError("人员不能为空");
+            //msg.setError("人员不能为空");
+            msg.setError(MessageUtils.message("other.peopleNull"));
         }
 
         return msg;

+ 9 - 8
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/WxCorpInfoServiceImpl.java

@@ -11,10 +11,7 @@ import com.management.platform.mapper.UserCorpwxTimeMapper;
 import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.WxCorpInfoMapper;
 import com.management.platform.service.WxCorpInfoService;
-import com.management.platform.util.ColorUtil;
-import com.management.platform.util.DateTimeUtil;
-import com.management.platform.util.HttpRespMsg;
-import com.management.platform.util.SnowFlake;
+import com.management.platform.util.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
@@ -283,7 +280,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         HttpRespMsg msg = new HttpRespMsg();
         WxCorpInfo corpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
         if (corpInfo == null) {
-            msg.setError("该企业未对接企业微信");
+            //msg.setError("该企业未对接企业微信");
+            msg.setError(MessageUtils.message("wx.dockError"));
             return msg;
         }
         String url = null;
@@ -333,7 +331,8 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
         List<String> corpwxUserIds = userList.stream().map(User::getCorpwxUserid).collect(Collectors.toList());
         System.out.println("新拉取到的无姓名用户WXCorp_userid size=" + corpwxUserIds.size());
         if (corpwxUserIds.size() == 0) {
-            msg.data = "无新成员更新";
+            //msg.data = "无新成员更新";
+            msg.data = MessageUtils.message("wx.noNewMemberUp");
             return msg;
         }
         String url = null;
@@ -387,9 +386,11 @@ public class WxCorpInfoServiceImpl extends ServiceImpl<WxCorpInfoMapper, WxCorpI
                 userCorpwxTimeMapper.delete(new QueryWrapper<UserCorpwxTime>().eq("company_id", wxCorpInfo.getCompanyId()).in("corpwx_userid", notUsefullCpIds));
             }
             if (updateUserList.size() == 0) {
-                msg.data = "处理完毕。当前无新人员需要关联企业微信身份";
+                //msg.data = "处理完毕。当前无新人员需要关联企业微信身份";
+                msg.data = MessageUtils.message("wx.AssCompleted");
             } else {
-                msg.data = "处理完毕。本次自动关联了:" + updateUserList.size() + "位人员:" + updateUserList.stream().map(User::getName).collect(Collectors.joining(","));
+                //msg.data = "处理完毕。本次自动关联了:" + updateUserList.size() + "位人员:" + updateUserList.stream().map(User::getName).collect(Collectors.joining(","));
+                msg.data = MessageUtils.message("wx.AssCompletedByParam",updateUserList.size(),updateUserList.stream().map(User::getName).collect(Collectors.joining(",")));
             }
 
         } catch (Exception exception) {

+ 157 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties

@@ -1,11 +1,29 @@
 # 用户相关信息
 user.notExists=用户不存在
+user.accountNoExist=账号不存在
+user.accountDeactivation=该账号已停用
+user.notFind=未找到用户
+user.notExistsByParam=该用户不存在:{0}
 user.duplicate=账号重名
 user.inactive=该账户已停用,无法登陆。请联系管理员
 user.accountExpired=账号试用已到期,请联系客服。
+user.memberExpired=账号会员已到期,请联系客服。
 user.noRole=请先联系管理员为您分配角色
+user.roleNameRepeat=角色名称不能重复
 user.pwdError=密码错误
+user.NoPermission=您尚无权使用系统,请联系管理员。
 user.AccountDeactivation=您的账号已停用,无法操作
+#注册相关
+register.codeError=验证码不正确
+register.phoneExist=该电话号码已注册
+register.phoneError=该电话号码已存在
+register.companyExist=该公司已注册,请联系管理员为您添加账号
+register.peopleFull=公司人员已达上限
+register.jobNoExist=该工号已存在
+register.peopleFullAndCallRoot=人数已达上限,无法导入.请联系客服提高人数上限。
+register.peopleNoEnough=仅剩余"{0}"人可添加,请减少本次导入的人员数量或者联系客服提高人数上限。
+register.phoneRepeat=手机号有重复 批量新建账号失败:{0}
+register.fullError=公司人员已达上限,无法启用
 #权限相关
 access.operationError=无权操作
 access.viewError=无权查看
@@ -14,7 +32,14 @@ access.createDelete=非创建人无权删除
 access.createEnd=非创建人无权结束
 access.createOperation=非创建人无权操作
 access.verificationError=验证失败
+access.verErrorOrDataLack=验证失败或缺少数据
+access.verificationErrorByParam=验证失败{0}
 access.grant=该用户企业未授权
+access.cancelSuc=权限取消成功
+access.addSuc=权限加入成功
+access.otherCompanyProject=无权查看其他公司的项目详情
+access.otherCompanyPeople=只能删除同一公司人员的账号
+access.staffStop={0}已停用,请先启用该员工再转让。
 #名称相关
 name.nullNameError=名称不能为空
 name.nameRepeat=该名称已存在
@@ -23,18 +48,38 @@ name.nameRepeatByParam={0}名称重复
 name.CategoryNameRepeat=分类名称已存在
 #其他
 other.error=发生其他错误
+other.errorByParameter=发生其他错误{0}
 other.update=更新失败
 other.deleteScu=删除成功
 other.parameterError=参数异常
 other.MissingData=缺少数据
 other.stateError=状态不对,无法操作
 other.saveError=保存失败
+other.addFail=添加失败
+other.modifyFail=修改失败
+other.billNoExist=票据编号已存在
+other.infoEmpty=未检查到相关信息
+other.recordNoExist=该记录不存在
+other.NumAlreadyExists=编号已存在
+other.operationFail=操作失败
+other.tokenError=token错误
+other.tokenOverdue=token过期失效
+other.deleteErrorByAccess=只有创建人和项目经理可以删除
+other.ExecutorNull=执行人["{0}"]不存在
+other.pushFail=推送失败,请检查日志
+other.peopleNull=人员不能为空
 # 请求相关
 request.countLimit=接口访问次数超过限制,请1分钟后重试。
 request.illegal=请求非法
+request.frequently=请求过于频繁,请稍后再试
 # 部门相关
 department.duplicateError=保存失败: 部门[{0}]存在重复。
 department.reviewedError=当前部门存在待审核报告,无法操作!
+department.ParentNull=无所选父级部门
+department.modifyOtherError=不能修改其他公司的部门
+department.noDistribution=未分配
+department.notExist=部门["{0}"]不存在
+department.notExistAndCreat=部门["{0}"]不存在,请先创建该部门
 # 日期相关
 date.dateNullError=开始日期和结束日期不能为空
 date.startDateError=开始日期不得早于{0}
@@ -42,6 +87,8 @@ date.endDateError=结束日期不得早于{0}
 date.dateEarly=日期不得早于2020-01-01或者超过当前一个月
 date.startThanEnd=开始日期不能大于结束日期
 date.dateThan365=日期间隔不得超过365天
+date.formatError=日期格式有误
+data.NullErrorByRow=第"{0}"行缺少日期
 # 公司相关
 Company.nullNameError=名称不能为空
 Company.nameRepeat=该名称已存在
@@ -56,11 +103,18 @@ customer.nameRepeat=客户名称已存在
 customer.noRepeat=客户编号已存在
 customer.accessError=无权删除
 customer.UsedError=客户{0}已被使用
+customer.info=请填写客户数据
+customer.nameNull=第"{0}"行缺少客户名称
+customer.exportNameRepeat=当前导入数据存在重复客户名称["{0}"]
 DD.dateError=开始日期不能晚于结束日期
 DD.keyAndSecretError=该公司没有设置innerAppkey和innerAppSecrt
 expense.deleteError=删除失败,已绑定费用报销数据
+expense.notExist=客户["{0}"]不存在
 # 文件相关
 file.error=文件处理出错
+file.generateError=文件生成错误
+file.dateNull=请填写数据再上传
+file.dateNoExist=该数据不存在
 file.dataFormatError=数据格式有误或存在空数据 导入失败
 file.FormatErrorAndDecrypt=文件格式错误,如果安装了加密软件需要先解密再上传
 file.encryption=文件加密状态,需要先解除加密状态再上传
@@ -73,9 +127,18 @@ file.duplicateTemplate=已存在模板名称为[{0}]的文件,请删除后重新
 # 配置相关
 config.used=当前配置["{0}"]已使用
 config.usedNoParam=当前配置已被使用
+config.isPrivateDeploy=请配置isPrivateDeploy: true
+config.ddCorpId=请在company_dingding表中增加corpid:"{0}
+config.companyIdExist=companyId已存在,如需重新初始化请先重置company_dingding中该条数据的companyId为null
 # 审核相关
 finance.operationStateError=只有待审核状态才可以操作
+finance.revokeReport=只有待审核状态的报告才能撤回
 finance.revokeStateError=只有审核通过状态才可以撤销
+finance.professional=只有专业审核全部通过才能进行操作
+finance.masterProfessional=只有专业负责人才能进行专业审核
+finance.choiceDaily=请选择需要审核的日报
+finance.skipData=跳过以下已审核数据:"{0}"。
+finance.importErrorByAllAdopt=本次数据全部已审核通过,无法导入。
 # pdf相关
 pdf.previewError=该格式不支持在线预览
 # 日报相关
@@ -85,18 +148,27 @@ profession.repeatError=已存在填写日报: "{0}", 请重新选择日期范围
 profession.SubmitErrorByDay=工作日天数为0,无法提交。(批量填报会自动跳过节假日,请尝试填写日报或者重新选择日期范围)
 profession.duration=请填写工作时长
 profession.workDurationError=加班时长必须大于0
+profession.workTimeZeroError=工作时长必须大于零
 profession.OvertimeHoursError=加班时长("{0}"h)不能超过工作时长("{1}"h)
 profession.MaxReportTimeError=每日工作时长不得超过"{0}"小时
 profession.workTimeError=无法提交:"{0}"日合计工作时长为"{1}"h, 超过"{2}"h
+profession.toReviewed=尚存在日报在该专业上待审核,审核通过后才能移除
+profession.submit={0}提交了日报
+profession.submitReplace={0}为{1}代填了日报
+profession.alreadyNull=日报已不存在
+profession.TypeError=操作错误,日报状态不对:{0}
+profession.alreadyRevoke=该日报已被撤销,无法重复操作
 # 项目相关
 project.deleteErrorByProject=删除失败,已绑定项目
 project.deleteErrorByMaster=删除失败,已绑定主项目
 project.DateRelation=该数据已经被以下项目关联,无法删除:{0}
 project.revokeError=该项目已完成,无法撤销
 project.nonExistent=该项目已不存在
+project.nonExistentByParam=项目["{0}"]已不存在
 project.BoundItems=已绑定项目
 project.RecordNotExist=记录不存在,操作失败
 project.emptyError=项目不能为空
+project.emptyNameError=项目名称不能为空
 project.idOrNameNoExist=项目编号/名称"{0}"不存在
 project.StageNameError=阶段名称已存在
 project.StageUsedError=该阶段已被使用
@@ -104,6 +176,27 @@ project.complete=项目["{0}"]已完成。
 project.revoke=项目["{0}"]已撤销。
 project.InsufficientBudget=项目["{0}"]的["{1}"]预算不足,请联系管理人员下拨预算
 project.joinError=员工无参与的项目,请先到项目管理中进行设置项目参与人
+project.ClearInfo=请清空项目关联信息
+project.masterNull=当前项目["{0}"]负责人["{1}"]不存在
+project.setPersonnelAllotment=请先设置无项目工时人员的分配比例
+project.lackApportion=缺少待分摊项目,请重新设置并保存分摊比例设置
+project.quotaNoEnough={0}可下拨额度不足{1}元, 请校正总成本预算。
+project.revokeErrByNoNew=只有最新的一次下拨可以撤销
+project.fillDataError=请填写项目数据
+project.fillNameError=请填写项目名称
+project.submitFailByNoRepeat=提交失败:项目编号已存在
+project.noExist=项目["{0}"]不存在,请先在项目管理中添加或导入。
+project.sonNoExist=子项目["{0}"]不存在,请先在项目管理中添加或导入。
+project.costBaseline=成本基线"{0}"预算小于当前基线预算
+project.dailyDataDel=检测到该项目存在相关日报,确定要删除全部数据吗
+project.contractAmount=请先设置项目合同金额
+project.masterProjectNull=主项目["{0}"]不存在
+project.nameAndIdNoExist=项目编号为["{0}"]的项目名称为["{1}"]的项目不存在
+project.nameAndGroupNoExist=项目名称为["{0}"]的任务分组["{1}"]不存在
+project.upDataSuc=成功更新"{0}"条项目数据
+project.upSonSuc=成功更新"{0}"条项目子表数据
+project.deleteDate=成功删除"{0}"条项目数据
+project.masterError=请给["{0}"]项目设置项目负责人
 # 供货相关
 provider.noRepeat=供货商编号已存在
 provider.classNameRepeat=该分类下供货商名称已存在
@@ -117,11 +210,74 @@ Stages.repeatedCollection=您已认领过该任务,请勿重复操作
 Stages.receiveError=该任务已被其他人认领
 Stages.noExist=该任务已不存在
 Stages.noExistAndRefresh=该任务不存在,请刷新查看
+Stages.ListNull=任务列表为空,无法保存
+Stages.ListNotExist=任务列表["{0}"]不存在
+Stages.leastOneGroup=至少保留一个任务分组
 #分组相关
 group.RepeatName=分组存在重名
+group.userNull=用户["{0}"]不存在,请在组织结构中添加该成员
+group.userNullById=用户["{0}","{1}"]不存在,请在组织结构中添加该成员
 #微信相关
 wx.TicketError=jsapiTicket获取失败
 wx.bindError=该用户尚未绑定企业微信,需要通过账号密码登录
 wx.dockError=该企业未对接企业微信
 wx.synSecretError=请先设置企业通讯录同步Secret
-wx.synError=同步失败:{0}
+wx.synError=同步失败:{0}
+wx.noNewMemberUp=无新成员更新
+wx.AssCompleted=处理完毕。当前无新人员需要关联企业微信身份
+wx.AssCompletedByParam=处理完毕。本次自动关联了:{0}位人员:{1}
+#请假相关
+leave.businessRepeat=该时间段已有出差申请,不能重复提交
+leave.repeatedLeave=该时间段已有请假申请,不能重复请假
+#报销相关
+Reimbursement.nameNull=报销人名称不能fa为空
+Reimbursement.costTypeNull=费用类型不能为空
+Reimbursement.dataNull=填报日期不能为空
+Reimbursement.PeopleNull=报销人["{0}"]不存在
+Reimbursement.TypeError=当前费用类型["{0}"]中不存在["{1}"]类型
+#薪资相关
+salary.uploadErrorByAdopt={0}月薪资已审核通过,无法上传。
+salary.lackAndUpAgain=缺少["{0}"]的薪资成本,请修改数据重新上传
+#报表相关
+report.userNull=用户["{0}"]在财务报表中不存在,请重新导入
+report.warningType=已设置工时预警类型的成本预算,暂不支持导入工时
+report.data=请填写工时数据
+report.negativeError={0}的工时存在负数,请检查修改
+report.dataNullError=工时数据不能为空
+report.hoursZero={0}工时为零,请检查
+report.typeErrorByHourAndSalary=表格格式不正确,需要月度工时和月薪薪资两个sheet={0}
+report.noExist={0}不存在于薪资表中,请检查后提交
+#模板相关
+Template.AlreadyExists=该模板名称已存在
+Template.lackSonProject=缺少子项目列,请下载最新模板
+Template.lackMasterRow=缺少主项目列,请下载最新模板
+Template.lackDepartment=缺少部门列,请下载最新模板进行导入
+#角色相关
+role.noExist=该角色不存在
+role.deleteRootError=不可删除超级管理员
+role.deleteErrorByDefault=该角色为新增员工时的默认角色,请设置其他角色为默认后再尝试删除
+role.deleteErrorByHavePeople=该角色存在相关人员,请将他们修改为其他角色后再尝试删除
+#员工相关
+staff.nameNullByRow=第"{0}"行缺少员工姓名
+staff.peopleNullAndAdd=人员["{0}"]不存在,请先在组织结构中添加或者通过钉钉同步导入
+staff.proportionError=人员["{0}"]"+"分摊比例不满足100%,当前比例["{1}"%],请检查
+staff.workingHoursNull=工号为"{0}"的员工在工时系统中不存在
+staff.deleteErrorByDaily=该员工存在填写的日报,无法删除。
+staff.deleteErrorByTask=该员工存在参与的任务,无法删除
+staff.deleteErrorByProject=该员工存在负责的项目,无法删除
+#数据相关
+data.importRepeat=请勿导入重复数据
+data.importSucRow=成功导入"{0}"条数据。
+data.OversizeError=数据量过大,请分时间段导出
+data.upSkip=自动更新"{0}"条已存在项目编码:"{1}。
+data.exceedMonthError=获取数据时间段不得超过一个月
+data.verificationError=数据有误 验证失败
+#供应商相关
+supplier.noExist=供应商["{0}"]在供应商分类["{1}"]不存在
+supplier.addSupplier=请填写供应商数据
+supplier.lackNameOnRow=第"{0}"行缺少供应商名称
+supplier.nameRepeat=当前导入数据存在重复供应商名称["{0}"]
+#研究中心相关
+research.addData=请填写研究中心数据
+research.nameNull=第"{0}"行缺少中心名称
+research.nameRepeat=当前导入数据存在重复中心名称["{0}"]

+ 157 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages_en_US.properties

@@ -1,11 +1,29 @@
 # 用户相关信息
 user.notExists=user does not exist
+user.accountNoExist=The account does not exist.
+user.accountDeactivation=The account has been deactivated.
+user.notFind=User not found.
+user.notExistsByParam=The user does not exist: {0}.
 user.duplicate=duplicate account
 user.inactive=The account has been disabled and cannot be logged in. Please contact the administrator.
 user.accountExpired=Account trial has expired, please contact customer service.
+user.memberExpired=Account member has expired, please contact customer service.
 user.noRole=Please contact the administrator first to assign you a role.
 user.pwdError=password error
+user.NoPermission=You are not authorized to use the system. Please contact the administrator.
+user.roleNameRepeat=The role name cannot be duplicate.
 user.AccountDeactivation=Your account has been deactivated, unable to operate.
+#注册相关
+register.codeError=Incorrect verification code.
+register.phoneExist=The phone number is already registered.
+register.phoneError=The phone number already exists.
+register.companyExist=The company has been registered, please contact the administrator to add your account.
+register.peopleFull=Company personnel has reached the upper limit.
+register.jobNoExist=The job number already exists.
+register.peopleFullAndCallRoot=The number of people has reached the upper limit and cannot be imported. Please contact customer service to increase the upper limit.
+register.peopleNoEnough=Only "{0}" people can be added. Please reduce the number of people imported this time or contact customer service to increase the maximum number of people.
+register.phoneRepeat=Failed to batch create accounts with duplicate mobile phone numbers: {0}.
+register.fullError=Company personnel has reached the upper limit, unable to enable.
 #权限相关
 access.operationError=No permission to operate.
 access.viewError=No permission to view.
@@ -14,7 +32,14 @@ access.createDelete=Non creator has no right to delete.
 access.createEnd=Non creator has no right to end.
 access.createOperation=Non creator has no right to operate.
 access.verificationError=Validation failed.
+access.verErrorOrDataLack=Validation failed or data is missing.
+access.verificationErrorByParam=Validation failed {0}.
 access.grant=The user enterprise is not authorized.
+access.cancelSuc=Permission cancelled successfully.
+access.addSuc=Permission joined successfully.
+access.otherCompanyProject=No right to view project details of other companies.
+access.otherCompanyPeople=You can only delete the account of a person in the same company.
+access.staffStop={0} has been deactivated. Please enable the employee before transferring.
 #名称相关
 name.nullNameError=Name cannot be empty.
 name.nameRepeat=The name already exists.
@@ -23,18 +48,38 @@ name.nameRepeatByParam=Duplicate {0} name.
 name.CategoryNameRepeat=Category name already exists.
 #其他
 other.error=Other errors occurred.
+other.errorByParameter=Other error {0} occurred.
 other.update=Update failed.
 other.deleteScu=Deletion succeeded.
 other.parameterError=Parameter exception
 other.MissingData=Missing data
 other.stateError=Wrong status, unable to operate
 other.saveError=Save failed
+other.addFail=Add failed.
+other.modifyFail=Modification failed.
+other.billNoExist=Bill No. already exists.
+other.infoEmpty=No relevant information is checked.
+other.recordNoExist=The record does not exist.
+other.NumAlreadyExists=Number already exists.
+other.operationFail=operation failed
+other.tokenError=Token error
+other.tokenOverdue=Token expires
+other.deleteErrorByAccess=Only the creator and project manager can delete.
+other.ExecutorNull=Executor ["{0}"] does not exist.
+other.pushFail=Push failed, please check the log.
+other.peopleNull=Personnel cannot be empty.
 # 请求相关
 request.countLimit=The number of interface accesses exceeds the limit. Please try again in 1 minute.
 request.illegal=Illegal request
+request.frequently=Too many requests, please try again later.
 # 部门相关
 department.duplicateError=save fail: department [{0}] already exists
 department.reviewedError=The current department has a report to be approved, unable to operate!
+department.ParentNull=No selected parent department.
+department.modifyOtherError=Departments of other companies cannot be modified.
+department.noDistribution=Unassigned
+department.notExist=Department ["{0}"] does not exist
+department.notExistAndCreat=The department ["{0}"] does not exist. Please create it first.
 # 日期相关
 date.dateNullError=Start date and end date cannot be blank.
 date.startDateError=Start date cannot be earlier than {0}.
@@ -42,6 +87,8 @@ date.endDateError=End date cannot be earlier than {0}.
 date.dateEarly=The date cannot be earlier than January 1, 2020 or later than the current month.
 date.startThanEnd=The start date cannot be later than the end date.
 date.dateThan365=The date interval shall not exceed 365 days.
+date.formatError=Incorrect date format
+data.NullErrorByRow=Missing date in row '{0}'
 # 公司相关
 Company.nullNameError=Name cannot be empty
 Company.nameRepeat=The name already exists.
@@ -56,11 +103,18 @@ customer.nameRepeat=Customer name already exists.
 customer.noRepeat=Customer number already exists.
 customer.accessError=No permission to delete.
 customer.UsedError=Customer {0} has been used.
+customer.info=Please fill in the customer data
+customer.nameNull=Missing customer name in row "{0}".
+customer.exportNameRepeat=The current imported data has duplicate customer name ["{0}"].
 DD.dateError=The start date cannot be later than the end date.
 DD.keyAndSecretError=The company is not set innerAppkey and innerAppSecrt
 expense.deleteError=Failed to delete. Expense reimbursement data has been bound.
+expense.notExist=The customer ["{0}"] does not exist.
 # 文件相关
 file.error=File processing error.
+file.generateError=File generation error
+file.dateNull=Please fill in the data before uploading
+file.dateNoExist=The data does not exist.
 file.dataFormatError=Data format error or empty data import failure.
 file.FormatErrorAndDecrypt=The file format is incorrect. If the encryption software is installed, it needs to be decrypted first and then uploaded.
 file.encryption=The file encryption status needs to be removed before uploading.
@@ -73,9 +127,18 @@ file.duplicateTemplate=A file with template name [{0}] already exists. Please de
 # 配置相关
 config.used=The current configuration ['{0}'] is already in use.
 config.usedNoParam=The current configuration is already in use.
+config.isPrivateDeploy=Please configure isPrivateDeploy: true.
+config.ddCorpId=Please add a core in the company_dingding table: "{0}
+config.companyIdExist=The companyId already exists. If you need to reinitialize, please reset the company first_ The companyId of this piece of data in dingding is null.
 # 审核相关
 finance.operationStateError=You can only operate in the status of pending approval.
+finance.revokeReport=Only reports in pending approval status can be withdrawn.
 finance.revokeStateError=Only approved status can be revoked.
+finance.professional=Operation can only be performed after all professional reviews are passed.
+finance.masterProfessional=Only the person in charge of the discipline can conduct professional review.
+finance.choiceDaily=Please select the daily report to be approved.
+finance.skipData=Skipping the following audited data: '{0}'.
+finance.importErrorByAllAdopt=This data has been approved and cannot be imported.
 # pdf相关
 pdf.previewError=This format does not support online preview.
 # 日报相关
@@ -85,18 +148,27 @@ profession.repeatError=Daily report: "{0}" already exists, please reselect the d
 profession.SubmitErrorByDay=The number of working days is 0, unable to submit. (Holidays will be skipped automatically when filling in batches. Please try filling in daily reports or reselecting the date range).
 profession.duration=Please fill in the working hours.
 profession.workDurationError=Overtime duration must be greater than 0.
+profession.workTimeZeroError=Working hours must be greater than zero.
 profession.OvertimeHoursError=Overtime duration ("{0}" h) cannot exceed working duration ("{1}" h).
 profession.MaxReportTimeError=The daily working hours shall not exceed "{0}" hours.
 profession.workTimeError=Cannot submit: the total working hours of "{0}" day is "{1}" h, which exceeds "{2}" h.
+profession.toReviewed=There are still daily reports to be reviewed in this discipline, which can only be removed after approval.
+profession.submit={0} submitted daily report.
+profession.submitReplace={0} filled in the daily report for {1}.
+profession.alreadyNull=Daily report no longer exists
+profession.TypeError=Operation error, the daily report status is incorrect: {0}.
+profession.alreadyRevoke=The daily report has been canceled, and you cannot repeat the operation.
 # 项目相关
 project.deleteErrorByProject=Failed to delete, bound item.
 project.deleteErrorByMaster=Failed to delete, the master project has been bound.
 project.DateRelation=The data has been associated with the following items and cannot be deleted: {0}.
 project.revokeError=The project has been completed and cannot be canceled.
 project.nonExistent=The item no longer exists.
+project.nonExistentByParam=The project ['{0}'] no longer exists.
 project.BoundItems=Project already bound
 project.RecordNotExist=The operation failed because the record does not exist.
 project.emptyError=Item cannot be empty.
+project.emptyNameError=Project name cannot be empty.
 project.idOrNameNoExist=The project number/name "{0}" does not exist.
 project.StageNameError=Stage name already exists.
 project.StageUsedError=This stage has been used.
@@ -104,6 +176,27 @@ project.complete=Project ['{0}'] has completed.
 project.revoke=The project ['{0}'] has been withdrawn.
 project.InsufficientBudget=The budget of ["{1}"] of project ["{0}"] is insufficient. Please contact the management personnel to allocate the budget.
 project.joinError=The employee does not participate in the project, please go to the project management to set the project participant first.
+project.ClearInfo=Please clear the associated information of the project.
+project.masterNull=The person in charge of the current project ["{0}"] ["{1}"] does not exist.
+project.setPersonnelAllotment=Please set the allocation proportion of personnel without project hours first.
+project.lackApportion=Missing items to be allocated, please reset and save allocation proportion settings.
+project.quotaNoEnough={0} allocatable quota is insufficient {1} yuan, please correct the total cost budget.
+project.revokeErrByNoNew=Only the latest allocation can be revoked.
+project.fillDataError=Please fill in the project data.
+project.fillNameError=Please fill in the project name.
+project.submitFailByNoRepeat=Submission failed: the item number already exists.
+project.noExist=The project ["{0}"] does not exist. Please add or import it in project management first.
+project.sonNoExist=The subproject ["{0}"] does not exist. Please add or import it in project management first.
+project.costBaseline=The cost baseline "{0}" budget is less than the current baseline budget.
+project.dailyDataDel=It is detected that there are daily reports related to this item. Are you sure you want to delete all data.
+project.contractAmount=Please set the project contract amount first.
+project.masterProjectNull=The main project ['{0}'] does not exist.
+project.nameAndIdNoExist=The project with project name [{1}] and project number [{0}] does not exist.
+project.nameAndGroupNoExist=Task group [{1}] with project name [{0}] does not exist.
+project.upDataSuc=Successfully updated '{0}' item data.
+project.upSonSuc=Successfully updated "{0}" item sub table data.
+project.deleteDate=Successfully deleted '{0}' item data.
+project.masterError=Please set project leader for ["{0}"] project.
 # 供货相关
 provider.noRepeat=Vendor No. already exists.
 provider.classNameRepeat=The supplier name under this category already exists.
@@ -117,11 +210,74 @@ Stages.repeatedCollection=You have claimed this task, please do not repeat the o
 Stages.receiveError=This task has been claimed by others.
 Stages.noExist=The task no longer exists.
 Stages.noExistAndRefresh=This task does not exist, please refresh and view.
+Stages.ListNull=The task list is empty and cannot be saved.
+Stages.ListNotExist=The task list ["{0}"] does not exist.
+Stages.leastOneGroup=Keep at least one task group.
 #分组相关
 group.RepeatName=Group has duplicate name.
+group.userNull=The user ["{0}"] does not exist. Please add the member in the organization structure.
+group.userNullById=The user ["{0}", "{1}"] does not exist. Please add the member in the organization structure.
 #微信相关
 wx.TicketError=jsapiTicket Get failed.
 wx.bindError=The user has not been bound to WeChat and needs to log in through the account password.
 wx.dockError=The enterprise has not connected to WeChat.
 wx.synSecretError=Please set the synchronization secret of the enterprise address book first.
-wx.synError=Synchronization failed: {0}.
+wx.synError=Synchronization failed: {0}.
+wx.noNewMemberUp=No new member updates
+wx.AssCompleted=Processing completed. Currently, no new personnel need WeChat identity of affiliated enterprises.
+wx.AssCompletedByParam=Processing completed. This time: {0} people are automatically associated:{1}.
+#请假相关
+leave.businessRepeat=There is already a travel application in this period, which cannot be submitted repeatedly.
+leave.repeatedLeave=There is already a leave application in this period, and you cannot ask for leave again.
+#报销相关
+Reimbursement.nameNull=The name of the reimbursement applicant cannot be blank.
+Reimbursement.costTypeNull=Expense type cannot be empty
+Reimbursement.dataNull=The filling date cannot be blank
+Reimbursement.PeopleNull=Reimbursement applicant ["{0}"] does not exist.
+Reimbursement.TypeError=The [{1}] type does not exist in the current expense type [{0}].
+#薪资相关
+salary.uploadErrorByAdopt={0} The monthly salary has been approved and cannot be uploaded.
+salary.lackAndUpAgain=The salary cost of ["{0}"] is missing, please modify the data and upload again.
+#报表相关
+report.userNull=User ["{0}"] does not exist in the financial statement, please import again.
+report.warningType=Cost budget with hour alert type has been set, and importing hours is not supported temporarily.
+report.data=Please fill in the working hour data.
+report.negativeError=The working hours of {0} are negative, please check and modify.
+report.dataNullError=Labor hour data cannot be empty.
+report.hoursZero={0} Work is zero, please check.
+report.typeErrorByHourAndSalary=The table format is incorrect. Two sheets of monthly man hours and monthly salary are required={0}.
+report.noExist={0} does not exist in the payroll, please check and submit.
+#模板相关
+Template.AlreadyExists=The template name already exists.
+Template.lackSonProject=The sub item column is missing. Please download the latest template.
+Template.lackMasterRow=The main item column is missing. Please download the latest template.
+Template.lackDepartment=The department column is missing. Please download the latest template to import.
+#角色相关
+role.noExist=The role does not exist
+role.deleteRootError=Cannot delete super administrator
+role.deleteErrorByDefault=This role is the default role when adding new employees. Please set other roles as default before attempting to delete
+role.deleteErrorByHavePeople=There are related persons in this role. Please modify them to other roles before deleting them.
+#员工相关
+staff.nameNullByRow=Employee name is missing in row "{0}".
+staff.peopleNullAndAdd=The person ["{0}"] does not exist. Please add it in the organization structure first or import it synchronously through nails.
+staff.proportionError=The personnel ["{0}"] "+" allocation proportion does not meet 100%. The current proportion ["{1}"%], please check.
+staff.workingHoursNull=The employee with job number "{0}" does not exist in the work hour system.
+staff.deleteErrorByDaily=The employee has daily reports filled in and cannot be deleted.
+staff.deleteErrorByTask=The employee has a task and cannot be deleted.
+staff.deleteErrorByProject=The employee has a responsible project and cannot be deleted.
+#数据相关
+data.importRepeat=Do not import duplicate data
+data.importSucRow=Successfully imported '{0}' pieces of data.
+data.OversizeError=The data volume is too large, please export in different time periods
+data.upSkip=Auto update '{0}' item code already exists: '{1}'.
+data.exceedMonthError=The data acquisition period shall not exceed one month.
+data.verificationError=Data error verification failed
+#供应商相关
+supplier.noExist=Supplier ["{0}"] does not exist in supplier category ["{1}"].
+supplier.addSupplier=Please fill in the supplier data
+supplier.lackNameOnRow=The supplier name is missing in row "{0}"
+supplier.nameRepeat=The current imported data has duplicate supplier names ["{0}"].
+#研究中心相关
+research.addData=Please fill in the data of the research center.
+research.nameNull=The center name is missing in row '{0}'.
+research.nameRepeat=The current imported data has duplicate center name ["{0}"].

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/ProjectMapper.xml

@@ -791,7 +791,7 @@
         FROM task_group
         LEFT JOIN group_participator ON task_group.id = group_participator.group_id
         LEFT JOIN project on task_group.project_id = project.id
-        LEFT JOIN `user` ON project.incharger_id = `user`.id
+        LEFT JOIN `user` ON task_group.incharger_id = `user`.id
         where project.company_id = #{companyId}
         GROUP BY task_group.id
         ORDER BY project_id