| | |
| | | @Resource |
| | | public MmItemStatusDao mmItemStatusDao; |
| | | |
| | | public void recordStatus(String itemId, ItemRunStatusEnum status, Long duration) { |
| | | public void recordStatus(String itemId, ItemRunStatusEnum status, Long duration, Date runTime) { |
| | | QueryWrapper<MmItemStatusEntity> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("item_id", itemId); |
| | | MmItemStatusEntity entity = mmItemStatusDao.selectOne(queryWrapper); |
| | |
| | | entity = new MmItemStatusEntity(); |
| | | entity.setId(UUID.randomUUID().toString()); |
| | | entity.setItemId(itemId); |
| | | entity.setLastTime(new Date()); |
| | | entity.setLastTime(runTime); |
| | | entity.setStatus(status.getCode()); |
| | | entity.setDuration(duration); |
| | | mmItemStatusDao.insert(entity); |
| | | } else { |
| | | entity.setLastTime(new Date()); |
| | | entity.setLastTime(runTime); |
| | | entity.setStatus(status.getCode()); |
| | | entity.setDuration(duration); |
| | | mmItemStatusDao.updateById(entity); |