Commit f22dd4a469593778ed3e912342c87627c196738e
1 parent
772893f3
优化签到流程
Showing
10 changed files
with
130 additions
and
80 deletions
Bsth-admin/src/main/java/com/ruoyi/common/cache/NowSchedulingCache.java
| @@ -3,25 +3,28 @@ package com.ruoyi.common.cache; | @@ -3,25 +3,28 @@ package com.ruoyi.common.cache; | ||
| 3 | import cn.hutool.core.collection.CollectionUtil; | 3 | import cn.hutool.core.collection.CollectionUtil; |
| 4 | import cn.hutool.core.map.MapUtil; | 4 | import cn.hutool.core.map.MapUtil; |
| 5 | import com.ruoyi.common.utils.StringUtils; | 5 | import com.ruoyi.common.utils.StringUtils; |
| 6 | +import com.ruoyi.domain.DriverScheduling; | ||
| 6 | import com.ruoyi.driver.mapper.DriverSchedulingMapper; | 7 | import com.ruoyi.driver.mapper.DriverSchedulingMapper; |
| 7 | import com.ruoyi.errorScheduling.domain.ErrorJobcode; | 8 | import com.ruoyi.errorScheduling.domain.ErrorJobcode; |
| 8 | import com.ruoyi.errorScheduling.service.IErrorJobcodeService; | 9 | import com.ruoyi.errorScheduling.service.IErrorJobcodeService; |
| 9 | import com.ruoyi.in.domain.SignIn; | 10 | import com.ruoyi.in.domain.SignIn; |
| 10 | -import com.ruoyi.domain.DriverScheduling; | 11 | +import com.ruoyi.service.BigViewServiceV1; |
| 11 | import com.ruoyi.service.ThreadJobService; | 12 | import com.ruoyi.service.ThreadJobService; |
| 12 | import com.ruoyi.utils.ConstDateUtil; | 13 | import com.ruoyi.utils.ConstDateUtil; |
| 13 | -import lombok.extern.slf4j.Slf4j; | ||
| 14 | import org.apache.commons.collections4.CollectionUtils; | 14 | import org.apache.commons.collections4.CollectionUtils; |
| 15 | import org.slf4j.Logger; | 15 | import org.slf4j.Logger; |
| 16 | import org.slf4j.LoggerFactory; | 16 | import org.slf4j.LoggerFactory; |
| 17 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | import org.springframework.stereotype.Component; | 18 | import org.springframework.stereotype.Component; |
| 18 | -import org.springframework.stereotype.Service; | ||
| 19 | 19 | ||
| 20 | import java.util.*; | 20 | import java.util.*; |
| 21 | import java.util.concurrent.ConcurrentHashMap; | 21 | import java.util.concurrent.ConcurrentHashMap; |
| 22 | 22 | ||
| 23 | @Component | 23 | @Component |
| 24 | public class NowSchedulingCache { | 24 | public class NowSchedulingCache { |
| 25 | + @Autowired | ||
| 26 | + private BigViewServiceV1 bigViewServiceV1; | ||
| 27 | + | ||
| 25 | private final DriverSchedulingMapper schedulingMapper; | 28 | private final DriverSchedulingMapper schedulingMapper; |
| 26 | static Logger log = LoggerFactory.getLogger(SchedulingCache.class); | 29 | static Logger log = LoggerFactory.getLogger(SchedulingCache.class); |
| 27 | /** | 30 | /** |
| @@ -151,17 +154,43 @@ public class NowSchedulingCache { | @@ -151,17 +154,43 @@ public class NowSchedulingCache { | ||
| 151 | * @param index | 154 | * @param index |
| 152 | * @param signIn | 155 | * @param signIn |
| 153 | */ | 156 | */ |
| 154 | - public void updateCacheByJobCode(String remark, String key, Integer index, SignIn signIn) { | 157 | + public void updateCacheByJobCode(String remark, String key, Integer index, SignIn signIn,boolean isNew,DriverScheduling sourceScheduling) { |
| 158 | + if(isNew && Objects.nonNull(sourceScheduling)){ | ||
| 159 | + if(Objects.isNull(cacheNowDayScheduling.get(key))){ | ||
| 160 | + return; | ||
| 161 | + } | ||
| 162 | + | ||
| 163 | + int size = CollectionUtils.size(cacheNowDayScheduling.get(key).get(signIn.getJobCode())); | ||
| 164 | + for (int i = 0; i < size; i++) { | ||
| 165 | + if(Objects.equals(cacheNowDayScheduling.get(key).get(signIn.getJobCode()).get(i).getId(),sourceScheduling.getId())){ | ||
| 166 | + index = i; | ||
| 167 | + break; | ||
| 168 | + } | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + | ||
| 172 | + | ||
| 173 | + | ||
| 174 | + } | ||
| 155 | if (key.equals(ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(0))) | 175 | if (key.equals(ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(0))) |
| 156 | || key.equals(ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1)))) { | 176 | || key.equals(ConstDateUtil.formatDate(ConstDateUtil.getTheSpecifiedNumberOfDaysOfTime(-1)))) { |
| 157 | DriverScheduling scheduling = cacheNowDayScheduling.get(key).get(signIn.getJobCode()).get(index); | 177 | DriverScheduling scheduling = cacheNowDayScheduling.get(key).get(signIn.getJobCode()).get(index); |
| 158 | scheduling.setSignInId(signIn.getId()); | 178 | scheduling.setSignInId(signIn.getId()); |
| 159 | scheduling.setRemark(remark); | 179 | scheduling.setRemark(remark); |
| 160 | - scheduling.setExType(signIn.getExType()); | 180 | + |
| 181 | + Integer exType = signIn.getExType(); | ||
| 182 | + if(isNew){ | ||
| 183 | + exType = bigViewServiceV1.isSignStatusWineEnum(signIn)?3:bigViewServiceV1.isSignStatusDelayEnum(signIn)?1:Objects.equals(2,signIn.getExType())?2:0; | ||
| 184 | + } | ||
| 185 | + scheduling.setExType(exType); | ||
| 161 | scheduling.setSignTime(signIn.getCreateTime()); | 186 | scheduling.setSignTime(signIn.getCreateTime()); |
| 162 | scheduling.setSignType(signIn.getType()); | 187 | scheduling.setSignType(signIn.getType()); |
| 163 | scheduling.setAlcoholFlag(signIn.getAlcoholFlag()); | 188 | scheduling.setAlcoholFlag(signIn.getAlcoholFlag()); |
| 164 | scheduling.setAlcoholIntake(signIn.getAlcoholIntake()); | 189 | scheduling.setAlcoholIntake(signIn.getAlcoholIntake()); |
| 190 | + | ||
| 191 | + | ||
| 192 | + cacheNowDayScheduling.get(key).get(signIn.getJobCode()).set(index,scheduling); | ||
| 165 | } | 193 | } |
| 166 | } | 194 | } |
| 195 | + | ||
| 167 | } | 196 | } |
Bsth-admin/src/main/java/com/ruoyi/domain/DriverSchedulingV1.java
| 1 | package com.ruoyi.domain; | 1 | package com.ruoyi.domain; |
| 2 | 2 | ||
| 3 | +import com.baomidou.mybatisplus.annotation.TableField; | ||
| 3 | import com.baomidou.mybatisplus.annotation.TableName; | 4 | import com.baomidou.mybatisplus.annotation.TableName; |
| 5 | +import lombok.Data; | ||
| 4 | 6 | ||
| 5 | /** | 7 | /** |
| 6 | * @author liujun | 8 | * @author liujun |
| 7 | * @date 2024年09月23日 15:36 | 9 | * @date 2024年09月23日 15:36 |
| 8 | */ | 10 | */ |
| 9 | @TableName("scheduling") | 11 | @TableName("scheduling") |
| 12 | +@Data | ||
| 10 | public class DriverSchedulingV1 extends DriverScheduling { | 13 | public class DriverSchedulingV1 extends DriverScheduling { |
| 14 | + @TableField(exist = false) | ||
| 15 | + private Integer index; | ||
| 11 | } | 16 | } |
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| @@ -450,10 +450,12 @@ public class DriverServiceImpl implements IDriverService { | @@ -450,10 +450,12 @@ public class DriverServiceImpl implements IDriverService { | ||
| 450 | vo = DriverResponseVo.createDriverResponseVo(recommendation.getTimestamps(), driver, SIGN_IN_OUT_STRING, !alcoholFlag, schedulingFlag, recommendation.getNbbm(), recommendation.getLpName(), recommendation.getLineName()); | 450 | vo = DriverResponseVo.createDriverResponseVo(recommendation.getTimestamps(), driver, SIGN_IN_OUT_STRING, !alcoholFlag, schedulingFlag, recommendation.getNbbm(), recommendation.getLpName(), recommendation.getLineName()); |
| 451 | } | 451 | } |
| 452 | 452 | ||
| 453 | + | ||
| 453 | // 如果驾驶员酒精测试在之前不合格 必须重测 | 454 | // 如果驾驶员酒精测试在之前不合格 必须重测 |
| 454 | - if ("驾驶员".equals(driver.getPosts())) { | 455 | + if ("驾驶员".equals(driver.getPosts()) && BC_TYPE_OUT.equals(recommendation.getBcType())) { |
| 455 | String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + driver.getJobCode(); | 456 | String key = REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW + ConstDateUtil.formatDate("yyyyMMdd") + ":" + driver.getJobCode(); |
| 456 | Integer count = redisCache.getCacheObject(key); | 457 | Integer count = redisCache.getCacheObject(key); |
| 458 | + log.info("key:[{}],count:[{}]",key,count); | ||
| 457 | if (!Objects.isNull(count) && !Objects.isNull(vo)) { | 459 | if (!Objects.isNull(count) && !Objects.isNull(vo)) { |
| 458 | vo.setCheckAlcohol(alcoholFlag); | 460 | vo.setCheckAlcohol(alcoholFlag); |
| 459 | } | 461 | } |
Bsth-admin/src/main/java/com/ruoyi/in/controller/SignInController.java
| @@ -12,13 +12,10 @@ import com.ruoyi.in.domain.SignIn; | @@ -12,13 +12,10 @@ import com.ruoyi.in.domain.SignIn; | ||
| 12 | import com.ruoyi.in.service.ISignInService; | 12 | import com.ruoyi.in.service.ISignInService; |
| 13 | import com.ruoyi.in.service.SignInServiceV1; | 13 | import com.ruoyi.in.service.SignInServiceV1; |
| 14 | import com.ruoyi.pojo.response.SignInResponseVo; | 14 | import com.ruoyi.pojo.response.SignInResponseVo; |
| 15 | -import com.ruoyi.utils.ConstDateUtil; | ||
| 16 | import io.swagger.annotations.Api; | 15 | import io.swagger.annotations.Api; |
| 17 | import io.swagger.annotations.ApiOperation; | 16 | import io.swagger.annotations.ApiOperation; |
| 18 | import io.swagger.annotations.ApiParam; | 17 | import io.swagger.annotations.ApiParam; |
| 19 | import lombok.extern.slf4j.Slf4j; | 18 | import lombok.extern.slf4j.Slf4j; |
| 20 | -import org.apache.commons.lang3.RandomUtils; | ||
| 21 | -import org.apache.commons.lang3.StringUtils; | ||
| 22 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 23 | import org.springframework.validation.annotation.Validated; | 20 | import org.springframework.validation.annotation.Validated; |
| 24 | import org.springframework.web.bind.annotation.*; | 21 | import org.springframework.web.bind.annotation.*; |
| @@ -26,13 +23,7 @@ import org.springframework.web.bind.annotation.*; | @@ -26,13 +23,7 @@ import org.springframework.web.bind.annotation.*; | ||
| 26 | import javax.servlet.http.HttpServletRequest; | 23 | import javax.servlet.http.HttpServletRequest; |
| 27 | import javax.servlet.http.HttpServletResponse; | 24 | import javax.servlet.http.HttpServletResponse; |
| 28 | import java.io.IOException; | 25 | import java.io.IOException; |
| 29 | -import java.text.MessageFormat; | ||
| 30 | -import java.util.Date; | ||
| 31 | import java.util.List; | 26 | import java.util.List; |
| 32 | -import java.util.Objects; | ||
| 33 | -import java.util.concurrent.TimeUnit; | ||
| 34 | - | ||
| 35 | -import static com.ruoyi.common.redispre.GlobalRedisPreName.REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW; | ||
| 36 | 27 | ||
| 37 | /** | 28 | /** |
| 38 | * 签到Controller | 29 | * 签到Controller |
| @@ -110,36 +101,36 @@ public class SignInController extends BaseController { | @@ -110,36 +101,36 @@ public class SignInController extends BaseController { | ||
| 110 | @PostMapping("/newAdd") | 101 | @PostMapping("/newAdd") |
| 111 | @ApiOperation("新增签到(设备传入)") | 102 | @ApiOperation("新增签到(设备传入)") |
| 112 | public AjaxResult addSignIn(@ApiParam @RequestBody @Validated SignIn signIn) throws FileUploadException, IOException { | 103 | public AjaxResult addSignIn(@ApiParam @RequestBody @Validated SignIn signIn) throws FileUploadException, IOException { |
| 113 | - String key = MessageFormat.format("sign:assignment:{0}", signIn.getJobCode()); | ||
| 114 | - if (redisCache.hasKey(key)) { | ||
| 115 | - log.info(" sing method old sign :[{}]", signIn); | ||
| 116 | - return signInService.addSignIn(signIn); | ||
| 117 | - } | ||
| 118 | - | ||
| 119 | - Integer num = RandomUtils.nextInt(0, 10); | ||
| 120 | - if (num < 3) { | ||
| 121 | - redisCache.setCacheObject(key, num, 5, TimeUnit.MINUTES); | ||
| 122 | - log.info("[{}] sing method 走新的签到方式 :[{}] ", num, signIn); | ||
| 123 | - key = StringUtils.join(REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW, ConstDateUtil.FAST_YYYY_MM_DD.format(new Date()), ":", signIn.getJobCode()); | ||
| 124 | - Integer count = redisCache.getCacheObject(key); | ||
| 125 | - try { | 104 | +// String key = MessageFormat.format("sign:assignment:{0}", signIn.getJobCode()); |
| 105 | +// if (redisCache.hasKey(key)) { | ||
| 106 | +// log.info(" sing method old sign :[{}]", signIn); | ||
| 107 | +// return signInService.addSignIn(signIn); | ||
| 108 | +// } | ||
| 109 | +// | ||
| 110 | +// Integer num = RandomUtils.nextInt(0, 10); | ||
| 111 | +// if (num < 3) { | ||
| 112 | +// redisCache.setCacheObject(key, num, 5, TimeUnit.MINUTES); | ||
| 113 | +// log.info("[{}] sing method 走新的签到方式 :[{}] ", num, signIn); | ||
| 114 | +// key = StringUtils.join(REDIS_SIGN_IN_DRIVER_ALCOHOL_OVERFLOW, ConstDateUtil.FAST_YYYY_MM_DD.format(new Date()), ":", signIn.getJobCode()); | ||
| 115 | +// Integer count = redisCache.getCacheObject(key); | ||
| 116 | +// try { | ||
| 126 | return signInServiceV1.addsignInV1(signIn); | 117 | return signInServiceV1.addsignInV1(signIn); |
| 127 | - } catch (Exception e) { | ||
| 128 | - if (Objects.isNull(count)) { | ||
| 129 | - count = 0; | ||
| 130 | - } else { | ||
| 131 | - count = count - 1; | ||
| 132 | - } | ||
| 133 | - if (redisCache.hasKey(key)) { | ||
| 134 | - redisCache.setCacheObject(key, count, 1, TimeUnit.DAYS); | ||
| 135 | - } | ||
| 136 | - log.error("[{}] sing method 走新的签到方式,签到失败 :[{}]", num, signIn, e); | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - log.info("[{}] sing method old sign :[{}]", num, signIn); | ||
| 142 | - return signInService.addSignIn(signIn); | 118 | +// } catch (Exception e) { |
| 119 | +// if (Objects.isNull(count) || count < 1) { | ||
| 120 | +// count = 0; | ||
| 121 | +// } else { | ||
| 122 | +// count = count - 1; | ||
| 123 | +// } | ||
| 124 | +// if (redisCache.hasKey(key)) { | ||
| 125 | +// redisCache.setCacheObject(key, count, 1, TimeUnit.DAYS); | ||
| 126 | +// } | ||
| 127 | +// log.error("[{}] sing method 走新的签到方式,签到失败 :[{}]", num, signIn, e); | ||
| 128 | +// } | ||
| 129 | +// | ||
| 130 | +// } | ||
| 131 | + | ||
| 132 | +// log.info("[{}] sing method old sign :[{}]", num, signIn); | ||
| 133 | +// return signInService.addSignIn(signIn); | ||
| 143 | } | 134 | } |
| 144 | 135 | ||
| 145 | // /** | 136 | // /** |
Bsth-admin/src/main/java/com/ruoyi/in/domain/CalDriverScheduling.java
| 1 | package com.ruoyi.in.domain; | 1 | package com.ruoyi.in.domain; |
| 2 | 2 | ||
| 3 | import com.ruoyi.domain.DriverScheduling; | 3 | import com.ruoyi.domain.DriverScheduling; |
| 4 | +import com.ruoyi.domain.DriverSchedulingV1; | ||
| 4 | import lombok.Data; | 5 | import lombok.Data; |
| 5 | 6 | ||
| 7 | +import java.util.Objects; | ||
| 8 | + | ||
| 6 | /** | 9 | /** |
| 7 | * @author liujun | 10 | * @author liujun |
| 8 | * @date 2024年09月23日 11:29 | 11 | * @date 2024年09月23日 11:29 |
| @@ -17,4 +20,9 @@ public class CalDriverScheduling { | @@ -17,4 +20,9 @@ public class CalDriverScheduling { | ||
| 17 | this.index = index; | 20 | this.index = index; |
| 18 | this.driverScheduling = driverScheduling; | 21 | this.driverScheduling = driverScheduling; |
| 19 | } | 22 | } |
| 23 | + | ||
| 24 | + public CalDriverScheduling(DriverSchedulingV1 driverScheduling) { | ||
| 25 | + this.index = Objects.isNull(driverScheduling) ? null : driverScheduling.getIndex(); | ||
| 26 | + this.driverScheduling = driverScheduling; | ||
| 27 | + } | ||
| 20 | } | 28 | } |
Bsth-admin/src/main/java/com/ruoyi/in/domain/SignIn.java
| @@ -92,7 +92,7 @@ public class SignIn extends BaseEntity { | @@ -92,7 +92,7 @@ public class SignIn extends BaseEntity { | ||
| 92 | @Excel(name = "酒精摄入量") | 92 | @Excel(name = "酒精摄入量") |
| 93 | @ApiModelProperty("酒精摄入量 52.12") | 93 | @ApiModelProperty("酒精摄入量 52.12") |
| 94 | private BigDecimal alcoholIntake; | 94 | private BigDecimal alcoholIntake; |
| 95 | - @Excel(name = "异常类型",readConverterExp = "0=无异常,1=超时异常,2=无排班异常,3=酒精超标异常,200=早签,300=迟到") | 95 | + @Excel(name = "异常类型",readConverterExp = "0=无异常,1=超时异常,2=无排班异常,3=酒精超标异常,20=早签,30=迟到") |
| 96 | @ApiModelProperty("异常类型") | 96 | @ApiModelProperty("异常类型") |
| 97 | private Integer exType; | 97 | private Integer exType; |
| 98 | 98 |
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceImpl.java
| @@ -155,6 +155,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -155,6 +155,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | @Override | 157 | @Override |
| 158 | + @Transactional(rollbackFor = Exception.class) | ||
| 158 | public AjaxResult addSignIn(SignIn signIn) throws IOException { | 159 | public AjaxResult addSignIn(SignIn signIn) throws IOException { |
| 159 | // 查询员工信息 | 160 | // 查询员工信息 |
| 160 | Driver driver = driverMapper.getDriverInfoByJobCode(signIn.getJobCode()); | 161 | Driver driver = driverMapper.getDriverInfoByJobCode(signIn.getJobCode()); |
| @@ -170,16 +171,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -170,16 +171,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 170 | List<DriverScheduling> dto = schedulingService.queryScheduling(signIn.getJobCode(), now); | 171 | List<DriverScheduling> dto = schedulingService.queryScheduling(signIn.getJobCode(), now); |
| 171 | handleSignBody(signIn, driver, globalIndex, now, dto); | 172 | handleSignBody(signIn, driver, globalIndex, now, dto); |
| 172 | 173 | ||
| 173 | - | ||
| 174 | - if (CollectionUtils.isNotEmpty(dto)) { | ||
| 175 | - int size = CollectionUtils.size(dto); | ||
| 176 | - if (size > 0 && globalIndex.getIndex() < size) { | ||
| 177 | - log.info("签到签退数据为:[{}]", dto.get(globalIndex.getIndex())); | ||
| 178 | - } | ||
| 179 | - } else { | ||
| 180 | - log.info("没有签到或签退的数据"); | ||
| 181 | - } | ||
| 182 | - if (PERSONNEL_POSTS_DRIVER.equals(driver.getPosts()) && CollectionUtils.isNotEmpty(dto) && Objects.equals(dto.get(globalIndex.getIndex()).getBcType(), BC_TYPE_OUT)) { | 174 | + if (PERSONNEL_POSTS_DRIVER.equals(driver.getPosts()) && CollectionUtils.isNotEmpty(dto) && Objects.nonNull(dto.get(globalIndex.getIndex())) && Objects.equals(dto.get(globalIndex.getIndex()).getBcType(), BC_TYPE_OUT)) { |
| 183 | AjaxResult result = getAjaxResultByDriverSignInfo(signIn, vo); | 175 | AjaxResult result = getAjaxResultByDriverSignInfo(signIn, vo); |
| 184 | if (!Objects.isNull(result)) { | 176 | if (!Objects.isNull(result)) { |
| 185 | String msg = "签到异常: 请使用手持式酒精测试棒进行酒测"; | 177 | String msg = "签到异常: 请使用手持式酒精测试棒进行酒测"; |
| @@ -191,7 +183,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -191,7 +183,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 191 | uploadImage(signIn, vo); | 183 | uploadImage(signIn, vo); |
| 192 | signInMapper.insertSignIn(signIn); | 184 | signInMapper.insertSignIn(signIn); |
| 193 | // 更新考勤 | 185 | // 更新考勤 |
| 194 | - schedulingService.computedSignInBySignIn(dto, signIn, globalIndex); | 186 | + schedulingService.computedSignInBySignIn(dto, signIn, globalIndex,false,null); |
| 195 | 187 | ||
| 196 | if (TempCache.checkJobCodeExist(signIn.getJobCode())) { | 188 | if (TempCache.checkJobCodeExist(signIn.getJobCode())) { |
| 197 | TempCache.updateSignStatus(signIn.getJobCode()); | 189 | TempCache.updateSignStatus(signIn.getJobCode()); |
| @@ -302,7 +294,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -302,7 +294,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 302 | if (CollectionUtil.isNotEmpty(dto)) { | 294 | if (CollectionUtil.isNotEmpty(dto)) { |
| 303 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), signIn.getRemark(), signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 295 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), signIn.getRemark(), signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 304 | // 更新缓存 | 296 | // 更新缓存 |
| 305 | - nowSchedulingCache.updateCacheByJobCode(signIn.getRemark(), ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | 297 | + nowSchedulingCache.updateCacheByJobCode(signIn.getRemark(), ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn,false,null); |
| 306 | } | 298 | } |
| 307 | 299 | ||
| 308 | // 异常保存到异常异常中 | 300 | // 异常保存到异常异常中 |
| @@ -362,7 +354,7 @@ public class SignInServiceImpl implements ISignInService { | @@ -362,7 +354,7 @@ public class SignInServiceImpl implements ISignInService { | ||
| 362 | for (SignInResponseVo sign : value) { | 354 | for (SignInResponseVo sign : value) { |
| 363 | GlobalIndex globalIndex = new GlobalIndex(); | 355 | GlobalIndex globalIndex = new GlobalIndex(); |
| 364 | checkSignIn(sign.getCreateTime().getTime(), resultMap.get(sign.getJobCode()), globalIndex, sign, drivers.get(sign.getJobCode())); | 356 | checkSignIn(sign.getCreateTime().getTime(), resultMap.get(sign.getJobCode()), globalIndex, sign, drivers.get(sign.getJobCode())); |
| 365 | - schedulingService.computedSignInBySignIn(resultMap.get(sign.getJobCode()), sign, globalIndex); | 357 | + schedulingService.computedSignInBySignIn(resultMap.get(sign.getJobCode()), sign, globalIndex,false,null); |
| 366 | } | 358 | } |
| 367 | } | 359 | } |
| 368 | } | 360 | } |
| @@ -387,9 +379,9 @@ public class SignInServiceImpl implements ISignInService { | @@ -387,9 +379,9 @@ public class SignInServiceImpl implements ISignInService { | ||
| 387 | for (SignIn signIn : signInList) { | 379 | for (SignIn signIn : signInList) { |
| 388 | handlerExOutData(transformMap.get(signIn.getJobCode()), signIn); | 380 | handlerExOutData(transformMap.get(signIn.getJobCode()), signIn); |
| 389 | 381 | ||
| 390 | - schedulingService.computedSignInBySignIn(new ArrayList<>(Arrays.asList(transformMap.get(signIn.getJobCode()))), signIn, new GlobalIndex()); | 382 | + schedulingService.computedSignInBySignIn(new ArrayList<>(Arrays.asList(transformMap.get(signIn.getJobCode()))), signIn, new GlobalIndex(),false,null); |
| 391 | // // 更新缓存 | 383 | // // 更新缓存 |
| 392 | - nowSchedulingCache.updateCacheByJobCode(signIn.getRemark(), ConstDateUtil.formatDate(transformMap.get(signIn.getJobCode()).getScheduleDate()), 0, signIn); | 384 | + nowSchedulingCache.updateCacheByJobCode(signIn.getRemark(), ConstDateUtil.formatDate(transformMap.get(signIn.getJobCode()).getScheduleDate()), 0, signIn,false,null); |
| 393 | signInMapper.updateSignIn(signIn); | 385 | signInMapper.updateSignIn(signIn); |
| 394 | 386 | ||
| 395 | } | 387 | } |
Bsth-admin/src/main/java/com/ruoyi/in/service/impl/SignInServiceV1Impl.java
| @@ -40,13 +40,13 @@ import org.apache.commons.lang3.time.FastDateFormat; | @@ -40,13 +40,13 @@ import org.apache.commons.lang3.time.FastDateFormat; | ||
| 40 | import org.springframework.beans.BeanUtils; | 40 | import org.springframework.beans.BeanUtils; |
| 41 | import org.springframework.beans.factory.annotation.Autowired; | 41 | import org.springframework.beans.factory.annotation.Autowired; |
| 42 | import org.springframework.stereotype.Service; | 42 | import org.springframework.stereotype.Service; |
| 43 | +import org.springframework.transaction.annotation.Transactional; | ||
| 43 | 44 | ||
| 44 | import javax.annotation.Resource; | 45 | import javax.annotation.Resource; |
| 45 | import java.io.File; | 46 | import java.io.File; |
| 46 | import java.io.IOException; | 47 | import java.io.IOException; |
| 47 | import java.math.BigDecimal; | 48 | import java.math.BigDecimal; |
| 48 | import java.util.*; | 49 | import java.util.*; |
| 49 | -import java.util.concurrent.atomic.AtomicInteger; | ||
| 50 | 50 | ||
| 51 | import static com.ruoyi.common.ConstSignInConstSignInProperties.*; | 51 | import static com.ruoyi.common.ConstSignInConstSignInProperties.*; |
| 52 | import static com.ruoyi.common.ErrorTypeProperties.SIGN_IN_ERROR; | 52 | import static com.ruoyi.common.ErrorTypeProperties.SIGN_IN_ERROR; |
| @@ -79,6 +79,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | @@ -79,6 +79,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | ||
| 79 | private static final FastDateFormat HHMM = FastDateFormat.getInstance("HH:mm"); | 79 | private static final FastDateFormat HHMM = FastDateFormat.getInstance("HH:mm"); |
| 80 | 80 | ||
| 81 | @Override | 81 | @Override |
| 82 | + @Transactional(rollbackFor = Exception.class) | ||
| 82 | public AjaxResult addsignInV1(SignIn signIn) throws IOException { | 83 | public AjaxResult addsignInV1(SignIn signIn) throws IOException { |
| 83 | 84 | ||
| 84 | SignInV1 signInV1 = new SignInV1(); | 85 | SignInV1 signInV1 = new SignInV1(); |
| @@ -141,6 +142,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | @@ -141,6 +142,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | ||
| 141 | switchAndChooseAlcohol(signIn, driver, scheduling); | 142 | switchAndChooseAlcohol(signIn, driver, scheduling); |
| 142 | 143 | ||
| 143 | } else { | 144 | } else { |
| 145 | + log.info("签到的数据为:[{}]",scheduling); | ||
| 144 | SignInV1 sourceSign = getById(scheduling.getSignInId()); | 146 | SignInV1 sourceSign = getById(scheduling.getSignInId()); |
| 145 | if (Objects.nonNull(sourceSign)) { | 147 | if (Objects.nonNull(sourceSign)) { |
| 146 | switchAndChooseTime(signIn, scheduling, dateTime); | 148 | switchAndChooseTime(signIn, scheduling, dateTime); |
| @@ -154,7 +156,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | @@ -154,7 +156,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | ||
| 154 | signInMapper.insertSignIn(signIn); | 156 | signInMapper.insertSignIn(signIn); |
| 155 | // 更新考勤 | 157 | // 更新考勤 |
| 156 | if (Objects.nonNull(calDriverScheduling)) { | 158 | if (Objects.nonNull(calDriverScheduling)) { |
| 157 | - schedulingService.computedSignInBySignIn(scheduling, calDriverScheduling.getIndex(), signIn); | 159 | + schedulingService.computedSignInBySignIn(scheduling, calDriverScheduling.getIndex(), signIn,true); |
| 158 | } | 160 | } |
| 159 | 161 | ||
| 160 | if (TempCache.checkJobCodeExist(signIn.getJobCode())) { | 162 | if (TempCache.checkJobCodeExist(signIn.getJobCode())) { |
| @@ -173,7 +175,11 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | @@ -173,7 +175,11 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | ||
| 173 | // 酒精测试后续恢复的需要删除异常的酒测缓存 | 175 | // 酒精测试后续恢复的需要删除异常的酒测缓存 |
| 174 | BeanUtils.copyProperties(signIn, signInV1); | 176 | BeanUtils.copyProperties(signIn, signInV1); |
| 175 | if (SIGN_IN_SUCCESS.equals(signIn.getStatus())) { | 177 | if (SIGN_IN_SUCCESS.equals(signIn.getStatus())) { |
| 176 | - String prompt = signIn.getRemark().replace("正常", ""); | 178 | + String prompt = "正常"; |
| 179 | + if (org.apache.commons.lang3.StringUtils.isNotEmpty(signIn.getRemark())) { | ||
| 180 | + prompt = signIn.getRemark().replace("正常", ""); | ||
| 181 | + } | ||
| 182 | + | ||
| 177 | if (signIn.getType().equals(SIGN_OUT)) { | 183 | if (signIn.getType().equals(SIGN_OUT)) { |
| 178 | return AjaxResult.success(SIGN_OUT_SUCCESS_STRING + "," + prompt, signInV1); | 184 | return AjaxResult.success(SIGN_OUT_SUCCESS_STRING + "," + prompt, signInV1); |
| 179 | } else { | 185 | } else { |
| @@ -207,7 +213,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | @@ -207,7 +213,7 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | ||
| 207 | Integer extype = Objects.isNull(signIn.getExType()) ? 0 : signIn.getExType(); | 213 | Integer extype = Objects.isNull(signIn.getExType()) ? 0 : signIn.getExType(); |
| 208 | if (checkAlcoholIntake(signIn.getAlcoholIntake())) { | 214 | if (checkAlcoholIntake(signIn.getAlcoholIntake())) { |
| 209 | threadJobService.asyncSendEmail(scheduling, signIn, driver); | 215 | threadJobService.asyncSendEmail(scheduling, signIn, driver); |
| 210 | - signIn.setRemark(join(signIn.getRemark(), ErrorTypeProperties.ALCOHOL_SIGN_IN_ERROR, signIn.getAlcoholIntake().toString(), "mg/100ml。")); | 216 | + signIn.setRemark(join(signIn.getRemark(), org.apache.commons.lang3.StringUtils.join(ErrorTypeProperties.ALCOHOL_SIGN_IN_ERROR, signIn.getAlcoholIntake().toString(), "mg/100ml。"))); |
| 211 | signIn.setExType(extype + ConstSignInConstSignInProperties.SIGN_ALCOHOL_EX_NUM); | 217 | signIn.setExType(extype + ConstSignInConstSignInProperties.SIGN_ALCOHOL_EX_NUM); |
| 212 | 218 | ||
| 213 | signIn.setStatus(ConstSignInConstSignInProperties.SIGN_IN_FAIL); | 219 | signIn.setStatus(ConstSignInConstSignInProperties.SIGN_IN_FAIL); |
| @@ -339,18 +345,21 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | @@ -339,18 +345,21 @@ public class SignInServiceV1Impl extends ServiceImpl<SignInMapperV1, SignInV1> i | ||
| 339 | * @return com.ruoyi.domain.DriverScheduling | 345 | * @return com.ruoyi.domain.DriverScheduling |
| 340 | */ | 346 | */ |
| 341 | private CalDriverScheduling findSchedulingByDateTime(List<DriverSchedulingV1> schedulings, long dateTime, String type) { | 347 | private CalDriverScheduling findSchedulingByDateTime(List<DriverSchedulingV1> schedulings, long dateTime, String type) { |
| 348 | + int size = CollectionUtils.size(schedulings); | ||
| 349 | + for (int i = 0; i < size; i++) { | ||
| 350 | + DriverSchedulingV1 s = schedulings.get(i); | ||
| 351 | + s.setIndex(i); | ||
| 342 | 352 | ||
| 343 | - AtomicInteger atomicInteger = new AtomicInteger(-1); | ||
| 344 | - Optional<DriverSchedulingV1> optional = schedulings.stream().map(s -> { | ||
| 345 | - atomicInteger.addAndGet(1); | ||
| 346 | if (Objects.nonNull(s.getFcsjT()) && org.apache.commons.lang3.StringUtils.equalsAnyIgnoreCase(org.apache.commons.lang3.StringUtils.trim(s.getBcType()), type)) { | 353 | if (Objects.nonNull(s.getFcsjT()) && org.apache.commons.lang3.StringUtils.equalsAnyIgnoreCase(org.apache.commons.lang3.StringUtils.trim(s.getBcType()), type)) { |
| 347 | s.setMinTime(Math.abs(s.getFcsjT() - dateTime)); | 354 | s.setMinTime(Math.abs(s.getFcsjT() - dateTime)); |
| 348 | } else { | 355 | } else { |
| 349 | s.setMinTime(Long.MAX_VALUE); | 356 | s.setMinTime(Long.MAX_VALUE); |
| 350 | } | 357 | } |
| 351 | - return s; | ||
| 352 | - }).min(Comparator.comparing(DriverScheduling::getMinTime)); | ||
| 353 | - return new CalDriverScheduling(atomicInteger.get(), optional.orElse(null)); | 358 | + |
| 359 | + } | ||
| 360 | + | ||
| 361 | + Optional<DriverSchedulingV1> optional = schedulings.stream().min(Comparator.comparing(DriverScheduling::getMinTime)); | ||
| 362 | + return new CalDriverScheduling(optional.orElse(null)); | ||
| 354 | } | 363 | } |
| 355 | 364 | ||
| 356 | /** | 365 | /** |
Bsth-admin/src/main/java/com/ruoyi/service/SchedulingService.java
| @@ -115,7 +115,7 @@ public class SchedulingService { | @@ -115,7 +115,7 @@ public class SchedulingService { | ||
| 115 | * @param signIn | 115 | * @param signIn |
| 116 | * @param globalIndex | 116 | * @param globalIndex |
| 117 | */ | 117 | */ |
| 118 | - public void computedSignInBySignIn(List<DriverScheduling> dto, SignIn signIn, GlobalIndex globalIndex) { | 118 | + public void computedSignInBySignIn(List<DriverScheduling> dto, SignIn signIn, GlobalIndex globalIndex, boolean isNew,DriverScheduling sourceScheduling) { |
| 119 | // 无排班不记录不在考勤表不更新 | 119 | // 无排班不记录不在考勤表不更新 |
| 120 | if (CollectionUtil.isEmpty(dto)) { | 120 | if (CollectionUtil.isEmpty(dto)) { |
| 121 | return; | 121 | return; |
| @@ -126,12 +126,14 @@ public class SchedulingService { | @@ -126,12 +126,14 @@ public class SchedulingService { | ||
| 126 | if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) { | 126 | if (Objects.isNull(dto.get(globalIndex.getIndex()).getSignInId()) || dto.size() == 1) { |
| 127 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 127 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 128 | // 更新缓存 | 128 | // 更新缓存 |
| 129 | - nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | 129 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn, isNew,sourceScheduling); |
| 130 | + | ||
| 130 | } | 131 | } |
| 131 | // 之前的无效 | 132 | // 之前的无效 |
| 132 | else if (!SIGN_NO_EX_NUM.equals(dto.get(globalIndex.getIndex()).getExType())) { | 133 | else if (!SIGN_NO_EX_NUM.equals(dto.get(globalIndex.getIndex()).getExType())) { |
| 133 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 134 | schedulingMapper.updateRoster(dto.get(globalIndex.getIndex()), signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 134 | - nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn); | 135 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex(), signIn, isNew,sourceScheduling); |
| 136 | + | ||
| 135 | } | 137 | } |
| 136 | // 之前的有效 | 138 | // 之前的有效 |
| 137 | else { | 139 | else { |
| @@ -145,7 +147,7 @@ public class SchedulingService { | @@ -145,7 +147,7 @@ public class SchedulingService { | ||
| 145 | * | 147 | * |
| 146 | * @param signIn | 148 | * @param signIn |
| 147 | */ | 149 | */ |
| 148 | - public void computedSignInBySignIn(DriverScheduling driverScheduling, int index, SignIn signIn) { | 150 | + public void computedSignInBySignIn(DriverScheduling driverScheduling, int index, SignIn signIn,boolean isNew) { |
| 149 | // 无排班不记录不在考勤表不更新 | 151 | // 无排班不记录不在考勤表不更新 |
| 150 | if (Objects.isNull(driverScheduling)) { | 152 | if (Objects.isNull(driverScheduling)) { |
| 151 | return; | 153 | return; |
| @@ -156,21 +158,21 @@ public class SchedulingService { | @@ -156,21 +158,21 @@ public class SchedulingService { | ||
| 156 | if (Objects.isNull(driverScheduling.getSignInId())) { | 158 | if (Objects.isNull(driverScheduling.getSignInId())) { |
| 157 | schedulingMapper.updateRoster(driverScheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 159 | schedulingMapper.updateRoster(driverScheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 158 | // 更新缓存 | 160 | // 更新缓存 |
| 159 | - nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(driverScheduling.getScheduleDate()), index, signIn); | 161 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(driverScheduling.getScheduleDate()), index, signIn,isNew,driverScheduling); |
| 160 | } | 162 | } |
| 161 | // 之前的无效 | 163 | // 之前的无效 |
| 162 | else if (!SIGN_NO_EX_NUM.equals(driverScheduling.getExType())) { | 164 | else if (!SIGN_NO_EX_NUM.equals(driverScheduling.getExType())) { |
| 163 | schedulingMapper.updateRoster(driverScheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 165 | schedulingMapper.updateRoster(driverScheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 164 | - nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(driverScheduling.getScheduleDate()), index, signIn); | 166 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(driverScheduling.getScheduleDate()), index, signIn,isNew,driverScheduling); |
| 165 | } | 167 | } |
| 166 | // 之前的有效 | 168 | // 之前的有效 |
| 167 | else { | 169 | else { |
| 168 | - handlerRecord(driverScheduling, signIn, index); | 170 | + handlerRecord(driverScheduling, signIn, index,isNew); |
| 169 | } | 171 | } |
| 170 | 172 | ||
| 171 | } | 173 | } |
| 172 | 174 | ||
| 173 | - private void handlerRecord(DriverScheduling scheduling, SignIn signIn, Integer index) { | 175 | + private void handlerRecord(DriverScheduling scheduling, SignIn signIn, Integer index,boolean isNew) { |
| 174 | if (Objects.isNull(scheduling)) { | 176 | if (Objects.isNull(scheduling)) { |
| 175 | return; | 177 | return; |
| 176 | } | 178 | } |
| @@ -194,7 +196,7 @@ public class SchedulingService { | @@ -194,7 +196,7 @@ public class SchedulingService { | ||
| 194 | String remark = getRemark(scheduling, signIn); | 196 | String remark = getRemark(scheduling, signIn); |
| 195 | signInMapper.updateSignIn(signIn); | 197 | signInMapper.updateSignIn(signIn); |
| 196 | schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 198 | schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 197 | - nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(scheduling.getScheduleDate()), index, signIn); | 199 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(scheduling.getScheduleDate()), index, signIn,isNew,scheduling); |
| 198 | } | 200 | } |
| 199 | 201 | ||
| 200 | 202 | ||
| @@ -233,6 +235,13 @@ public class SchedulingService { | @@ -233,6 +235,13 @@ public class SchedulingService { | ||
| 233 | } | 235 | } |
| 234 | 236 | ||
| 235 | if (bigViewServiceV1.isSignStatusWineEnum(signIn) && StringUtils.isNotEmpty(signIn.getRemark())) { | 237 | if (bigViewServiceV1.isSignStatusWineEnum(signIn) && StringUtils.isNotEmpty(signIn.getRemark())) { |
| 238 | + if(StringUtils.indexOf(scheduling.getRemark(),signIn.getRemark()) > -1){ | ||
| 239 | + return scheduling.getRemark(); | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + if(StringUtils.indexOf(sb.toString(),signIn.getRemark()) > -1){ | ||
| 243 | + return sb.toString(); | ||
| 244 | + } | ||
| 236 | int index = signIn.getRemark().indexOf(ALCOHOL_SIGN_IN_ERROR); | 245 | int index = signIn.getRemark().indexOf(ALCOHOL_SIGN_IN_ERROR); |
| 237 | if (index != -1) { | 246 | if (index != -1) { |
| 238 | sb.append("," + signIn.getRemark().substring(index)); | 247 | sb.append("," + signIn.getRemark().substring(index)); |
| @@ -279,7 +288,7 @@ public class SchedulingService { | @@ -279,7 +288,7 @@ public class SchedulingService { | ||
| 279 | String remark = getRemark(dto, signIn, index); | 288 | String remark = getRemark(dto, signIn, index); |
| 280 | signInMapper.updateSignIn(signIn); | 289 | signInMapper.updateSignIn(signIn); |
| 281 | schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); | 290 | schedulingMapper.updateRoster(scheduling, signIn.getId(), signIn.getExType(), signIn.getCreateTime(), remark, signIn.getType(), signIn.getAlcoholFlag(), signIn.getAlcoholIntake()); |
| 282 | - nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex() + 1, signIn); | 291 | + nowSchedulingCache.updateCacheByJobCode(remark, ConstDateUtil.formatDate(dto.get(0).getScheduleDate()), globalIndex.getIndex() + 1, signIn,false,scheduling); |
| 283 | } | 292 | } |
| 284 | 293 | ||
| 285 | private Integer bcTypeTransform(String bcType) { | 294 | private Integer bcTypeTransform(String bcType) { |
Bsth-admin/src/main/java/com/ruoyi/service/impl/BigViewServiceImpl.java
| @@ -460,10 +460,15 @@ public class BigViewServiceImpl implements BigViewService { | @@ -460,10 +460,15 @@ public class BigViewServiceImpl implements BigViewService { | ||
| 460 | if (DRIVER_STRING.equals(scheduling.getPosts())) { | 460 | if (DRIVER_STRING.equals(scheduling.getPosts())) { |
| 461 | LineInfo.PersonInfoVo driverInfoVo = matchMap.get(nbbm).getDriverInfoVo(); | 461 | LineInfo.PersonInfoVo driverInfoVo = matchMap.get(nbbm).getDriverInfoVo(); |
| 462 | if (!Objects.isNull(driverInfoVo)) { | 462 | if (!Objects.isNull(driverInfoVo)) { |
| 463 | + | ||
| 463 | // 第二次签到时间未到不记录状态 | 464 | // 第二次签到时间未到不记录状态 |
| 464 | if (time - scheduling.getFcsjT() < 0) { | 465 | if (time - scheduling.getFcsjT() < 0) { |
| 465 | return; | 466 | return; |
| 466 | } | 467 | } |
| 468 | + | ||
| 469 | + if(Objects.isNull(driverInfoVo.getSignStatus()) || Objects.isNull(personInfoVo.getSignStatus())){ | ||
| 470 | + return; | ||
| 471 | + } | ||
| 467 | // 如有多异常覆盖策略 异常等级排 未签 -》 迟到 -》 酒驾 | 472 | // 如有多异常覆盖策略 异常等级排 未签 -》 迟到 -》 酒驾 |
| 468 | if (driverInfoVo.getSignStatus().compareTo(personInfoVo.getSignStatus()) > 0) { | 473 | if (driverInfoVo.getSignStatus().compareTo(personInfoVo.getSignStatus()) > 0) { |
| 469 | return; | 474 | return; |