Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
New file |
| | |
| | | // tableData.js
|
| | |
|
| | | import { ref } from 'vue';
|
| | |
|
| | | export const tableData = ref([
|
| | | {
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },{
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },{
|
| | | location: '1',
|
| | | type: 'Type A',
|
| | | length: '100',
|
| | | height: '50',
|
| | | thickness: '10',
|
| | | quantity: '5',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '2',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 0
|
| | | },
|
| | | {
|
| | | location: '3',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '4',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | },
|
| | | {
|
| | | location: '5',
|
| | | type: 'Type B',
|
| | | length: '120',
|
| | | height: '60',
|
| | | thickness: '12',
|
| | | quantity: '10',
|
| | | entry_time: '2024-06-19 10:00:00',
|
| | | batchnumber: '444',
|
| | | shelf_status: 1
|
| | | }
|
| | | // Add more data as needed
|
| | | ]);
|
| | |
| | |
|
| | | <!-- 左侧按钮组 -->
|
| | | <div >
|
| | | <el-button type="success" size="mini" @click="storage()">原片仓储详情</el-button>
|
| | | <el-button type="success" size="mini" @click="handleInbound()">入库</el-button>
|
| | | <el-button type="success" size="mini" >吊装位入库</el-button>
|
| | |
|
| | |
| | | </el-form-item>
|
| | |
|
| | | </div>
|
| | |
|
| | | <el-dialog v-model="Hidden" top="10vh" width="80%" >
|
| | | <el-table
|
| | | :data="tableData"
|
| | | :data="tableData" v-model="dialogVisible3"
|
| | |
|
| | | style="width: 98%; height: 200px"
|
| | | @selection-change="handleSelectionChange"
|
| | |
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | |
|
| | | <el-table
|
| | | :data="tasktableData"
|
| | |
| | | </template>
|
| | | </el-table-column>
|
| | | </el-table>
|
| | |
|
| | | </el-dialog>
|
| | | </el-card>
|
| | |
|
| | | <div ref="chart" id="chart" style="width: 100%; height: 250px;"></div>
|
| | | |
| | | <!-- <div ref="chart" id="chart" style="width: 100%; height: 250px;"></div> -->
|
| | |
|
| | |
|
| | | |
| | | <div class="img-ypcc" >
|
| | |
|
| | |
|
| | | <div class="img-car1" :style="'z-index:999;left:297px;top:158px;position:absolute;'">
|
| | | <div v-show="cellshow1" style="margin-top:10px;width:200px;height:5px;background-color:#409EFF;"></div>
|
| | | </div>
|
| | | |
| | | </div>
|
| | |
|
| | | <!-- 入库对话框 -->
|
| | | <el-dialog
|
| | |
| | | </el-dialog>
|
| | |
|
| | |
|
| | | <!-- <div ref="chart" id="chart" style="width: 100%; height: 400px;"></div> -->
|
| | | </div>
|
| | | </template>
|
| | |
|
| | |
| | | }
|
| | | // Add more data as needed
|
| | | ]);
|
| | |
|
| | | const Hidden = ref(false)
|
| | |
|
| | | const getTagType2 =(status) => {
|
| | | switch (status) {
|
| | |
| | | // 打开入库对话框
|
| | | dialogVisible.value = true;
|
| | | };
|
| | |
|
| | | const storage = () => {
|
| | | // 打开入库对话框
|
| | | Hidden.value = true;
|
| | | };
|
| | | |
| | |
|
| | | const handleCloseDialog = () => {
|
| | | // 关闭对话框时重置表单数据
|
| | |
| | |
|
| | |
|
| | |
|
| | | let chartInstance = null;
|
| | | |
| | |
|
| | | onMounted(() => {
|
| | | // Initialize the chart
|
| | | chartInstance = echarts.init(document.getElementById('chart'));
|
| | |
|
| | | // Simulated data for demonstration
|
| | | const chartData = {
|
| | | labels: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
|
| | | datasets: [
|
| | | { name: '使用情况统计', data: [{ remaining: 4, total: 5 }, { remaining: 9, total: 10 }, { remaining: 0, total: 30 }, { remaining: 0, total: 10 },{ remaining: 4, total: 5 }] }
|
| | | ]
|
| | | };
|
| | |
|
| | | const options = {
|
| | | tooltip: {
|
| | | trigger: 'axis',
|
| | | axisPointer: {
|
| | | type: 'shadow'
|
| | | }
|
| | | },
|
| | | legend: {
|
| | | data: ['使用情况统计']
|
| | | },
|
| | | xAxis: {
|
| | | type: 'category',
|
| | | data: chartData.labels
|
| | | },
|
| | | yAxis: {
|
| | | type: 'value'
|
| | | },
|
| | | series: chartData.datasets.map(item => ({
|
| | | name: item.name,
|
| | | type: 'bar',
|
| | | stack: '总量',
|
| | | label: {
|
| | | show: true,
|
| | | position: 'inside',
|
| | | formatter: '{c}%'
|
| | | },
|
| | | data: item.data.map(dataItem => ({
|
| | | value: (dataItem.remaining / dataItem.total * 100).toFixed(2), // 计算剩余量占比,保留两位小数
|
| | | remaining: dataItem.remaining,
|
| | | total: dataItem.total,
|
| | | itemStyle: {
|
| | | color: getColorByRemaining(dataItem.remaining, dataItem.total)
|
| | | }
|
| | | }))
|
| | | }))
|
| | | };
|
| | |
|
| | | function getColorByRemaining(remaining, total) {
|
| | | // 根据剩余量与总量的比例,设置不同的颜色逻辑
|
| | | const percentage = remaining / total;
|
| | | if (percentage >= 0.8) {
|
| | | return '#FF6666'; // Red
|
| | | } else if (percentage >= 0.5) {
|
| | | return '#FFCC66'; // Yellow
|
| | | } else {
|
| | | return '#66CC66'; // Green
|
| | | }
|
| | | }
|
| | |
|
| | | // Set options and render chart
|
| | | if (chartInstance) {
|
| | | chartInstance.setOption(options);
|
| | | }
|
| | | });
|
| | |
|
| | | onBeforeUnmount(() => {
|
| | | if (chartInstance) {
|
| | | chartInstance.dispose();
|
| | | chartInstance = null;
|
| | | }
|
| | | });
|
| | |
|
| | | const handleSelectionChange = (selection) => {
|
| | | console.log('Selection changed:', selection);
|
| | | };
|
| | |
|
| | | </script>
|
| | |
|
| | |
| | |
|
| | |
|
| | |
|
| | | .img-ypcc{
|
| | | margin-left: 80px;
|
| | | background-image:url('../../assets/ypcc.png');
|
| | | background-repeat: no-repeat;
|
| | | background-attachment: local;
|
| | | min-height: 800px;
|
| | | width: 1600px;
|
| | | max-width: 100%;
|
| | | background-size: 1400px 800px;
|
| | | overflow: hidden;
|
| | | position:relative
|
| | | }
|
| | |
|
| | | .img-car1{
|
| | | background-image:url('../../assets/ypccche.png');
|
| | | position: absolute;
|
| | | background-repeat: no-repeat;
|
| | | background-attachment: local;
|
| | | min-height: 200px;
|
| | | width: 200px;
|
| | | max-width: 100%;
|
| | | background-size: 200px 70px;
|
| | | overflow: hidden;
|
| | | position:relative
|
| | | }
|
| | |
|
| | | .custom-dialog {
|
| | | max-height: 90vh; /* 最大高度为视口高度的90% */
|
| | |
| | | */ |
| | | void saveGlassInfo(List<GlassInfo> glassinfo); |
| | | |
| | | /** |
| | | * @param flowCardId |
| | | * @return 根据流程卡号查询玻璃信息 |
| | | */ |
| | | int getGlassInfoCountByFlowCardId(String flowCardId); |
| | | |
| | | /** |
| | |
| | | * 查询所有工程状态不为300不同流程卡号 |
| | | */ |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.print.attribute.standard.MediaSize; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | public List<Map<String, Object>> selectCutTerritory() { |
| | | List<UpPattenUsage> upPattenUsage = upPattenUsageMapper.selectList(new MPJLambdaWrapper<UpPattenUsage>() |
| | | .selectAll(UpPattenUsage.class) |
| | | .eq(UpPattenUsage::getState, 1).or().eq(UpPattenUsage::getState, 0).orderByDesc(UpPattenUsage::getState)); |
| | | .orderByDesc(UpPattenUsage::getState) |
| | | .orderByDesc(UpPattenUsage::getId)); |
| | | if (!upPattenUsage.isEmpty()) { |
| | | UpPattenUsage upPattenUsage1 = upPattenUsage.get(0); |
| | | List<Map<String, Object>> cutTerritorys=optimizeDetailMapper.selectJoinMaps(JoinWrappers.lambda(OptimizeDetail.class) |
| | |
| | | return edgGlassTaskInfoService.save(edgGlassTaskInfo); |
| | | } |
| | | |
| | | /** |
| | | * 当前切割版图信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void currentCutTerritory() { |
| | | public void CacheGlassTasks() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //识别摆片 |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | 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("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边任务 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgTask() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //磨边信息 |
| | | List<Map<String, Object>> EdgTasks1 = taskCacheService.selectEdgInfo("2001"); |
| | | List<Map<String, Object>> EdgTasks2 = taskCacheService.selectEdgInfo("2002"); |
| | | jsonObject.append("EdgTasks1", EdgTasks1); |
| | | jsonObject.append("EdgTasks2", EdgTasks2); |
| | | |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 磨边前 缓存内信息 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void selectEdgStorageCage() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("cacheGlass"); |
| | | 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("Home is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: prod |
| | | application: |
| | | name: cacheGlass |
| | | mybatis-plus: |
| | |
| | | @PostMapping("/insertBigStorageCageDetails") |
| | | public Result insertBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.insertBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"添加成功",bigStorageCageService.querybigStorageCageDetail(0)); |
| | | return Result.build(200,"添加成功",bigStorageCageService.querybigStorageCageDetail()); |
| | | } |
| | | |
| | | @ApiOperation("理片笼详情删除") |
| | | @PostMapping("/deleteBigStorageCageDetails") |
| | | public Result deleteBigStorageCageDetails(@RequestBody BigStorageCageDetails bigStorageCageDetails) { |
| | | bigStorageCageDetailsService.deleteBigStorageCageDetails(bigStorageCageDetails); |
| | | return Result.build(200,"删除成功",bigStorageCageService.querybigStorageCageDetail(0)); |
| | | return Result.build(200,"删除成功",bigStorageCageService.querybigStorageCageDetail()); |
| | | } |
| | | |
| | | @ApiOperation("理片笼任务破损0/拿走1") |
| | |
| | | |
| | | boolean outGlass(); |
| | | |
| | | List<BigStorageCage> querybigStorageCageDetail(int deviceId); |
| | | List<BigStorageCage> querybigStorageCageDetailAll(); |
| | | |
| | | Map<Integer, List<BigStorageCage>> querybigStorageCageDetail(); |
| | | |
| | | List<Map<String, Object>> selectBigStorageCageUsage(); |
| | | |
| | | void updateStorageCageDisabled(int slot,int enableState); |
| | | void updateStorageCageDisabled(int slot, int enableState); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | */ |
| | | @Override |
| | | public List<BigStorageCageDetails> selectTask(int taskType) { |
| | | return null; |
| | | // if (taskType == 1) { |
| | | // //进片任务数据 |
| | | // LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | // feedWrapper.eq(BigStorageCageDetails::getState, Const.BIG_STORAGE_IN); |
| | | // List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | // |
| | | // LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | // feedTaskWrapper.lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT); |
| | | // List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(feedTaskWrapper); |
| | | // |
| | | // Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | // .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | | // |
| | | // for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | // BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | // bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | // } |
| | | // return bigStorageCageDetailsList; |
| | | // } else { |
| | | // //出片任务数据 |
| | | // LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | // outWrapper.eq(BigStorageCageDetails::getState, Const.BIG_STORAGE_OUT); |
| | | // List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | // |
| | | // LambdaQueryWrapper<BigStorageCageOutTask> outTaskWrapper = new LambdaQueryWrapper<>(); |
| | | // outTaskWrapper.lt(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS); |
| | | // List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(outTaskWrapper); |
| | | // |
| | | // Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | | // .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task)); |
| | | // for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | // BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | // bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | // } |
| | | // return bigStorageCageDetailsList; |
| | | // } |
| | | if (taskType == 1) { |
| | | //进片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> feedWrapper = new LambdaQueryWrapper<>(); |
| | | feedWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(feedWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageFeedTask> feedTaskWrapper = new LambdaQueryWrapper<>(); |
| | | feedTaskWrapper.lt(BigStorageCageFeedTask::getTaskState, Const.BIG_STORAGE_IN_SLOT); |
| | | List<BigStorageCageFeedTask> bigStorageCageFeedTaskList = bigStorageCageFeedTaskMapper.selectList(feedTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageFeedTask> listMap = bigStorageCageFeedTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageFeedTask::getGlassId, task -> task)); |
| | | Iterator<BigStorageCageDetails> iterator = bigStorageCageDetailsList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | BigStorageCageDetails bigStorageCageDetails = iterator.next(); |
| | | BigStorageCageFeedTask bigStorageCageFeedTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | if (bigStorageCageDetails.getBigStorageCageFeedTask() == null) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } else { |
| | | //出片任务数据 |
| | | LambdaQueryWrapper<BigStorageCageDetails> outWrapper = new LambdaQueryWrapper<>(); |
| | | outWrapper.eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN); |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = baseMapper.selectList(outWrapper); |
| | | |
| | | LambdaQueryWrapper<BigStorageCageOutTask> outTaskWrapper = new LambdaQueryWrapper<>(); |
| | | outTaskWrapper.lt(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_SUCCESS); |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = bigStorageCageOutTaskMapper.selectList(outTaskWrapper); |
| | | |
| | | Map<String, BigStorageCageOutTask> listMap = bigStorageCageOutTaskList.stream() |
| | | .collect(Collectors.toMap(BigStorageCageOutTask::getGlassId, task -> task)); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList) { |
| | | BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | } |
| | | Iterator<BigStorageCageDetails> iterator = bigStorageCageDetailsList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | BigStorageCageDetails bigStorageCageDetails = iterator.next(); |
| | | BigStorageCageOutTask bigStorageCageOutTask = listMap.get(bigStorageCageDetails.getGlassId()); |
| | | bigStorageCageDetails.setBigStorageCageOutTask(bigStorageCageOutTask); |
| | | if (bigStorageCageDetails.getBigStorageCageOutTask() == null) { |
| | | iterator.remove(); |
| | | } |
| | | } |
| | | return bigStorageCageDetailsList; |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | |
| | | import com.mes.temperingglass.entity.TemperingGlassInfo; |
| | | import com.mes.temperingglass.service.TemperingGlassInfoService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | public BigStorageCageDetails feedGlass(GlassInfo glassInfo, BigStorageCageDetails bigStorageCageDetails) { |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | //玻璃不钢化时 |
| | | if(glassInfo.getTemperingLayoutId()==null){ |
| | | if (glassInfo.getTemperingLayoutId() == null) { |
| | | |
| | | BigStorageCage bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | BigStorageCage bigStorageCage = baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | |
| | | .last("limit 1") |
| | | ); |
| | | |
| | | if(bigStorageCage.getSlot()!=null){ |
| | | if (bigStorageCage.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId()); |
| | | } |
| | | }else{ |
| | | } else { |
| | | //玻璃钢化时 |
| | | BigStorageCage bigStorageCage=new BigStorageCage(); |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | | |
| | | bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | bigStorageCage = baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | |
| | | .eq(BigStorageCageDetails::getTemperingFeedSequence, glassInfo.getTemperingFeedSequence() - 1) |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | ); |
| | | log.info("1、查询理片笼内片序-1等于当前玻璃片序的玻璃"+bigStorageCage); |
| | | log.info("1、查询理片笼内片序-1等于当前玻璃片序的玻璃" + bigStorageCage); |
| | | |
| | | log.info("2、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果不为空时"+bigStorageCage.getSlot()); |
| | | log.info("2、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果不为空时" + bigStorageCage.getSlot()); |
| | | if (bigStorageCage.getSlot() != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCage.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCage.getDeviceId()); |
| | | } else { |
| | | log.info("3、查询理片笼内片序-1等于当前玻璃片序的玻璃的结果为空时获取当前玻璃版图id是否存在理片笼内"); |
| | | |
| | | bigStorageCage=baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | bigStorageCage = baseMapper.selectJoinOne(BigStorageCage.class, new MPJLambdaWrapper<BigStorageCage>() |
| | | .selectAll(BigStorageCage.class) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on |
| | | .eq(BigStorageCage::getDeviceId, BigStorageCageDetails::getDeviceId) |
| | |
| | | .gt(BigStorageCage::getRemainWidth, glassInfo.getWidth()) |
| | | ); |
| | | |
| | | if(bigStorageCage != null){ |
| | | if (bigStorageCage != null) { |
| | | log.info("4、获取笼子内适合的格子"); |
| | | BigStorageCage bigStorageCages=bigStorageCageSlot(bigStorageCage.getDeviceId()); |
| | | BigStorageCage bigStorageCages = bigStorageCageSlot(bigStorageCage.getDeviceId()); |
| | | bigStorageCageDetails.setSlot(bigStorageCages.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(bigStorageCages.getDeviceId()); |
| | | }else{ |
| | | } else { |
| | | log.info("5、获取每个笼子版图id的个数"); |
| | | QueryWrapper<BigStorageCageDetails> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("a.device_id", "COUNT(DISTINCT b.tempering_layout_id) AS layoutCount") |
| | |
| | | .apply("LEFT JOIN (SELECT device_id, tempering_layout_id FROM big_storage_cage_details) b ON a.device_id = b.device_id AND a.slot = b.slot") |
| | | .orderByAsc("layoutCount") |
| | | .orderByAsc("a.device_id"); |
| | | List<Map<String, Object>> bigStorageCageDetailsCount= bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | List<Map<String, Object>> bigStorageCageDetailsCount = bigStorageCageDetailsMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("5、查询笼子内是否有合适的格子"); |
| | | boolean found=false; |
| | | boolean found = false; |
| | | for (Map<String, Object> map : bigStorageCageDetailsCount) { |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | int deviceId = Integer.parseInt(entry.getKey()); |
| | | BigStorageCage bigStorageCages=bigStorageCageSlot(deviceId); |
| | | if(bigStorageCage!=null){ |
| | | BigStorageCage bigStorageCages = bigStorageCageSlot(deviceId); |
| | | if (bigStorageCage != null) { |
| | | bigStorageCageDetails.setSlot(bigStorageCages.getSlot()); |
| | | bigStorageCageDetails.setDeviceId(deviceId); |
| | | found=true; |
| | | found = true; |
| | | break; |
| | | } |
| | | } |
| | | if(found){ |
| | | if (found) { |
| | | break; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | if (bigStorageCageDetails.getSlot() != null) { |
| | | log.info("6、当找到合适的格子时添加玻璃到笼子表"); |
| | | bigStorageCageDetails.setState(0); |
| | | bigStorageCageDetailsMapper.insert(bigStorageCageDetails); |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()) ; |
| | | updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | } |
| | | return bigStorageCageDetails; |
| | | } |
| | | |
| | | //获取笼子内的空格子 |
| | | private BigStorageCage bigStorageCageSlot(Integer deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper=new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper |
| | | .eq(BigStorageCage::getRemainWidth,"5000") |
| | | .eq(BigStorageCage::getEnableState,"0") |
| | | .eq(BigStorageCage::getDeviceId,deviceId) |
| | | .orderByAsc(BigStorageCage::getSlot) |
| | | .last("LIMIT 1"); |
| | | return bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper |
| | | .eq(BigStorageCage::getRemainWidth, "5000") |
| | | .eq(BigStorageCage::getEnableState, "0") |
| | | .eq(BigStorageCage::getDeviceId, deviceId) |
| | | .orderByAsc(BigStorageCage::getSlot) |
| | | .last("LIMIT 1"); |
| | | return bigStorageCageMapper.selectOne(bigStorageCageWrapper); |
| | | } |
| | | |
| | | //出片逻辑 |
| | | @Override |
| | | public boolean outGlass() { |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getState,-1); |
| | | LambdaQueryWrapper<TemperingGlassInfo> temperingGlassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | temperingGlassInfoWrapper.eq(TemperingGlassInfo::getState, -1); |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(temperingGlassInfoWrapper); |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃"+temperingGlassInfoList.size()); |
| | | if(temperingGlassInfoList.size()>0){ |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃" + temperingGlassInfoList.size()); |
| | | if (temperingGlassInfoList.size() > 0) { |
| | | temperingGlassInfoService.addOutTask(temperingGlassInfoList); |
| | | log.info("2、添加任务到任务表"); |
| | | return true; |
| | | }else{ |
| | | } else { |
| | | log.info("3、没有可出的玻璃时获取是否有小片到齐的版图"); |
| | | |
| | | QueryWrapper<BigStorageCageDetails> wrapper = Wrappers.query(); |
| | |
| | | .groupBy("tempering_layout_id"); |
| | | List<Map<String, Object>> temperingLayoutIdList = bigStorageCageDetailsMapper.selectMaps(wrapper); |
| | | |
| | | boolean key=false; |
| | | boolean key = false; |
| | | for (Map<String, Object> row : temperingLayoutIdList) { |
| | | for (Map.Entry<String, Object> entry : row.entrySet()) { |
| | | String temperingId = entry.getKey(); |
| | | Object temperingNo = entry.getValue(); |
| | | |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper=new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getTemperingLayoutId,temperingId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList= glassInfoService.list(glassInfoWrapper); |
| | | if(glassInfoList.size()==Integer.parseInt(temperingNo.toString())){ |
| | | for (GlassInfo glassInfo:glassInfoList |
| | | ) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoWrapper.eq(GlassInfo::getTemperingLayoutId, temperingId) |
| | | .orderByDesc(GlassInfo::getTemperingFeedSequence); |
| | | List<GlassInfo> glassInfoList = glassInfoService.list(glassInfoWrapper); |
| | | if (glassInfoList.size() == Integer.parseInt(temperingNo.toString())) { |
| | | for (GlassInfo glassInfo : glassInfoList |
| | | ) { |
| | | |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | TemperingGlassInfo temperingGlassInfo = new TemperingGlassInfo(); |
| | | BeanUtils.copyProperties(glassInfo, temperingGlassInfo); |
| | | temperingGlassInfoService.save(temperingGlassInfo); |
| | | |
| | | } |
| | | key=true; |
| | | } |
| | | if(key){ |
| | | key = true; |
| | | } |
| | | if (key) { |
| | | return false; |
| | | } |
| | | } |
| | |
| | | public void updateRemainWidth(int slot) { |
| | | log.info("获取该格子内玻璃信息,计算格子剩余宽度"); |
| | | double width = 5000; |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper=new LambdaQueryWrapper(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper = new LambdaQueryWrapper(); |
| | | bigStorageCageDetailsWrapper |
| | | .eq(BigStorageCageDetails::getSlot,slot) |
| | | .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getState,Const.GLASS_STATE_ARTIFICIAL); |
| | | .eq(BigStorageCageDetails::getSlot, slot) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL); |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | for (BigStorageCageDetails bigStorageCageDetails : bigStorageCageDetailsList |
| | | ) { |
| | | double widths=bigStorageCageDetails.getWidth(); |
| | | double gap=bigStorageCageDetails.getGap(); |
| | | width -= widths+gap; |
| | | double widths = bigStorageCageDetails.getWidth(); |
| | | double gap = bigStorageCageDetails.getGap(); |
| | | width -= widths + gap; |
| | | } |
| | | //修改格子剩余宽度 |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | | bigStorageCage.setRemainWidth((int)width); |
| | | bigStorageCage.setRemainWidth((int) width); |
| | | UpdateWrapper<BigStorageCage> bigStorageCageWrapper = new UpdateWrapper<>(); |
| | | bigStorageCageWrapper.eq("slot", slot); |
| | | bigStorageCageMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | |
| | | |
| | | //查询大理片信息,前端展示用 |
| | | @Override |
| | | public List<BigStorageCage> querybigStorageCageDetail(int deviceId) { |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper =new LambdaQueryWrapper<>(); |
| | | LambdaQueryWrapper<BigStorageCageDetails> bigStorageCageDetailsWrapper =new LambdaQueryWrapper<>(); |
| | | bigStorageCageDetailsWrapper |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_IN) |
| | | .or() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL); |
| | | if(deviceId!=0){ |
| | | bigStorageCageWrapper.eq(BigStorageCage::getDeviceId,deviceId); |
| | | bigStorageCageDetailsWrapper.eq(BigStorageCageDetails::getDeviceId,deviceId); |
| | | } |
| | | public List<BigStorageCage> querybigStorageCageDetailAll() { |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)); |
| | | return bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | } |
| | | |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectList(bigStorageCageWrapper); |
| | | log.info("1、获取大理片笼信息完成,获取到的数据{}", bigStorageCages.size()); |
| | | //查询大理片信息,前端展示用 |
| | | @Override |
| | | public Map<Integer, List<BigStorageCage>> querybigStorageCageDetail() { |
| | | |
| | | List<BigStorageCageDetails> bigStorageCageDetailsList = bigStorageCageDetailsMapper.selectList(bigStorageCageDetailsWrapper); |
| | | |
| | | Map<Integer, List<BigStorageCageDetails>> listMap = bigStorageCageDetailsList.stream().collect(Collectors.groupingBy(BigStorageCageDetails::getSlot)); |
| | | for (BigStorageCage bigStorageCage : bigStorageCages) { |
| | | List<BigStorageCageDetails> bigStorageCageDetails = listMap.get(bigStorageCage.getSlot()); |
| | | bigStorageCage.setBigStorageCageDetails(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCages; |
| | | MPJLambdaWrapper<BigStorageCage> wrapper = new MPJLambdaWrapper<>(); |
| | | wrapper.selectAll(BigStorageCage.class).selectCollection(BigStorageCageDetails.class, BigStorageCage::getBigStorageCageDetails) |
| | | .leftJoin(BigStorageCageDetails.class, on -> on.eq(BigStorageCageDetails::getSlot, BigStorageCage::getSlot) |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)); |
| | | List<BigStorageCage> bigStorageCages = bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | Map<Integer, List<BigStorageCage>> listMap = bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | return listMap; |
| | | } |
| | | |
| | | //笼子使用情况,界面展示用 |
| | |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,COUNT(device_id) - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | |
| | | .groupBy("device_id"); |
| | | List<Map<String, Object>> bigStorageCageUsages=baseMapper.selectMaps(wrapper); |
| | | List<Map<String, Object>> bigStorageCageUsages = baseMapper.selectMaps(wrapper); |
| | | |
| | | return bigStorageCageUsages; |
| | | } |
| | | |
| | | //笼子的启用/禁用 |
| | | @Override |
| | | public void updateStorageCageDisabled(int slot,int enableState){ |
| | | BigStorageCage bigStorageCage=new BigStorageCage(); |
| | | public void updateStorageCageDisabled(int slot, int enableState) { |
| | | BigStorageCage bigStorageCage = new BigStorageCage(); |
| | | bigStorageCage.setEnableState(enableState); |
| | | LambdaQueryWrapper<BigStorageCage> bigStorageCageWrapper = new LambdaQueryWrapper<>(); |
| | | bigStorageCageWrapper.eq(BigStorageCage::getSlot,slot); |
| | | baseMapper.update(bigStorageCage,bigStorageCageWrapper); |
| | | bigStorageCageWrapper.eq(BigStorageCage::getSlot, slot); |
| | | baseMapper.update(bigStorageCage, bigStorageCageWrapper); |
| | | } |
| | | } |
| | |
| | | @Resource |
| | | private TemperingGlassInfoService temperingGlassInfoService; |
| | | |
| | | private JSONObject jsonObject = new JSONObject(); |
| | | public void hangzhoumes() throws InterruptedException { |
| | | List<Double> carPostion=new ArrayList<>(); |
| | | carPostion.add(0.25); |
| | | carPostion.add(0.5); |
| | | jsonObject.append("carPostion",carPostion); |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask); |
| | | |
| | | //出片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2); |
| | | jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask); |
| | | |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | //理片笼表格信息 |
| | | jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetailAll()); |
| | | |
| | | } |
| | | |
| | | public void salve_hangzhoumes_1() throws InterruptedException { |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); |
| | | |
| | | } |
| | | /** |
| | | * fixedRate : 上一个调用开始后再次调用的延时(不用等待上一次调用完成) |
| | | * fixedDelay : 上一个调用结束后再次调用的延时 |
| | | */ |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void plcStorageCageTask() throws InterruptedException { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject = new JSONObject(); |
| | | try { |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfo1", bigStorageCageService.querybigStorageCageDetail(1)); |
| | | jsonObject.append("bigStorageCageInfo2", bigStorageCageService.querybigStorageCageDetail(2)); |
| | | jsonObject.append("bigStorageCageInfo3", bigStorageCageService.querybigStorageCageDetail(3)); |
| | | jsonObject.append("bigStorageCageInfo4", bigStorageCageService.querybigStorageCageDetail(4)); |
| | | jsonObject.append("bigStorageCageInfo5", bigStorageCageService.querybigStorageCageDetail(5)); |
| | | jsonObject.append("bigStorageCageInfo6", bigStorageCageService.querybigStorageCageDetail(6)); |
| | | jsonObject.append("bigStorageCageInfo7", bigStorageCageService.querybigStorageCageDetail(7)); |
| | | jsonObject.append("bigStorageCageInfo8", bigStorageCageService.querybigStorageCageDetail(8)); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | | jsonObject.append("bigStorageCageDetailsFeedTask", bigStorageCageDetailsFeedTask); |
| | | |
| | | //出片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsOutTask=bigStorageCageDetailsService.selectTask(2); |
| | | jsonObject.append("bigStorageCageDetailsOutTask", bigStorageCageDetailsOutTask); |
| | | |
| | | //理片笼使用情况 |
| | | List<Map<String, Object>> bigStorageCageUsage=bigStorageCageService.selectBigStorageCageUsage(); |
| | | jsonObject.append("bigStorageCageUsage", bigStorageCageUsage); |
| | | |
| | | //出片队列 |
| | | List<TemperingGlassInfo> temperingGlassInfoList= temperingGlassInfoService.list(); |
| | | jsonObject.append("temperingGlassInfoList", temperingGlassInfoList); |
| | | |
| | | //理片笼表格信息 |
| | | jsonObject.append("bigStorageCageInfo", bigStorageCageService.querybigStorageCageDetail(0)); |
| | | |
| | | |
| | | hangzhoumes(); |
| | | salve_hangzhoumes_1(); |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("slicecage"); |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | |
| | | judgeGlassTypeStatus(d04Id, Const.A10_OUT_TARGET_POSITION, mesD04Address); |
| | | } |
| | | log.info("结束扫码任务"); |
| | | // if (flag01 && flag04) { |
| | | // //比较最早一片任务的版图id及版序 求出卧转立的线路 |
| | | // Integer startLine = getStartLine(); |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else if (flag01 || flag04) { |
| | | // Integer startLine = flag01.equals(Boolean.TRUE) ? Const.A09_OUT_TARGET_POSITION : Const.A10_OUT_TARGET_POSITION; |
| | | // //计算目标格子,发送启动任务 |
| | | // computeTargetByLine(startLine); |
| | | // } else { |
| | | // log.info("两条线未收到进片任务,结束本次扫描进卧转立任务"); |
| | | // } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | |
| | | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcToHomeEdgOutTask() { |
| | | |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | String mesToPLCAddress = plcMesObject.getPlcParameter("MESToPLC").getAddress(); |
| | | List<BigStorageCageOutTask> outingList = bigStorageCageOutTaskService.list(new LambdaQueryWrapper<BigStorageCageOutTask>().eq(BigStorageCageOutTask::getTaskState, Const.BIG_STORAGE_OUT_NEW)); |
| | | Assert.isTrue(CollectionUtils.isEmpty(outingList), "有正在执行出片的任务,结束当前出片线程"); |
| | | |
| | |
| | | .orderBy(Boolean.TRUE, sequenceOrder, TemperingGlassInfo::getTemperingFeedSequence)); |
| | | if (CollectionUtils.isNotEmpty(temperingGlassInfoList)) { |
| | | log.info("有正在出片的钢化任务"); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | return; |
| | | } |
| | | //是否有人工下片任务 有直接出 |
| | | List<BigStorageCageDetails> artificialList = bigStorageCageDetailsService.list(new LambdaQueryWrapper<BigStorageCageDetails>() |
| | | .eq(BigStorageCageDetails::getState, Const.GLASS_STATE_ARTIFICIAL).orderByDesc(BigStorageCageDetails::getWidth)); |
| | | if (CollectionUtils.isNotEmpty(artificialList)) { |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.FALSE, mesToPLCAddress); |
| | | return; |
| | | } |
| | | //钢化优先:获取理片笼 玻璃小片 破损表 数量 判断笼内版图是否到齐 |
| | |
| | | .eq(GlassInfo::getTemperingLayoutId, temperingLayoutDTO.getTemperingLayoutId()) |
| | | .eq(GlassInfo::getEngineerId, temperingLayoutDTO.getEngineerId())); |
| | | temperingGlassInfoService.saveBatch(temperingGlassInfos); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE); |
| | | computeOutGlassInfo(temperingGlassInfoList, Boolean.TRUE, mesToPLCAddress); |
| | | return; |
| | | } |
| | | //未到齐 执行内部调度任务 |
| | |
| | | List<BigStorageCageOutTask> outTasks = list.stream().map(e -> new BigStorageCageOutTask(e.getGlassId(), first.getSlot(), second.getSlot(), |
| | | slotWidth, 0, 0, 1)).collect(Collectors.toList()); |
| | | bigStorageCageOutTaskService.saveBatch(outTasks); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | return; |
| | | } |
| | | } |
| | |
| | | log.info("送片任务已发送完成,任务线路为:{},启动地址为{}", line, outLine); |
| | | } |
| | | |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering) { |
| | | private <T extends BigStorageCageBaseInfo> Boolean computeOutGlassInfo(List<T> list, Boolean isTempering, String mesToPLCAddress) { |
| | | //任务数据 获取车子存放玻璃最大数量 玻璃间隔 |
| | | List<BigStorageCageOutTask> bigStorageCageOutTaskList = new ArrayList<>(); |
| | | //打车剩余尺寸 |
| | |
| | | .in(BigStorageCageDetails::getGlassId, glassIds)); |
| | | //更新笼子内格子的剩余尺寸 |
| | | updateSlotRemain(list, glassIds); |
| | | S7object.getinstance().plccontrol.writeWord(mesToPLCAddress, 1); |
| | | log.info("已向plc发送出片任务确认,地址为:{}", mesToPLCAddress); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 任务类型 1:进 2:出 |
| | | */ |
| | | private String taskType; |
| | | private Integer taskType; |
| | | |
| | | /** |
| | | * 宽 |
| | |
| | | */ |
| | | public interface DownStorageCageService extends MPJBaseService<DownStorageCage> { |
| | | |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, Integer taskType); |
| | | |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType); |
| | | DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, Integer taskType); |
| | | // List<Map<String, Object>> selectCacheLeisure(); |
| | | |
| | | |
| | |
| | | */ |
| | | List<Map<String, Object>> selectDownStorageCages(); |
| | | |
| | | |
| | | /** |
| | | * @return 查询缓存中最多的流程卡 |
| | | */ |
| | | List<DownStorageCageDetails> selectCacheMax(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | private DownStorageCageDetailsMapper downStorageCageDetailsMapper; |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(GlassInfo glassInfo, Integer startCell, Integer endCell, Integer taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, String taskType) { |
| | | public DownGlassTask createDownGlassTask(DownStorageCageDetails glassInfo, Integer startCell, Integer endCell, Integer taskType) { |
| | | DownGlassTask downGlassTask = new DownGlassTask(); |
| | | |
| | | BeanUtils.copyProperties(glassInfo, downGlassTask); |
| | |
| | | log.info("3、如果当前玻璃属于流程卡中的片序的顺序则直通,执行下片任务"); |
| | | DownWorkstation downWorkstation = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getFlowCardId, glassInfo.getFlowCardId())); |
| | | int WorkstationId = downWorkstation.getWorkstationId(); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, WorkstationId, "3"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, WorkstationId, 3); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | |
| | | } else { |
| | |
| | | downStorageCageDetailsService.save(details); |
| | | log.info("7、玻璃信息已存入理片笼详情表,玻璃信息为{}", details); |
| | | |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, item.getSlot(), "1"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(glassInfo, 0, item.getSlot(), 1); |
| | | //添加进片任务 |
| | | log.info("8、生成进片任务信息存入任务表{}", downGlassTask); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | |
| | | if (endCell == null) { |
| | | endCell = 7; |
| | | } |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, 9, endCell, "2"); |
| | | DownGlassTask downGlassTask = downStorageCageService.createDownGlassTask(selectedItem, 9, endCell, 2); |
| | | downGlassTaskService.insertCacheTask(downGlassTask); |
| | | LambdaQueryWrapper<DownStorageCageDetails> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(DownStorageCageDetails::getGlassId, selectedItem.getGlassId()); |
| | |
| | | @Value("${mes.maxHeight}") |
| | | private Integer maxHeight; |
| | | |
| | | @Value("${mes.minWidth}") |
| | | private Integer minWidth; |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | @Value("${mes.minHeight}") |
| | | private Integer minHeight; |
| | | |
| | | |
| | | @Scheduled(fixedDelay = 3000) |
| | | public void plcHomeEdgTask() { |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | PlcParameterObject plcParameterObject = S7object.getinstance().PlcMesObject; |
| | | String requestWord = plcParameterObject.getPlcParameter("requestWord").getValue(); |
| | | String glassIdeValue = plcParameterObject.getPlcParameter("requestID").getValue(); |
| | | //A08 A09表示线路相同 可做等价 无数据转int异常 |
| | |
| | | String confirmationWrodValue = plcParameterObject.getPlcParameter("confirmationWord").getValue(); |
| | | String confirmationWrodAddress = plcParameterObject.getPlcParameter("confirmationWord").getAddress(); |
| | | String currentSlot = plcParameterObject.getPlcParameter("currentCell").getValue(); |
| | | |
| | | |
| | | |
| | | log.info("1、获取到的请求字为:{},获取到的扫描ID为:{},获取到的确认字为:{},获取到的出片状态分别为:g06:{}、g08:{}、g11:{}、g13:{},当前格子号为:{}", |
| | | requestWord, glassIdeValue, confirmationWrodValue, out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, currentSlot); |
| | |
| | | inTo(glassIdeValue, requestWord, currentSlot); |
| | | } else if ("2".equals(requestWord)) { |
| | | //09空闲 :1 10空闲 :2 都空闲:3 其他0 |
| | | log.info("2、出片请求,且确认字为0,执行进片任务"); |
| | | log.info("2、出片请求,且确认字为0,执行出片任务"); |
| | | outTo(out06Glassstate, out08Glassstate, out11Glassstate, out13Glassstate, glassIdeValue, currentSlot); |
| | | } else if ("3".equals(requestWord)) { |
| | | log.info("2、进片和出片都空闲,执行出片任务"); |
| | |
| | | } |
| | | Boolean checkFlag = Boolean.FALSE; |
| | | //玻璃尺寸是否走人工下片 |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight) { |
| | | log.info("该玻璃尺寸走人工下片,直接进片"); |
| | | } else { |
| | | if (glassInfo.getWidth() > maxWidth || glassInfo.getHeight() > maxHeight || glassInfo.getWidth() < minWidth || glassInfo.getHeight() < minHeight) { |
| | | log.info("该玻璃尺寸不符合要求,需要走人工下片直接进片"); |
| | | } |
| | | else { |
| | | log.info("该玻璃尺寸非人工下片"); |
| | | //获取该玻璃的流程卡是否已绑定架子 |
| | | DownWorkstation one = downWorkstationService.getOne(new LambdaQueryWrapper<DownWorkstation>() |
| | |
| | | downGlassTask.setStartCell(startCell); |
| | | downGlassTask.setGlassId(glassInfo.getGlassId()); |
| | | downGlassTask.setEndCell(endCell); |
| | | downGlassTask.setTaskType(taskType + ""); |
| | | downGlassTask.setTaskType(taskType); |
| | | downGlassTask.setWidth((int) glassInfo.getWidth()); |
| | | downGlassTask.setHeight((int) glassInfo.getHeight()); |
| | | downGlassTask.setFlowCardId(glassInfo.getFlowCardId()); |
| | |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | mes: |
| | | maxWidth: 1000 #下片的最大宽度 |
| | | maxHeight: 1000 #下片的最大高度 |
| | | maxWidth: 2500 #下片的最大宽度 2500*2000 |
| | | maxHeight: 2000 #下片的最大高度 |
| | | minWidth: 400 #下片的最小宽度 |
| | | minHeight: 400 #下片的最小高度 |
| | | |
| | | throughWidth: 3000 |
| | | throughHeight: 3000 |
| | | throughHeight: 2500 |
| | | threshold: 5 #下片的最大阈值 |
| | |
| | | import com.mes.downworkstation.service.DownWorkstationService; |
| | | import com.mes.downworkstation.service.impl.DownWorkstationServiceImpl; |
| | | import com.mes.glassinfo.service.impl.GlassInfoServiceImpl; |
| | | import com.mes.job.DownLoadCacheGlassTask; |
| | | import com.mes.utils.Result; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.junit.Test; |
| | |
| | | |
| | | |
| | | DownStorageCage downStorageCage= new DownStorageCage(); |
| | | downStorageCage.setEnableState("0"); |
| | | downStorageCage.setEnableState(0); |
| | | downStorageCage.setId(1); |
| | | downStorageCageService.updateDownStorageCage(downStorageCage); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |