Bladeren bron

合并无匹配的数据直接新增

anderx 1 jaar geleden
bovenliggende
commit
beae4692a0
1 gewijzigde bestanden met toevoegingen van 2 en 4 verwijderingen
  1. 2 4
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

+ 2 - 4
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -928,7 +928,7 @@ public class SysUserServiceImpl implements ISysUserService
             amount = amount.add(BigDecimal.valueOf(e.getCheckDuration()));
         }
         UserRecord userRecord = userRecordMapper.selectByPrimaryKey(in.getId());
-        if (amount.compareTo(BigDecimal.valueOf(userRecord.getSumDuration())) > 0){
+        if (amount.compareTo(BigDecimal.valueOf(userRecord.getCheckDuration())) > 0){
             throw new ServiceException(String.format("核算统计[%s]间超过打卡工时[%s],请重新输入!",amount,userRecord.getSumDuration()));
         }
         for (ProjectStaffRecord projectStaffRecord : in.getList()) {
@@ -1023,7 +1023,6 @@ public class SysUserServiceImpl implements ISysUserService
         if (!list2.isEmpty()){
             //判定多打卡状态是否正常
             for (UserRecord e : list2) {
-                if (e.getStatus()==0){
                     e.getRecordTime().toInstant();
                     LocalDateTime localDateTime = LocalDateTime.ofInstant(e.getRecordTime().toInstant(), ZoneId.systemDefault());
                     LocalDate localDate = localDateTime.toLocalDate();
@@ -1032,12 +1031,11 @@ public class SysUserServiceImpl implements ISysUserService
                     for (ProjectStaffRecord e2 : list3) {
                         sum = sum.add(BigDecimal.valueOf(e2.getCheckDuration()));
                     }
-                    BigDecimal sum2 = BigDecimal.valueOf(e.getSumDuration());
+                    BigDecimal sum2 = BigDecimal.valueOf(e.getCheckDuration());
                     if (sum.compareTo(sum2) != 0){
                         String dateStr = DateUtils.parseStrYYYYnMMyDD(e.getRecordTime());
                         return  AjaxResult.error(String.format("[%S]考勤[%S]多打卡时间[%s != %s],请处理后再提交",e.getName(),dateStr,sum,sum2));
                     }
-                }
             }
         }
         return AjaxResult.success();