| | |
| | | package com.mes.downworkstation.service.impl; |
| | | |
| | | 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.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.downglassinfo.entity.DownGlassInfo; |
| | | import com.mes.downglassinfo.mapper.DownGlassInfoMapper; |
| | | import com.mes.downglassinfo.service.DownGlassInfoService; |
| | | import com.mes.downworkstation.entity.DownWorkstation; |
| | | import com.mes.downworkstation.entity.DownWorkstationTask; |
| | | import com.mes.downworkstation.entity.DownWorkstionAndDownGlassinfo; |
| | |
| | | import com.mes.downworkstation.mapper.DownWorkstationTaskMapper; |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.DownWorkstationTaskService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.utils.RedisUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private DownWorkstationTaskMapper downWorkstationTaskMapper; |
| | | @Autowired |
| | | private DownGlassInfoMapper downGlassInfoMapper; |
| | | @Autowired |
| | | private DownGlassInfoService downGlassInfoService; |
| | | @Autowired |
| | | private GlassInfoService glassInfoService; |
| | | @Autowired |
| | |
| | | |
| | | @Override |
| | | public void updateFlowCardIdAndCount(String flowCardId, int workstationId, int layer) { |
| | | int glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, layer); |
| | | GlassInfo glassInfo = glassInfoService.getOne( |
| | | new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getFlowCardId, flowCardId) |
| | | .last("limit 1") |
| | | ); |
| | | QueryWrapper<Damage> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("process_id", flowCardId); |
| | | queryWrapper.eq("technology_number", layer); |
| | | int otherNumber = damageservice.count(queryWrapper); |
| | | |
| | | LambdaQueryWrapper<DownGlassInfo> wrapper = new LambdaQueryWrapper(); |
| | | wrapper.eq(DownGlassInfo::getFlowCardId, flowCardId); |
| | | wrapper.lt(DownGlassInfo::getWorkStationId, 7); |
| | | |
| | | UpdateWrapper<DownWorkstation> updateWrapper = new UpdateWrapper<>(); |
| | | int glassInfoCount = 0; |
| | | if (glassInfo.getCombine() == 0) { |
| | | glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, layer); |
| | | queryWrapper.eq("technology_number", layer); |
| | | wrapper.eq(DownGlassInfo::getLayer, layer); |
| | | updateWrapper.set("layer", layer); |
| | | } else { |
| | | glassInfoCount = glassInfoService.getGlassInfoCountByFlowCardId(flowCardId, 0); |
| | | updateWrapper.set("layer", 0); |
| | | } |
| | | int otherNumber = damageservice.count(queryWrapper); |
| | | int racksNumber = downGlassInfoService.count(wrapper); |
| | | |
| | | updateWrapper.set("total_quantity", glassInfoCount) |
| | | .set("flow_card_id", flowCardId) |
| | | .set("layer", layer) |
| | | |
| | | .set("other_number", otherNumber) |
| | | .set("racks_number", racksNumber) |
| | | .eq("workstation_id", workstationId); |
| | | // .eq("id", workstationId); |
| | | this.update(updateWrapper); |