浏览代码

日报提交bug修改

QuYueTing 3 周之前
父节点
当前提交
6311fa2c90

+ 25 - 23
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ReportController.java

@@ -1554,32 +1554,34 @@ public class ReportController {
         }
         }
         //针对泓浒(苏州),需要按照工单号的部门来设置工时所属部门,同时设置是否是协作工时
         //针对泓浒(苏州),需要按照工单号的部门来设置工时所属部门,同时设置是否是协作工时
         if (Constant.HONG_HU_COMPANY_ID == company.getId()) {
         if (Constant.HONG_HU_COMPANY_ID == company.getId()) {
-            List<String> collect = reportList.stream().map(Report::getExtraField4).collect(Collectors.toList());
-            List<ErpOrderInfo> orderList = erpOrderInfoMapper.selectList(new QueryWrapper<ErpOrderInfo>().in("order_id", collect));
-            for (Report report : reportList) {
-                String errorMsg = null;
-                Optional<ErpOrderInfo> first = orderList.stream().filter(order -> order.getOrderId().equals(report.getExtraField4())).findFirst();
-                if (first.isPresent()) {
-                    if (first.get().getDeptId() == null) {
-                        errorMsg = "工单号:"+report.getExtraField4()+"无部门id";
-                    } else {
-                        Department deptItem = departmentMapper.selectOne(new QueryWrapper<Department>().eq("dept_code", first.get().getDeptId()));
-                        if (deptItem != null) {
-                            if (!deptItem.getDepartmentId().equals(report.getDeptId())) {
-                                report.setDeptId(deptItem.getDepartmentId());
-                                report.setIsAssist(true);
-                            }
+            List<String> collect = reportList.stream().filter(r -> !StringUtils.isEmpty(r.getExtraField4())).map(Report::getExtraField4).collect(Collectors.toList());
+            if (collect.size() > 0) {
+                List<ErpOrderInfo> orderList = erpOrderInfoMapper.selectList(new QueryWrapper<ErpOrderInfo>().in("order_id", collect));
+                for (Report report : reportList) {
+                    String errorMsg = null;
+                    Optional<ErpOrderInfo> first = orderList.stream().filter(order -> order.getOrderId().equals(report.getExtraField4())).findFirst();
+                    if (first.isPresent()) {
+                        if (first.get().getDeptId() == null) {
+                            errorMsg = "工单号:"+report.getExtraField4()+"无部门id";
                         } else {
                         } else {
-                            errorMsg = "工时系统中尚未给部门:"+first.get().getDeptName()+"设置部门编号";
+                            Department deptItem = departmentMapper.selectOne(new QueryWrapper<Department>().eq("dept_code", first.get().getDeptId()));
+                            if (deptItem != null) {
+                                if (!deptItem.getDepartmentId().equals(report.getDeptId())) {
+                                    report.setDeptId(deptItem.getDepartmentId());
+                                    report.setIsAssist(true);
+                                }
+                            } else {
+                                errorMsg = "工时系统中尚未给部门:"+first.get().getDeptName()+"设置部门编号";
+                            }
                         }
                         }
+                    } else {
+                        errorMsg = "erpOrderInfo表中工单号不存在:"+report.getExtraField4();
+                    }
+                    if (errorMsg != null) {
+                        HttpRespMsg httpRespMsg = new HttpRespMsg();
+                        httpRespMsg.setError(errorMsg);
+                        return httpRespMsg;
                     }
                     }
-                } else {
-                    errorMsg = "erpOrderInfo表中工单号不存在:"+report.getExtraField4();
-                }
-                if (errorMsg != null) {
-                    HttpRespMsg httpRespMsg = new HttpRespMsg();
-                    httpRespMsg.setError(errorMsg);
-                    return httpRespMsg;
                 }
                 }
             }
             }
         }
         }

+ 25 - 22
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinanceMonthlyWorktimeServiceImpl.java

