ソースを参照

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

ggooalice 2 年 前
コミット
92fb65ed1e
16 ファイル変更342 行追加189 行削除
  1. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectPercentageController.java
  2. 14 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java
  3. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectPercentageService.java
  4. 9 6
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java
  5. 19 12
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java
  6. 58 16
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectPercentageServiceImpl.java
  7. 4 4
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectServiceImpl.java
  8. 3 3
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  9. 26 2
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java
  10. 1 1
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/i18n/messages.properties
  11. 3 3
      fhKeeper/formulahousekeeper/timesheet/src/components/select.vue
  12. 174 131
      fhKeeper/formulahousekeeper/timesheet/src/views/project/detailDep.vue
  13. 5 4
      fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue
  14. 10 4
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue
  15. 13 1
      fhKeeper/formulahousekeeper/timesheet/src/vuex/store.js
  16. 1 0
      fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectPercentageController.java

@@ -38,7 +38,7 @@ public class ProjectPercentageController {
 
     @RequestMapping("/importData")
     public HttpRespMsg importData(Integer companyId, Integer withCheckIn,
-                                  MultipartFile file, HttpServletRequest request,String ymonth){
+                                  MultipartFile file, HttpServletRequest request,String ymonth) throws Exception {
         return projectPercentageService.importData(companyId,withCheckIn, file, request,ymonth);
     }
 }

+ 14 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/WeiXinCorpController.java

