Commit 3968f2355f4d8b7eb303dbe1589bb7beadc3bc98
1 parent
a93def1f
优化导入数据
Showing
2 changed files
with
22 additions
and
2 deletions
Bsth-admin/src/main/java/com/ruoyi/controller/app/AppSignExceptionController.java
| ... | ... | @@ -59,11 +59,14 @@ public class AppSignExceptionController extends BaseController { |
| 59 | 59 | SignIn signIn = new SignIn(); |
| 60 | 60 | if (Objects.nonNull(dto.getSignTime())) { |
| 61 | 61 | signIn.setStartCreateTime(DateUtil.shortDate(dto.getSignTime())); |
| 62 | + signIn.setEndCreateTime(DateUtils.addDays(signIn.getStartCreateTime(), 1)); | |
| 62 | 63 | } else { |
| 63 | - signIn.setStartCreateTime(DateUtil.shortDate(new Date())); | |
| 64 | + signIn.setEndCreateTime(DateUtil.shortDate(new Date())); | |
| 65 | + signIn.setStartCreateTime(DateUtils.addMonths(signIn.getStartCreateTime(), -2)); | |
| 66 | + | |
| 64 | 67 | } |
| 65 | 68 | |
| 66 | - signIn.setEndCreateTime(DateUtils.addDays(signIn.getStartCreateTime(), 1)); | |
| 69 | + | |
| 67 | 70 | List<SignIn> signIns = signInService.list(signIn); |
| 68 | 71 | if (CollectionUtils.isEmpty(signIns)) { |
| 69 | 72 | log.info("signIns is null"); | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/sign/in/exception/report/EquipmentExceptionReportServiceImpl.java
| ... | ... | @@ -20,6 +20,7 @@ import com.ruoyi.service.scheduling.LinggangSchedulingService; |
| 20 | 20 | import com.ruoyi.service.sign.in.exception.report.EquipmentExceptionReportService; |
| 21 | 21 | import lombok.extern.slf4j.Slf4j; |
| 22 | 22 | import org.apache.commons.collections4.CollectionUtils; |
| 23 | +import org.apache.commons.lang3.StringUtils; | |
| 23 | 24 | import org.springframework.beans.BeanUtils; |
| 24 | 25 | import org.springframework.beans.factory.annotation.Autowired; |
| 25 | 26 | import org.springframework.stereotype.Service; |
| ... | ... | @@ -80,10 +81,26 @@ public class EquipmentExceptionReportServiceImpl extends ServiceImpl<EquipmentEx |
| 80 | 81 | |
| 81 | 82 | @Override |
| 82 | 83 | public List<EquipmentExceptionReport> list(EquipmentExceptionReport entity) { |
| 84 | + String fleetName = entity.getFleetName(); | |
| 85 | + String lineName = entity.getLineName(); | |
| 86 | + | |
| 87 | + entity.setFleetName(null); | |
| 88 | + entity.setLineName(null); | |
| 83 | 89 | LambdaQueryWrapper<EquipmentExceptionReport> wrapper = new LambdaQueryWrapper<>(entity); |
| 84 | 90 | if(CollectionUtils.isNotEmpty(entity.getSignIds())){ |
| 85 | 91 | wrapper.in(EquipmentExceptionReport::getSignId,entity.getSignIds()); |
| 86 | 92 | } |
| 93 | + | |
| 94 | + if(StringUtils.isNotEmpty(lineName)){ | |
| 95 | + wrapper.like(EquipmentExceptionReport::getLineName,lineName); | |
| 96 | + } | |
| 97 | + | |
| 98 | + if(StringUtils.isNotEmpty(fleetName)){ | |
| 99 | + wrapper.like(EquipmentExceptionReport::getFleetName,fleetName); | |
| 100 | + } | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 87 | 104 | return list(wrapper); |
| 88 | 105 | } |
| 89 | 106 | // @Override | ... | ... |