Przeglądaj źródła

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

seyason 11 miesięcy temu
rodzic
commit
9449d8f4f8
31 zmienionych plików z 963 dodań i 360 usunięć
  1. 82 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinancialAuditController.java
  2. 99 135
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserWithBeisenController.java
  3. 83 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/FinancialAudit.java
  4. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/FinancialAuditMapper.java
  5. 16 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/FinancialAuditService.java
  6. 20 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinancialAuditServiceImpl.java
  7. 53 71
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java
  8. 12 0
      fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/DateTimeUtil.java
  9. 21 0
      fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/FinancialAuditMapper.xml
  10. 24 24
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java
  11. 8 8
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java
  12. 12 12
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java
  13. 30 8
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java
  14. 4 1
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProdProcedureServiceImpl.java
  15. 6 0
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java
  16. 82 42
      fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java
  17. 43 17
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml
  18. BIN
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/upload/今日计划导入模板.xlsx
  19. BIN
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/upload/插单计划导入模板.xlsx
  20. BIN
      fhKeeper/formulahousekeeper/management-workshop/src/main/resources/upload/明日计划导入模板.xlsx
  21. 3 0
      fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue
  22. 4 1
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue
  23. 4 0
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponentDetil.vue
  24. 51 15
      fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue
  25. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json
  26. 2 1
      fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json
  27. 16 0
      fhKeeper/formulahousekeeper/timesheet/src/routes.js
  28. 5 2
      fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue
  29. 211 0
      fhKeeper/formulahousekeeper/timesheet/src/views/financeAudit/financeAudit.vue
  30. 5 0
      fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue
  31. 49 22
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

+ 82 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/FinancialAuditController.java

@@ -0,0 +1,82 @@
+package com.management.platform.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.management.platform.entity.FinancialAudit;
+import com.management.platform.entity.Project;
+import com.management.platform.entity.ProjectStage;
+import com.management.platform.entity.User;
+import com.management.platform.mapper.UserMapper;
+import com.management.platform.service.FinancialAuditService;
+import com.management.platform.service.ProjectStageService;
+import com.management.platform.util.HttpRespMsg;
+import com.management.platform.util.MessageUtils;
+import io.lettuce.core.pubsub.PubSubOutput;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-06-05
+ */
+@RestController
+@RequestMapping("/financial-audit")
+public class FinancialAuditController {
+    @Autowired
+    private FinancialAuditService financialAuditService;
+    @Resource
+    private UserMapper userMapper;
+
+    @RequestMapping("/list")
+    public HttpRespMsg list(Integer pageIndex, Integer pageSize, String startDate, String endDate, Integer status, HttpServletRequest request) throws ParseException {
+        HttpRespMsg httpRespMsg = new HttpRespMsg(); 
+        Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();  
+        QueryWrapper<FinancialAudit> queryWrapper = new QueryWrapper<FinancialAudit>()  
+            .eq("company_id", companyId)  
+            .eq("review_status", status)  
+            .ge("report_yrMnth", startDate)
+            .le("report_yrMnth", endDate);
+        IPage<FinancialAudit> auditIPage = financialAuditService.page(new Page<FinancialAudit>(pageIndex, pageSize), queryWrapper);
+        Map<String, Object> map = new HashMap<>();
+        map.put("records", auditIPage.getRecords());
+        map.put("total", auditIPage.getTotal());
+    
+        httpRespMsg.data = map;  
+        return httpRespMsg;
+    }
+
+    @RequestMapping("/audit")
+    public HttpRespMsg audit(Integer id, HttpServletRequest request) {
+        HttpRespMsg httpRespMsg = new HttpRespMsg();
+        String token = request.getHeader("Token");
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+        User user = userMapper.selectById(token);
+//                financialAuditService.update().eq("id", id).set("review_status", 2).set("reviewer_id", user.getId()).set("reviewer_name", user.getName());
+        FinancialAudit item = new FinancialAudit();
+        item.setId(id);
+        item.setReviewStatus(2);
+        item.setReviewerId(user.getId());
+        item.setReviewerName(user.getName());
+        item.setReviewTime(sdf.format(new Date()));
+        financialAuditService.updateById(item);
+        return httpRespMsg;
+    }
+}
+

+ 99 - 135
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/UserWithBeisenController.java

@@ -12,6 +12,7 @@ import com.management.platform.mapper.UserMapper;
 import com.management.platform.mapper.UserWithBeisenMapper;
 import com.management.platform.service.*;
 import com.management.platform.util.BeiSenUtils;
+import com.management.platform.util.DateTimeUtil;
 import com.management.platform.util.HttpRespMsg;
 import com.management.platform.util.WorkDayCalculateUtils;
 import org.springframework.transaction.annotation.Transactional;