@@ -142,6 +142,8 @@ public class WeiXinCorpController {
     private UserService userService;
     @Resource
     private CompanyReportMapper companyReportMapper;
+    @Resource
+    private TaskExecutorMapper taskExecutorMapper;
     @Autowired
     RestTemplate restTemplate;
     @Resource
@@ -1451,6 +1453,8 @@ public class WeiXinCorpController {
                         stage.setStagesName("工作开展");
                         stagesMapper.insert(stage);
                         Task task=new Task();
+                        TimeType timeType = timeTypeMapper.selectById(company.getId());
+                        Integer oneDayHours = 8;
                         task.setCreateDate(LocalDate.now());
                         task.setProjectId(project.getId());
                         task.setCompanyId(company.getId());
@@ -1460,11 +1464,21 @@ public class WeiXinCorpController {
                         task.setExecutorId(user.getId());
                         task.setExecutorColor(user.getColor());
                         task.setExecutorName(user.getName());
+                        task.setPlanHours(oneDayHours);
                         task.setStagesId(stage.getId());
                         task.setGroupId(taskGroup.getId());
                         task.setSeq(0);
                         task.setName("示例任务");
                         taskMapper.insert(task);
+                        //任务执行人表也要插入,不然会导致编辑任务的时候执行人为空
+                        TaskExecutor executor = new TaskExecutor();
+                        executor.setTaskId(task.getId());
+                        executor.setPlanHours(oneDayHours);
+                        executor.setProjectId(project.getId());
+                        executor.setExecutorId(user.getId());
+                        executor.setExecutorColor(user.getColor());
+                        executor.setExecutorName(user.getName());
+                        taskExecutorMapper.insert(executor);
                     }
 
                     int companyId = company.getId();

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/ProjectPercentageService.java

@@ -21,5 +21,5 @@ public interface ProjectPercentageService extends IService<ProjectPercentage> {
 
     HttpRespMsg getMonthSetting(String ymonth);
 
-    HttpRespMsg importData(Integer companyId, Integer withCheckIn, MultipartFile file, HttpServletRequest request,String ymonth);
+    HttpRespMsg importData(Integer companyId, Integer withCheckIn, MultipartFile file, HttpServletRequest request,String ymonth) throws Exception;
 }

+ 9 - 6
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ExpenseSheetServiceImpl.java

@@ -396,23 +396,26 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                 if (expenseTypeCell == null) {
                     throw new Exception("费用类型不能为空");
                 }
-                if (reportDateCell == null  || StringUtils.isEmpty(reportDateCell.getStringCellValue())) {
+                if (reportDateCell == null  || reportDateCell.getDateCellValue() == null) {
                     throw new Exception("填报日期不能为空");
                 }
                 //做完非空校验后,进行姓名处理
-                List<String> userNameList=new ArrayList<>();
+
                 String reimburserName = reimburserCell.getStringCellValue();
-                userNameList.add(reimburserName);
+
                 HttpRespMsg respMsg= null;
+                List<User> targetUserList= new ArrayList<>();
                 if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                    List<String> userNameList=new ArrayList<>();
+                    userNameList.add(reimburserName);
                     System.out.println("参与搜素的人员列表"+userNameList);
                     respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                     if(respMsg.code.equals("0")){
                         msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
                         return msg;
                     }
+                    targetUserList = (List<User>) respMsg.data;
                 }
-                List<User> targetUserList= (List<User>) respMsg.data;
                 ExpenseSheet expenseSheet = new ExpenseSheet();
                 if(functionList.size()>0){
                     expenseSheet.setStatus(0);
@@ -444,9 +447,9 @@ public class ExpenseSheetServiceImpl extends ServiceImpl<ExpenseSheetMapper, Exp
                     Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(reimburserName)).findFirst();
                     first = userList.stream().filter(us -> us.getName().equals(reimburserName)||(us.getJobNumber()!=null&&us.getJobNumber().equals(reimburserName))||(optional.isPresent()&&us.getCorpwxUserid()!=null&&us.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findFirst();
                 }else {
-                    first = userList.stream().filter(us -> us.getName().equals(reimburserName)).findFirst();
+                    first = userList.stream().filter(us -> us.getName().equals(reimburserName)||(us.getJobNumber()!=null&&us.getJobNumber().equals(reimburserName))).findFirst();
                 }
-                if (first.isPresent()) {
+                if (first != null && first.isPresent()) {
                     expenseSheet.setOwnerId(first.get().getId());
                     expenseSheet.setOwnerName(first.get().getName());
                 } else {

+ 19 - 12
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceServiceImpl.java

@@ -220,8 +220,14 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                     nameStartIndex = 1;
                 }
                 Cell nameCell = row.getCell(nameStartIndex + 0);
-                String name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
-                if(name.equals("姓名")){
+                String name = null;
+                if (nameCell == null) {
+                    msg.setError("姓名不能为空");
+                    return msg;
+                } else {
+                    name = nameCell.getStringCellValue().trim().replaceAll("\\u00a0", "");
+                }
+                if("姓名".equals(name)){
                     continue;
                 }
                 //判断工号是否填写
@@ -319,16 +325,17 @@ public class FinanceServiceImpl extends ServiceImpl<FinanceMapper, Finance> impl
                 if (field3 != null)field3.setCellType(CellType.STRING);
 
                 finance.setCompanyId(companyId);
-                Optional<User> userOp;
-                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
-                    Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(name)).findFirst();
-                    userOp= userList.stream().filter(u ->((optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid())))).findFirst();
-                }else {
-                    userOp= userList.stream().filter(u -> u.getName().equals(name)).findFirst();
-                }
-                if(userOp.isPresent()){
-                    finance.setName(userOp.get().getName());
-                }
+//                Optional<User> userOp;
+//                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+//                    Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(name)).findFirst();
+//                    userOp= userList.stream().filter(u ->((optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid())))).findFirst();
+//                }else {
+//                    userOp= userList.stream().filter(u -> u.getName().equals(name)).findFirst();
+//                }
+//                if(userOp.isPresent()){
+//
+//                }
+                finance.setName(name);
                 //工号模式下,工号也不是必填,有工号优先按工号匹配
                 if (includeJobNumber) {
                     finance.setJobNumber(jobNumberCell!=null?jobNumberCell.getStringCellValue():null);

+ 58 - 16
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/ProjectPercentageServiceImpl.java

@@ -4,16 +4,11 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.management.platform.entity.FinanceProjects;
-import com.management.platform.entity.Project;
-import com.management.platform.entity.ProjectPercentage;
-import com.management.platform.entity.User;
-import com.management.platform.mapper.ProjectMapper;
-import com.management.platform.mapper.ProjectPercentageMapper;
-import com.management.platform.mapper.ReportMapper;
-import com.management.platform.mapper.UserMapper;
+import com.management.platform.entity.*;
+import com.management.platform.mapper.*;
 import com.management.platform.service.FinanceProjectsService;
 import com.management.platform.service.ProjectPercentageService;
+import com.management.platform.service.WxCorpInfoService;
 import com.management.platform.util.ExcelUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.MessageUtils;
@@ -21,6 +16,7 @@ import com.taobao.api.internal.util.StringUtils;
 import org.apache.poi.EncryptedDocumentException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.usermodel.XSSFCell;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -53,6 +49,10 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
     @Resource
     private ReportMapper reportMapper;
     @Resource
+    private WxCorpInfoService wxCorpInfoService;
+    @Resource
+    private WxCorpInfoMapper wxCorpInfoMapper;
+    @Resource
     private ProjectPercentageService projectPercentageService;
     @Override
     public HttpRespMsg saveMonthSetting(String projectCols, String userSettings, String ymonth) {
@@ -139,7 +139,7 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
     }
 
     @Override
-    public HttpRespMsg importData(Integer companyId, Integer withCheckIn, MultipartFile multipartFile, HttpServletRequest request,String ymonth) {
+    public HttpRespMsg importData(Integer companyId, Integer withCheckIn, MultipartFile multipartFile, HttpServletRequest request,String ymonth) throws Exception {
         HttpRespMsg msg = new HttpRespMsg();
         String fileName=multipartFile.getOriginalFilename();
         File file = new File(fileName == null ? "file" : fileName);
@@ -160,6 +160,7 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
             Workbook workbook = WorkbookFactory.create(new FileInputStream(file));
             //获取公司全部成员
             List<User> allUserList = userMapper.selectList(new QueryWrapper<User>().eq("company_id", companyId));
+            WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",companyId));
             Sheet sheet = workbook.getSheetAt(0);
             //由于第一行需要指明列对应的标题
             int rowNum = sheet.getLastRowNum();
@@ -176,6 +177,37 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
             List<FinanceProjects> filterFPList = new ArrayList<>();
             int projectNameStartIndex=1;
             int dataCount = 0;
+            List<String> userNameList=new ArrayList<>();
+            for(int rowIndex = 1; rowIndex <= rowNum; rowIndex++){
+                Row row = sheet.getRow(rowIndex);
+                if (row == null) {
+                    continue;
+                }
+                if (ExcelUtil.isRowEmpty(row)) {
+                    continue;
+                }
+                if (row.getCell(0) == null) {
+                    //msg.setError("第"+dataCount+"行缺少员工姓名");
+                    msg.setError(MessageUtils.message("staff.nameNullByRow",rowIndex));
+                    return msg;
+                }
+                Cell userNameCell = row.getCell(0);
+                if (userNameCell!=null)userNameCell.setCellType(CellType.STRING);
+                String username = userNameCell.getStringCellValue().trim();
+                if(!userNameList.contains(username)&&!StringUtils.isEmpty(username)){
+                    userNameList.add(username);
+                }
+            }
+            HttpRespMsg respMsg=new HttpRespMsg();
+            if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
+                respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
+                if(respMsg.code.equals("0")){
+                    msg.setError("姓名为["+String.valueOf(respMsg.data)+"]的人员存在重复,请使用工号!");
+                    return msg;
+                }
+            }
+            List<User> targetUserList= (List<User>) respMsg.data;
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
                 Row row = sheet.getRow(rowIndex);
                 if (row == null) {
@@ -198,8 +230,10 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
                             break;
                         }
                         //查询对应名称项目 id存到projectList
-                        Project project = projectMapper.selectList(new QueryWrapper<Project>().eq("project_name", projectName)).get(0);
-                        projectList.add(project.getId().toString());
+                        Optional<Project> first = allProjectList.stream().filter(al -> al.getProjectName().equals(projectName)).findFirst();
+                        if(first.isPresent()){
+                            projectList.add(first.get().getId().toString());
+                        }
                         pIndex++;
                     }
                     if (projectNotExists) {
@@ -221,19 +255,27 @@ public class ProjectPercentageServiceImpl extends ServiceImpl<ProjectPercentageM
                         msg.setError(MessageUtils.message("staff.nameNullByRow",dataCount));
                         return msg;
                     }
-                    String username = row.getCell(0).getStringCellValue().trim();
+                    Cell userNameCell = row.getCell(0);
+                    if (userNameCell!=null)userNameCell.setCellType(CellType.STRING);
+                    String username = userNameCell.getStringCellValue().trim();
                     //检查人员是否存在
-                    Optional<User> any = allUserList.stream().filter(u -> u.getName().equals(username)).findAny();
-                    if (!any.isPresent()) {
+                    Optional<User> userOp;
+                    if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
+                        Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(username)).findFirst();
+                        userOp= allUserList.stream().filter(u ->((u.getJobNumber()!=null&&u.getJobNumber().equals(username))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid())))).findFirst();
+                    }else {
+                        userOp= allUserList.stream().filter(u -> u.getName().equals(username)||(u.getJobNumber()!=null&&u.getJobNumber().equals(username))).findFirst();
+                    }
+                    if (!userOp.isPresent()) {
                         //msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");
                         msg.setError(MessageUtils.message("staff.peopleNullAndAdd",username));
                         return msg;
                     }
                     //人员存在
-                    User user = userMapper.selectList(new QueryWrapper<User>().eq("name", username)).get(0);
+                    User user = userOp.get();
                     Integer s = 0;
                     JSONObject jsonObject=new JSONObject();
-                    jsonObject.put("name",username);
+                    jsonObject.put("name",user.getName());
                     jsonObject.put("id",user.getId());
                     for (int i=projectNameStartIndex; i < projectNameStartIndex + projectList.size(); i++) {
                         if (row.getCell(i) == null) {

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

@@ -352,9 +352,9 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
             }
             //建筑工程版项目总进度计算
             Company company = companyMapper.selectById(companyId);
-            List<PpMembs> ppMembList = null;
-            List<ProjectProfession> ppList = null;
-            if (company.getPackageEngineering() == 1) {
+            List<PpMembs> ppMembList = new ArrayList<>();
+            List<ProjectProfession> ppList = new ArrayList<>();
+            if (company.getPackageEngineering() == 1 && projectIds.size() > 0) {
                 ppMembList = ppMembsMapper.selectList(new QueryWrapper<PpMembs>().in("project_id", projectIds));
                 ppList = projectProfessionMapper.selectList(new QueryWrapper<ProjectProfession>().in("project_id", projectIds));
             }
@@ -3189,7 +3189,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
                     }
                 }
                 HttpRespMsg respMsg=new HttpRespMsg();
-                if(userNameList.size() > 0 && wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
+                if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1&&userNameList.size()>0){
                     System.out.println("参与搜素的人员列表"+userNameList + userNameList.size());
                     respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
                     if(respMsg.code.equals("0")){

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

@@ -3514,7 +3514,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             List<SubProject> allSubProjectList = subProjectMapper.selectList(new QueryWrapper<SubProject>().eq("company_id", companyId));
             List<Report> reportList = new ArrayList<>();
             int projectNameStartIndex = (withCheckIn==null?2:6);
-            int dataCount = 0;
+
             List<String> userNameList=new ArrayList<>();
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
                 Row row = sheet.getRow(rowIndex);
@@ -3524,7 +3524,6 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 if (ExcelUtil.isRowEmpty(row)) {
                     continue;
                 }
-                dataCount++;
                 String username = withCheckIn==null?row.getCell(1).getStringCellValue().trim():row.getCell(2).getStringCellValue().trim();
                 if(username.equals("员工")){
                     continue;
@@ -3543,6 +3542,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 }
             }
             List<User> targetUserList= (List<User>) respMsg.data;
+            int dataCount = 0;
             for (int rowIndex = 0; rowIndex <= rowNum; rowIndex++) {
                 Row row = sheet.getRow(rowIndex);
                 if (row == null) {
@@ -3619,7 +3619,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                         Optional<User> optional = targetUserList.stream().filter(tl -> tl.getName().equals(username)).findFirst();
                         any = allUserList.stream().filter(u -> u.getName().equals(username)||(u.getJobNumber()!=null&&u.getJobNumber().equals(username))||(optional.isPresent()&&u.getCorpwxUserid()!=null&&u.getCorpwxUserid().equals(optional.get().getCorpwxUserid()))).findAny();
                     }else {
-                        any = allUserList.stream().filter(u -> u.getName().equals(username)).findAny();
+                        any = allUserList.stream().filter(u -> u.getName().equals(username)||(u.getJobNumber()!=null&&u.getJobNumber().equals(username))).findAny();
                     }
                     if (!any.isPresent()) {
                         //msg.setError("人员["+username+"]不存在,请先在组织结构中添加或者通过钉钉同步导入");

+ 26 - 2
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/UserServiceImpl.java

@@ -333,8 +333,32 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
                 }
                 if (first == null || !first.isPresent()) {
                     //按照姓名匹配
-                    first = userList.stream().filter(u ->
-                            u.getName().equals(name)).findFirst();
+                    WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id", companyId));
+                    if (wxCorpInfo != null && wxCorpInfo.getSaasSyncContact() == 1) {
+                        //需要转译的情况;TODO: 验收通过后抽取出去,改成批量一次性搜索全部姓名
+                        List<String> userNameList = new ArrayList<>();
+                        userNameList.add(name);
+                        HttpRespMsg respMsg = null;
+                        try {
+                            respMsg = wxCorpInfoService.getBatchSearchUserInfo(wxCorpInfo, userNameList,null);
+                            if(respMsg.code.equals("0")){
+                                msg.setError("["+String.valueOf(respMsg.data)+"]在系统中为重名人员,请完善工号信息!");
+                                return msg;
+                            }
+                            List<User> targetUserList= (List<User>) respMsg.data;
+                            if (targetUserList.size() > 0) {
+                                User targetU = targetUserList.get(0);
+                                first = userList.stream().filter(u->u.getCorpwxUserid() != null && u.getCorpwxUserid().equals(targetU.getCorpwxUserid())).findFirst();
+                            }
+                        } catch (Exception exception) {
+                            exception.printStackTrace();
+                            msg.setError(exception.getMessage());
+                            return msg;
+                        }
+                    } else {
+                        first = userList.stream().filter(u ->
+                                u.getName().equals(name)).findFirst();
+                    }
                 }
                 if (first != null && first.isPresent()) {
                     if (salaryCell != null) {

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

@@ -349,7 +349,7 @@ role.deleteErrorByDefault=该角色为新增员工时的默认角色,请设置
 role.deleteErrorByHavePeople=该角色存在相关人员,请将他们修改为其他角色后再尝试删除
 #员工相关
 staff.nameNullByRow=第{0}行缺少员工姓名
-staff.peopleNullAndAdd=人员[{0}]不存在,请先在组织结构中添加或者通过钉钉同步导入
+staff.peopleNullAndAdd=人员[{0}]不存在,请先在组织结构中添加或同步通讯录
 staff.proportionError=人员[{0}]分摊比例不满足100%,当前比例[{1}%],请检查
 staff.workingHoursNull=工号为{0}的员工在工时系统中不存在
 staff.deleteErrorByDaily=该员工存在填写的日报,无法删除。

+ 3 - 3
fhKeeper/formulahousekeeper/timesheet/src/components/select.vue

@@ -208,7 +208,7 @@ export default {
                 if(!this.multiSelect) {
                     if(this.optionsOId) {
                         for(let i in this.options) {
-                            if(this.options[i].auditorId == this.optionsOId || this.options[i].id == this.optionsOId) {
+                            if(this.options[i].userId == this.optionsOId || this.options[i].auditorId == this.optionsOId || this.options[i].id == this.optionsOId) {
                                 this.selectName = this.options[i].name || this.options[i].auditorName
                             }
                         }
@@ -219,7 +219,7 @@ export default {
                 if(this.multiSelect) {
                     for(var i in this.options) {
                         for(var j in this.optionsOId) {
-                            if(this.options[i].auditorId == this.optionsOId[j] || this.options[i].id == this.optionsOId[j]) {
+                            if(this.options[i].userId == this.optionsOId || this.options[i].auditorId == this.optionsOId[j] || this.options[i].id == this.optionsOId[j]) {
                                 this.multiSelectList.push(this.options[i])
                                 this.options[i].flg = true
                             }
@@ -259,7 +259,7 @@ export default {
             if(!this.multiSelect) {
                 this.optionsOId = JSON.parse(JSON.stringify(this.subjectId))
                 for(let i in this.options) {
-                    if(this.options[i].auditorId == this.optionsOId || this.options[i].id == this.optionsOId) {
+                    if(this.options[i].userId == this.optionsOId || this.options[i].auditorId == this.optionsOId || this.options[i].id == this.optionsOId) {
                         this.selectName = this.options[i].auditorName || this.options[i].name 
                     }
                 }

+ 174 - 131
fhKeeper/formulahousekeeper/timesheet/src/views/project/detailDep.vue

@@ -138,139 +138,21 @@
                                     this.widthHtval = document.body.clientWidth - 230
                                 }
                             }
-                        // 
-                        var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
-                        if (list.length > 0) {
-                            this.cost = res.data.totalCostMoney;
-                            for(var i in list) {
-                                xList.push(list[i].name);
-                                var pro = list[i].project;
-                                for(var j in pro) {
-                                    if(array.indexOf(pro[j].project) == -1) {
-                                        array.push(pro[j].project)
-                                    }
-                                }
-                            }
-
-                            for(var i in array) {
-                                yList.push(array[i]);
-                                var dataList = [];
-                                for(var j in list) {
-                                    var curUser = list[j];
-                                    var project = list[j].project;
-                                    if(project.length != 0) {
-                                        //找到当前用户对应的项目
-                                        var findProject = project.filter(p=>p.project == array[i]);
-                                        if (findProject.length > 0) {
-                                            dataList.push({
-                                                    "value": this.yAxisValue==0?findProject[0].money:findProject[0].time,
-                                                    "cost": findProject[0].time,
-                                                    "money": findProject[0].money
-                                                })
-                                        } else {
-                                            dataList.push({
-                                                    "value": 0,
-                                                    "cost": 0,
-                                                    "money": 0,
-                                                })
-                                        }
-                                    } else {
-                                        dataList.push({
-                                            "value": 0,
-                                            "cost": 0,
-                                            "money": 0
-                                        })
-                                    }
+                            if(this.user.userNameNeedTranslate == '1') {
+                                let dealWithList = []
+                                let list = res.data.list
+                                for(var i in list) {
+                                    let obj = {}
+                                    obj.type = 'userName'
+                                    obj.id = list[i].name
+                                    dealWithList.push(obj)
                                 }
-
-                                series.push({
-                                    name: array[i],
-                                    type: 'bar',
-                                    stack:'1',
-                                    barMaxWidth: 30,
-                                    data: dataList,
-                                })
+                                this.dealWithTranslationPlone(dealWithList, res)
+                            } else {
+                                this.renderingDiagram(res)
                             }
-
-                            var myChart = echarts.init(document.getElementById("container"));
-                            // 设置宽度
-                            myChart.resize({
-                                width: this.widthHtval
-                            })
-                            _this.myChart = myChart;
-                            var option = {
-                                // 工具箱
-                                legend: {
-                                    x: 80,
-                                    y: 10,
-                                    data: yList
-                                },
-                                grid : {
-                                    top : 80,    //距离容器上边界40像素
-                                    bottom: 35,   //距离容器下边界30像素
-                                    left: 150,
-                                    right: 150
-                                },
-                                toolbox: {
-                                    show: true,
-                                    feature:{
-                                        saveAsImage:{
-                                            show:true
-                                        },
-                                        restore:{
-                                            show:true
-                                        },
-                                        dataView:{
-                                            show:true
-                                        },
-                                        dataZoom:{
-                                            show:true
-                                        },
-                                        magicType:{
-                                            type:['line','bar']
-                                        }
-                                    }
-                                },
-                                tooltip:{
-                                    trigger:'axis',
-                                    formatter: function (params,ticket,callback) {
-                                        
-                                        var totalTime = 0.0;
-                                        for(var i in params) {
-                                            totalTime += parseFloat(params[i].data.cost)
-                                        }
-                                        var res = params[0].name + " 工时 : " + totalTime.toFixed(1)+"小时<br/>";
-                                        for(var i in params) {
-                                            if (params[i].data.value > 0) {
-                                                res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName 
-                                                    + "</font><br/>工作成本 : " + params[i].data.money
-                                                    + "元 <br/>工作时长"+" : " + params[i].data.cost + "小时</br></div>";
-                                            }
-                                        }
-                                        return res;
-                                    }
-                                },
-                                xAxis: {
-                                    data: xList,
-                                    axisLabel: {
-                                        interval:0,rotate:20
-                                    }
-                                },
-                                yAxis: [{
-                                    type : 'value',
-                                    axisLabel: {
-                                        formatter:this.yAxisValue==0?'{value} (元)':'{value}(小时)'
-                                    }
-                                }],
-                                series: series,
-                            };
-                            myChart.setOption(option, {notMerge: true});
-                        } else {
-                            this.$message({
-                                message: "暂无数据",
-                                type: "error"
-                                });
-                        }
+                        // 
+                        
                     } else {
                         this.$message({
                         message: res.msg,
@@ -286,6 +168,167 @@
                     });
                 });
             },
+            dealWithTranslationPlone(items, obj) {
+                if (WWOpenData.initCanvas) {
+                    WWOpenData.initCanvas()
+                }
+                const myFunOne = async () => {
+                    const result = await new Promise((resolve, reject) => {
+                        if(WWOpenData.prefetch) {
+                             WWOpenData.prefetch({ items }, (err, data) => {
+                                if (err) { return reject(err) }
+                                resolve(data)
+                            })
+                        }
+                    })
+                    for(var i in obj.data.list) {
+                        if(result.items[i]) {  
+                            obj.data.list[i].name = result.items[i].data
+                        }
+                    }
+                    this.renderingDiagram(obj)
+                }
+                myFunOne()
+            },
+            // 渲染图表
+            renderingDiagram (res) {
+                var _this = this;
+                var xList = [] , yList = [] , list = res.data.list, array = [] , series = [];
+                if (list.length > 0) {
+                    this.cost = res.data.totalCostMoney;
+                    for(var i in list) {
+                        xList.push(list[i].name);
+                        var pro = list[i].project;
+                        for(var j in pro) {
+                            if(array.indexOf(pro[j].project) == -1) {
+                                array.push(pro[j].project)
+                            }
+                        }
+                    }
+                    for(var i in array) {
+                        yList.push(array[i]);
+                        var dataList = [];
+                        for(var j in list) {
+                            var curUser = list[j];
+                            var project = list[j].project;
+                            if(project.length != 0) {
+                                //找到当前用户对应的项目
+                                var findProject = project.filter(p=>p.project == array[i]);
+                                if (findProject.length > 0) {
+                                    dataList.push({
+                                            "value": this.yAxisValue==0?findProject[0].money:findProject[0].time,
+                                            "cost": findProject[0].time,
+                                            "money": findProject[0].money
+                                        })
+                                } else {
+                                    dataList.push({
+                                            "value": 0,
+                                            "cost": 0,
+                                            "money": 0,
+                                        })
+                                }
+                            } else {
+                                dataList.push({
+                                    "value": 0,
+                                    "cost": 0,
+                                    "money": 0
+                                })
+                            }
+                        }
+                        series.push({
+                            name: array[i],
+                            type: 'bar',
+                            stack:'1',
+                            barMaxWidth: 30,
+                            data: dataList,
+                        })
+                    }
+                    var myChart = echarts.init(document.getElementById("container"));
+                    // 设置宽度
+                    myChart.resize({
+                        width: this.widthHtval
+                    })
+                    _this.myChart = myChart;
+                    var option = {
+                        // 工具箱
+                        legend: {
+                            x: 80,
+                            y: 10,
+                            data: yList
+                        },
+                        grid : {
+                            top : 80,    //距离容器上边界40像素
+                            bottom: 35,   //距离容器下边界30像素
+                            left: 150,
+                            right: 150
+                        },
+                        toolbox: {
+                            show: true,
+                            feature:{
+                                saveAsImage:{
+                                    show:true
+                                },
+                                restore:{
+                                    show:true
+                                },
+                                dataView:{
+                                    show:true
+                                },
+                                dataZoom:{
+                                    show:true
+                                },
+                                magicType:{
+                                    type:['line','bar']
+                                }
+                            }
+                        },
+                        tooltip:{
+                            trigger:'axis',
+                            formatter: function (params,ticket,callback) {
+                                
+                                var totalTime = 0.0;
+                                for(var i in params) {
+                                    totalTime += parseFloat(params[i].data.cost)
+                                }
+                                var res
+                                if(_this.user.userNameNeedTranslate != 1) {
+                                    res = params[0].name + " 工时 : " + totalTime.toFixed(1)+"小时<br/>";
+                                } else {
+                                    res = " 工时 : " + totalTime.toFixed(1)+"小时<br/>";
+                                }
+                                
+                                for(var i in params) {
+                                    if (params[i].data.value > 0) {
+                                        res += "<div style='margin-top:3px;font-size:12px;'><font color='#ddd'>项目名称:" + params[i].seriesName 
+                                            + "</font><br/>工作成本 : " + params[i].data.money
+                                            + "元 <br/>工作时长"+" : " + params[i].data.cost + "小时</br></div>";
+                                    }
+                                }
+                                return res;
+                            }
+                        },
+                        xAxis: {
+                            data: xList,
+                            axisLabel: {
+                                interval:0,rotate:20
+                            }
+                        },
+                        yAxis: [{
+                            type : 'value',
+                            axisLabel: {
+                                formatter:this.yAxisValue==0?'{value} (元)':'{value}(小时)'
+                            }
+                        }],
+                        series: series,
+                    };
+                    myChart.setOption(option, {notMerge: true});
+                } else {
+                    this.$message({
+                        message: "暂无数据",
+                        type: "error"
+                        });
+                }
+            },
             // 左右滚动
             scrollFunction () {
                 this.domObj = document.getElementById('clearfix') // 通过id获取要设置的div

+ 5 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/project/finance.vue

@@ -188,9 +188,9 @@
             <el-table-column prop="name" :label="$t('lable.name')" sortable width="150" fixed="left">
                 <template slot-scope="scope">
                     <div>
-                        <!-- <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span> -->
-                        <!-- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.name}}</span> -->
-                        {{scope.row.name}}
+                        <span v-if="user.userNameNeedTranslate == '1'"><ww-open-data type='userName' :openid='scope.row.name'></ww-open-data></span>
+                        <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.name}}</span>
+                        <!-- {{scope.row.name}} -->
                     </div>
                 </template>
             </el-table-column>
@@ -504,7 +504,7 @@
                     <el-option v-for="item in noReportUserList" :label="item.name" :key="item.id" :value="item.userId"></el-option>
                 </el-select>
 
-                <selectCat v-if="user.userNameNeedTranslate == '1'" @selectCal="selectCal" :subject="noReportUserList" :subjectId="chosenNoReportUserIds" :distinction="'2'" :size="'mini'"></selectCat>
+                <selectCat v-if="user.userNameNeedTranslate == '1'" @selectCal="selectCal" :subject="noReportUserList" :subjectId="chosenNoReportUserIds" :distinction="'2'" :size="'small'"></selectCat>
 
                 <el-button @click="averageCost" >{{ $t('Automaticallocation') }}</el-button>
             </div>
@@ -1340,6 +1340,7 @@ import { error } from 'dingtalk-jsapi';
                 }
                 if (index === 2 && this.user.timeType.financeJobnumEnabled == 1) {
                     sums[index] = '';
+                    return;
                 }
                 const values = data.map(item => Number(item[column.property]));
                 if (!values.every(value => isNaN(value))) {

+ 10 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1668,6 +1668,7 @@
      // 引入自定义级联组件
     import vueCascader from "@/components/cascader.vue"
     
+    import { mapMutations } from 'vuex'
     let _that = this
     export default {
         mixins: [dragMixin],
@@ -1923,7 +1924,7 @@
                 weeklyFilledTimeDate: null,
                 leaveAllNum: 0,
 
-                dataLoading: true
+                dataLoading: false
             };
         },
         watch: {
@@ -2010,11 +2011,16 @@
             }
 
             const that = this
-            setTimeout(()=>{
-                that.dataLoading = false
-            }, 1000)
+            if(this.user.userNameNeedTranslate == 1) {
+                that.dataLoading = that.$store.state.dataLoading
+                this.upDataLoading()
+                setTimeout(()=>{
+                    that.dataLoading = that.$store.state.dataLoading
+                }, 1000)
+            }
         },
         methods: {
+            ...mapMutations(['upDataLoading']),
             test(){
                 console.log('test',this.workForm.domains);
             },

+ 13 - 1
fhKeeper/formulahousekeeper/timesheet/src/vuex/store.js

@@ -8,7 +8,9 @@ Vue.use(Vuex)
 // 应用初始状态
 const state = {
     count: 10,
-    isDing: false
+    isDing: false,
+    dataLoading: true, // 需要转译的情况下日报页面显示加载
+    timer: null
 }
 
 // 定义所需的 mutations
@@ -21,6 +23,16 @@ const mutations = {
     },
     isDingFun(state){
         state.isDing = true
+    },
+    upDataLoading(state) {
+        setTimeout(()=>{
+            state.dataLoading = false
+            console.log(state.dataLoading, '看看他的值')
+        }, 1000)
+        // state.timer = setTimeout(()=>{
+        //     clearTimeout(state.timer)
+        //     state.dataLoading = false
+        // }, 1800000)
     }
 }
 

+ 1 - 0
fhKeeper/formulahousekeeper/timesheet_h5/src/views/audit/audit.vue

@@ -35,6 +35,7 @@
 export default {
     data() {
         return {
+            user: JSON.parse(localStorage.userInfo),
             search: {
                 date: null,
                 projectId: null,