| | |
| | | const cantakea = ref(true); |
| | | const cantakeb = ref(true); |
| | | const canona = ref(true); |
| | | const canons = ref(true); |
| | | const cantakeall = ref(true); |
| | | const canonb = ref(true); |
| | | const canSelectProjectb = ref(true); |
| | |
| | | const engineerId = ref('') |
| | | const router = useRouter() |
| | | const currentGlassId = ref(null); |
| | | const currentstartSlot = ref(null); |
| | | const currentengineerId = ref(null); |
| | | const currenttemperingLayoutId = ref(null); |
| | | const currenttemperingFeedSequence = ref(null); |
| | |
| | | adjustedRects1.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currentstartSlot.value = rect.slot; |
| | | currentengineerId.value = rect.engineerId; |
| | | currenttemperingLayoutId.value = rect.temperingLayoutId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | |
| | | adjustedRects3.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currentstartSlot.value = rect.slot; |
| | | currentengineerId.value = rect.engineerId; |
| | | currenttemperingLayoutId.value = rect.temperingLayoutId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | |
| | | adjustedRects2.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currentstartSlot.value = rect.slot; |
| | | currentengineerId.value = rect.engineerId; |
| | | currenttemperingLayoutId.value = rect.temperingLayoutId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | |
| | | adjustedRects4.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currentstartSlot.value = rect.slot; |
| | | currentengineerId.value = rect.engineerId; |
| | | currenttemperingLayoutId.value = rect.temperingLayoutId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | |
| | | adjustedRectsa.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currentstartSlot.value = rect.slot; |
| | | currentengineerId.value = rect.engineerId; |
| | | currenttemperingLayoutId.value = rect.temperingLayoutId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | |
| | | } |
| | | if (currentRect.value.state == 1) { |
| | | canona.value = false; |
| | | } else if (currentRect.value.state == 0) { |
| | | } else if (currentRect.value.state == 0||currentRect.value.state == -1) { |
| | | canona.value = true; |
| | | } |
| | | if (currentRect.value.state == 1) { |
| | | canons.value = false; |
| | | } else if (currentRect.value.state == -1) { |
| | | canons.value = true; |
| | | } |
| | | |
| | | if (currentRect.value.state > 5) { |
| | | cantakeall.value = false; |
| | | } else{ |
| | |
| | | if (index !== -1) { |
| | | adjustedRectsb.value[index].isActive = true; |
| | | } |
| | | currentGlassId.value = rect.glassId; |
| | | currentGlassId.value = rect.glassId; |
| | | currentstartSlot.value = rect.slot; |
| | | currentengineerId.value = rect.engineerId; |
| | | currenttemperingLayoutId.value = rect.temperingLayoutId; |
| | | currenttemperingFeedSequence.value = rect.temperingFeedSequence; |
| | |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success('成功!'); |
| | | blinda.value = false; |
| | | updateoutColorsa(); |
| | | } else { |
| | | // 请求失败,显示错误消息 |
| | | ElMessage.error(response.message); |
| | | } |
| | | } |
| | | catch (error) { |
| | | // 处理错误 |
| | | console.error(error); |
| | | } |
| | | } |
| | | // 进炉前出片 |
| | | const outTask = async (line) => { |
| | | try { |
| | | const response = await request.post('/cacheVerticalGlass/bigStorageCageOutTask/temperingOut', { |
| | | glassId: currentGlassId.value, |
| | | endSlot: line, |
| | | startSlot: currentstartSlot.value, |
| | | }) |
| | | if (response.code == 200) { |
| | | ElMessage.success(response.message); |
| | | blinda.value = false; |
| | | updateoutColorsa(); |
| | | } else { |
| | |
| | | <el-button type="info" plain @click="handleal11" :disabled="!cantakeall" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('processCard.intofurnace') }} |
| | | </el-button> |
| | | <el-button type="success" plain :icon="Edit" @click="outTask(3002)" :disabled="!canons" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('searchOrder.specifyout') }} |
| | | </el-button> |
| | | <el-button type="success" plain :icon="Edit" @click="outTask(3001)" :disabled="!canons" style="width: 150px;margin-left: 10px;margin-top: 10px;"> |
| | | {{ $t('searchOrder.outfilm') }} |
| | | </el-button> |
| | | </el-dialog> |
| | | <!-- 已出炉 --> |
| | | <el-dialog v-model="blindb" top="30vh" width="15%" style="text-align: center;" @close="handleDialogCloseb"> |
| | |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | startDate.setDate(endDate.getDate()); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | startDate.setDate(endDate.getDate()); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | startDate.setDate(endDate.getDate()); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | |
| | | const reportData = ref([]) |
| | | const endDate = new Date(); |
| | | const startDate = new Date(); |
| | | startDate.setDate(endDate.getDate() - 100); // 获取一个星期前的时间 |
| | | startDate.setDate(endDate.getDate()); // 获取一个星期前的时间 |
| | | // 格式化为 "YYYY-MM-DD" 格式 |
| | | const formatDate = (date) => { |
| | | const year = date.getFullYear(); |
| | |
| | | import request from "@/utils/request" |
| | | import {ElMessage} from "element-plus" |
| | | import {onMounted, ref} from "vue" |
| | | // import {useRouter} from 'vue-router' |
| | | // import {changeFilterEvent, filterChanged} from "@/hook" |
| | | // import {useI18n} from 'vue-i18n' |
| | | // import deepClone from "@/utils/deepClone"; |
| | | import companyInfo from "@/lang/companyInfo" |
| | | |
| | | const company = companyInfo() |
| | |
| | | <div id="entirety" > |
| | | |
| | | <div class="row1"> |
| | | <div style="position: absolute;font-weight: bold;margin-left: 5px;" v-if="item.tempering_layout_id!=null">{{ item.tempering_layout_id }}/{{ item.tempering_feed_sequence }}</div> |
| | | |
| | | <span>{{ item.customer_name }}</span> |
| | | <span>{{ item.order_id }}</span> |
| | | <span v-if="item.process.includes('夹胶')">胶片</span> |
| | | <span v-else-if="item.process.includes('中空')">中空</span> |
| | | <span v-else-if="item.process.includes('百叶')">百叶</span> |
| | | <span v-else></span> |
| | | <div style="position: absolute;font-weight: bold;margin-left: 210px;margin-top: -26px;" >{{ index+1 }}</div> |
| | | </div> |
| | | <div class="row2"> |
| | | <span>{{ item.project }}</span> |
| | | <span>{{ item.building_number }}</span> |
| | | </div> |
| | | <div class="row3" v-if="item.other_columns!=null&&(JSON.parse(item.other_columns).S02!=null)">{{JSON.parse(item.other_columns).S02}}={{item.quantity}}</div> |
| | | <div class="row3" v-else>{{Math.round(item.width)}}x{{Math.round(item.height)}}={{item.quantity}}</div> |
| | | <div class="row3" v-if="item.other_columns!=null&&(JSON.parse(item.other_columns).S02!=null)"> |
| | | <span v-if="item.tempering_layout_id!==null " style="font-size: 7pt;"> |
| | | ({{ index+1 }}) {{ item.tempering_layout_id }}/{{ item.tempering_feed_sequence }} |
| | | </span> |
| | | {{JSON.parse(item.other_columns).S02}}={{item.quantity}} |
| | | </div> |
| | | <div class="row3" v-else> |
| | | <span v-if="item.heat_layout_id!==null " style="font-size: 7pt;"> |
| | | ({{ index+1 }}) {{ item.tempering_layout_id }}/{{ item.tempering_feed_sequence }} |
| | | </span> |
| | | {{Math.round(item.width)}}x{{Math.round(item.height)}}={{item.quantity}} |
| | | </div> |
| | | <div class="row5"> |
| | | <span>{{item.glass_child }}</span> |
| | | <span>{{ item.processing_note }}</span> |
| | |
| | | |
| | | #entirety{ |
| | | text-align: center; |
| | | width: 46%; |
| | | height: 170px; |
| | | width: 48%; |
| | | height: 160px; |
| | | border: black 1px; |
| | | word-wrap: break-word; |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | .row1 { |
| | |
| | | height: 35px; |
| | | } |
| | | .row1 span { |
| | | font-size: 12pt; |
| | | } |
| | | |
| | | .row2 { |
| | | font-size: 14pt; |
| | | } |
| | | .row2 { |
| | | font-size: 12pt; |
| | | font-weight: bold; |
| | | height: 35px; |
| | | } |
| | | .row2 span { |
| | | font-size: 12pt; |
| | | font-size: 17pt; |
| | | } |
| | | span { |
| | | font-size: 12pt; |
| | |
| | | .row3 { |
| | | margin-top: -5px; |
| | | height: 35px; |
| | | font-size: 22pt; |
| | | font-size: 20pt; |
| | | font-weight: bolder; |
| | | line-height: 35px; |
| | | } |
| | | .row3 span{ |
| | | font-size: 24pt; |
| | | } |
| | | |
| | | .row5 { |
| | | height: 50px; |
| | | font-weight: bold; |
| | | font-size: 12pt; |
| | | /* margin-left: 20px; */ |
| | | font-size: 14pt; |
| | | } |
| | | .row5 span { |
| | | font-size: 12pt; |
| | | font-size: 16pt; |
| | | } |
| | | |
| | | .row6 { |
| | | height: 15px; |
| | | height: 25px; |
| | | font-weight: bold; |
| | | font-size: 8pt; |
| | | font-size: 10pt; |
| | | } |
| | | .row6 span { |
| | | font-size: 16pt; |
| | | } |
| | | |
| | | |
| | |
| | | damage1 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .lt(Damage::getStatus, 7) |
| | | .eq(Damage::getGlassId, damage.getGlassId()) |
| | | ); |
| | | } else { |
| | |
| | | new LambdaQueryWrapper<Damage>() |
| | | .eq(Damage::getGlassId, glassId) |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE_TAKE) |
| | | .lt(Damage::getStatus, 7) |
| | | ); |
| | | } |
| | | |
| | |
| | | * 打标属性 |
| | | */ |
| | | private String markIcon; |
| | | /** |
| | | * 生产状态 |
| | | */ |
| | | private Integer productionStatus; |
| | | |
| | | } |
| | |
| | | @Override |
| | | public List<OrderChange> orderChange(List<OrderChange> orderChanges) { |
| | | for (OrderChange orderChange : orderChanges) { |
| | | glassInfoService.update( |
| | | new LambdaUpdateWrapper<GlassInfo>() |
| | | .set(GlassInfo::getProductionStatus, 3) |
| | | .eq(GlassInfo::getFlowCardId, orderChange.getOldProcessId()) |
| | | .eq(GlassInfo::getGlassType, orderChange.getOldOrderNumber()) |
| | | .eq(GlassInfo::getLayer, orderChange.getOldTechnologyNumber()) |
| | | ); |
| | | int affectedRows = glassInfoMapper.update(null, |
| | | new LambdaUpdateWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getFlowCardId, orderChange.getOldProcessId()) |
| | |
| | | .set(GlassInfo::getFlowCardId, orderChange.getNewProcessId()) |
| | | .set(GlassInfo::getGlassType, orderChange.getNewOrderNumber()) |
| | | .set(GlassInfo::getLayer, orderChange.getNewTechnologyNumber()) |
| | | .set(GlassInfo::getProductionStatus, 2) |
| | | .orderByDesc(GlassInfo::getTemperingLayoutId, GlassInfo::getTemperingLayoutId) |
| | | .last("limit " + orderChange.getChangeNumber()) |
| | | .inSql(GlassInfo::getGlassId, "select glass_id from edg_storage_cage_details where flow_card_id ='" + orderChange.getOldProcessId() + |
| | | "' and glass_id not in (select glass_id from damage where (type=8 or type=9) and process_id='" + orderChange.getOldProcessId() + "')")); |
| | |
| | | public List<TemperingGlassInfo> selectWaitingGlass() { |
| | | //获取等待进炉中的玻璃信息 |
| | | QueryWrapper<TemperingGlassInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("Top 1 *").in("state", 1, 0, -1); |
| | | wrapper.select("Top 1 *").in("state", 1, 0, -1) |
| | | .orderByAsc("id"); |
| | | TemperingGlassInfo glass = temperingMapper.selectOne(wrapper); |
| | | if (glass != null) { |
| | | QueryWrapper<TemperingGlassInfo> glassinfo = new QueryWrapper<>(); |
| | |
| | | |
| | | <select id="selectLabel" resultType="java.util.Map"> |
| | | select fc.process_id, |
| | | od.remarks as order_id, |
| | | o.order_id, |
| | | o.project, |
| | | o.customer_id, |
| | | ogd.child_width as width, |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | public interface EdgStorageCageDetailsMapper extends MPJBaseMapper<EdgStorageCageDetails> { |
| | | |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | } |
| | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.edgglasstask.entity.request.IdentWornRequest; |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @return |
| | | */ |
| | | EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | } |
| | |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import com.mes.pp.entity.*; |
| | | import com.mes.pp.mapper.OptimizeDetailMapper; |
| | | import com.mes.pp.mapper.OptimizeHeatDetailMapper; |
| | |
| | | Map<String, Damage> damageMaps = damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId, upPattenUsage1.getEngineeringId()) |
| | | .lt(Damage::getStatus, 7) |
| | | .and(wrapper -> wrapper.eq(Damage::getType, 8) |
| | | .or() |
| | | .eq(Damage::getType, 9)) |
| | |
| | | public EdgStorageCageDetails queryEdgStorageDetailsBySize(int deviceId, int currentSlot, double width, double height) { |
| | | return baseMapper.queryEdgStorageDetailsBySize(deviceId, currentSlot, width, height); |
| | | } |
| | | |
| | | @Override |
| | | public List<PieChartVO> queryPieChart() { |
| | | return this.baseMapper.queryPieChart(); |
| | | } |
| | | } |
| | |
| | | import com.mes.edgstoragecage.entity.EdgStorageCageDetails; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageDetailsService; |
| | | import com.mes.edgstoragecage.service.EdgStorageCageService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import com.mes.taskcache.entity.TaskCache; |
| | | import com.mes.taskcache.service.TaskCacheService; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | WebSocketServer webServerService; |
| | | @Autowired |
| | | DamageService damageService; |
| | | @Autowired |
| | | EngineeringMapper engineeringMapper; |
| | | |
| | | |
| | | @Value("${mes.threshold}") |
| | | private int threshold; |
| | |
| | | } |
| | | |
| | | // taskRequestTypeValue = "2"; |
| | | // out08Glassstate = "1"; |
| | | // out08Glassstate = "0"; |
| | | // out10Glassstate = "1"; |
| | | // currentSlot = "1"; |
| | | // confirmationWrodValue = "0"; |
| | | // glassIdeValue = "P25021704|75|12"; |
| | | // glassIdeValue = ""; |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:A09:{}、A10:{},当前格子号为:{}", |
| | | taskRequestTypeValue, glassIdeValue, confirmationWrodValue, out08Glassstate, out10Glassstate, currentSlot); |
| | |
| | | if (!result) { |
| | | log.info("此玻璃id已经进过"); |
| | | return; |
| | | } |
| | | if (StringUtils.isNotBlank(glassIdeValue)) { |
| | | GlassInfo glassInfo = glassInfoService.getOne( |
| | | new LambdaQueryWrapper<GlassInfo>() |
| | | .eq(GlassInfo::getGlassId, glassIdeValue) |
| | | ); |
| | | Engineering engineering = engineeringMapper.selectOne( |
| | | new LambdaQueryWrapper<Engineering>() |
| | | .eq(Engineering::getEngineerId, glassInfo.getEngineerId()) |
| | | ); |
| | | if (engineering.getState() == 2) { |
| | | log.info("此订单已禁止生产"); |
| | | return; |
| | | } |
| | | } |
| | | if ("1".equals(taskRequestTypeValue) && result) { |
| | | log.info("2、进片请求,且确认字为0,执行进片任务,扫码重复ID验证【有重复=false,无重复=true】:{}", result); |
| | |
| | | .eq(GlassInfo::getGlassId, glassId) |
| | | ); |
| | | if (glassInfos != null) { |
| | | if (Math.max(glassInfos.getWidth(), glassInfos.getHeight()) > Integer.parseInt(firstLength) && out08Glassstate == 1) { |
| | | endcell = Const.A09_OUT_TARGET_POSITION; |
| | | if (Math.max(glassInfos.getWidth(), glassInfos.getHeight()) > Integer.parseInt(firstLength)) { |
| | | if (out08Glassstate == 1) { |
| | | endcell = Const.A09_OUT_TARGET_POSITION; |
| | | } else { |
| | | log.info("当前玻璃只能走大线,但大线未空闲玻璃信息:{}", glassInfos); |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | endcell = computerLineByState(out08Glassstate, out10Glassstate); |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (sendwServer != null) { |
| | | List<PieChartVO> pieChartVOS = edgStorageCageDetailsService.queryPieChart(); |
| | | jsonObject.append("pieChartVOS", pieChartVOS); |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("largenScreen is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | select * |
| | | from slot_temp limit 1 |
| | | </select> |
| | | <select id="queryPieChart" resultType="com.mes.largenscreen.entity.PieChartVO"> |
| | | SELECT round(sum(CASE WHEN e.station_cell = 5 THEN 1 ELSE 0 END), 2) as oneCompletedQuantity, |
| | | round(sum(CASE WHEN e.station_cell = 5 THEN escd.width * escd.height / 1000000 ELSE 0 END), |
| | | 2) as oneCompletedArea, |
| | | round(sum(CASE WHEN e.station_cell = 6 THEN 1 ELSE 0 END), 2) as twoCompletedQuantity, |
| | | round(sum(CASE WHEN e.station_cell = 6 THEN escd.width * escd.height / 1000000 ELSE 0 END), |
| | | 2) as twoCompletedArea, |
| | | round(sum(CASE WHEN e.station_cell = 5 and escd.device_id is null THEN 1 ELSE 0 END), |
| | | 2) as oneUncompletedQuantity, |
| | | round(sum(CASE |
| | | WHEN e.station_cell = 5 and escd.device_id is null THEN gi.width * gi.height / 1000000 |
| | | ELSE 0 END), |
| | | 2) as oneUncompletedArea, |
| | | round(sum(CASE WHEN e.station_cell = 6 and escd.device_id is null THEN 1 ELSE 0 END), |
| | | 2) as twoUncompletedQuantity, |
| | | round(sum( CASE WHEN e.station_cell = 6 and escd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END ),2) as twoUncompletedArea |
| | | FROM |
| | | glass_info gi |
| | | left join edg_storage_cage_details escd ON gi.glass_id = escd.glass_id |
| | | left join engineering e on gi.engineer_id=e.engineer_id |
| | | WHERE |
| | | date(e.create_time) = date(now()) |
| | | </select> |
| | | </mapper> |
| | |
| | | if (result == true) { |
| | | return Result.build(200, "指定钢化成功", 1); |
| | | } else { |
| | | return Result.build(200, "已存在钢化任务,请等待钢化完成再指定钢化", 1); |
| | | return Result.build(200, "已存在钢化任务或此工程已被禁止生产,请等待钢化完成再指定钢化", 1); |
| | | } |
| | | } |
| | | |
| | |
| | | @ApiOperation("指定工程") |
| | | @PostMapping("/appointEngineerId") |
| | | public Result appointEngineerId(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.appointEngineerId(bigStorageCageDetails.getEngineerId()); |
| | | return Result.build(200, "修改成功", 1); |
| | | return Result.build(200, bigStorageCageDetailsService.appointEngineerId(bigStorageCageDetails.getEngineerId()), 1); |
| | | } |
| | | |
| | | @ApiOperation("调度时间查询") |
| | |
| | | |
| | | import com.github.yulichang.base.MPJBaseMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | public interface BigStorageCageMapper extends MPJBaseMapper<BigStorageCage> { |
| | | |
| | | List<Integer> queryFreeDeviceByUsed(@Param(value = "thickness") double thickness, @Param(value = "slotHeight") double slotHeight); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | // |
| | | // List<Integer> queryFreeDeviceByNotUsed(@Param(value = "thickness") double thickness); |
| | | } |
| | |
| | | |
| | | String temperingSwitch(Boolean flag); |
| | | |
| | | void appointEngineerId(String engineerId); |
| | | String appointEngineerId(String engineerId); |
| | | |
| | | long scheduleTime(); |
| | | |
| | |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | List<Integer> queryFreeDeviceByUsed(double thickness,double slotHeight); |
| | | |
| | | List<PieChartVO> queryPieChart(); |
| | | |
| | | // List<Integer> queryFreeDeviceByNotUsed(double thickness); |
| | | } |
| | |
| | | import com.mes.common.config.Const; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | |
| | | private BigStorageCageOutTaskService bigStorageCageOutTaskService; |
| | | @Resource |
| | | private BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | @Resource |
| | | private EngineeringMapper engineeringMapper; |
| | | |
| | | @Value("${mes.minCount}") |
| | | private int minCount; |
| | |
| | | } |
| | | Damage damage = new Damage(); |
| | | if (status == 8) { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_DAMAGE); |
| | | // bigStorageCageDetails.setState(Const.GLASS_STATE_DAMAGE); |
| | | damage.setType(Const.GLASS_STATE_DAMAGE); |
| | | } else { |
| | | bigStorageCageDetails.setState(Const.GLASS_STATE_TAKE); |
| | | // bigStorageCageDetails.setState(Const.GLASS_STATE_TAKE); |
| | | damage.setType(Const.GLASS_STATE_TAKE); |
| | | } |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | // baseMapper.updateById(bigStorageCageDetails); |
| | | baseMapper.deleteById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | damage.setGlassId(bigStorageCageDetails.getGlassId()); |
| | | damage.setWorkingProcedure("钢化"); |
| | |
| | | |
| | | @Override |
| | | public boolean temperingGlass(String temperingLayoutId, String engineerId, String temperingFeedSequence) { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoLambdaQueryWrapper |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper); |
| | | if (temperingGlassInfoList.size() == 0) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(GlassInfo::getEngineerId, engineerId) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | if ("0".equals(temperingFeedSequence)) { |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | plcStorageCageTask.computeOutMoreGlassInfo(temperingGlassInfos, Boolean.FALSE, 1); |
| | | Engineering engineering = engineeringMapper.selectOne( |
| | | new LambdaQueryWrapper<Engineering>() |
| | | .eq(Engineering::getEngineerId, engineerId) |
| | | ); |
| | | if(engineering.getState()!=2){ |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoLambdaQueryWrapper |
| | | .eq(TemperingGlassInfo::getState, Const.TEMPERING_NEW); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoMapper.selectList(temperingGlassInfoLambdaQueryWrapper); |
| | | if (temperingGlassInfoList.size() == 0) { |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | | .selectAs(BigStorageCageDetails::getSlot, TemperingGlassInfo::getSlot) |
| | | .innerJoin(BigStorageCageDetails.class, BigStorageCageDetails::getGlassId, GlassInfo::getGlassId) |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutId) |
| | | .eq(GlassInfo::getEngineerId, engineerId) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, GlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | if ("0".equals(temperingFeedSequence)) { |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfos)) { |
| | | plcStorageCageTask.computeOutMoreGlassInfo(temperingGlassInfos, Boolean.FALSE, 1); |
| | | } |
| | | } else { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | } |
| | | } else { |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | return true; |
| | | } |
| | | return true; |
| | | } |
| | | return false; |
| | | }else{ |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void appointEngineerId(String engineerId) { |
| | | redisUtil.setCacheObject("temperingengineerId", engineerId); |
| | | public String appointEngineerId(String engineerId) { |
| | | if(engineerId!=""){ |
| | | Engineering engineering = engineeringMapper.selectOne( |
| | | new LambdaQueryWrapper<Engineering>() |
| | | .eq(Engineering::getEngineerId, engineerId) |
| | | ); |
| | | if (engineering.getState() != 2) { |
| | | redisUtil.setCacheObject("temperingengineerId", engineerId); |
| | | return "指定成功"; |
| | | } else { |
| | | return "指定失败,此工程已经被禁止生产"; |
| | | } |
| | | }else{ |
| | | redisUtil.setCacheObject("temperingengineerId", engineerId); |
| | | return "指定成功"; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | .in(BigStorageCageOutTask::getEndSlot, Const.OUT_TARGET_POSITION_ALL) |
| | | .eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW) |
| | | ); |
| | | if(bigStorageCageOutTasks.size()>0){ |
| | | if (bigStorageCageOutTasks.size() > 0) { |
| | | List<String> outGlassId = bigStorageCageOutTasks.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | temperingGlassInfoService.remove( |
| | | new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardDTO> selectFlowCardCount(){ |
| | | public List<FlowCardDTO> selectFlowCardCount() { |
| | | return baseMapper.selectFlowCardCount(); |
| | | } |
| | | } |
| | |
| | | import com.mes.common.config.Const; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | return baseMapper.queryFreeDeviceByUsed(thickness, slotHeight); |
| | | } |
| | | |
| | | @Override |
| | | public List<PieChartVO> queryPieChart() { |
| | | return baseMapper.queryPieChart(); |
| | | } |
| | | |
| | | // @Override |
| | | // public List<Integer> queryFreeDeviceByNotUsed(double thickness) { |
| | | // return baseMapper.queryFreeDeviceByNotUsed(thickness); |
| | |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.tomcat.util.bcel.Const; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | */ |
| | | @Api(description = "出片任务信息") |
| | | @RestController |
| | | @Slf4j |
| | | @RequestMapping("/bigStorageCageOutTask") |
| | | public class BigStorageCageOutTaskController { |
| | | |
| | |
| | | ); |
| | | } |
| | | bigStorageCageOutTaskService.updateById(bigStorageCageOutTask); |
| | | log.info("手动修改出片任务" + bigStorageCageOutTask); |
| | | return Result.build(200, "修改成功", 1); |
| | | } |
| | | |
| | | @ApiOperation("出片任务报表") |
| | | @PostMapping("/selectBigStorageCageOutTask") |
| | | public Result selectBigStorageCageOutTask(@RequestBody BigStorageCageOutTask bigStorageCageOutTask, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | return Result.build(200, "查询成功", bigStorageCageOutTaskService.selectBigStorageCageOutTask(bigStorageCageOutTask, startTime, endTime)); |
| | | } |
| | | |
| | | @ApiOperation("钢化出片") |
| | | @PostMapping("/temperingOut") |
| | | public Result selectBigStorageCageOutTask(@RequestBody BigStorageCageOutTask bigStorageCageOutTask) { |
| | | return Result.build(200, bigStorageCageOutTaskService.temperingOut(bigStorageCageOutTask), 1); |
| | | } |
| | | } |
| | | |
| | |
| | | void deleteTask(List<BigStorageCageOutTask> outGlassId); |
| | | |
| | | List<BigStorageCageOutTask> selectBigStorageCageOutTask(BigStorageCageOutTask bigStorageCageOutTask, String startTime, String endTime); |
| | | |
| | | String temperingOut(BigStorageCageOutTask bigStorageCageOutTask); |
| | | } |
| | |
| | | package com.mes.bigstoragetask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.mes.bigstorage.entity.BigStorageCageDetails; |
| | | import com.mes.bigstorage.mapper.BigStorageCageDetailsMapper; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageFeedTask; |
| | | import com.mes.bigstoragetask.entity.BigStorageCageOutTask; |
| | | import com.mes.bigstoragetask.mapper.BigStorageCageOutTaskMapper; |
| | | import com.mes.bigstoragetask.service.BigStorageCageOutTaskService; |
| | | import com.mes.common.config.Const; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.mapper.TemperingGlassInfoMapper; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author zhoush |
| | |
| | | BigStorageCageOutTaskMapper bigStorageCageOutTaskMapper; |
| | | @Resource |
| | | BigStorageCageDetailsMapper bigStorageCageDetailsMapper; |
| | | @Resource |
| | | BigStorageCageDetailsService bigStorageCageDetailsService; |
| | | |
| | | @Override |
| | | public boolean saveBatch(List<BigStorageCageOutTask> list) { |
| | |
| | | * 检测PLC是否完成任务 |
| | | */ |
| | | @Override |
| | | public void updateOutTask(){ |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList=querybigStorageCageOutTask(1); |
| | | log.info("查询任务表是否有已完成的出片任务"+bigStorageCageOutTaskList.size()); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask:bigStorageCageOutTaskList |
| | | public void updateOutTask() { |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = querybigStorageCageOutTask(1); |
| | | log.info("查询任务表是否有已完成的出片任务" + bigStorageCageOutTaskList.size()); |
| | | for (BigStorageCageOutTask bigStorageCageOutTask : bigStorageCageOutTaskList |
| | | ) { |
| | | deleteOutTask(bigStorageCageOutTask.getGlassId()); |
| | | } |
| | |
| | | * 完成出片任务 |
| | | */ |
| | | @Override |
| | | public void deleteOutTask(String glassId){ |
| | | public void deleteOutTask(String glassId) { |
| | | log.info("根据任务id修改钢化小片表状态,删除已完成的出片任务,删除笼子表玻璃"); |
| | | |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper =new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId,glassId); |
| | | TemperingGlassInfo temperingGlassInfo=temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getGlassId, glassId); |
| | | TemperingGlassInfo temperingGlassInfo = temperingGlassInfoMapper.selectOne(temperingGlassInfoWrapper); |
| | | //判断是否手动任务,不钢化任务完成后删掉,钢化任务完成后改状态为0 |
| | | if(temperingGlassInfo.getState()==-2){ |
| | | if (temperingGlassInfo.getState() == -2) { |
| | | temperingGlassInfoMapper.deleteById(temperingGlassInfo.getId()); |
| | | }else{ |
| | | } else { |
| | | temperingGlassInfo.setState(0); |
| | | temperingGlassInfoMapper.updateById(temperingGlassInfo); |
| | | } |
| | | |
| | | LambdaQueryWrapper<BigStorageCageOutTask> bigStorageCageOutTaskWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageOutTaskWrapper.eq(BigStorageCageOutTask::getGlassId,glassId); |
| | | BigStorageCageOutTask bigStorageCageOutTask=bigStorageCageOutTaskMapper.selectOne(bigStorageCageOutTaskWrapper); |
| | | LambdaQueryWrapper<BigStorageCageOutTask> bigStorageCageOutTaskWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageOutTaskWrapper.eq(BigStorageCageOutTask::getGlassId, glassId); |
| | | BigStorageCageOutTask bigStorageCageOutTask = bigStorageCageOutTaskMapper.selectOne(bigStorageCageOutTaskWrapper); |
| | | bigStorageCageOutTaskMapper.deleteById(bigStorageCageOutTask.getId()); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId,glassId); |
| | | BigStorageCageDetails bigStorageCageDetails=bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getGlassId, glassId); |
| | | BigStorageCageDetails bigStorageCageDetails = bigStorageCageDetailsMapper.selectOne(bigStorageCageDetailsWrapper); |
| | | bigStorageCageDetailsMapper.deleteById(bigStorageCageOutTask.getId()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void deleteTask(List<BigStorageCageOutTask> outGlassId){ |
| | | public void deleteTask(List<BigStorageCageOutTask> outGlassId) { |
| | | baseMapper.deleteTask(outGlassId); |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageCageOutTask> selectBigStorageCageOutTask(BigStorageCageOutTask bigStorageCageOutTask, String startTime, String endTime){ |
| | | public List<BigStorageCageOutTask> selectBigStorageCageOutTask(BigStorageCageOutTask bigStorageCageOutTask, String startTime, String endTime) { |
| | | if (endTime != null && !endTime.isEmpty()) { |
| | | endTime = endTime + " 23:59:59"; |
| | | } |
| | |
| | | wrapper.between(BigStorageCageOutTask::getCreateTime, startTime, endTime); |
| | | return baseMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public String temperingOut(BigStorageCageOutTask bigStorageCageOutTask) { |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = this.list( |
| | | new LambdaQueryWrapper<BigStorageCageOutTask>() |
| | | .lt(BigStorageCageOutTask::getTaskState, 3) |
| | | ); |
| | | if (CollectionUtils.isEmpty(bigStorageCageOutTaskList)) { |
| | | bigStorageCageOutTask.setTrainNumber(1); |
| | | bigStorageCageOutTask.setSerialNumber(1); |
| | | bigStorageCageOutTask.setTaskState(1); |
| | | this.save(bigStorageCageOutTask); |
| | | bigStorageCageDetailsService.update( |
| | | new LambdaUpdateWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getGlassId, bigStorageCageOutTask.getGlassId()) |
| | | .set(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT_ING) |
| | | .orderByDesc(BigStorageCageDetails::getId) |
| | | .last("limit 1") |
| | | ); |
| | | return "任务添加成功"; |
| | | } else { |
| | | return "任务添加失败,当前有未完成的任务"; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.largenscreen.entity.PieChartVO; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import com.mes.tools.WebSocketServer; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void largenScreen() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage = bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | List<PieChartVO> pieChartVOS = bigStorageCageService.queryPieChart(); |
| | | jsonObject.append("pieChartVOS", pieChartVOS); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("largenScreen"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |
| | | // // 将最后一个消息转换为整数类型的列表 |
| | | webserver.clearMessages(); |
| | | } |
| | | } else { |
| | | log.info("largenScreen is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.mes.device.PlcParameterObject; |
| | | import com.mes.edgglasstask.entity.EdgGlassTaskInfo; |
| | | import com.mes.edgglasstask.service.EdgGlassTaskInfoService; |
| | | import com.mes.engineering.entity.Engineering; |
| | | import com.mes.engineering.mapper.EngineeringMapper; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.service.GlassInfoService; |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | @Resource |
| | | private DamageService damageService; |
| | | @Resource |
| | | private EngineeringMapper engineeringMapper; |
| | | |
| | | @Resource |
| | | private RedisUtil redisUtil; |
| | |
| | | String d04ToMES = plcParameterObject.getPlcParameter("D04ToMES").getValue(); |
| | | |
| | | |
| | | // d01Id="P25010108|37|8"; |
| | | // d01Id="P25031806|15|3"; |
| | | // d04ToMES="1"; |
| | | // d01ToMES="1"; |
| | | |
| | |
| | | .isNull(BigStorageCageOutTask::getGlassId) |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | log.info("查询的出片任务:{}", temperingGlassInfoList); |
| | | List<String> glassIds = temperingGlassInfoList.stream().map(TemperingGlassInfo::getGlassId).collect(Collectors.toList()); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsService.list( |
| | | new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .in(BigStorageCageDetails::getGlassId, glassIds) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_OUT) |
| | | ); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | List<String> detialGlassIds = bigStorageCageDetailsList.stream().map(BigStorageCageDetails::getGlassId).collect(Collectors.toList()); |
| | | temperingGlassInfoList.removeIf(info -> detialGlassIds.contains(info.getGlassId())); |
| | | log.info("笼内不存在玻璃的钢化任务{}", bigStorageCageDetailsList); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutMoreGlassInfo(temperingGlassInfoList, Boolean.TRUE, 1); |
| | |
| | | //到齐,将玻璃小片数据存入钢化小片表,逻辑生成出片任务 结束 |
| | | for (TemperingLayoutDTO item : temperingLayoutDTOList) { |
| | | if (redisUtil.getCacheObject("temperingengineerId").equals(item.getEngineerId())) { |
| | | Engineering engineering = engineeringMapper.selectOne( |
| | | new LambdaQueryWrapper<Engineering>() |
| | | .eq(Engineering::getEngineerId, item.getEngineerId()) |
| | | ); |
| | | if (engineering.getState() == 2) { |
| | | redisUtil.setCacheObject("temperingengineerId", ""); |
| | | Date endDate = new Date(); |
| | | log.info("当前工程被禁止生产,大理片笼出片任务结束时间:{},共耗时:{}ms,结束扫码任务", endDate, endDate.getTime() - startDate.getTime()); |
| | | return; |
| | | } |
| | | List<TemperingGlassInfo> temperingGlassInfos = glassInfoService.selectJoinList(TemperingGlassInfo.class, JoinWrappers.lambda(GlassInfo.class) |
| | | .selectAll(GlassInfo.class) |
| | | .select("-1 as state") |
| | |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date())); |
| | | } |
| | | } else { |
| | | if(serialNumber <= outCarMaxSize && remainWidth > maxLength){ |
| | | if (serialNumber <= outCarMaxSize && remainWidth > maxLength) { |
| | | remainWidth = remainWidth - maxLength - glassGap; |
| | | bigStorageCageOutTaskList.add(new BigStorageCageOutTask(e.getGlassId(), e.getSlot(), Const.ARTIFICIAL_OUT_TARGET_POSITION, |
| | | e.getWidth() * 10, e.getHeight() * 10, trainNumber, serialNumber++, 1, new Date())); |
| | | }else{ |
| | | } else { |
| | | remainWidth = carWidth - maxLength - glassGap; |
| | | trainNumber = trainNumber + 1; |
| | | serialNumber = 1; |
| | |
| | | } |
| | | Assert.isFalse(CollectionUtils.isEmpty(bigStorageCageOutTaskList), "未获取出片数据,结束出片任务"); |
| | | log.info("获取出片任务数据{}条,执行保存", bigStorageCageOutTaskList.size()); |
| | | List<String> outGlassIds = bigStorageCageOutTaskList.stream() |
| | | .map(BigStorageCageOutTask::getGlassId) |
| | | .collect(Collectors.toList()); |
| | | //判断工程变更时修改出片位置 |
| | | List<GlassInfo> glassInfos = glassInfoService.list( |
| | | new LambdaQueryWrapper<GlassInfo>() |
| | | .in(GlassInfo::getGlassId, outGlassIds) |
| | | .eq(GlassInfo::getProductionStatus, 3) |
| | | ); |
| | | if (CollectionUtils.isNotEmpty(glassInfos)) { |
| | | List<String> changeGlassIds = glassInfos.stream() |
| | | .map(GlassInfo::getGlassId) |
| | | .collect(Collectors.toList()); |
| | | bigStorageCageOutTaskList.forEach(task -> { |
| | | if (changeGlassIds.contains(task.getGlassId())) { |
| | | task.setEndSlot(Const.ARTIFICIAL_OUT_TARGET_POSITION); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | bigStorageCageOutTaskService.saveBatch(bigStorageCageOutTaskList); |
| | | List<String> glassIds = bigStorageCageOutTaskList.stream().map(BigStorageCageOutTask::getGlassId).collect(Collectors.toList()); |
| | | log.info("将出片玻璃{}玻璃状态改为已出片", glassIds); |
| | |
| | | count2, |
| | | count1, |
| | | count2 - count1 as count3, |
| | | count(c.glass_id) as count4, |
| | | count4, |
| | | slots |
| | | from (select engineer_id, |
| | | tempering_layout_id, |
| | |
| | | and tempering_layout_id!=0 |
| | | group by engineer_id, tempering_layout_id) as a |
| | | left join |
| | | (select engineer_id, tempering_layout_id, count(*) as count2 |
| | | from glass_info |
| | | (select gi.engineer_id, gi.tempering_layout_id, count(gi.glass_id) as count2,count(d.glass_id) as count4 |
| | | from glass_info gi left join damage d on gi.glass_id=d.glass_id and (d.type=8 or d.type=9) |
| | | group by engineer_id, tempering_layout_id) as b |
| | | on a.engineer_id = b.engineer_id and a.tempering_layout_id = b.tempering_layout_id |
| | | left join damage as c |
| | | on a.engineer_id = c.engineer_id and a.tempering_layout_id = c.tempering_layout_id and |
| | | (type = 8 or type = 9) |
| | | group by a.engineer_id, a.tempering_layout_id |
| | | order by a.engineer_id, a.tempering_layout_id |
| | | </select> |
| | |
| | | <!-- COUNT(DISTINCT T1.TEMPERING_LAYOUT_ID),--> |
| | | <!-- COUNT(DISTINCT T.SLOT) - COUNT(DISTINCT T1.SLOT) DESC--> |
| | | <!-- </select>--> |
| | | <select id="queryPieChart" resultType="com.mes.largenscreen.entity.PieChartVO"> |
| | | SELECT |
| | | round(sum( CASE WHEN e.station_cell = 5 THEN 1 ELSE 0 END ),2) as oneCompletedQuantity, |
| | | round(sum( CASE WHEN e.station_cell = 5 THEN bscd.width*bscd.height/1000000 ELSE 0 END ),2) as oneCompletedArea, |
| | | round(sum( CASE WHEN e.station_cell = 6 THEN 1 ELSE 0 END ),2) as twoCompletedQuantity, |
| | | round(sum( CASE WHEN e.station_cell = 6 THEN bscd.width*bscd.height/1000000 ELSE 0 END ),2) as twoCompletedArea, |
| | | round(sum( CASE WHEN e.station_cell = 5 and bscd.device_id is null THEN 1 ELSE 0 END ),2) as oneUncompletedQuantity, |
| | | round(sum( CASE WHEN e.station_cell = 5 and bscd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END ),2) as oneUncompletedArea, |
| | | round(sum( CASE WHEN e.station_cell = 6 and bscd.device_id is null THEN 1 ELSE 0 END ),2) as twoUncompletedQuantity, |
| | | round(sum( CASE WHEN e.station_cell = 6 and bscd.device_id is null THEN gi.width*gi.height/1000000 ELSE 0 END ),2) as twoUncompletedArea |
| | | FROM |
| | | glass_info gi |
| | | left join big_storage_cage_details bscd ON gi.glass_id = bscd.glass_id |
| | | left join engineering e on gi.engineer_id=e.engineer_id |
| | | WHERE |
| | | date(e.create_time) = date(now()) |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.Stream; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | // requestWord="3"; |
| | | // glassIdeValue="P25031802|4|1"; |
| | | // out06Glassstate="1"; |
| | | // out08Glassstate="1"; |
| | | // out11Glassstate ="1"; |
| | | // out13Glassstate="1"; |
| | | // currentSlot="1"; |
| | | // confirmationWrodValue="0"; |
| | | requestWord = "2"; |
| | | glassIdeValue = ""; |
| | | out06Glassstate = "1"; |
| | | out08Glassstate = "1"; |
| | | out11Glassstate = "1"; |
| | | out13Glassstate = "1"; |
| | | currentSlot = "1"; |
| | | confirmationWrodValue = "0"; |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | |
| | | log.info("笼内没有玻璃,无法执行出片"); |
| | | return Boolean.FALSE; |
| | | } |
| | | // //获取最小工程与炉数 |
| | | // Map<String, List<DownStorageCageDetails>> groupedMap = tempList.stream() |
| | | // .collect(Collectors.groupingBy(item -> item.getEngineerId() + "_" + item.getTemperingLayoutId())); |
| | | // // 获取第一个 先进卧理那一炉的信息 |
| | | // List<DownStorageCageDetails> cageList = |
| | | // new ArrayList<>(groupedMap.values().stream().findFirst().orElse(Collections.emptyList())); |
| | | // |
| | | // if (groupedMap.size() > 1) { |
| | | // //按流程卡进行分组 |
| | | // Map<String, List<DownStorageCageDetails>> getFlowCardIds = cageList.stream() |
| | | // .collect(Collectors.groupingBy(item -> item.getFlowCardId() + "_" + item.getLayer())); |
| | | // // 按 短边 降序,长边 降序,炉内片序 降序 |
| | | // getFlowCardIds.forEach((key, list) -> { |
| | | // list.sort(Comparator.comparingDouble((DownStorageCageDetails item) -> Math.min(item.getWidth(), item.getHeight())) |
| | | // .reversed() |
| | | // .thenComparingDouble(item -> Math.max(item.getWidth(), item.getHeight())) |
| | | // .reversed() |
| | | // .thenComparingInt(item -> item.getTemperingFeedSequence())); |
| | | // }); |
| | | // //获取每个流程卡出片优先级最高的玻璃 |
| | | // tempList = getFlowCardIds.values().stream() |
| | | // .map(list -> list.isEmpty() ? null : list.get(0)) |
| | | // .filter(Objects::nonNull) |
| | | // .collect(Collectors.toList()); |
| | | // } else { |
| | | // //笼内加扫码位玻璃id |
| | | // List<String> cageGlassIds = cageList.stream() |
| | | // .map(DownStorageCageDetails::getGlassId) |
| | | // .collect(Collectors.toList()); |
| | | // //获取破损拿走的玻璃并过滤调已经在笼内的,防止乱报破损 |
| | | // List<Damage> damageList = damageService.list( |
| | | // new LambdaQueryWrapper<Damage>() |
| | | // .eq(Damage::getEngineerId, cageList.get(0).getEngineerId()) |
| | | // .eq(Damage::getTemperingLayoutId, cageList.get(0).getTemperingLayoutId()) |
| | | // .and(item -> item.eq(Damage::getType, 8).or().eq(Damage::getType, 9)) |
| | | // .lt(Damage::getStatus, 4) |
| | | // .notIn(Damage::getGlassId, cageGlassIds) |
| | | // ); |
| | | // //获取破损/拿走玻璃id |
| | | // List<String> damageGlassIds = damageList.stream() |
| | | // .map(Damage::getGlassId) |
| | | // .collect(Collectors.toList()); |
| | | // //获取已出片玻璃信息 |
| | | // List<DownStorageCageDetails> downStorageCageDetails = downStorageCageDetailsService.list( |
| | | // new LambdaQueryWrapper<DownStorageCageDetails>() |
| | | // .eq(DownStorageCageDetails::getEngineerId, cageList.get(0).getEngineerId()) |
| | | // .eq(DownStorageCageDetails::getTemperingLayoutId, cageList.get(0).getTemperingLayoutId()) |
| | | // ); |
| | | // //获取已出片玻璃id |
| | | // List<String> downGlassIds = downStorageCageDetails.stream() |
| | | // .map(DownStorageCageDetails::getGlassId) |
| | | // .collect(Collectors.toList()); |
| | | // //获取所有未下片的玻璃信息 |
| | | // List<GlassInfo> glassInfoList = glassInfoService.list( |
| | | // new LambdaQueryWrapper<GlassInfo>() |
| | | // .eq(GlassInfo::getEngineerId, cageList.get(0).getEngineerId()) |
| | | // .eq(GlassInfo::getTemperingLayoutId, cageList.get(0).getTemperingLayoutId()) |
| | | // .notIn(CollectionUtils.isNotEmpty(damageGlassIds), GlassInfo::getGlassId, damageGlassIds) |
| | | // .notIn(CollectionUtils.isNotEmpty(downGlassIds), GlassInfo::getGlassId, downGlassIds) |
| | | // ); |
| | | // //按流程卡进行分组 |
| | | // Map<String, List<GlassInfo>> getFlowCardIds = glassInfoList.stream() |
| | | // .collect(Collectors.groupingBy(item -> item.getFlowCardId() + "_" + item.getLayer())); |
| | | // // 按 短边 降序,长边 降序,炉内片序 降序 |
| | | // getFlowCardIds.forEach((key, list) -> { |
| | | // list.sort(Comparator.comparingDouble((GlassInfo item) -> Math.min(item.getWidth(), item.getHeight())) |
| | | // .reversed() |
| | | // .thenComparingDouble(item -> Math.max(item.getWidth(), item.getHeight())) |
| | | // .reversed() |
| | | // .thenComparingInt(item -> item.getTemperingFeedSequence())); |
| | | // }); |
| | | // //获取一炉所有未出片流程卡优先级最高的玻璃 |
| | | // List<GlassInfo> glassInfos = getFlowCardIds.values().stream() |
| | | // .map(list -> list.isEmpty() ? null : list.get(0)) |
| | | // .filter(Objects::nonNull) |
| | | // .collect(Collectors.toList()); |
| | | // //获取一炉所有未出片流程卡优先级最高的玻璃id |
| | | // List<String> noOutGlassIds = glassInfos.stream() |
| | | // .map(GlassInfo::getGlassId) |
| | | // .collect(Collectors.toList()); |
| | | // //获取匹配的玻璃信息 |
| | | // List<DownStorageCageDetails> filteredList = tempList.stream() |
| | | // .filter(item -> noOutGlassIds.contains(item.getGlassId())) |
| | | // .collect(Collectors.toList()); |
| | | // if (CollectionUtils.isNotEmpty(filteredList)) { |
| | | // tempList = filteredList; |
| | | // } else { |
| | | // //是否满笼 |
| | | // if (tempList.size() == 9) { |
| | | // // 结果列表 |
| | | // List<DownStorageCageDetails> resultList = new ArrayList<>(); |
| | | // |
| | | // // 将 glassInfos 转换成 Map,以 flowCardId_layer 作为 key |
| | | // Map<String, GlassInfo> glassInfoMap = glassInfos.stream() |
| | | // .collect(Collectors.toMap( |
| | | // item -> item.getFlowCardId() + "_" + item.getLayer(), |
| | | // item -> item |
| | | // )); |
| | | // |
| | | // // 按 flowCardId 和 layer 进行分组 |
| | | // Map<String, List<DownStorageCageDetails>> groupedByFlowCardLayer = tempList.stream() |
| | | // .collect(Collectors.groupingBy(item -> item.getFlowCardId() + "_" + item.getLayer())); |
| | | // |
| | | // // 遍历分组,找出每一组中误差最小的 DownStorageCageDetails |
| | | // for (Map.Entry<String, List<DownStorageCageDetails>> entry : groupedByFlowCardLayer.entrySet()) { |
| | | // String key = entry.getKey(); |
| | | // List<DownStorageCageDetails> groupList = entry.getValue(); |
| | | // |
| | | // // 只有当 glassInfoMap 里有相应的 key 时,才计算最接近的匹配项 |
| | | // if (glassInfoMap.containsKey(key)) { |
| | | // GlassInfo glassInfo = glassInfoMap.get(key); |
| | | // double glassShortEdge = Math.min(glassInfo.getWidth(), glassInfo.getHeight()); |
| | | // double glassLongEdge = Math.max(glassInfo.getWidth(), glassInfo.getHeight()); |
| | | // |
| | | // // 找到误差最小的 DownStorageCageDetails |
| | | // Optional<DownStorageCageDetails> bestMatch = groupList.stream() |
| | | // .min(Comparator.comparingDouble(item -> { |
| | | // double itemShortEdge = Math.min(item.getWidth(), item.getHeight()); |
| | | // double itemLongEdge = Math.max(item.getWidth(), item.getHeight()); |
| | | // |
| | | // // 先比较短边误差 |
| | | // double shortEdgeDiff = Math.abs(itemShortEdge - glassShortEdge); |
| | | // // 再比较长边误差(仅当短边误差相同时) |
| | | // double longEdgeDiff = Math.abs(itemLongEdge - glassLongEdge); |
| | | // |
| | | // return shortEdgeDiff * 1000 + longEdgeDiff; // 让短边误差优先级更高 |
| | | // })); |
| | | // |
| | | // bestMatch.ifPresent(resultList::add); |
| | | // } |
| | | // } |
| | | // tempList = resultList; |
| | | // } else { |
| | | // return Boolean.FALSE; |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | |
| | | //优先走08片台的玻璃:走人工下片或者2号机械臂 |
| | | //1、08台忙碌,仅走1号机械臂 |
| | | //2、08台空闲,先走扔工下片或2号机械臂,无玻璃出片 在走1号机械臂 |