@@ -129,12 +129,17 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
     @Override
     @Override
     public HttpRespMsg getByMonth(Integer companyId, String ymonth, Integer reGenerate, HttpServletRequest request) throws Exception {
     public HttpRespMsg getByMonth(Integer companyId, String ymonth, Integer reGenerate, HttpServletRequest request) throws Exception {
         //获取该月份的数据,如果没有自动生成
         //获取该月份的数据,如果没有自动生成
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
         String token = request.getHeader("token");
         String token = request.getHeader("token");
         User user = userMapper.selectById(token);
         User user = userMapper.selectById(token);
         FinanceMonthlyWorktime financeMonthlyWorktime = financeMonthlyWorktimeMapper.selectOne(new LambdaQueryWrapper<FinanceMonthlyWorktime>().eq(FinanceMonthlyWorktime::getCompanyId, companyId).eq(FinanceMonthlyWorktime::getYmonth, ymonth));
         FinanceMonthlyWorktime financeMonthlyWorktime = financeMonthlyWorktimeMapper.selectOne(new LambdaQueryWrapper<FinanceMonthlyWorktime>().eq(FinanceMonthlyWorktime::getCompanyId, companyId).eq(FinanceMonthlyWorktime::getYmonth, ymonth));
         Integer detailCount = 0;
         Integer detailCount = 0;
         if (financeMonthlyWorktime != null) {
         if (financeMonthlyWorktime != null) {
             if (reGenerate== 1) {
             if (reGenerate== 1) {
+                if (financeMonthlyWorktime.getStatus() == 1) {
+                    httpRespMsg.setError("已定稿,无法重置");
+                    return httpRespMsg;
+                }
                 //删除明细数据
                 //删除明细数据
                 fmwDetailMapper.delete(new LambdaQueryWrapper<FmwDetail>().eq(FmwDetail::getFmwId, financeMonthlyWorktime.getId()));
                 fmwDetailMapper.delete(new LambdaQueryWrapper<FmwDetail>().eq(FmwDetail::getFmwId, financeMonthlyWorktime.getId()));
             } else {
             } else {
@@ -201,10 +206,6 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                     departmentList.stream().filter(d->d.getDepartmentId().equals(report.getDeptId())).findFirst().ifPresent(d->{
                     departmentList.stream().filter(d->d.getDepartmentId().equals(report.getDeptId())).findFirst().ifPresent(d->{
                         fmwDetail.setDeptCode(d.getDeptCode());
                         fmwDetail.setDeptCode(d.getDeptCode());
                         fmwDetail.setDeptName(d.getDepartmentName());
                         fmwDetail.setDeptName(d.getDepartmentName());
-                        //为提高可读性,从erpOrderInfo表中获取部门名称
-                        erpOrderInfoList.stream().filter(e->e.getDeptId().equals(d.getDeptCode())).findFirst().ifPresent(e->{
-                            fmwDetail.setDeptName(e.getDeptName());
-                        });
                     });
                     });
                     setFmwTime(fmwDetail, report);
                     setFmwTime(fmwDetail, report);
                     //从assistList中获取协作工时
                     //从assistList中获取协作工时
@@ -299,23 +300,26 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
                                         }
                                         }
                                     }
                                     }
                                 }
                                 }
-                            }
-
-                            List<FmwDetail> fmwDetails = insertDataList.stream().filter(fmwDetail -> fmwDetail.getDeptId().equals(deptId)).collect(Collectors.toList());
-                            double assistDeptTotalTime = fmwDetails.stream().reduce(0.0, (a, b) -> a + b.getMaintanceTime() + b.getDebugTime() + b.getWaitingTime(), Double::sum);
-                            if (assistDeptTotalTime > 0) {
-                                //计算总工时: 用维修组装工时,调试工时和等料工时相加
-                                insertDataList.forEach(fmwDetail -> {
-                                    //计算每一个项目的部门内部工时占比,按比例分摊公共工时
-                                    if (fmwDetail.getProjectId().equals(publicReportDeptItem.getProjectId())) {
-                                        double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
-                                        double assignTime = curProjectTime / assistDeptTotalTime * publicReportDeptItem.getWorkingTime();
-                                        fmwDetail.setPublicTime(assignTime);
-                                    }
-                                });
                             } else {
                             } else {
-                                throw new Exception("存在部门公共工时无法分配,来源deptId=="+deptId);
+                                //本部门也没有协作其他部门产生工单工时
+                                throw new Exception("公共工时无法分配,因为本部门没有协作其他部门产生工单工时,deptId=="+deptId);
                             }
                             }