@@ -194,29 +195,27 @@ public class UserWithBeisenController {
                 Stream<JSONObject> timeStream1 = times.stream().map(time -> (JSONObject) time);
                 //获取最早上班打卡时间
                 List<LocalTime> minLocalTimeList = timeStream.filter(t -> t.getIntValue("Type") == 1).map(i -> LocalDateTime.parse(i.getString("ActualTime"),df1).toLocalTime()).collect(Collectors.toList());
-                Optional<LocalTime> min = minLocalTimeList.stream().min(LocalTime::compareTo);
+                Optional<LocalTime> minOp = minLocalTimeList.stream().min(LocalTime::compareTo);
                 //获取最晚下班时间
                 List<LocalTime> maxLocalTimeList = timeStream1.filter(t -> t.getIntValue("Type") == 9).map(i -> LocalDateTime.parse(i.getString("ActualTime"),df1).toLocalTime()).collect(Collectors.toList());
-                Optional<LocalTime> max = maxLocalTimeList.stream().max(LocalTime::compareTo);
+                Optional<LocalTime> maxOp = maxLocalTimeList.stream().max(LocalTime::compareTo);
                 if(first.isPresent()){
-                    boolean workDay = WorkDayCalculateUtils.isWorkDay(localDate)&&!holidaySettings.stream().anyMatch(h->h.getHolidayDate().isEqual(localDate));
+                    boolean workDay = WorkDayCalculateUtils.isWorkDay(localDate);
                     //todo:针对景昱 工作日默认以8小时工作制度加上加班时长 非工作日以加班时长为准
-                    Duration between = Duration.between(min.get(), max.get());
                     Double workTime;
-                    if(timeType.getCompanyId()==5978){
-                        if(workDay){
-                            workTime=8.0;
-                        }else {
-                            workTime=0.0;
-                        }
+                    LocalTime min = minOp.get();
+                    LocalTime max = maxOp.get();
+                    Duration between = Duration.between(min,max);
+                    if(between.toHours()<=0){
+                        continue;
                     }else {
-                        if(between.toHours()<0){
-                            workTime=0.0;
-                        }else {
-                            BigDecimal decimal = new BigDecimal(between.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            workTime=decimal.doubleValue();
-                        }
+                        //去掉休息时长
+                        long rest1 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("12:00:00", df4), LocalTime.parse("13:00:00", df4));
+                        long rest2 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("17:30:00", df4), LocalTime.parse("18:00:00", df4));
+                        long lastWorkMinute = between.toMinutes() - rest1-rest2;
+                        BigDecimal decimal = new BigDecimal(lastWorkMinute);
+                        decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
+                        workTime=decimal.doubleValue();
                     }
                     Stream<JSONObject> overTimeStream = allOverTimeList.stream().map(elment -> (JSONObject) elment);
                     Stream<JSONObject> vacationStream = allVacationList.stream().map(elment -> (JSONObject) elment);
@@ -229,22 +228,31 @@ public class UserWithBeisenController {
                         List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
                                 && (a.getIntValue("ApproveStatus") == 2||a.getIntValue("ApproveStatus") == 1)).collect(Collectors.toList());
                         //加班数据可能存在结束日期是当前日期的情况的情况
-                        BigDecimal overTimeBigDecimal= new BigDecimal(0);;
+                        BigDecimal overTimeBigDecimal= new BigDecimal(0);
+                        //计算加班时长 工作日打卡超过19:00:00算加班那 非工作日全天算加班
+                        if(workDay){
+                            //工作日打卡超过19:00:00算加班那 非工作日全天算加班
+                            if(max.isAfter(LocalTime.parse("19:00:00", df4))){
+                                overTimeBigDecimal = new BigDecimal(Duration.between(LocalTime.parse("18:00:00", df4),max).toMinutes());
+                            }
+                        }else {
+                            //非工作日全天 去掉休息时长 都算加班
+                            overTimeBigDecimal=new BigDecimal(Duration.between(min, max).toMinutes()) ;
+                            long rest1 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("12:00:00", df4), LocalTime.parse("13:00:00", df4));
+                            long rest2 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("17:30:00", df4), LocalTime.parse("18:00:00", df4));
+                            overTimeBigDecimal=overTimeBigDecimal.subtract(new BigDecimal(rest1)).subtract(new BigDecimal(rest2));
+                        }
                         for (JSONObject o : overTimeList) {
                             //存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
                             if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
                                 //存在开始日期为当天的数据
                                 if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
                                     //开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
-                                    //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l = decimal.doubleValue();
-                                    if(l<o.getDouble("OverTimeDuration")){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
+                                    //对比打卡体现的加班时长和加班单时长取小
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>o.getDouble("OverTimeDuration")){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+o.getDouble("OverTimeDuration");
                                     }
                                 }else {
                                     //开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
@@ -252,17 +260,13 @@ public class UserWithBeisenController {
                                     LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
                                     Duration duration = Duration.between(start, stop);
                                     BigDecimal decimal = new BigDecimal(duration.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
                                     double l = decimal.doubleValue();
-                                    //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l1 = decimal1.doubleValue();
-                                    if(l1<l){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
+                                    //对比打卡体现的加班时长和加班单时长取小
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>l){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+l;
                                     }
                                 }
                             }else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
@@ -270,14 +274,10 @@ public class UserWithBeisenController {
                                 if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
                                     //开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
                                     //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l = decimal.doubleValue();
-                                    if(l<o.getDouble("OverTimeDuration")){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>o.getDouble("OverTimeDuration")){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+o.getDouble("OverTimeDuration");
                                     }
                                 }else {
                                     //开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
@@ -285,34 +285,17 @@ public class UserWithBeisenController {
                                     LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
                                     Duration duration = Duration.between(start, stop);
                                     BigDecimal decimal = new BigDecimal(duration.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
                                     double l = decimal.doubleValue();
-                                    //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l1 = decimal1.doubleValue();
-                                    if(l1<l){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
+                                    //对比打卡体现的加班时长和加班单时长取小
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>l){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+l;
                                     }
                                 }
                             }
                         }
-                        if(workDay){
-                            //工作日计算按照前面的逻辑计算加班时长计算
-                            workTime= workTime+overTimeBigDecimal.doubleValue();
-                        }else {
-                            //非工作日加班 根据实际打卡时长 比较 加班单时长
-                            BigDecimal decimal = new BigDecimal(between.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            if((decimal.doubleValue())>overTimeBigDecimal.doubleValue()){
-                                workTime= workTime+overTimeBigDecimal.doubleValue();
-                            }else {
-                                workTime= workTime+(decimal.doubleValue());
-                            }
-                        }
                         //处理修改
                         List<JSONObject> vacationList = vacationStream.filter(a ->{
                             LocalDate vacationStartDate = LocalDateTime.parse(a.getString("VacationStartDateTime"), df3).toLocalDate();
@@ -332,7 +315,7 @@ public class UserWithBeisenController {
                         if(vacationList.size()>0){
                             double vacationDuration = vacationList.stream().mapToDouble(i -> i.getDouble("VacationDuration")).sum();
                             BigDecimal decimal = new BigDecimal(vacationDuration);
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
 //                            //可能存在休假多天 只减去一天
                             if(decimal.doubleValue()>=8){
                                 workTime= workTime-8;
@@ -343,8 +326,8 @@ public class UserWithBeisenController {
                     }
                     UserFvTime userFvTime=new UserFvTime();
                     userFvTime.setWorkDate(localDate);
-                    userFvTime.setStartTime(min.isPresent()?df2.format(min.get()):"08:30");
-                    userFvTime.setEndTime(max.isPresent()?df2.format(max.get()):"17:30");
+                    userFvTime.setStartTime(df2.format(min));
+                    userFvTime.setEndTime(df2.format(max));
                     userFvTime.setUserId(first.get().getId());
                     userFvTime.setCompanyId(companyId);
                     userFvTime.setWorkHours(workTime.floatValue());
@@ -459,20 +442,17 @@ public class UserWithBeisenController {
             Duration between = Duration.between(LocalTime.parse(firstCard, df4), LocalTime.parse(lastCard, df4));
             LocalTime min = LocalTime.parse(firstCard, df4);
             LocalTime max = LocalTime.parse(lastCard, df4);
-            if(timeType.getCompanyId()==5978){
-                if(workDay){
-                    workTime=8.0;
-                }else {
-                    workTime=0.0;
-                }
+            if(between.toHours()<=0){
+                msg.setError("无考勤记录");
+                return msg;
             }else {
-                if(between.toHours()<0){
-                    workTime=0.0;
-                }else {
-                    BigDecimal decimal = new BigDecimal(between.toMinutes());
-                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                    workTime=decimal.doubleValue();
-                }
+                //去掉休息时长
+                long rest1 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("12:00:00", df4), LocalTime.parse("13:00:00", df4));
+                long rest2 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("17:30:00", df4), LocalTime.parse("18:00:00", df4));
+                long lastWorkMinute = between.toMinutes() - rest1-rest2;
+                BigDecimal decimal = new BigDecimal(lastWorkMinute);
+                decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
+                workTime=decimal.doubleValue();
             }
             Stream<JSONObject> overTimeStream = allOverTimeList.stream().map(elment -> (JSONObject) elment);
             Stream<JSONObject> vacationStream = vacationList.stream().map(elment -> (JSONObject) elment);
@@ -487,21 +467,30 @@ public class UserWithBeisenController {
                 LocalDate localDate = LocalDate.parse(createDate, df);
                 //加班数据可能存在结束日期是当前日期的情况的情况
                 BigDecimal overTimeBigDecimal= new BigDecimal(0);
+                //计算加班时长 工作日打卡超过19:00:00算加班那 非工作日全天算加班
+                if(workDay){
+                    //工作日打卡超过19:00:00算加班那 非工作日全天算加班
+                    if(max.isAfter(LocalTime.parse("19:00:00", df4))){
+                        overTimeBigDecimal = new BigDecimal(Duration.between(LocalTime.parse("18:00:00", df4), LocalTime.parse(lastCard, df4)).toMinutes());
+                    }
+                }else {
+                    //非工作日全天 去掉休息时长 都算加班
+                    overTimeBigDecimal=new BigDecimal(Duration.between(LocalTime.parse(firstCard, df4), LocalTime.parse(lastCard, df4)).toMinutes()) ;
+                    long rest1 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("12:00:00", df4), LocalTime.parse("13:00:00", df4));
+                    long rest2 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("17:30:00", df4), LocalTime.parse("18:00:00", df4));
+                    overTimeBigDecimal=overTimeBigDecimal.subtract(new BigDecimal(rest1)).subtract(new BigDecimal(rest2));
+                }
                 for (JSONObject o : overTimeList) {
                     //存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
                     if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
                         //存在开始日期为当天的数据
                         if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
                             //开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
-                            //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
-                            Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
-                            BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            double l = decimal.doubleValue();
-                            if(l<o.getDouble("OverTimeDuration")){
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
-                            }else {
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
+                            //对比打卡体现的加班时长和加班单时长取小
+                            BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                            if(divide.doubleValue()>o.getDouble("OverTimeDuration")){
+                                //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                workTime=workTime-divide.doubleValue()+o.getDouble("OverTimeDuration");
                             }
                         }else {
                             //开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
@@ -509,17 +498,13 @@ public class UserWithBeisenController {
                             LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
                             Duration duration = Duration.between(start, stop);
                             BigDecimal decimal = new BigDecimal(duration.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
                             double l = decimal.doubleValue();
-                            //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                            Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
-                            BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
-                            decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            double l1 = decimal1.doubleValue();
-                            if(l1<l){
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
-                            }else {
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
+                            //对比打卡体现的加班时长和加班单时长取小
+                            BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                            if(divide.doubleValue()>l){
+                                //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                workTime=workTime-divide.doubleValue()+l;
                             }
                         }
                     }else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
@@ -527,14 +512,10 @@ public class UserWithBeisenController {
                         if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
                             //开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
                             //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                            Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
-                            BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            double l = decimal.doubleValue();
-                            if(l<o.getDouble("OverTimeDuration")){
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
-                            }else {
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
+                            BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                            if(divide.doubleValue()>o.getDouble("OverTimeDuration")){
+                                //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                workTime=workTime-divide.doubleValue()+o.getDouble("OverTimeDuration");
                             }
                         }else {
                             //开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
@@ -542,34 +523,17 @@ public class UserWithBeisenController {
                             LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
                             Duration duration = Duration.between(start, stop);
                             BigDecimal decimal = new BigDecimal(duration.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
                             double l = decimal.doubleValue();
-                            //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                            Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max);
-                            BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
-                            decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            double l1 = decimal1.doubleValue();
-                            if(l1<l){
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
-                            }else {
-                                overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
+                            //对比打卡体现的加班时长和加班单时长取小
+                            BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                            if(divide.doubleValue()>l){
+                                //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                workTime=workTime-divide.doubleValue()+l;
                             }
                         }
                     }
                 }
-                if(workDay){
-                    //工作日计算按照前面的逻辑计算加班时长计算
-                    workTime= workTime+overTimeBigDecimal.doubleValue();
-                }else {
-                    //非工作日加班 根据实际打卡时长 比较 加班单时长
-                    BigDecimal decimal = new BigDecimal(between.toMinutes());
-                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                    if((decimal.doubleValue())>overTimeBigDecimal.doubleValue()){
-                        workTime= workTime+overTimeBigDecimal.doubleValue();
-                    }else {
-                        workTime= workTime+(decimal.doubleValue());
-                    }
-                }
                 //处理修改
                 List<JSONObject> lastVacationList = vacationStream.filter(a ->{
                     LocalDate vacationStartDate = LocalDateTime.parse(a.getString("VacationStartDateTime"), df3).toLocalDate();
@@ -589,7 +553,7 @@ public class UserWithBeisenController {
                 if(lastVacationList.size()>0){
                     double vacationDuration = lastVacationList.stream().mapToDouble(i -> i.getDouble("VacationDuration")).sum();
                     BigDecimal decimal = new BigDecimal(vacationDuration);
-                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
 //                            //可能存在休假多天 只减去一天
                     if(decimal.doubleValue()>=8){
                         workTime= workTime-8;

+ 83 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/entity/FinancialAudit.java

@@ -0,0 +1,83 @@
+package com.management.platform.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import java.time.LocalDate;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-06-05
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+public class FinancialAudit extends Model<FinancialAudit> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 财务审核id
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 日报年月
+     */
+    @TableField("report_yrMnth")
+    @DateTimeFormat(pattern = "yyyy-MM")
+    @JsonFormat(pattern = "yyyy-MM")
+    private LocalDate reportYrmnth;
+
+    /**
+     * 审核人_id
+     */
+    @TableField("reviewer_id")
+    private String reviewerId;
+
+    /**
+     * 审核人_name
+     */
+    @TableField("reviewer_name")
+    private String reviewerName;
+
+    /**
+     * 审核时间
+     */
+    @TableField("review_time")
+    @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm")
+    @JsonFormat(pattern = "yyyy-MM-dd hh:mm")
+    private String reviewTime;
+
+    /**
+     * 审核状态,1-未审核,2-已审核
+     */
+    @TableField("review_status")
+    private Integer reviewStatus;
+
+    /**
+     * 对应公司
+     */
+    @TableField("company_id")
+    private Integer companyId;
+
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/mapper/FinancialAuditMapper.java

@@ -0,0 +1,16 @@
+package com.management.platform.mapper;
+
+import com.management.platform.entity.FinancialAudit;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-06-05
+ */
+public interface FinancialAuditMapper extends BaseMapper<FinancialAudit> {
+
+}

+ 16 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/FinancialAuditService.java

@@ -0,0 +1,16 @@
+package com.management.platform.service;
+
+import com.management.platform.entity.FinancialAudit;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-06-05
+ */
+public interface FinancialAuditService extends IService<FinancialAudit> {
+
+}

+ 20 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/service/impl/FinancialAuditServiceImpl.java

@@ -0,0 +1,20 @@
+package com.management.platform.service.impl;
+
+import com.management.platform.entity.FinancialAudit;
+import com.management.platform.mapper.FinancialAuditMapper;
+import com.management.platform.service.FinancialAuditService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author Seyason
+ * @since 2024-06-05
+ */
+@Service
+public class FinancialAuditServiceImpl extends ServiceImpl<FinancialAuditMapper, FinancialAudit> implements FinancialAuditService {
+
+}

+ 53 - 71
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/task/TimingTask.java

@@ -2146,30 +2146,28 @@ public class TimingTask {
                 Stream<JSONObject> timeStream1 = times.stream().map(time -> (JSONObject) time);
                 //获取最早上班打卡时间
                 List<LocalTime> minLocalTimeList = timeStream.filter(t -> t.getIntValue("Type") == 1).map(i -> LocalDateTime.parse(i.getString("ActualTime"),df1).toLocalTime()).collect(Collectors.toList());
-                Optional<LocalTime> min = minLocalTimeList.stream().min(LocalTime::compareTo);
+                Optional<LocalTime> minOp = minLocalTimeList.stream().min(LocalTime::compareTo);
                 //获取最早上班打卡时间
                 List<LocalTime> maxLocalTimeList = timeStream1.filter(t -> t.getIntValue("Type") == 9).map(i -> LocalDateTime.parse(i.getString("ActualTime"),df1).toLocalTime()).collect(Collectors.toList());
-                Optional<LocalTime> max = maxLocalTimeList.stream().max(LocalTime::compareTo);
+                Optional<LocalTime> maxOp = maxLocalTimeList.stream().max(LocalTime::compareTo);
                 //获取最晚下班时间
                 if(first.isPresent()){
-                    boolean workDay = WorkDayCalculateUtils.isWorkDay(localDate)&&!holidaySettings.stream().anyMatch(h->h.getHolidayDate().isEqual(localDate));
+                    boolean workDay = WorkDayCalculateUtils.isWorkDay(localDate);
                     //todo:针对景昱 工作日默认以8小时工作制度加上加班时长 非工作日以加班时长为准
-                    Duration between = Duration.between(min.get(), max.get());
                     Double workTime;
-                    if(beisenConfig.getCompanyId()==5978){
-                        if(workDay){
-                            workTime=8.0;
-                        }else {
-                            workTime=0.0;
-                        }
+                    LocalTime min = minOp.get();
+                    LocalTime max = maxOp.get();
+                    Duration between = Duration.between(min,max);
+                    if(between.toHours()<=0){
+                        continue;
                     }else {
-                        if(between.toHours()<0){
-                            workTime=0.0;
-                        }else {
-                            BigDecimal decimal = new BigDecimal(between.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            workTime=decimal.doubleValue();
-                        }
+                        //去掉休息时长
+                        long rest1 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("12:00:00", df4), LocalTime.parse("13:00:00", df4));
+                        long rest2 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("17:30:00", df4), LocalTime.parse("18:00:00", df4));
+                        long lastWorkMinute = between.toMinutes() - rest1-rest2;
+                        BigDecimal decimal = new BigDecimal(lastWorkMinute);
+                        decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
+                        workTime=decimal.doubleValue();
                     }
                     Stream<JSONObject> overTimeStream = allOverTimeList.stream().map(elment -> (JSONObject) elment);
                     Stream<JSONObject> vacationStream = allVacationList.stream().map(elment -> (JSONObject) elment);
@@ -2182,22 +2180,31 @@ public class TimingTask {
                         List<JSONObject> overTimeList = overTimeStream.filter(a -> a.getString("StaffId").equals(beisen.get().getUserId())
                                 && (a.getIntValue("ApproveStatus") == 2||a.getIntValue("ApproveStatus") == 1)).collect(Collectors.toList());
                         //加班数据可能存在结束日期是当前日期的情况的情况
-                        BigDecimal overTimeBigDecimal= new BigDecimal(0);;
+                        BigDecimal overTimeBigDecimal= new BigDecimal(0);
+                        //计算加班时长 工作日打卡超过19:00:00算加班那 非工作日全天算加班
+                        if(workDay){
+                            //工作日打卡超过19:00:00算加班那 非工作日全天算加班
+                            if(max.isAfter(LocalTime.parse("19:00:00", df4))){
+                                overTimeBigDecimal = new BigDecimal(Duration.between(LocalTime.parse("18:00:00", df4),max).toMinutes());
+                            }
+                        }else {
+                            //非工作日全天 去掉休息时长 都算加班
+                            overTimeBigDecimal=new BigDecimal(Duration.between(min, max).toMinutes()) ;
+                            long rest1 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("12:00:00", df4), LocalTime.parse("13:00:00", df4));
+                            long rest2 = DateTimeUtil.calculateOverlap(min, max, LocalTime.parse("17:30:00", df4), LocalTime.parse("18:00:00", df4));
+                            overTimeBigDecimal=overTimeBigDecimal.subtract(new BigDecimal(rest1)).subtract(new BigDecimal(rest2));
+                        }
                         for (JSONObject o : overTimeList) {
                             //存在开始日期为当前日期的数据以及结束日期为当天日期的数据 分开计算
                             if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(localDate)){
                                 //存在开始日期为当天的数据
                                 if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
                                     //开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
-                                    //判断打卡时间是不是大于19:00 大于才算加班 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l = decimal.doubleValue();
-                                    if(l<o.getDouble("OverTimeDuration")){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
+                                    //对比打卡体现的加班时长和加班单时长取小
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>o.getDouble("OverTimeDuration")){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+o.getDouble("OverTimeDuration");
                                     }
                                 }else {
                                     //开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
@@ -2205,17 +2212,13 @@ public class TimingTask {
                                     LocalDateTime stop = start.toLocalDate().atTime(LocalTime.MAX);
                                     Duration duration = Duration.between(start, stop);
                                     BigDecimal decimal = new BigDecimal(duration.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
                                     double l = decimal.doubleValue();
-                                    //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l1 = decimal1.doubleValue();
-                                    if(l1<l){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
+                                    //对比打卡体现的加班时长和加班单时长取小
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>l){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+l;
                                     }
                                 }
                             }else if(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate().isEqual(localDate)){
@@ -2223,14 +2226,10 @@ public class TimingTask {
                                 if(LocalDateTime.parse(o.getString("StartDate"),df1).toLocalDate().isEqual(LocalDateTime.parse(o.getString("StopDate"),df1).toLocalDate())){
                                     //开始日期和结束日期是相同的情况 说明是加班区间只存在于当天的情况
                                     //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l = decimal.doubleValue();
-                                    if(l<o.getDouble("OverTimeDuration")){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l<0?0:l));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(o.getDouble("OverTimeDuration")));
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>o.getDouble("OverTimeDuration")){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+o.getDouble("OverTimeDuration");
                                     }
                                 }else {
                                     //开始日期和结束日期是不相同的情况 说明是加班区间存在加班到第二天的情况
@@ -2238,34 +2237,17 @@ public class TimingTask {
                                     LocalDateTime start = stop.toLocalDate().atTime(LocalTime.MIN);
                                     Duration duration = Duration.between(start, stop);
                                     BigDecimal decimal = new BigDecimal(duration.toMinutes());
-                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                                    decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
                                     double l = decimal.doubleValue();
-                                    //判断打卡时间是不是大于19:00 通过打卡计算加班时长 与加班单作比较 取小
-                                    Duration timeDurantion = Duration.between(LocalTime.parse(workDay?"18:00:00":"08:30:00", df4), max.get());
-                                    BigDecimal decimal1 = new BigDecimal(timeDurantion.toMinutes());
-                                    decimal1=decimal1.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                                    double l1 = decimal1.doubleValue();
-                                    if(l1<l){
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l1<0?0:l1));
-                                    }else {
-                                        overTimeBigDecimal=overTimeBigDecimal.add(new BigDecimal(l));
+                                    //对比打卡体现的加班时长和加班单时长取小
+                                    BigDecimal divide = overTimeBigDecimal.divide(new BigDecimal(60), 1, RoundingMode.HALF_DOWN);
+                                    if(divide.doubleValue()>l){
+                                        //打卡获取到的加班时长大于加班单时长 需要在打卡体现的时长-打卡体现的加班时长+加班单时长
+                                        workTime=workTime-divide.doubleValue()+l;
                                     }
                                 }
                             }
                         }
-                        if(workDay){
-                            //工作日计算按照前面的逻辑计算加班时长计算
-                            workTime= workTime+overTimeBigDecimal.doubleValue();
-                        }else {
-                            //非工作日加班 根据实际打卡时长 比较 加班单时长
-                            BigDecimal decimal = new BigDecimal(between.toMinutes());
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
-                            if((decimal.doubleValue())>overTimeBigDecimal.doubleValue()){
-                                workTime= workTime+overTimeBigDecimal.doubleValue();
-                            }else {
-                                workTime= workTime+(decimal.doubleValue());
-                            }
-                        }
                         List<JSONObject> vacationList = vacationStream.filter(a ->{
                             LocalDate vacationStartDate = LocalDateTime.parse(a.getString("VacationStartDateTime"), df3).toLocalDate();
                             LocalDate vacationStopDate = LocalDateTime.parse(a.getString("VacationStopDateTime"), df3).toLocalDate();
@@ -2284,7 +2266,7 @@ public class TimingTask {
                         if(vacationList.size()>0){
                             double vacationDuration = vacationList.stream().mapToDouble(i -> i.getDouble("VacationDuration")).sum();
                             BigDecimal decimal = new BigDecimal(vacationDuration);
-                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_UP);
+                            decimal=decimal.divide(new BigDecimal(60),1,RoundingMode.HALF_DOWN);
 //                            //可能存在休假多天 只减去一天
                             if(decimal.doubleValue()>=8){
                                 workTime= workTime-8;
@@ -2295,8 +2277,8 @@ public class TimingTask {
                     }
                     UserFvTime userFvTime=new UserFvTime();
                     userFvTime.setWorkDate(localDate);
-                    userFvTime.setStartTime(min.isPresent()?df2.format(min.get()):"08:30:00");
-                    userFvTime.setEndTime(max.isPresent()?df2.format(max.get()):"17:30:00");
+                    userFvTime.setStartTime(df2.format(min));
+                    userFvTime.setEndTime(df2.format(max));
                     userFvTime.setUserId(first.get().getId());
                     userFvTime.setCompanyId(5978);
                     userFvTime.setWorkHours(workTime.floatValue());

+ 12 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/util/DateTimeUtil.java

@@ -5,6 +5,7 @@ import org.apache.tomcat.jni.Local;
 import java.math.BigDecimal;
 import java.time.*;
 import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
 import java.time.temporal.TemporalAccessor;
 import java.util.Arrays;
 import java.util.Date;
@@ -37,6 +38,17 @@ public class DateTimeUtil {
         return hours;
     }
 
+    public static long calculateOverlap(LocalTime start1, LocalTime end1, LocalTime start2, LocalTime end2) {
+        if (start1.isAfter(end2) || start2.isAfter(end1)) {
+            return 0;
+        }
+
+        LocalTime overlapStart = start1.isBefore(start2) ? start2 : start1;
+        LocalTime overlapEnd = end1.isAfter(end2) ? end2 : end1;
+
+        return ChronoUnit.MINUTES.between(overlapStart, overlapEnd);
+    }
+
     /**
      * 返回四舍五入到整数的部分
      */

+ 21 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/resources/mapper/FinancialAuditMapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.management.platform.mapper.FinancialAuditMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.management.platform.entity.FinancialAudit">
+        <id column="id" property="id" />
+        <result column="report_yrMnth" property="reportYrmnth" />
+        <result column="reviewer_id" property="reviewerId" />
+        <result column="reviewer_name" property="reviewerName" />
+        <result column="review_time" property="reviewTime" />
+        <result column="review_status" property="reviewStatus" />
+        <result column="company_id" property="companyId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, report_yrMnth, reviewer_id, reviewer_name, review_time, review_status, company_id
+    </sql>
+
+</mapper>

+ 24 - 24
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/controller/ReportController.java

@@ -1532,8 +1532,8 @@ public class ReportController {
 
     //人员工时工价表
     @RequestMapping("getPersonWorkHoursWagesList")
-    public HttpRespMsg getPersonWorkHoursWagesList(Integer deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
-        return reportService.getPersonWorkHoursWagesList(deptId,userId,startDate,endDate,pageIndex,pageSize);
+    public HttpRespMsg getPersonWorkHoursWagesList(String deptIds,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+        return reportService.getPersonWorkHoursWagesList(deptIds,userId,startDate,endDate,pageIndex,pageSize);
     }
 
     @RequestMapping("getPersonWorkHoursWagesDetail")
@@ -1542,48 +1542,48 @@ public class ReportController {
     }
 
     @RequestMapping("exportPersonWorkHoursWorkTime")
-    public HttpRespMsg exportPersonWorkHoursWorkTime(Integer deptId,String userId,String startDate,String endDate){
-        return reportService.exportPersonWorkHoursWorkTime(deptId,userId,startDate,endDate);
+    public HttpRespMsg exportPersonWorkHoursWorkTime(String deptIds,String userId,String startDate,String endDate){
+        return reportService.exportPersonWorkHoursWorkTime(deptIds,userId,startDate,endDate);
     }
 
     @RequestMapping("getProcedureRealTimeProgressList")
-    public HttpRespMsg getProcedureRealTimeProgressList(String deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
-        return reportService.getProcedureRealTimeProgressList(deptId,userId,startDate,endDate,pageIndex,pageSize);
+    public HttpRespMsg getProcedureRealTimeProgressList(String deptIds,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+        return reportService.getProcedureRealTimeProgressList(deptIds,userId,startDate,endDate,pageIndex,pageSize);
     }
 
     @RequestMapping("exportProcedureRealTimeProgressList")
-    public HttpRespMsg exportProcedureRealTimeProgressList(String deptId,String userId,String startDate,String endDate){
-        return reportService.exportProcedureRealTimeProgressList(deptId,userId,startDate,endDate);
+    public HttpRespMsg exportProcedureRealTimeProgressList(String deptIds,String userId,String startDate,String endDate){
+        return reportService.exportProcedureRealTimeProgressList(deptIds,userId,startDate,endDate);
     }
 
     @RequestMapping("/workReportQuery")
-    public HttpRespMsg workReportQuery(Integer productId,String vehicleNum,String steelNum,Integer deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
-        return reportService.workReportQuery(productId,vehicleNum,steelNum,deptId,userId,startDate,endDate,pageIndex,pageSize);
+    public HttpRespMsg workReportQuery(Integer productId,String vehicleNum,String steelNum,String deptIds,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+        return reportService.workReportQuery(productId,vehicleNum,steelNum,deptIds,userId,startDate,endDate,pageIndex,pageSize);
     }
 
     @RequestMapping("/exportWorkReportQuery")
-    public HttpRespMsg exportWorkReportQuery(Integer productId,String vehicleNum,String steelNum,Integer deptId,String userId,String startDate,String endDate){
-        return reportService.exportWorkReportQuery(productId,vehicleNum,steelNum,deptId,userId,startDate,endDate);
+    public HttpRespMsg exportWorkReportQuery(Integer productId,String vehicleNum,String steelNum,String deptIds,String userId,String startDate,String endDate){
+        return reportService.exportWorkReportQuery(productId,vehicleNum,steelNum,deptIds,userId,startDate,endDate);
     }
 
     @RequestMapping("getPlanRealTimeProgressList")
-    public HttpRespMsg getPlanRealTimeProgressList(String deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
-        return reportService.getPlanRealTimeProgressList(deptId,userId,startDate,endDate,pageIndex,pageSize);
+    public HttpRespMsg getPlanRealTimeProgressList(String deptIds,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+        return reportService.getPlanRealTimeProgressList(deptIds,userId,startDate,endDate,pageIndex,pageSize);
     }
 
     @RequestMapping("exportPlanRealTimeProgressList")
-    public HttpRespMsg exportPlanRealTimeProgressList(String deptId,String userId,String startDate,String endDate){
-        return reportService.exportPlanRealTimeProgressList(deptId,userId,startDate,endDate);
+    public HttpRespMsg exportPlanRealTimeProgressList(String deptIds,String userId,String startDate,String endDate){
+        return reportService.exportPlanRealTimeProgressList(deptIds,userId,startDate,endDate);
     }
 
     @RequestMapping("getDpetStatisticsProgressList")
-    public HttpRespMsg getDpetStatisticsProgressList(String deptId,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
-        return reportService.getDpetStatisticsProgressList(deptId,userId,startDate,endDate,pageIndex,pageSize);
+    public HttpRespMsg getDpetStatisticsProgressList(String deptIds,String userId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+        return reportService.getDpetStatisticsProgressList(deptIds,userId,startDate,endDate,pageIndex,pageSize);
     }
 
     @RequestMapping("exportDpetStatisticsProgressList")
-    public HttpRespMsg exportDpetStatisticsProgressList(String deptId,String userId,String startDate,String endDate){
-        return reportService.exportDpetStatisticsProgressList(deptId,userId,startDate,endDate);
+    public HttpRespMsg exportDpetStatisticsProgressList(String deptIds,String userId,String startDate,String endDate){
+        return reportService.exportDpetStatisticsProgressList(deptIds,userId,startDate,endDate);
     }
 
     /**
@@ -1624,13 +1624,13 @@ public class ReportController {
     }
 
     @RequestMapping("/getPlanDataWithStation")
-    public HttpRespMsg getPlanDataWithStation(@RequestParam(defaultValue = "0") Integer isFilterDept,Integer filterDeptId,Integer stationId,String startDate,String endDate,Integer pageIndex,Integer pageSize){
-        return reportService.getPlanDataWithStation(isFilterDept,filterDeptId,stationId,startDate,endDate,pageIndex,pageSize);
+    public HttpRespMsg getPlanDataWithStation(@RequestParam(defaultValue = "0") Integer isFilterDept,Integer filterDeptId,String stationIds,String startDate,String endDate,Integer pageIndex,Integer pageSize){
+        return reportService.getPlanDataWithStation(isFilterDept,filterDeptId,stationIds,startDate,endDate,pageIndex,pageSize);
     }
 
     @RequestMapping("/exportPlanDataWithStation")
-    public HttpRespMsg exportPlanDataWithStation(@RequestParam(defaultValue = "0") Integer isFilterDept,Integer filterDeptId,Integer stationId,String startDate,String endDate){
-        return reportService.exportPlanDataWithStation(isFilterDept,filterDeptId,stationId,startDate,endDate);
+    public HttpRespMsg exportPlanDataWithStation(@RequestParam(defaultValue = "0") Integer isFilterDept,Integer filterDeptId,String stationIds,String startDate,String endDate){
+        return reportService.exportPlanDataWithStation(isFilterDept,filterDeptId,stationIds,startDate,endDate);
     }
     
     @RequestMapping("/getPlanDataWithUserId")

+ 8 - 8
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/mapper/ReportMapper.java

@@ -186,21 +186,21 @@ public interface ReportMapper extends BaseMapper<Report> {
 
     List<Map<String, Object>> getPersonWorkHoursWagesDetail(String date, String userId, Integer companyId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
 
-    List<Map<String, Object>> getProcedureRealTimeProgressList(Integer companyId,String deptId, String foremanId,String userId, String startDate, String endDate, Integer pageStart, Integer pageSize);
+    List<Map<String, Object>> getProcedureRealTimeProgressList(Integer companyId,List<Integer> deptIds, String foremanId,String userId, String startDate, String endDate, Integer pageStart, Integer pageSize);
 
-    Integer getProcedureRealTimeProgressCount(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate);
+    Integer getProcedureRealTimeProgressCount(Integer companyId, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate);
 
-    List<Map<String, Object>> workReportQuery(Integer companyId,Integer productId, String vehicleNum,String steelNum, Integer deptId, String foremanId, String userId, String startDate, String endDate,Integer pageStart, Integer pageSize);
+    List<Map<String, Object>> workReportQuery(Integer companyId,Integer productId, String vehicleNum,String steelNum, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate,Integer pageStart, Integer pageSize);
 
-    Integer selectCountForWorkQuery(Integer companyId, Integer productId, String vehicleNum, String steelNum, Integer deptId, String foremanId, String userId, String startDate, String endDate);
+    Integer selectCountForWorkQuery(Integer companyId, Integer productId, String vehicleNum, String steelNum, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate);
 
-    List<Map<String, Object>> getPlanRealTimeProgressList(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate, Integer pageStart, Integer pageSize,@Param("list") List<Integer> planIds);
+    List<Map<String, Object>> getPlanRealTimeProgressList(Integer companyId, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate, Integer pageStart, Integer pageSize,@Param("list") List<Integer> planIds);
 
-    Integer getPlanRealTimeProgressCount(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate);
+    Integer getPlanRealTimeProgressCount(Integer companyId, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate);
 
-    List<Map<String, Object>> getDpetStatisticsProgressList(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate, Integer pageStart, Integer pageSize);
+    List<Map<String, Object>> getDpetStatisticsProgressList(Integer companyId, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate, Integer pageStart, Integer pageSize);
 
-    Integer getDpetStatisticsProgressCount(Integer companyId, String deptId, String foremanId, String userId, String startDate, String endDate);
+    Integer getDpetStatisticsProgressCount(Integer companyId, List<Integer> deptIds, String foremanId, String userId, String startDate, String endDate);
 
     List<Map<String,Object>> getReportList(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, Integer companyId);
 

+ 12 - 12
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/ReportService.java

@@ -117,27 +117,27 @@ public interface ReportService extends IService<Report> {
 
     HttpRespMsg getChekerList(Integer checkType, Integer deptId);
 
-    HttpRespMsg getPersonWorkHoursWagesList(Integer deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
+    HttpRespMsg getPersonWorkHoursWagesList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
     HttpRespMsg getPersonWorkHoursWagesDetail(String date, String userId,String startDate,String endDate,Integer checkStatus,Integer detailStatus);
 
-    HttpRespMsg exportPersonWorkHoursWorkTime(Integer deptId, String userId, String startDate, String endDate);
+    HttpRespMsg exportPersonWorkHoursWorkTime(String deptIds, String userId, String startDate, String endDate);
 
-    HttpRespMsg getProcedureRealTimeProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
+    HttpRespMsg getProcedureRealTimeProgressList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg exportProcedureRealTimeProgressList(String deptId, String userId, String startDate, String endDate);
+    HttpRespMsg exportProcedureRealTimeProgressList(String deptIds, String userId, String startDate, String endDate);
 
-    HttpRespMsg workReportQuery(Integer productId, String vehicleNum, String steelNum, Integer deptId, String userId, String startDate, String endDate,Integer pageIndex,Integer pageSize);
+    HttpRespMsg workReportQuery(Integer productId, String vehicleNum, String steelNum, String deptIds, String userId, String startDate, String endDate,Integer pageIndex,Integer pageSize);
 
-    HttpRespMsg exportWorkReportQuery(Integer productId, String vehicleNum, String steelNum, Integer deptId, String userId, String startDate, String endDate);
+    HttpRespMsg exportWorkReportQuery(Integer productId, String vehicleNum, String steelNum, String deptIds, String userId, String startDate, String endDate);
 
-    HttpRespMsg getPlanRealTimeProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
+    HttpRespMsg getPlanRealTimeProgressList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg exportPlanRealTimeProgressList(String deptId, String userId, String startDate, String endDate);
+    HttpRespMsg exportPlanRealTimeProgressList(String deptIds, String userId, String startDate, String endDate);
 
-    HttpRespMsg getDpetStatisticsProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
+    HttpRespMsg getDpetStatisticsProgressList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg exportDpetStatisticsProgressList(String deptId, String userId, String startDate, String endDate);
+    HttpRespMsg exportDpetStatisticsProgressList(String deptIds, String userId, String startDate, String endDate);
 
     HttpRespMsg exportReport(String startDate, String endDate, Integer planId, Integer stateKey, Integer departmentId, HttpServletRequest request);
 
@@ -149,9 +149,9 @@ public interface ReportService extends IService<Report> {
 
  	Object fixSteelNumData();
 
- 	HttpRespMsg getPlanDataWithStation(Integer isFilterDept,Integer filterDeptId,Integer stationId, String startDate, String endDate, Integer pageIndex, Integer pageSize);
+ 	HttpRespMsg getPlanDataWithStation(Integer isFilterDept,Integer filterDeptId,String stationIds, String startDate, String endDate, Integer pageIndex, Integer pageSize);
 
-    HttpRespMsg exportPlanDataWithStation(Integer isFilterDept, Integer filterDeptId, Integer stationId, String startDate, String endDate);
+    HttpRespMsg exportPlanDataWithStation(Integer isFilterDept, Integer filterDeptId, String stationIds, String startDate, String endDate);
 
     HttpRespMsg getPlanDataWithUserId(String userId, String startDate, String endDate);
 

+ 30 - 8
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/PlanServiceImpl.java

@@ -599,19 +599,25 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                         }
                     }
                     plan.setPlanType(0);
-                    //排产工单号 产品名称 钢印号 数量 主工序 工位 开工时间 完工时间 描述
+                    //排产工单号 产品名称 排产订单号 项目名称 列序号 钢印号 数量 主工序 工位 开工时间 完工时间 描述
                     XSSFCell productSchedulingNumCell = row.getCell(0);
                     XSSFCell productNameCell = row.getCell(1);
-                    XSSFCell steelStampNumberCell = row.getCell(2);
-                    XSSFCell numCell = row.getCell(3);
-                    XSSFCell mainProcessCell = row.getCell(4);
-                    XSSFCell stationNameCell = row.getCell(5);
-                    XSSFCell startDateCell = row.getCell(6);
-                    XSSFCell endDateCell = row.getCell(7);
-                    XSSFCell describtionCell = row.getCell(8);
+                    XSSFCell productOrderNumCell = row.getCell(2);
+                    XSSFCell projectNameCell = row.getCell(3);
+                    XSSFCell columnNumCell = row.getCell(4);
+                    XSSFCell steelStampNumberCell = row.getCell(5);
+                    XSSFCell numCell = row.getCell(6);
+                    XSSFCell mainProcessCell = row.getCell(7);
+                    XSSFCell stationNameCell = row.getCell(8);
+                    XSSFCell startDateCell = row.getCell(9);
+                    XSSFCell endDateCell = row.getCell(10);
+                    XSSFCell describtionCell = row.getCell(11);
 
                     if (productSchedulingNumCell != null) productSchedulingNumCell.setCellType(CellType.STRING);
                     if (productNameCell != null) productNameCell.setCellType(CellType.STRING);
+                    if (productOrderNumCell != null) productOrderNumCell.setCellType(CellType.STRING);
+                    if (projectNameCell != null) projectNameCell.setCellType(CellType.STRING);
+                    if (columnNumCell != null) columnNumCell.setCellType(CellType.STRING);
                     if (steelStampNumberCell != null) steelStampNumberCell.setCellType(CellType.STRING);
                     if (numCell != null) numCell.setCellType(CellType.NUMERIC);
                     if (mainProcessCell != null) mainProcessCell.setCellType(CellType.STRING);
@@ -635,6 +641,22 @@ public class PlanServiceImpl extends ServiceImpl<PlanMapper, Plan> implements Pl
                         }
                         plan.setProductSchedulingNum(productSchedulingNumCell.getStringCellValue());
                     }
+                    if(productOrderNumCell!=null&&!StringUtils.isEmpty(productOrderNumCell.getStringCellValue())){
+                        plan.setProductOrderNum(productOrderNumCell.getStringCellValue());
+                    }
+                    if(projectNameCell!=null&&!StringUtils.isEmpty(productNameCell.getStringCellValue())){
+                        plan.setProjectName(projectNameCell.getStringCellValue());
+                    }
+                    if(columnNumCell!=null&&StringUtils.isEmpty(columnNumCell.getStringCellValue())){
+                        String stringCellValue = columnNumCell.getStringCellValue();
+                        if(stringCellValue.contains("-")){
+                            String[] split = stringCellValue.split("-");
+                            if(split.length>1){
+                                plan.setColumnNumStart(Integer.valueOf(split[0]));
+                                plan.setColumnNumEnd(Integer.valueOf(split[1]));
+                            }
+                        }
+                    }
                     if(steelStampNumberCell!=null&&!StringUtils.isEmpty(steelStampNumberCell.getStringCellValue())){
                         String stringCellValue = steelStampNumberCell.getStringCellValue();
                         String[] split = stringCellValue.split("\\|");

+ 4 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProdProcedureServiceImpl.java

@@ -111,19 +111,22 @@ public class ProdProcedureServiceImpl extends ServiceImpl<ProdProcedureMapper, P
                     this.updateBatchById(updateList);
                     //todo:更新产品工序单价
                     List<Integer> procedureIds = updateList.stream().map(ProdProcedure::getId).distinct().collect(Collectors.toList());
+                    procedureIds.add(-1);
                     //todo:找到用到当前工序的plan_procedure_total(计划指定工序总进度表) 更新 单价相关数据
                     List<PlanProcedureTotal> planProcedureTotals = planProcedureTotalService.list(new LambdaQueryWrapper<PlanProcedureTotal>().in(PlanProcedureTotal::getProdProcedureId, procedureIds));
                     if(planProcedureTotals.size()>0){
                         List<Integer> planIds = planProcedureTotals.stream().map(PlanProcedureTotal::getPlanId).distinct().collect(Collectors.toList());
                         List<Plan> planList = planService.list(new LambdaQueryWrapper<Plan>().in(Plan::getId, planIds));
                         List<Integer> totalIds = planProcedureTotals.stream().map(PlanProcedureTotal::getId).distinct().collect(Collectors.toList());
+                        totalIds.add(-1);
                         List<ProdProcedureTeam> allProdProcedureTeams = prodProcedureTeamService.list(new LambdaQueryWrapper<ProdProcedureTeam>().in(ProdProcedureTeam::getPlanProcedureId,totalIds));
                         List<Integer> teamIdList = allProdProcedureTeams.stream().map(ProdProcedureTeam::getId).distinct().collect(Collectors.toList());
+                        teamIdList.add(-1);
                         List<Report> allReports = reportService.list(new LambdaQueryWrapper<Report>().select(Report::getId,Report::getUserProcedureTeamId, Report::getProdProcedureId,Report::getFinishNum).in(Report::getUserProcedureTeamId, teamIdList));
                         List<ProdProcedureTeam> needUpdateTeamList=new ArrayList<>();
                         List<Report> needUpdateReportList=new ArrayList<>();
                         for (PlanProcedureTotal planProcedureTotal : planProcedureTotals) {
-                            Optional<ProdProcedure> first = updateList.stream().filter(u -> u.getId().equals(planProcedureTotal.getId())).findFirst();
+                            Optional<ProdProcedure> first = updateList.stream().filter(u -> u.getId().equals(planProcedureTotal.getProdProcedureId())).findFirst();
                             if(first.isPresent()){
                                 Optional<Plan> plan = planList.stream().filter(p -> p.getId().equals(planProcedureTotal.getPlanId())).findFirst();
                                 if(plan.isPresent()){

+ 6 - 0
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ProductServiceImpl.java

@@ -269,6 +269,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                 if(row==null){
                     continue;
                 }
+                if (ExcelUtil.isRowEmpty(row)) {
+                    continue;
+                }
 
                 //产品基本信息
                 XSSFCell nameCell = row.getCell(0);
@@ -380,6 +383,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
                 if(row==null){
                     continue;
                 }
+                if (ExcelUtil.isRowEmpty(row)) {
+                    continue;
+                }
 
                 //工序信息
                 XSSFCell productNameCell = row.getCell(0);

+ 82 - 42
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4046,7 +4046,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
 //    }
 
     @Override
-    public HttpRespMsg getPersonWorkHoursWagesList(Integer deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getPersonWorkHoursWagesList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         HashMap resultMap=new HashMap();
         DateTimeFormatter dtf=DateTimeFormatter.ofPattern("yyyy-MM-dd");
@@ -4063,16 +4063,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部人员工时工价");
         QueryWrapper<User> queryWrapper=new QueryWrapper();
         queryWrapper.eq("company_id",companyId);
-        List<Integer> deptIds=new ArrayList<>();
-        if(deptId!=null){
-            deptIds = getBranchDepartment(Integer.valueOf(deptId), departmentList);
-            deptIds.add(Integer.valueOf(deptId));
-            queryWrapper.in("department_id",deptIds);
+        List<Integer> deptIdList=new ArrayList<>();
+        if(deptIds!=null&&!StringUtils.isEmpty(deptIds)){
+            String[] split = deptIds.split(",");
+            for (String deptId : split) {
+                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+                deptIdList.addAll(branchDepartment);
+            }
+            queryWrapper.in("department_id",deptIdList);
         }
         if(!StringUtils.isEmpty(userId)){
             queryWrapper.eq("id",userId);
         }
-        List<Map<String,Object>> personWorkHoursWagesList=reportMapper.getPersonWorkHoursWagesList(companyId,startDate,endDate,deptIds,userId);
+        List<Map<String,Object>> personWorkHoursWagesList=reportMapper.getPersonWorkHoursWagesList(companyId,startDate,endDate,deptIdList,userId);
         if(!canViewAll){
             /*作为工长看到的数据*/
             List<Plan> plans = planMapper.selectList(new QueryWrapper<Plan>().eq("foreman_id", user.getId()));
@@ -4271,8 +4274,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportPersonWorkHoursWorkTime(Integer deptId, String userId, String startDate, String endDate) {
-        HttpRespMsg respMsg = getPersonWorkHoursWagesList(deptId, userId, startDate, endDate, -1, -1);
+    public HttpRespMsg exportPersonWorkHoursWorkTime(String deptIds, String userId, String startDate, String endDate) {
+        HttpRespMsg respMsg = getPersonWorkHoursWagesList(deptIds, userId, startDate, endDate, -1, -1);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         HashMap resultMap= (HashMap) respMsg.data;
         List<User> mapList= (List<User>) resultMap.get("records");
@@ -4437,24 +4440,33 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg getProcedureRealTimeProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getProcedureRealTimeProgressList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
+        List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, user.getCompanyId()));
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部工序实时进度");
         Integer pageStart = null;
         if (pageIndex!=null){
             pageStart = (pageIndex -1) * pageSize;
         }
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Integer> deptIdList=new ArrayList<>();
+        if(!StringUtils.isEmpty(deptIds)){
+            String[] split = deptIds.split(",");
+            for (String deptId : split) {
+                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+                deptIdList.addAll(branchDepartment);
+            }
+        }
         HashMap map=new HashMap();
         List<Map<String, Object>> planRealTimeProgressList;
         Integer total;
         if(!canViewAll){
-            planRealTimeProgressList = reportMapper.getProcedureRealTimeProgressList(companyId, deptId,user.getId(), userId, startDate, endDate, pageStart, pageSize);
-            total=reportMapper.getProcedureRealTimeProgressCount(companyId, deptId,user.getId(), userId, startDate, endDate);
+            planRealTimeProgressList = reportMapper.getProcedureRealTimeProgressList(companyId, deptIdList,user.getId(), userId, startDate, endDate, pageStart, pageSize);
+            total=reportMapper.getProcedureRealTimeProgressCount(companyId, deptIdList,user.getId(), userId, startDate, endDate);
         }else {
-            planRealTimeProgressList = reportMapper.getProcedureRealTimeProgressList(companyId, deptId,null, userId, startDate, endDate, pageStart, pageSize);
-            total=reportMapper.getProcedureRealTimeProgressCount(companyId, deptId,null, userId, startDate, endDate);
+            planRealTimeProgressList = reportMapper.getProcedureRealTimeProgressList(companyId, deptIdList,null, userId, startDate, endDate, pageStart, pageSize);
+            total=reportMapper.getProcedureRealTimeProgressCount(companyId, deptIdList,null, userId, startDate, endDate);
         }
 
 
@@ -4465,9 +4477,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportProcedureRealTimeProgressList(String deptId, String userId, String startDate, String endDate) {
+    public HttpRespMsg exportProcedureRealTimeProgressList(String deptIds, String userId, String startDate, String endDate) {
         HttpRespMsg msg=new HttpRespMsg();
-        HttpRespMsg respMsg = getProcedureRealTimeProgressList(deptId, userId, startDate, endDate, null, null);
+        HttpRespMsg respMsg = getProcedureRealTimeProgressList(deptIds, userId, startDate, endDate, null, null);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         HashMap resultMap= (HashMap) respMsg.data;
         List<Map<String, Object>> mapList= (List<Map<String, Object>>) resultMap.get("records");
@@ -4498,7 +4510,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg workReportQuery(Integer productId, String vehicleNum, String steelNum, Integer deptId, String userId, String startDate, String endDate,Integer pageIndex,Integer pageSize) {
+    public HttpRespMsg workReportQuery(Integer productId, String vehicleNum, String steelNum, String deptIds, String userId, String startDate, String endDate,Integer pageIndex,Integer pageSize) {
         HttpRespMsg msg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部报工");
@@ -4507,15 +4519,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             pageStart = (pageIndex -1) * pageSize;
         }
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
+        List<Integer> deptIdList=new ArrayList<>();
+        if(!StringUtils.isEmpty(deptIds)){
+            String[] split = deptIds.split(",");
+            for (String deptId : split) {
+                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+                deptIdList.addAll(branchDepartment);
+            }
+        }
         Map map=new HashMap();
         List<Map<String,Object>> mapList;
         Integer total;
         if(!canViewAll){
-            mapList=reportMapper.workReportQuery(companyId,productId,vehicleNum,steelNum,deptId,user.getId(),userId,startDate,endDate,pageStart,pageSize);
-            total = reportMapper.selectCountForWorkQuery(companyId, productId, vehicleNum, steelNum, deptId,user.getId(), userId, startDate, endDate);
+            mapList=reportMapper.workReportQuery(companyId,productId,vehicleNum,steelNum,deptIdList,user.getId(),userId,startDate,endDate,pageStart,pageSize);
+            total = reportMapper.selectCountForWorkQuery(companyId, productId, vehicleNum, steelNum, deptIdList,user.getId(), userId, startDate, endDate);
         }else {
-            mapList=reportMapper.workReportQuery(companyId,productId,vehicleNum,steelNum,deptId,null,userId,startDate,endDate,pageStart,pageSize);
-            total = reportMapper.selectCountForWorkQuery(companyId, productId, vehicleNum, steelNum, deptId,null, userId, startDate, endDate);
+            mapList=reportMapper.workReportQuery(companyId,productId,vehicleNum,steelNum,deptIdList,null,userId,startDate,endDate,pageStart,pageSize);
+            total = reportMapper.selectCountForWorkQuery(companyId, productId, vehicleNum, steelNum, deptIdList,null, userId, startDate, endDate);
         }
 
         map.put("records",mapList);
@@ -4525,9 +4546,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportWorkReportQuery(Integer productId, String vehicleNum, String steelNum, Integer deptId, String userId, String startDate, String endDate) {
+    public HttpRespMsg exportWorkReportQuery(Integer productId, String vehicleNum, String steelNum, String deptIds, String userId, String startDate, String endDate) {
         HttpRespMsg msg=new HttpRespMsg();
-        HttpRespMsg respMsg = workReportQuery(productId, vehicleNum, steelNum, deptId, userId, startDate,endDate,null,null);
+        HttpRespMsg respMsg = workReportQuery(productId, vehicleNum, steelNum, deptIds, userId, startDate,endDate,null,null);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         HashMap resultMap= (HashMap) respMsg.data;
         List<Map<String, Object>> mapList= (List<Map<String, Object>>) resultMap.get("records");
@@ -4564,7 +4585,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg getPlanRealTimeProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getPlanRealTimeProgressList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部计划实时进度");
@@ -4575,15 +4596,24 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             pageStart = (pageIndex -1) * pageSize;
         }
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
+        List<Department> departmentList = departmentMapper.selectList(new LambdaQueryWrapper<Department>().eq(Department::getCompanyId, companyId));
+        List<Integer> deptIdList=new ArrayList<>();
+        if(!StringUtils.isEmpty(deptIds)){
+            String[] split = deptIds.split(",");
+            for (String deptId : split) {
+                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+                deptIdList.addAll(branchDepartment);
+            }
+        }
         List<Map<String, Object>> planRealTimeProgressList;
         Integer total;
         HashMap map=new HashMap();
         if(!canViewAll){
-            planRealTimeProgressList = reportMapper.getPlanRealTimeProgressList(companyId, deptId,user.getId(), userId, startDate, endDate, pageStart, pageSize,null);
-            total=reportMapper.getPlanRealTimeProgressCount(companyId, deptId,user.getId(), userId, startDate, endDate);
+            planRealTimeProgressList = reportMapper.getPlanRealTimeProgressList(companyId, deptIdList,user.getId(), userId, startDate, endDate, pageStart, pageSize,null);
+            total=reportMapper.getPlanRealTimeProgressCount(companyId, deptIdList,user.getId(), userId, startDate, endDate);
         }else {
-            planRealTimeProgressList = reportMapper.getPlanRealTimeProgressList(companyId, deptId,null, userId, startDate, endDate, pageStart, pageSize,null);
-            total=reportMapper.getPlanRealTimeProgressCount(companyId, deptId,null, userId, startDate, endDate);
+            planRealTimeProgressList = reportMapper.getPlanRealTimeProgressList(companyId, deptIdList,null, userId, startDate, endDate, pageStart, pageSize,null);
+            total=reportMapper.getPlanRealTimeProgressCount(companyId, deptIdList,null, userId, startDate, endDate);
         }
         planRealTimeProgressList.forEach(pt->{
             BigDecimal planWorkTime = new BigDecimal(pt.get("planWorkTime") == null ? 0 : Double.valueOf(String.valueOf(pt.get("planWorkTime"))));
@@ -4601,9 +4631,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportPlanRealTimeProgressList(String deptId, String userId, String startDate, String endDate) {
+    public HttpRespMsg exportPlanRealTimeProgressList(String deptIds, String userId, String startDate, String endDate) {
         HttpRespMsg msg=new HttpRespMsg();
-        HttpRespMsg respMsg = getPlanRealTimeProgressList(deptId, userId, startDate, endDate, null, null);
+        HttpRespMsg respMsg = getPlanRealTimeProgressList(deptIds, userId, startDate, endDate, null, null);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         HashMap resultMap= (HashMap) respMsg.data;
         List<Map<String, Object>> mapList= (List<Map<String, Object>>) resultMap.get("records");
@@ -4642,7 +4672,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg getDpetStatisticsProgressList(String deptId, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getDpetStatisticsProgressList(String deptIds, String userId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg httpRespMsg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         boolean canViewAll = sysFunctionService.hasPriviledge(user.getRoleId(), "查看全部部门生产统计");
@@ -4654,15 +4684,23 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         }
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         List<Department> departmentList = departmentMapper.selectList(new QueryWrapper<Department>().eq("company_id", companyId));
+        List<Integer> deptIdList=new ArrayList<>();
+        if(!StringUtils.isEmpty(deptIds)){
+            String[] split = deptIds.split(",");
+            for (String deptId : split) {
+                List<Integer> branchDepartment = getBranchDepartment(Integer.valueOf(deptId), departmentList);
+                deptIdList.addAll(branchDepartment);
+            }
+        }
         HashMap map=new HashMap();
         List<Map<String, Object>> dpetStatisticsProgressList;
         Integer total;
         if(!canViewAll){
-            dpetStatisticsProgressList = reportMapper.getDpetStatisticsProgressList(companyId, deptId,user.getId(), userId, startDate, endDate, pageStart, pageSize);
-            total=reportMapper.getDpetStatisticsProgressCount(companyId, deptId,user.getId(), userId, startDate, endDate);
+            dpetStatisticsProgressList = reportMapper.getDpetStatisticsProgressList(companyId, deptIdList,user.getId(), userId, startDate, endDate, pageStart, pageSize);
+            total=reportMapper.getDpetStatisticsProgressCount(companyId, deptIdList,user.getId(), userId, startDate, endDate);
         }else {
-            dpetStatisticsProgressList = reportMapper.getDpetStatisticsProgressList(companyId, deptId,null, userId, startDate, endDate, pageStart, pageSize);
-            total=reportMapper.getDpetStatisticsProgressCount(companyId, deptId,null, userId, startDate, endDate);
+            dpetStatisticsProgressList = reportMapper.getDpetStatisticsProgressList(companyId, deptIdList,null, userId, startDate, endDate, pageStart, pageSize);
+            total=reportMapper.getDpetStatisticsProgressCount(companyId, deptIdList,null, userId, startDate, endDate);
         }
         dpetStatisticsProgressList.forEach(pt->{
             BigDecimal planWorkTime = new BigDecimal(pt.get("planWorkTime") == null ? 0 : Double.valueOf(String.valueOf(pt.get("planWorkTime"))));
@@ -4682,9 +4720,9 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportDpetStatisticsProgressList(String deptId, String userId, String startDate, String endDate) {
+    public HttpRespMsg exportDpetStatisticsProgressList(String deptIds, String userId, String startDate, String endDate) {
         HttpRespMsg msg=new HttpRespMsg();
-        HttpRespMsg respMsg = getDpetStatisticsProgressList(deptId, userId, startDate, endDate, null, null);
+        HttpRespMsg respMsg = getDpetStatisticsProgressList(deptIds, userId, startDate, endDate, null, null);
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
         HashMap resultMap= (HashMap) respMsg.data;
         List<Map<String, Object>> mapList= (List<Map<String, Object>>) resultMap.get("records");
@@ -5303,7 +5341,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
 	@Override
-    public HttpRespMsg getPlanDataWithStation(Integer isFilterDept,Integer filterDeptId,Integer stationId, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
+    public HttpRespMsg getPlanDataWithStation(Integer isFilterDept,Integer filterDeptId,String stationIds, String startDate, String endDate, Integer pageIndex, Integer pageSize) {
         HttpRespMsg msg=new HttpRespMsg();
         User user = userMapper.selectById(request.getHeader("token"));
         NumberFormat format = NumberFormat.getPercentInstance();
@@ -5579,8 +5617,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
         }
         lastList=list;
 
-        if(stationId!=null){
-            lastList=lastList.stream().filter(l->Integer.valueOf(String.valueOf(l.get("deptId"))).equals(stationId)).collect(Collectors.toList());
+        if(stationIds!=null&&!StringUtils.isEmpty(stationIds)){
+            String[] split = stationIds.split(",");
+            List<Integer> collect = Arrays.asList(split).stream().map(i -> Integer.valueOf(i)).collect(Collectors.toList());
+            lastList=lastList.stream().filter(l->collect.contains(Integer.valueOf(String.valueOf(l.get("deptId"))))).collect(Collectors.toList());
         }
         //得到的数据再根据部门过滤一下
         if(pageSize!=null&&pageSize>lastList.size()){
@@ -5595,10 +5635,10 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
     }
 
     @Override
-    public HttpRespMsg exportPlanDataWithStation(Integer isFilterDept, Integer filterDeptId, Integer stationId, String startDate, String endDate) {
+    public HttpRespMsg exportPlanDataWithStation(Integer isFilterDept, Integer filterDeptId, String stationIds, String startDate, String endDate) {
         HttpRespMsg msg=new HttpRespMsg();
         Integer companyId = userMapper.selectById(request.getHeader("token")).getCompanyId();
-        HttpRespMsg data = getPlanDataWithStation(isFilterDept, filterDeptId, stationId, startDate, endDate, null, null);
+        HttpRespMsg data = getPlanDataWithStation(isFilterDept, filterDeptId, stationIds, startDate, endDate, null, null);
         Map<String, Object> objectMap = (Map<String, Object>) data.data;
         boolean isViewUser = (boolean) objectMap.get("isViewUser");
         List<Map<String, Object>> mapList = (List<Map<String, Object>>) objectMap.get("records");

+ 43 - 17
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -136,7 +136,9 @@
 
     <select id="getPersonWorkHoursWagesList" resultType="java.util.Map">
         select b.id as userId,c.department_name as departmentName,b.name as userName,DATE_FORMAT(a.create_date,'%Y%m%d') as crateDate,IFNULL(SUM(a.cost),0) as cost,IFNULL(SUM(a.working_time),0) as workTime
+        ,ppt.`work_time` AS planWorkTime,ppt.`job_of_money` AS planCost,(ppt.`work_time`-IFNULL(SUM(a.working_time),0)) AS surplusTime,(ppt.`job_of_money`-IFNULL(SUM(a.cost),0)) AS surplusCost
         from report a
+        LEFT JOIN `prod_procedure_team` ppt ON ppt.id=a.`user_procedure_team_id`
         left join user b on a.creator_id=b.id
         left join department c on c.department_id=b.department_id
         where a.company_id=#{companyId}
@@ -167,7 +169,7 @@
         left join plan on plan.id=r.plan_id
         left join user u on r.checker_id=u.id
         left join user u2 on r.creator_id=u2.id
-        where r.company_id=#{companyId}
+        where r.company_id=#{companyId}  and r.finish_num &gt; 0
         <if test="date!=null and date!=''">
             and r.create_date=#{date}
         </if>
@@ -196,8 +198,11 @@
         <if test="userId!=null and userId!=''">
             and b.foreman_id=#{userId}
         </if>
-        <if test="deptId!=null and deptId!=''">
-            and b.station_id=#{deptId}
+        <if test="deptIds!=null and deptIds.size()>0">
+            and b.station_id in
+            <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="foremanId!=null and foremanId!=''">
             and b.foreman_id=#{foremanId}
@@ -222,8 +227,11 @@
         <if test="userId!=null and userId!=''">
             and  b.foreman_id=#{userId}
         </if>
-        <if test="deptId!=null and deptId!=''">
-            and b.station_id=#{deptId}
+        <if test="deptIds!=null and deptIds.size()>0">
+            and b.station_id in
+            <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="foremanId!=null and foremanId!=''">
             and b.foreman_id=#{foremanId}
@@ -251,8 +259,11 @@
             <if test="vehicleNum!=null and vehicleNum!=''">
                 and #{vehicleNum} between pn.vehicle_num_start and pn.vehicle_num_end
             </if>
-            <if test="deptId!=null and deptId!=''">
-                and pn.station_id=#{deptId}
+            <if test="deptIds!=null and deptIds.size()>0">
+                and pn.station_id in
+                <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                    #{item}
+                </foreach>
             </if>
             <if test="foremanId!=null and foremanId!=''">
                 and pn.foreman_id=#{foremanId}
@@ -291,8 +302,11 @@
             <if test="vehicleNum!=null and vehicleNum!=''">
                 and #{vehicleNum} between pn.vehicle_num_start and pn.vehicle_num_end
             </if>
-            <if test="deptId!=null and deptId!=''">
-                and pn.station_id=#{deptId}
+            <if test="deptIds!=null and deptIds.size()>0">
+                and pn.station_id in
+                <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                    #{item}
+                </foreach>
             </if>
             <if test="foremanId!=null and foremanId!=''">
                 and pn.foreman_id=#{foremanId}
@@ -326,8 +340,11 @@
         <if test="userId!=null and userId!=''">
             and b.foreman_id=#{userId}
         </if>
-        <if test="deptId!=null and deptId!=''">
-            and b.station_id=#{deptId}
+        <if test="deptIds!=null and deptIds.size()>0">
+            and b.station_id in
+            <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="foremanId!=null and foremanId!=''">
             and b.foreman_id=#{foremanId}
@@ -361,8 +378,11 @@
         <if test="userId!=null and userId!=''">
             and b.foreman_id=#{userId}
         </if>
-        <if test="deptId!=null and deptId!=''">
-            and b.station_id=#{deptId}
+        <if test="deptIds!=null and deptIds.size()>0">
+            and b.station_id in
+            <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="foremanId!=null and foremanId!=''">
             and b.foreman_id=#{foremanId}
@@ -386,8 +406,11 @@
         <if test="userId!=null and userId!=''">
             and d.user_id=#{userId}
         </if>
-        <if test="deptId!=null and deptId!=''">
-            and p.station_id=#{deptId}
+        <if test="deptIds!=null and deptIds.size()>0">
+            and p.station_id in
+            <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="foremanId!=null and foremanId!=''">
             and p.foreman_id=#{foremanId}
@@ -414,8 +437,11 @@
         <if test="userId!=null and userId!=''">
             and d.user_id=#{userId}
         </if>
-        <if test="deptId!=null and deptId!=''">
-            and p.station_id=#{deptId}
+        <if test="deptIds!=null and deptIds.size()>0">
+            and p.station_id in
+            <foreach collection="deptIds" item="item" close=")" open="(" separator=",">
+                #{item}
+            </foreach>
         </if>
         <if test="foremanId!=null and foremanId!=''">
             and p.foreman_id=#{foremanId}

BIN
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/upload/今日计划导入模板.xlsx


BIN
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/upload/插单计划导入模板.xlsx


BIN
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/upload/明日计划导入模板.xlsx


+ 3 - 0
fhKeeper/formulahousekeeper/timesheet-workshop-h5/src/views/planView/component/planComponent.vue

@@ -44,6 +44,9 @@
                 <div class="PlanItem">
                   <div>每辆数量:</div><span class="textBeyondHiding">{{ item.product.vehicleNumber }}</span>
                 </div>
+                <div class="PlanItem">
+                  <div>列序号:</div><span class="textBeyondHiding">{{ item.columnNumStart }}-{{ item.columnNumEnd }}</span>
+                </div>
                 <div class="PlanItemBtn">
                   <span class="text" @click="hidePlan(item.id,item.hideState)">
                     {{ jisuanDate(item.startDate)>30 ? '隐藏' : ''}}

+ 4 - 1
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponent.vue

@@ -144,6 +144,9 @@
           <el-form-item label="排产工单号" style="width: 100%" prop="productSchedulingNum">
             <el-input v-model="todayPlanForm.productSchedulingNum" maxlength="50"></el-input>
           </el-form-item>
+          <el-form-item label="排产订单号" style="width: 100%" prop="productOrderNum">
+            <el-input v-model="todayPlanForm.productOrderNum" maxlength="50"></el-input>
+          </el-form-item>
           <el-form-item label="产品名称" style="width: 100%" prop="productId">
             <el-select :disabled="todayPlanForm.id==null?false:true" v-model="todayPlanForm.productId" placeholder="请选择" class="w100" @change="setProductCode" filterable>
               <el-option v-for="item in productList" :key="item.id" :label="item.name" :value="item.id">
@@ -153,7 +156,7 @@
           <el-form-item label="项目代码" style="width: 100%" prop="projectCode">
             <el-input :disabled="todayPlanForm.id==null?false:true" v-model="todayPlanForm.projectCode" maxlength="50" readonly></el-input>
           </el-form-item>
-          <el-form-item label="项目名称" style="width: 100%" prop="projectCode">
+          <el-form-item label="项目名称" style="width: 100%" prop="projectName">
             <el-input  v-model="todayPlanForm.projectName" maxlength="50" ></el-input>
           </el-form-item>
 

+ 4 - 0
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/plan/planComponentDetil.vue

@@ -29,6 +29,10 @@
           :height="tableHight"
           v-if="TabIndex == 0" v-loading="tableDataLoading"
         >
+        <el-table-column
+          type="index"
+          width="50">
+        </el-table-column>
           <el-table-column label="工序名称" width="400">
             <template slot-scope="scope">
                 <div class="disFlexscope">

+ 51 - 15
fhKeeper/formulahousekeeper/timesheet-workshop/src/views/statistic/index.vue

@@ -39,7 +39,7 @@
       <div class="headScreen" :style="'width:72%'">
           <!-- 部门筛选 -->
           <el-cascader v-if="ins!=5 && !isViewUser" v-model="departmentIdArray" :options="departmentList" :placeholder="$t('qing-xuan-ze-bu-men')"
-            :props="{ checkStrictly: true,expandTrigger: 'hover' }" collapse-tags :show-all-levels="false" clearable
+            :props="{ multiple: true, checkStrictly: true,expandTrigger: 'hover' }" collapse-tags :show-all-levels="false" clearable
             @change="selcts()" size="small" style="margin-bottom: 10px;width:180px"
           ></el-cascader>
 
@@ -90,8 +90,9 @@
                     <template slot-scope="scope">
                         <div v-for="(items, indexs) in scope.row.personWorkHoursWages" :key="indexs" @click="showReportDetail(scope.row,item,0)" :class="`${scope.row.departmentCascade== '小计' ? '' : 'colorText'}`">
                             <div v-if="items.crateDate == item">
-                               <div> {{items.workTime}}分钟 </div> 
-                               <div>{{items.cost}}元</div>
+                               <div style="color: black;"> {{items.workTime}}分钟  {{items.cost}}元</div> 
+                               <div>{{items.planWorkTime}}分钟  {{items.planCost}}元</div>
+                               <div style="color: red;">{{items.surplusTime}}分钟  {{items.surplusCost}}元</div>
                             </div>
                         </div>
                     </template>
@@ -889,13 +890,18 @@ export default {
     },
     //人员工时工价表数据
     getPersonWorkHoursWagesList(){
+        let deptArr = []
+        for(var i in this.departmentIdArray){
+          let itemList = this.departmentIdArray[i] 
+          deptArr.push(itemList[itemList.length - 1])
+        }
         this.listLoading=true
         this.http.post( "/report/getPersonWorkHoursWagesList", {
             startDate:this.rangeDatas[0],
             endDate:this.rangeDatas[1],
             pageIndex: this.page,
             pageSize: this.size,
-            deptId:this.departmentIdArray[this.departmentIdArray.length - 1],
+            deptIds:deptArr.join(','),
             userId:this.userId
         },
         res => {
@@ -962,12 +968,17 @@ export default {
     //工序实际工时表
     getProcedureRealTimeProgressList(){
       this.listLoading=true
+      let deptArr = []
+        for(var i in this.departmentIdArray){
+          let itemList = this.departmentIdArray[i] 
+          deptArr.push(itemList[itemList.length - 1])
+        }
         this.http.post( "/report/getProcedureRealTimeProgressList", {
             startDate:this.rangeDatas[0],
             endDate:this.rangeDatas[1],
             pageIndex: this.page,
             pageSize: this.size,
-            deptId:this.departmentIdArray[this.departmentIdArray.length - 1],
+            deptIds:deptArr.join(','),
             userId:this.userId
         },
         res => {
@@ -991,12 +1002,17 @@ export default {
     //部门生产统计表
     getDpetStatisticsProgressList(){
       this.listLoading=true
+      let deptArr = []
+        for(var i in this.departmentIdArray){
+          let itemList = this.departmentIdArray[i] 
+          deptArr.push(itemList[itemList.length - 1])
+        }
         this.http.post( "/report/getDpetStatisticsProgressList", {
             startDate:this.rangeDatas[0],
             endDate:this.rangeDatas[1],
             pageIndex: this.page,
             pageSize: this.size,
-            deptId:this.departmentIdArray[this.departmentIdArray.length - 1],
+            deptIds:deptArr.join(','),
         },
         res => {
           if (res.code == "ok") {
@@ -1019,12 +1035,17 @@ export default {
     //计划实际工时表
     getPlanRealTimeProgressList(){
       this.listLoading=true
+      let deptArr = []
+        for(var i in this.departmentIdArray){
+          let itemList = this.departmentIdArray[i] 
+          deptArr.push(itemList[itemList.length - 1])
+        }
         this.http.post( "/report/getPlanRealTimeProgressList", {
             startDate:this.rangeDatas[0],
             endDate:this.rangeDatas[1],
             pageIndex: this.page,
             pageSize: this.size,
-            deptId:this.departmentIdArray[this.departmentIdArray.length - 1],
+            deptIds:deptArr.join(','),
             userId:this.userId
         },
         res => {
@@ -1048,12 +1069,17 @@ export default {
     //人员工时工价表数据
     getWorkReportQuery(){
       this.listLoading=true
+      let deptArr = []
+        for(var i in this.departmentIdArray){
+          let itemList = this.departmentIdArray[i] 
+          deptArr.push(itemList[itemList.length - 1])
+        }
         this.http.post( "/report/workReportQuery", {
             startDate:this.rangeDatas[0],
             endDate:this.rangeDatas[1],
             pageIndex: this.page,
             pageSize: this.size,
-            deptId:this.departmentIdArray[this.departmentIdArray.length - 1],
+            deptIds:deptArr.join(','),
             userId:this.userId,
             productId:this.productId,
             vehicleNum:this.vehicleNum,
@@ -1107,12 +1133,17 @@ export default {
     },
     //车间工位计划表
     getPlanDataWithStation(deptId){
+      let deptArr = []
+        for(var i in this.departmentIdArray){
+          let itemList = this.departmentIdArray[i] 
+          deptArr.push(itemList[itemList.length - 1])
+        }
       let param={
         startDate:this.rangeDatas[0],
         endDate:this.rangeDatas[1],
         pageIndex: this.page,
         pageSize: this.size,
-        stationId:this.departmentIdArray[this.departmentIdArray.length - 1],
+        stationIds:deptArr.join(','),
       }
       if(deptId){
         this.exportDeptId=deptId
@@ -1327,26 +1358,31 @@ export default {
     var url = "/report";
     var fName = "";
     var sl = {}
+    let deptArr = []
+    for(var i in this.departmentIdArray){
+      let itemList = this.departmentIdArray[i] 
+      deptArr.push(itemList[itemList.length - 1])
+    }
     if (this.ins == 0) {  
         fName = '人员工时工价表_' + '.xlsx';
         url += "/exportPersonWorkHoursWorkTime";
         sl.startDate=this.rangeDatas[0];
         sl.endDate=this.rangeDatas[1];
-        sl.deptId=this.departmentIdArray[this.departmentIdArray.length-1];
+        sl.deptIds=deptArr.join(',');
         sl.userId=this.userId;
     } else if (this.ins == 1) {
         fName = '工序实时进度表_' + '.xlsx';
         url += "/exportProcedureRealTimeProgressList";
         sl.startDate=this.rangeDatas[0];
         sl.endDate=this.rangeDatas[1];
-        sl.deptId=this.departmentIdArray[this.departmentIdArray.length-1];
+        sl.deptIds=deptArr.join(',');
         sl.userId=this.userId;
     }else if (this.ins == 2) {
         fName = '报工详情表_' + '.xlsx';
         url += "/exportWorkReportQuery";
         sl.startDate=this.rangeDatas[0];
         sl.endDate=this.rangeDatas[1];
-        sl.deptId=this.departmentIdArray[this.departmentIdArray.length-1];
+        sl.deptIds=deptArr.join(',');
         sl.userId=this.userId;
         sl.vehicleNum=this.vehicleNum;
         sl.steelNum=this.steelNum;
@@ -1356,14 +1392,14 @@ export default {
         url += "/exportPlanRealTimeProgressList";
         sl.startDate=this.rangeDatas[0];
         sl.endDate=this.rangeDatas[1];
-        sl.deptId=this.departmentIdArray[this.departmentIdArray.length-1];
+        sl.deptIds=deptArr.join(',');
         sl.userId=this.userId;
     } else if (this.ins == 4) {
         fName = '部门生产统计表_' + '.xlsx';
         url += "/exportDpetStatisticsProgressList";
         sl.startDate=this.rangeDatas[0];
         sl.endDate=this.rangeDatas[1];
-        sl.deptId=this.departmentIdArray[this.departmentIdArray.length-1];
+        sl.deptIds=deptArr.join(',');
     }
     else if (this.ins == 5) {
         fName = '月度生产件数表_' + '.xlsx';
@@ -1378,7 +1414,7 @@ export default {
         sl.endDate=this.rangeDatas[1];
         if(!this.personnelFlag){
           url += "/exportPlanDataWithStation";
-          sl.deptId=this.departmentIdArray[this.departmentIdArray.length-1];
+          sl.deptIds=deptArr.join(',');
           if(this.exportDeptId){
           sl.filterDeptId=this.exportDeptId;
           sl.isFilterDept=1

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/en.json

@@ -26,7 +26,8 @@
     "basicDataManagemen": "Basic Data Managemen",
     "basicSystemSettings": "Basic System Settings",
     "roleRightsManagement": "Role Rights Management",
-    "gongshitongji":"工时统计表"
+    "gongshitongji":"工时统计表",
+    "caiwushenhe":"财务审核"
   },
   "role": {
     "ordinaryEmployees": "Ordinary employees",

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/i18n/zh.json

@@ -28,7 +28,8 @@
     "roleRightsManagement": "角色权限管理",
     "projectFormSettings": "项目表单设置",
     "budgetReview":"预估工时审核",
-    "gongshitongji":"工时统计表"
+    "gongshitongji":"工时统计表",
+    "caiwushenhe":"财务审核"
   },
   "role": {
     "ordinaryEmployees": "普通员工",

+ 16 - 0
fhKeeper/formulahousekeeper/timesheet/src/routes.js

@@ -93,6 +93,9 @@ import projectForm from './views/project/projectForm'
 // 预算工时审核
 import budgetReview from './views/project/budgetReview'
 
+// 财务审核
+import financeAudit from './views/financeAudit/financeAudit.vue'
+
 Vue.use(Router)
 
 export const fixedRouter = [
@@ -457,6 +460,19 @@ export const allRouters = [//组织架构
         // 其他信息
         meta: { text: 'navigation.approvalFlowSettings' } 
     },
+    {
+        
+        path: '/',
+        component: Home,
+        name: '财务审核',
+        iconCls: 'iconfont firerock-iconliucheng',
+        leaf: true,//只有一个节点
+        children: [
+            { path: '/financeAudit', component: financeAudit, name: '财务审核' },
+        ],
+        // 其他信息
+        meta: { text: 'navigation.caiwushenhe' } 
+    },
     //设置时间类型
     // {
         

+ 5 - 2
fhKeeper/formulahousekeeper/timesheet/src/views/Home.vue

@@ -193,8 +193,8 @@
 
             <section class="content-container">
                 <div class="contentMask" v-if="vTourFlg"></div>
-                <div class="grid-content bg-purple-light">
-                    <el-col :span="24" class="content-wrapper">
+                <div class="grid-content h-full bg-purple-light">
+                    <el-col :span="24" class="content-wrapper h-full">
                         <transition name="fade" mode="out-in">
                             <router-view></router-view>
                         </transition>
@@ -1127,6 +1127,9 @@
             top: 60px;
             bottom: 0px;
             overflow: hidden;
+            .h-full {
+                height: 100%;
+            }
             aside {
                 flex: 0 0 230px;
                 width: 230px;

+ 211 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/financeAudit/financeAudit.vue

@@ -0,0 +1,211 @@
+<template>
+    <div class='financeAudit'>
+        <div class="fAd_hrader">
+            <div class="items">
+                <div class="label">年月:</div>
+                <div class="value">
+                    <el-date-picker v-model="tableForm.dates" type="monthrange" range-separator="至" start-placeholder="开始日期"
+                        @change="getFinanceAuditTableData()" size="small" value-format="yyyy-MM" end-placeholder="结束日期">
+                    </el-date-picker>
+                </div>
+            </div>
+            <div class="items">
+                <div class="label">审核状态:</div>
+                <div class="value">
+                    <el-select v-model="tableForm.status" placeholder="请选择" size="small"
+                        @change="getFinanceAuditTableData()">
+                        <el-option v-for="item in statusOptions" :key="item.value" :label="item.label" :value="item.value">
+                        </el-option>
+                    </el-select>
+                </div>
+            </div>
+        </div>
+        <div class="fAd_content">
+            <el-table :data="financeAuditTableData" border style="width: 100%;height: 100%;"
+                v-loading="allLoading.tableLoading">
+                <el-table-column prop="reportYrmnth" label="日报年月" align="center">
+                    <template slot-scope="scope">
+                        <el-button type="text" @click="toDetail()">{{ scope.row.reportYrmnth }}</el-button>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="reviewerName" label="审核人" align="center"></el-table-column>
+                <el-table-column prop="reviewTime" label="审核时间" align="center"></el-table-column>
+                <el-table-column prop="reviewStatus" label="状态" align="center">
+                    <template slot-scope="scope">
+                        {{ scope.row.reviewStatus == 1 ? '未审核' : '已审核' }}
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" v-if="tableForm.status == 1" fixed="right">
+                    <template slot-scope="scope">
+                        <el-button @click="audit(scope.row)" type="text">审核</el-button>
+                        <el-button type="text" @click="toDetail()">查看详情</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <div class="fAd_footer">
+            <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
+                :current-page="paging.pageIndex" :page-sizes="[50, 100, 200, 500]" :page-size="paging.pageSize"
+                layout="total, prev, pager, next, sizes" :total="paging.total">
+            </el-pagination>
+        </div>
+    </div>
+</template>
+
+<script>
+export default {
+    name: '',
+    components: {},
+    props: {},
+    data() {
+        return {
+            tableForm: {
+                dates: [],
+                status: 1,
+            },
+            financeAuditTableData: [],
+            statusOptions: [
+                { value: 1, label: '未审核' },
+                { value: 2, label: '已审核' },
+            ],
+            paging: {
+                pageSize: 50,
+                pageIndex: 1,
+                total: 0
+            },
+            allLoading: {
+                tableLoading: false
+            }
+        }
+    },
+    computed: {},
+    watch: {},
+    created() { },
+    mounted() {
+        let firstMonth = this.dayjs().startOf('year').format('YYYY-MM')
+        let currentMonth = this.dayjs().format('YYYY-MM')
+        this.tableForm.dates = [firstMonth, currentMonth]
+        this.getFinanceAuditTableData()
+    },
+    methods: {
+        toDetail() {
+            this.$router.push({
+                path: '/cost',
+                query: {
+                    startDate: this.tableForm.dates[0],
+                    endDate: this.tableForm.dates[1]
+                }
+            })
+        },
+        audit(item) {
+            this.$confirm(`您确定要审核通过${item.reportYrmnth}月的工时报告吗?`, '财务审核提示', {
+                confirmButtonText: '确定',
+                cancelButtonText: '取消',
+                type: 'warning'
+            }).then(() => {
+                this.postData('/financial-audit/audit', { id: item.id }).then(res => {
+                    this.$message({
+                        type: 'success',
+                        message: '审核成功!'
+                    });
+                    this.getFinanceAuditTableData();
+                });
+            }).catch(() => {});
+        },
+        getFinanceAuditTableData() {
+            this.allLoading.tableLoading = true
+            let param = {
+                pageSize: this.paging.pageSize,
+                pageIndex: this.paging.pageIndex,
+                startDate: this.tableForm.dates[0] + '-01' || '',
+                endDate: this.tableForm.dates[1] + '-01' || '',
+                status: this.tableForm.status || '',
+            }
+            this.postData('/financial-audit/list', param).then(({ data }) => {
+                const { total, records } = data
+                this.financeAuditTableData = records
+                this.paging.total = total
+            }).finally(() => {
+                this.allLoading.tableLoading = false
+            })
+        },
+        handleSizeChange(val) {
+            this.paging.pageSize = val
+            this.paging.pageIndex = 1
+            this.getFinanceAuditTableData()
+        },
+        handleCurrentChange(val) {
+            this.paging.pageIndex = val
+            this.getFinanceAuditTableData()
+        },
+        // 单独封装请求
+        async postData(urls, param) {
+            return new Promise((resolve, reject) => {
+                this.http.post(urls, { ...param },
+                    res => {
+                        if (res.code == 'ok') {
+                            resolve(res)
+                        } else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            })
+                            reject(res)
+                        }
+                        resolve(res)
+                    },
+                    error => {
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                        reject(error)
+                    }
+                )
+            });
+        }
+    },
+}
+</script>
+<style scoped lang='scss'>
+* {
+    box-sizing: border-box;
+}
+
+.financeAudit {
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+
+    .fAd_hrader {
+        background-color: #F2F2F2;
+        padding: 10px 15px;
+        display: flex;
+
+        .items {
+            display: flex;
+            align-items: center;
+            margin-right: 20px;
+
+            &:last-child {
+                margin-right: 0;
+            }
+
+            .label {
+                margin-right: 10px;
+            }
+        }
+    }
+
+    .fAd_content {
+        flex: 1;
+    }
+
+    .fAd_footer {
+        background: #F2F2F2;
+        padding: 10px 20px;
+        display: flex;
+        justify-content: flex-end;
+    }
+}
+</style>

+ 5 - 0
fhKeeper/formulahousekeeper/timesheet/src/views/project/cost.vue

@@ -1472,6 +1472,11 @@
                 }
                 this.exportParam.dateRange = this.dateRange;
             }
+            if(this.$route.query && this.$route.query.endDate && this.$route.query.startDate) {
+                const { endDate, startDate } = this.$route.query
+                const lastDay = this.dayjs(`${endDate}-01`).endOf('month').format('YYYY-MM-DD');
+                this.dateRange = [startDate+'-01', lastDay];
+            }
             this.radio = this.$t('other.project')
             this.getEchart();
             var _this = this;

+ 49 - 22
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/list_import.vue

@@ -42,7 +42,7 @@
                     <el-button @click="approveAll" style="margin-left:10px;" :disabled="list.length==0" size="small">{{ $t('throughwithoneclick') }}</el-button>
                 </el-form-item>
                 <el-form-item style="margin-left:20px;" v-if="permissions.importAudit">
-                   <el-link type="primary" @click="recordList(),recordDialogVisible = true,pageIndexList = 1,pageSizeList = 20">{{ $t('Auditrecords') }}</el-link>
+                   <el-link type="primary" @click="recordList(),showRecordDialogVisible()">{{ $t('Auditrecords') }}</el-link>
                 </el-form-item>
             </el-form>
         </el-col>
@@ -167,9 +167,9 @@
         </el-col>
 
         <!-- 审核记录弹窗 -->
-        <el-dialog :title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="800px" :before-close="handleClose">
-            <div style="height: 430px">
-                <el-table :data="recordLists" style="width: 100%" height="400" v-loading="recordLoading">
+        <el-dialog :title="$t('Auditrecords')" :visible.sync="recordDialogVisible" width="80vw" top="7.8vh" :before-close="handleClose">
+            <div style="height: 65vh" ref="recordListsDivRef" v-loading="recordLoading">
+                <el-table :data="recordLists" style="width: 100%;" :height="recordListsTableHeight">
                     <el-table-column prop="userName" :label="$t('other.operator')" width="150">
                         <template slot-scope="scope">
                             <div>
@@ -184,21 +184,21 @@
                         <template slot-scope="scope">
                             <div>
                                 <div v-if="scope.row.membdateList.length > 1">
-                                    <el-popover placement="top" width="400" trigger="hover">
-                                    <div>
-                                        <span v-for="(item, index) in scope.row.membdateList" :key="index">
-                                            <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText></span>
-                                            <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
-                                            /{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
-                                        </span>
-                                    </div>
-                                    <div slot="reference" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 180px;">
-                                        <span v-for="(item, index) in scope.row.membdateList" :key="index">
-                                            <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText></span>
-                                            <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
-                                            /{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
-                                        </span>
-                                    </div>
+                                    <el-popover placement="top" width="500" trigger="hover">
+                                        <div class="popoverDiv">
+                                            <div v-for="(item, index) in scope.row.membdateList" :key="index" class="popoverDivItem">
+                                                <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText></span>
+                                                <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
+                                                /{{item.createDate}}
+                                            </div>
+                                        </div>
+                                        <div slot="reference" style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 180px;">
+                                            <span v-for="(item, index) in scope.row.membdateList" :key="index">
+                                                <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText></span>
+                                                <span v-if="user.userNameNeedTranslate != '1'">{{item.userName}}</span>
+                                                /{{item.createDate}} <span v-if="scope.row.membdateList.length > 1 && scope.row.membdateList.length - 1 != index">,</span>
+                                            </span>
+                                        </div>
                                     </el-popover>
                                 </div>
                                 <div style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width: 180px;" v-else>
@@ -272,11 +272,23 @@
                 totals: 0,
                 pageIndexList: 1,
                 pageSizeList: 20,
-                recordLoading: false
+                recordLoading: false,
+                recordListsTableHeight: '400'
 
             };
         },
         methods: {
+            showRecordDialogVisible() {
+                this.recordDialogVisible = true
+                this.pageIndexList = 1
+                this.pageSizeList = 20
+                setTimeout(() => {
+                    let element = this.$refs.recordListsDivRef.offsetHeight
+                    this.recordListsTableHeight = element - 55
+                    console.log(this.recordListsTableHeight, '<=== 高度')
+                }, 1000)
+                
+            },
             // 获取审核记录
             recordList() {
                 // this.recordDialogVisible = true
@@ -287,7 +299,9 @@
                     pageSize: this.pageSizeList
                 },
                 res => {
-                    this.recordLoading = false
+                    setTimeout(() => {
+                        this.recordLoading = false
+                    }, 1000)
                     if (res.code == "ok") {
                         console.log(res.data, '数据')
                         this.recordLists = res.data.records
@@ -300,7 +314,9 @@
                     }
                 },
                 error => {
-                    this.recordLoading = false
+                    setTimeout(() => {
+                        this.recordLoading = false
+                    }, 1000)
                     this.$message({
                         message: error,
                         type: "error"
@@ -629,4 +645,15 @@
     padding-left: 20px;
 }
 
+.popoverDiv {
+    display: flex;
+    flex-wrap: wrap;
+    max-height: 400px;
+    overflow-y: auto;
+    .popoverDivItem {
+        width: 33%;
+        text-align: center;
+    }
+}
+
 </style>