old mode 100644
new mode 100755
| | |
| | | package org.jeecg.modules.dry.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.util.RedisUtil; |
| | | import org.jeecg.modules.dry.common.CacheConstants; |
| | | import org.jeecg.modules.dry.entity.DryOrder; |
| | | import org.jeecg.modules.dry.mapper.DryOrderMapper; |
| | | import org.jeecg.modules.dry.service.IDryOrderService; |
| | | import org.jeecg.modules.dry.vo.DryOrderVo; |
| | | import org.jeecg.modules.dry.vo.DryRecentOrderAvg; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import java.util.List; |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description: 干燥工单 |
| | |
| | | @Service |
| | | public class DryOrderServiceImpl extends ServiceImpl<DryOrderMapper, DryOrder> implements IDryOrderService { |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | @Override |
| | | public void saveRealTimeData(DryOrderVo orderVo) { |
| | | log.info("保存实时数据:" + orderVo.toString()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<String> queryMonthOverview(String month, int tenantId) { |
| | | return baseMapper.queryMonthOverview(month, tenantId); |
| | | } |
| | | |
| | | @Override |
| | | public void queryRecentOrderAvg(DryOrderVo orderVo) { |
| | | DryRecentOrderAvg recentOrderAvg = (DryRecentOrderAvg) redisUtil.hget(CacheConstants.RedisKeyEnum.NEAR_TEN.getCode(), orderVo.getTenantId() + "_" + orderVo.getCode() + "_" + orderVo.getEquId()); |
| | | if (recentOrderAvg != null) { |
| | | orderVo.setEfficAvg(recentOrderAvg.getEfficAvg()); |
| | | orderVo.setSteamAvg(recentOrderAvg.getSteamAvg()); |
| | | orderVo.setWattAvg(recentOrderAvg.getWattAvg()); |
| | | } else { |
| | | DryRecentOrderAvg orderAvg = baseMapper.queryRecentOrderAvg(orderVo.getTenantId(), orderVo.getHerbName()); |
| | | if(orderAvg != null) { |
| | | redisUtil.hset(CacheConstants.RedisKeyEnum.NEAR_TEN.getCode(), orderVo.getTenantId() + "_" + orderVo.getCode() + "_" + orderVo.getEquId(),orderAvg,60*10); |
| | | orderVo.setEfficAvg(orderAvg.getEfficAvg()); |
| | | orderVo.setSteamAvg(orderAvg.getSteamAvg()); |
| | | orderVo.setWattAvg(orderAvg.getWattAvg()); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void sendByIds(List<String> list) { |
| | | LambdaUpdateWrapper<DryOrder> wrapper = new LambdaUpdateWrapper<>(); |
| | | wrapper.in(DryOrder::getId,list).set(DryOrder::getOrderStatus,1); |
| | | baseMapper.update(null,wrapper); |
| | | } |
| | | } |