+
+//                            List<FmwDetail> fmwDetails = insertDataList.stream().filter(fmwDetail -> fmwDetail.getDeptId().equals(deptId)).collect(Collectors.toList());
+//                            double assistDeptTotalTime = fmwDetails.stream().reduce(0.0, (a, b) -> a + b.getAssistTime(), Double::sum);
+//                            if (assistDeptTotalTime > 0) {
+//                                //计算总工时: 用维修组装工时,调试工时和等料工时相加
+//                                insertDataList.forEach(fmwDetail -> {
+//                                    //计算每一个项目的部门内部工时占比,按比例分摊公共工时
+//                                    if (fmwDetail.getProjectId().equals(publicReportDeptItem.getProjectId())) {
+//                                        double curProjectTime = fmwDetail.getMaintanceTime() + fmwDetail.getDebugTime() + fmwDetail.getWaitingTime();
+//                                        double assignTime = curProjectTime / assistDeptTotalTime * publicReportDeptItem.getWorkingTime();
+//                                        fmwDetail.setPublicTime(assignTime);
+//                                    }
+//                                });
+//                            } else {
+//                                throw new Exception("存在部门公共工时无法分配,来源deptId=="+deptId);
+//                            }
                         }
                         }
                     }
                     }
                 }
                 }
@@ -328,9 +332,8 @@ public class FinanceMonthlyWorktimeServiceImpl extends ServiceImpl<FinanceMonthl
         //查询数据
         //查询数据
         List<FmwDetail> details = fmwDetailMapper.selectList(new QueryWrapper<FmwDetail>().eq("fmw_id", financeMonthlyWorktime.getId()));
         List<FmwDetail> details = fmwDetailMapper.selectList(new QueryWrapper<FmwDetail>().eq("fmw_id", financeMonthlyWorktime.getId()));
         financeMonthlyWorktime.setDetailList(details);
         financeMonthlyWorktime.setDetailList(details);
-        HttpRespMsg msg = new HttpRespMsg();
-        msg.data = financeMonthlyWorktime;
-        return msg;
+        httpRespMsg.data = financeMonthlyWorktime;
+        return httpRespMsg;
     }
     }
 
 
     private void setFmwTime(FmwDetail fmwDetail, Report report) {
     private void setFmwTime(FmwDetail fmwDetail, Report report) {

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

@@ -2125,7 +2125,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
                 String name = (String)a.get("name");
                 String name = (String)a.get("name");
                 String uid = (String)a.get("userId");
                 String uid = (String)a.get("userId");
                 String corpwxUserid = (String)a.get("corpwxUserid");
                 String corpwxUserid = (String)a.get("corpwxUserid");
-
+                System.out.println("createDate=="+createDate + " name=="+name+" uid=="+uid+" corpwxUserid=="+corpwxUserid);
                 if (lastName == null || !(lastName.get("name").equals(name) && lastName.get("dateStr").equals(createDate))) {
                 if (lastName == null || !(lastName.get("name").equals(name) && lastName.get("dateStr").equals(createDate))) {
                     lastName = new HashMap<String, Object>();
                     lastName = new HashMap<String, Object>();
                     lastName.put("dateStr", createDate);
                     lastName.put("dateStr", createDate);

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

@@ -739,6 +739,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
             });
             });
             functionQueryWrapper.orderByAsc("seq");
             functionQueryWrapper.orderByAsc("seq");
             List<SysFunction> functionList = sysFunctionMapper.selectList(functionQueryWrapper);
             List<SysFunction> functionList = sysFunctionMapper.selectList(functionQueryWrapper);
+            //对于一些特定功能的权限做判断过滤
+            if (timeType.getTaskFileCharge() == 0) {
+                functionList = functionList.stream().filter(f -> !f.getName().equals("查看他人审核文件")).collect(Collectors.toList());
+            }
             functionList = functionList.stream().filter(f->functionIdList.contains(f.getId())).collect(Collectors.toList());
             functionList = functionList.stream().filter(f->functionIdList.contains(f.getId())).collect(Collectors.toList());
             user.setFunctionList(functionList);
             user.setFunctionList(functionList);
         } else {
         } else {

+ 1 - 1
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/MD5Util.java

@@ -22,7 +22,7 @@ public class MD5Util {
     }
     }
 
 
     public static void main(String[] args) throws ParseException {
     public static void main(String[] args) throws ParseException {
-        System.out.println(getPassword("工时管家"));
+        System.out.println(getPassword("Dy890606@1"));
 
 
     }
     }