| | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //大屏钢化信息 |
| | | Date startOfToday = new Date(LocalDate.now().atStartOfDay(ZoneId.systemDefault()).toInstant().toEpochMilli()); |
| | | |
| | | Integer putGlass = temperingAgoService.count( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW) |
| | | new QueryWrapper<TemperingGlassInfo>() |
| | | .eq("state", Const.TEMPERING_NEW) |
| | | .gt("create_time", startOfToday) |
| | | ); |
| | | jsonObject.append("temperingTaskType", putGlass); |
| | | //大屏钢化信息 |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingAgoService.list( |
| | | new LambdaQueryWrapper<TemperingGlassInfo>() |
| | | .select(TemperingGlassInfo::getEngineerId, TemperingGlassInfo::getTemperingLayoutId) // 选择要去重的字段 |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_START) |
| | | .groupBy(TemperingGlassInfo::getEngineerId, TemperingGlassInfo::getTemperingLayoutId) // 按 engineerId 和 temperingLayoutId 分组 |
| | | new QueryWrapper<TemperingGlassInfo>() |
| | | .select("engineer_id" ,"tempering_layout_id") |
| | | .eq("state", Const.TEMPERING_START) |
| | | .gt("create_time", startOfToday) |
| | | .groupBy("engineer_id" ,"tempering_layout_id") |
| | | ); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList.size()); |
| | | //大屏钢化信息 |