Merge branch 'master' of http://10.153.19.25:10101/r/HangZhouMes
| | |
| | | ElMessage.error(response.message); |
| | | } |
| | | |
| | | const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", { |
| | | glassId:"P24060403|3|6", |
| | | line:"2001", |
| | | workingProcedure:"冷加工", |
| | | remark:"", |
| | | status:"2" |
| | | }) |
| | | // const responses = await request.post("/cacheVerticalGlass/damage/insertDamage", { |
| | | // glassId:"P24081502|1|1", |
| | | // line:"1001", |
| | | // workingProcedure:"切割", |
| | | // remark:"", |
| | | // status:"0" |
| | | // }) |
| | | }; |
| | | // 报工 |
| | | const handleConfirm = async () => { |
| | |
| | | }; |
| | | fetchTableData(); |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | const handleMessage = (data) => { |
| | | // const socketUrl = `ws://${WebSocketHost}:${host}/api/temperingGlass/api/talk/screen`; |
| | | // const handleMessage = (data) => { |
| | | // adjustedRects.value = data.device[0].map(rect => ({ |
| | | // ...rect, |
| | | // completed: rect.completedQuantity, |
| | | // breakage: rect.breakageQuantity, |
| | | // thisProcess: rect.thisProcess, |
| | | // })); |
| | | }; |
| | | // }; |
| | | // let socket; |
| | | onMounted(() => { |
| | | socket = new WebSocket(socketUrl); |
| | | socket.onmessage = (event) => { |
| | | const data = JSON.parse(event.data); |
| | | // socket = new WebSocket(socketUrl); |
| | | // socket.onmessage = (event) => { |
| | | // const data = JSON.parse(event.data); |
| | | |
| | | // updateCharts(); |
| | | }; |
| | | // // updateCharts(); |
| | | // }; |
| | | // }; |
| | | }); |
| | | onUnmounted(() => { |
| | |
| | | }); |
| | | onMounted(() => { |
| | | fetchTableData(); |
| | | socket = initializeWebSocket(socketUrl, handleMessage); |
| | | // socket = initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (socket) { |
| | |
| | | } |
| | | }; |
| | | let socket = null; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/cacheGlass`; |
| | | const socketUrl = `ws://${WebSocketHost}:${host}/api/cacheGlass/api/talk/edgTasks`; |
| | | // 定义消息处理函数,更新 receivedData 变量 |
| | | const handleMessage = (data) => { |
| | | // 更新 tableData 的数据 |
| | |
| | | let totalQuantity1 = 0; |
| | | //面积 |
| | | let totalArea = 0; |
| | | //落架面积 |
| | | let totalArea1 = 0; |
| | | //重量 |
| | | let totalWeight = 0; |
| | | //落架重量 |
| | | let totalWeight1 = 0; |
| | | // 对每个集合中的 detailList 进行计算 |
| | | produceList.value[i].detailList.forEach(collection => { |
| | | totalQuantity += collection.quantity * 1; |
| | |
| | | //每个序号面积 |
| | | collection.total_area = parseFloat((collection.width * collection.height * collection.quantity / 1000000).toFixed(2)) |
| | | totalArea += collection.total_area * 1; |
| | | |
| | | collection.total_area1 = parseFloat((collection.width * collection.height * collection.quantity1 / 1000000).toFixed(2)) |
| | | totalArea1 += collection.total_area1 * 1; |
| | | |
| | | totalWeight += collection.width * collection.height * collection.quantity / 1000000 * collection.separation * 2.5 * 1; |
| | | totalWeight1 += collection.width * collection.height * collection.quantity1 / 1000000 * collection.separation * 2.5 * 1; |
| | | //每个序号周长 |
| | | collection.perimeter = parseFloat(((collection.width * 2 + collection.height * 2) * collection.quantity / 1000).toFixed(3)) |
| | | }); |
| | | // 输出每个集合中的总数量 |
| | | produceList.value[i].detail[0].quantity = totalQuantity |
| | | produceList.value[i].detail[0].quantity1 = totalQuantity |
| | | produceList.value[i].detail[0].quantity1 = totalQuantity1 |
| | | produceList.value[i].detail[0].gross_area = totalArea |
| | | produceList.value[i].detail[0].gross_area1 = totalArea1 |
| | | produceList.value[i].detail[0].weight = totalWeight |
| | | produceList.value[i].detail[0].weight1 = totalWeight1 |
| | | } |
| | | } |
| | | |
| | |
| | | <td v-for="(itemsum,index) in item.detail" :key="index" colspan="29"> |
| | | 数量: |
| | | <label>{{ itemsum.quantity }}</label> |
| | | 落加数量: |
| | | 落架数量: |
| | | <label>{{ itemsum.quantity1 }}</label> |
| | | 面积: |
| | | <label>{{ parseFloat(itemsum.gross_area.toFixed(2)) }}</label> |
| | | 落架面积: |
| | | <label>{{ parseFloat(itemsum.gross_area1.toFixed(2)) }}</label> |
| | | 重量: |
| | | <label>{{ parseFloat(itemsum.weight.toFixed(2)) }}</label> |
| | | 落架重量: |
| | | <label>{{ parseFloat(itemsum.weight1.toFixed(2)) }}</label> |
| | | </td> |
| | | </tr> |
| | | <tr v-for="(itemtextarea,index) in item.detail" :key="index"> |
| | |
| | | autoPrint.value = data.autoPrint[0]; |
| | | } |
| | | if (data.takeGlass != null) { |
| | | |
| | | takeGlass.value = data.takeGlass[0]; |
| | | // takeGlass.value 是一个空对象 |
| | | let width = takeGlass.value.width; |
| | | let height = takeGlass.value.height; |
| | | if (width < height) { |
| | | takeGlass.value.width = height; |
| | | takeGlass.value.height = width; |
| | | } |
| | | |
| | | |
| | | } |
| | | if (data.scanGlass != null) { |
| | | scanGlass.value = data.scanGlass[0]; |
| | | let width = scanGlass.value.width; |
| | | let height = scanGlass.value.height; |
| | | if (width < height) { |
| | | scanGlass.value.width = height; |
| | | scanGlass.value.height = width; |
| | | } |
| | | } |
| | | |
| | | //自动打印 |
| | |
| | | </el-date-picker> |
| | | |
| | | <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{ |
| | | $t('reportmanage.inquire') |
| | | }} |
| | | $t('reportmanage.inquire') |
| | | }} |
| | | </el-button> |
| | | <el-table height="200px" ref="table" @selection-change="handleSelectionChange" :data="downGlass" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | |
| | | </el-dialog> |
| | | <el-dialog v-model="dialogFormVisibleaDownGlasss" top="2vh" width="97%" :title="$t('人工下片信息')"> |
| | | <div style="display:flex;justify-content: space-around;"> |
| | | <el-card style="display: flex; justify-content: center; align-items: center; width:800px; height: 800px;position: relative;"> |
| | | <el-card |
| | | style="display: flex; justify-content: center; align-items: center; width:800px; height: 800px;position: relative;"> |
| | | <div |
| | | :style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }"> |
| | | |
| | | :style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }"> |
| | | |
| | | </div> |
| | | <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:200px;"> |
| | | <div>人工下片当前玻璃信息</div> |
| | | <div>{{ takeGlass.flowCardId }}</div> |
| | | <div>{{ takeGlass.layer }}</div> |
| | | <div>{{ takeGlass.glassId }}</div> |
| | | <div>{{ takeGlass.width }}</div> |
| | | <div>{{ takeGlass.height }}</div> |
| | | </div> |
| | | <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:170px;"> |
| | | <div>人工下片当前玻璃信息</div> |
| | | <div>{{ takeGlass.flowCardId }}</div> |
| | | <div>{{ takeGlass.layer }}</div> |
| | | <div>{{ takeGlass.glassId }}</div> |
| | | <div>{{ takeGlass.width }}</div> |
| | | <div>{{ takeGlass.height }}</div> |
| | | </div> |
| | | </el-card> |
| | | <el-card style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;position: relative;"> |
| | | <el-card |
| | | style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;position: relative;"> |
| | | <div |
| | | :style="{ width: scanGlass.width + 'px', height: scanGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (scanGlass.width > scanGlass.height ? scanGlass.width : scanGlass.height) + ')' }"> |
| | | |
| | | |
| | | </div> |
| | | <div style="font-size: 50px; text-align: center;position: absolute;top:0px;left:200px;"> |
| | | <div>扫码枪当前玻璃信息</div> |
| | | <div>{{ scanGlass.flowCardId }}</div> |
| | | <div>{{ scanGlass.layer }}</div> |
| | | <div>{{ scanGlass.glassId }}</div> |
| | | <div>{{ scanGlass.width }}</div> |
| | | <div>{{ scanGlass.height }}</div> |
| | | <div>扫码枪当前玻璃信息</div> |
| | | <div>{{ scanGlass.flowCardId }}</div> |
| | | <div>{{ scanGlass.layer }}</div> |
| | | <div>{{ scanGlass.glassId }}</div> |
| | | <div>{{ scanGlass.width }}</div> |
| | | <div>{{ scanGlass.height }}</div> |
| | | |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | </el-dialog> |
| | |
| | | import com.github.yulichang.base.MPJBaseService; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, String workingProcedure); |
| | | |
| | | void submitDamage(List<Damage> damageList); |
| | | |
| | | void submitReport(Damage damage); |
| | | |
| | | /** |
| | | * 单个破损 |
| | |
| | | List<DamagePrint> selectDamagePrintDetails(Damage damage); |
| | | |
| | | void deleteByGlassId(String glassId); |
| | | |
| | | void sendToERP(ReportingWork reportingWork, List<ReportingWorkDetail> reportingWorkDetails); |
| | | } |
| | |
| | | package com.mes.damage.service.impl; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | | import com.github.yulichang.query.MPJQueryWrapper; |
| | | import com.mes.common.config.Const; |
| | |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | | import com.mes.work_assignment.entity.WorkAssignment; |
| | | import com.mes.work_assignment.mapper.WorkAssignmentMapper; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.InputStreamReader; |
| | | import java.io.OutputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | |
| | | GlassInfoMapper glassInfoMapper; |
| | | @Resource |
| | | WorkAssignmentMapper workAssignmentMapper; |
| | | @Autowired |
| | | private DamageMapper damageMapper; |
| | | |
| | | /** |
| | | * 查询报工信息 |
| | | */ |
| | | @Override |
| | | public List<Damage> selectDamage(String startTime, String endTime, int type, String workingProcedure) { |
| | | public List<Damage> selectDamage(String startTime, String endTime, int type, int status, String workingProcedure) { |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper = new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime, startTime, endTime); |
| | | if (type != 0) { |
| | | damageSelectWrapper.eq(Damage::getType, type); |
| | | } |
| | | // if (status != 0) { |
| | | // damageSelectWrapper.eq(Damage::getStatus, status); |
| | | // } |
| | | if (status != 0) { |
| | | damageSelectWrapper.eq(Damage::getStatus, status); |
| | | } |
| | | if (!"0".equals(workingProcedure)) { |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure, workingProcedure); |
| | | } |
| | |
| | | public void submitDamage(List<Damage> damageList) { |
| | | Map<String, List<Damage>> firstMap = damageList.stream().collect(Collectors.groupingBy(e -> e.getProcessId() + ":" |
| | | + e.getWorkingProcedure() + ":" + e.getDeviceName() + ":" + e.getTeamsGroupsName())); |
| | | |
| | | for (Map.Entry<String, List<Damage>> entry : firstMap.entrySet()) { |
| | | ReportingWork reportingWork = new ReportingWork(); |
| | | List<ReportingWorkDetail> reportingWorkDetails = new ArrayList<>(); |
| | | String key = entry.getKey(); |
| | | List<Damage> damages = entry.getValue(); |
| | | for (Damage damage:damages |
| | | ) { |
| | | reportingWork.setOrderId(damage.getProcessId().substring(0, 10)); |
| | | reportingWork.setProductionId(damage.getProcessId().substring(0,11)); |
| | | reportingWork.setProcessId(damage.getProcessId()+"/"+damage.getTechnologyNumber()); |
| | | reportingWork.setDeviceName(damage.getDeviceName()); |
| | | reportingWork.setThisProcess(damage.getWorkingProcedure()); |
| | | reportingWork.setThisCompletedQuantity(1); |
| | | reportingWork.setThisWornQuantity(0); |
| | | reportingWork.setClasses("早班"); |
| | | reportingWork.setReportingWorkTime(LocalDateTime.now()); |
| | | reportingWork.setTeamsGroupsName(damage.getTeamsGroupsName()); |
| | | reportingWork.setCreator("auto"); |
| | | System.out.println("Key: " + key); |
| | | } |
| | | |
| | | System.out.println("Key: " + key); |
| | | |
| | | Map<String, List<Damage>> secondMap = damageList.stream().collect(Collectors.groupingBy(e -> e.getProcessId() + ":" |
| | | + e.getWorkingProcedure() + ":" + e.getDeviceName() + ":" + e.getTeamsGroupsName())); |
| | | |
| | | for (Map.Entry<String, List<Damage>> entrys : secondMap.entrySet()) { |
| | | List<Damage> damagesdetail = entrys.getValue(); |
| | | |
| | | |
| | | for (Damage damage:damagesdetail |
| | | ) { |
| | | ReportingWorkDetail reportingWorkDetail = new ReportingWorkDetail(); |
| | | reportingWorkDetail.setTechnologyNumber(damage.getTechnologyNumber()); |
| | | reportingWorkDetail.setOrderNumber(damage.getOrderNumber()); |
| | | reportingWorkDetail.setCompletedQuantity(1); |
| | | reportingWorkDetail.setBreakageQuantity(0); |
| | | reportingWorkDetails.add(reportingWorkDetail); |
| | | |
| | | } |
| | | } |
| | | sendToERP(reportingWork,reportingWorkDetails); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void submitReport(Damage damage) { |
| | | ReportingWork reportingWork = new ReportingWork(); |
| | | reportingWork.setOrderId(damage.getProcessId().substring(0, 10)); |
| | | reportingWork.setProductionId(damage.getProcessId().substring(0,11)); |
| | | reportingWork.setProcessId(damage.getProcessId()+"/"+damage.getTechnologyNumber()); |
| | | reportingWork.setDeviceName(damage.getDeviceName()); |
| | | reportingWork.setThisProcess(damage.getWorkingProcedure()); |
| | | // reportingWork.setNextProcess("磨边"); |
| | | reportingWork.setThisCompletedQuantity(1); |
| | | reportingWork.setThisWornQuantity(0); |
| | | reportingWork.setClasses("早班"); |
| | | reportingWork.setReportingWorkTime(LocalDateTime.now()); |
| | | reportingWork.setTeamsGroupsName(damage.getTeamsGroupsName()); |
| | | reportingWork.setCreator("auto"); |
| | | |
| | | List<ReportingWorkDetail> reportingWorkDetails = new ArrayList<>(); |
| | | ReportingWorkDetail reportingWorkDetail = new ReportingWorkDetail(); |
| | | reportingWorkDetail.setTechnologyNumber(damage.getTechnologyNumber()); |
| | | reportingWorkDetail.setOrderNumber(damage.getOrderNumber()); |
| | | reportingWorkDetail.setCompletedQuantity(1); |
| | | reportingWorkDetail.setBreakageQuantity(0); |
| | | reportingWorkDetails.add(reportingWorkDetail); |
| | | sendToERP(reportingWork,reportingWorkDetails); |
| | | } |
| | | |
| | | /** |
| | |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | if (damage.getType() == null) { |
| | | damage.setType(1); |
| | | } |
| | | if (damage.getType() == 1) { |
| | | damage.setStatus(2); |
| | | submitReport(damage); |
| | | } |
| | | baseMapper.insert(damage); |
| | | } |
| | | |
| | |
| | | if (damage.getEngineerId() != null) { |
| | | listDamage.eq("t.engineer_id", damage.getEngineerId()); |
| | | } |
| | | return damageMapper.selectJoinList(DamagePrint.class, listDamage); |
| | | return baseMapper.selectJoinList(DamagePrint.class, listDamage); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public List<DamagePrint> selectDamagePrintDetails(Damage damage) { |
| | | List<DamagePrint> listDamage = damageMapper.selectJoinList(DamagePrint.class, new MPJQueryWrapper<Damage>() |
| | | List<DamagePrint> listDamage = baseMapper.selectJoinList(DamagePrint.class, new MPJQueryWrapper<Damage>() |
| | | .select("b.flow_card_id,b.layer,t.engineer_id,b.tempering_layout_id,b.tempering_feed_sequence,t.glass_id,b.width,b.height,b.thickness") |
| | | .leftJoin("glass_info as b on t.glass_id=b.glass_id") |
| | | .eq("t.working_procedure", damage.getWorkingProcedure()) |
| | |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | ); |
| | | } |
| | | |
| | | @Override |
| | | public void sendToERP(ReportingWork reportingWork, List<ReportingWorkDetail> reportingWorkDetails){ |
| | | try { |
| | | // 目标系统的API URL |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSaveReportingWorkWorn"; |
| | | URL obj = new URL(url); |
| | | HttpURLConnection con = (HttpURLConnection) obj.openConnection(); |
| | | |
| | | // 设置请求方法和请求头 |
| | | con.setRequestMethod("POST"); |
| | | con.setRequestProperty("Content-Type", "application/json; utf-8"); |
| | | con.setRequestProperty("Accept", "application/json"); |
| | | con.setDoOutput(true); |
| | | |
| | | // 创建 JSON 对象 |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | // 将 ReportingWork 转换为 JSONObject |
| | | JSONObject reportingWorkJson = new JSONObject(objectMapper.writeValueAsString(reportingWork)); |
| | | reportingWorkJson.put("reportingWorkTime", reportingWork.getReportingWorkTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); |
| | | // 将 ReportingWorkDetail 列表转换为 JSONArray |
| | | JSONArray detailsJsonArray = new JSONArray(objectMapper.writeValueAsString(reportingWorkDetails)); |
| | | |
| | | // 将 JSON 对象和数组添加到结果对象中 |
| | | result.put("title", reportingWorkJson); |
| | | result.put("detail", detailsJsonArray); |
| | | result.put("type", 0); |
| | | result.put("userId", "admin"); |
| | | result.put("userName", "admin"); |
| | | result.put("qualityInsStatus", 0); |
| | | |
| | | // 将 result 对象转换为字符串 |
| | | String jsonInputString = result.toString(); |
| | | System.out.println("jsonInputString : " + result); |
| | | // 发送请求 |
| | | try (OutputStream os = con.getOutputStream()) { |
| | | byte[] input = jsonInputString.getBytes("utf-8"); |
| | | os.write(input, 0, input.length); |
| | | } |
| | | |
| | | // 获取响应码 |
| | | int responseCode = con.getResponseCode(); |
| | | System.out.println("Response Code : " + responseCode); |
| | | |
| | | // 获取响应内容 |
| | | try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"))) { |
| | | StringBuilder response = new StringBuilder(); |
| | | String inputLine; |
| | | while ((inputLine = in.readLine()) != null) { |
| | | response.append(inputLine); |
| | | } |
| | | System.out.println("Response Body: " + response.toString()); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | /** |
| | | * 建立时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | |
| | | /** |
| | |
| | | |
| | | <select id="selectFlowCard" resultType="java.util.Map"> |
| | | select fc.order_number, |
| | | concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, |
| | | od.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(IFNULL(od.processing_note,''), IFNULL(od.remarks,'')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation, |
| | | fc.technology_number |
| | | concat(round(ogd.child_width), "*", round(ogd.child_height)) as child_width, |
| | | od.quantity, |
| | | round(ogd.total_area, 2) as total_area, |
| | | od.perimeter, |
| | | od.bend_radius, |
| | | concat(IFNULL(od.processing_note,''), IFNULL(od.remarks,'')) as remarks, |
| | | od.other_columns, |
| | | round(ogd.child_width) as width, |
| | | round(ogd.child_height) as height, |
| | | pd.separation |
| | | <if test="technologyNumber != 0"> |
| | | ,fc.technology_number |
| | | </if> |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | | fc.technology_number = ogd.technology_number |
| | | left join sd.order_detail as od on od.order_id = fc.order_id and od.order_number = fc.order_number |
| | | left join sd.product_detail as pd |
| | | on pd.prod_id = od.product_id and pd.glass_sort = ogd.technology_number |
| | | where fc.process_id = #{processId} |
| | | <if test="technologyNumber != 0"> |
| | | and a.layer = #{technologyNumber} |
| | | </if> |
| | | <if test="technologyNumber != 0"> |
| | | and position(fc.technology_number in #{technologyNumber}) |
| | | </if> |
| | | <if test="technologyNumber != 0"> |
| | | group by fc.process_id, fc.order_number, fc.technology_number |
| | | </if> |
| | | <if test="technologyNumber == 0"> |
| | | group by fc.process_id, fc.order_number |
| | | </if> |
| | | order by IF(sort != NULL || sort != '', sort, fc.order_number) |
| | | |
| | | </select> |
| | |
| | | <select id="selectProject" resultType="java.util.Map"> |
| | | select o.customer_name, |
| | | o.project, |
| | | (select process from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as process , |
| | | (select process |
| | | from sd.order_glass_detail |
| | | where order_id = fc.order_id |
| | | and order_number = fc.order_number |
| | | and technology_number = fc.technology_number) as process, |
| | | od.edging_type, |
| | | (select glass_child from sd.order_glass_detail where order_id=fc.order_id and order_number=fc.order_number and technology_number=fc.technology_number) as glass_child , |
| | | (select glass_child |
| | | from sd.order_glass_detail |
| | | where order_id = fc.order_id |
| | | and order_number = fc.order_number |
| | | and technology_number = fc.technology_number) as glass_child, |
| | | od.product_name, |
| | | o.processing_note, |
| | | fc.process_id, |
| | | SUM(od.quantity) as quantity, |
| | | round(SUM(ogd.total_area), 2) as gross_area, |
| | | sum(od.weight) as weight, |
| | | 1 as technologyNumber, |
| | | concat(fc.process_id, '/', 1) as processIdNumber, |
| | | concat('对应我司单号',o.batch) AS otherRemarks |
| | | SUM(od.quantity) as quantity, |
| | | round(SUM(ogd.total_area), 2) as gross_area, |
| | | sum(od.weight) as weight, |
| | | 1 as technologyNumber, |
| | | concat(fc.process_id, '/', 1) as processIdNumber, |
| | | concat('对应我司单号', o.batch) AS otherRemarks |
| | | from pp.flow_card as fc |
| | | left join sd.order_glass_detail as ogd |
| | | on fc.order_id = ogd.order_id and fc.order_number = ogd.order_number and |
| | |
| | | ogd.glass_child, |
| | | GROUP_CONCAT(glass_child SEPARATOR ' ') AS concatenated_glass_child |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{processId}, 10) |
| | | where ogd.order_id = left (#{processId} |
| | | , 10) |
| | | and position(ogd.technology_number in #{technologyNumber}) |
| | | GROUP BY order_id, order_number) as ogdc |
| | | on ogdc.order_id = ogd.order_id and ogdc.order_number = ogd.order_number and |
| | |
| | | Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId,upPattenUsage1.getEngineeringId()) |
| | | .and(wrapper->wrapper.eq(Damage::getType,8) |
| | | .or() |
| | | .eq(Damage::getType,9)) |
| | | ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2)); |
| | | |
| | | List<Map<String, Object>> resultCutTerritory=new ArrayList<>(); |
| | |
| | | Map<String, Damage> damageMaps=damageMapper.selectList(new MPJLambdaQueryWrapper<Damage>() |
| | | .selectAll(Damage.class) |
| | | .eq(Damage::getEngineerId,current) |
| | | .and(wrapper->wrapper.eq(Damage::getType,8) |
| | | .or() |
| | | .eq(Damage::getType,9)) |
| | | ).stream().collect(Collectors.toMap(Damage::getGlassId,Damage->Damage,(V1,V2)->V2)); |
| | | |
| | | for (Map<String, Object> item : cutTerritory) { |
| | |
| | | |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("7、发送确认字完成"); |
| | | |
| | | Damage damage=new Damage(); |
| | | damage.setGlassId(glassInfo.getGlassId()); |
| | | damage.setWorkingProcedure("切割"); |
| | | damage.setLine(1001); |
| | | damage.setType(1); |
| | | damage.setRemark("进卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | |
| | | } |
| | | |
| | |
| | | log.info("7、添加出片玻璃尺寸信息到磨边前玻璃表是否完成:{}", glassSizeStatus); |
| | | S7object.getinstance().plccontrol.writeWord(confirmationWrodAddress, 1); |
| | | log.info("8、发送确认字已完成"); |
| | | Damage damage=new Damage(); |
| | | damage.setGlassId(glassInfo.getGlassId()); |
| | | damage.setWorkingProcedure("切割"); |
| | | damage.setLine(1001); |
| | | damage.setType(1); |
| | | damage.setRemark("进卧式理片"); |
| | | damageService.insertDamage(damage); |
| | | return Boolean.TRUE; |
| | | } |
| | | return Boolean.FALSE; |
| | |
| | | List<Map<String, Object>> currentCutTerritorys = edgStorageCageDetailsService.selectCutTerritory(); |
| | | jsonObject.append("currentCutTerritory", currentCutTerritorys); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<EdgGlassTaskInfo> edgTasks = edgGlassTaskInfoService.selectEdgInfo(); |
| | | jsonObject.append("edgTasks", edgTasks); |
| | | |
| | | //卧室缓存笼内信息 |
| | | List<Map<String, Object>> EdgStorageCageinfos = edgStorageCageService.selectEdgStorageCages(); |
| | | jsonObject.append("EdgStorageCageinfos", EdgStorageCageinfos); |
| | |
| | | } |
| | | } |
| | | |
| | | @Scheduled(fixedDelay = 1000) |
| | | public void CacheGlassTaskss() { |
| | | JSONObject jsonObject = new JSONObject(); |
| | | //log.info("本次识别版图{},++++{}",engineerId,currentCutTerritorys); |
| | | //磨边信息 |
| | | List<EdgGlassTaskInfo> edgTasks = edgGlassTaskInfoService.selectEdgInfo(); |
| | | jsonObject.append("edgTasks", edgTasks); |
| | | |
| | | ArrayList<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("edgTasks"); |
| | | 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("edgTasks is closed"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | baseMapper.updateById(bigStorageCageDetails); |
| | | bigStorageCageService.updateRemainWidth(bigStorageCageDetails.getSlot()); |
| | | damage.setGlassId(bigStorageCageDetails.getGlassId()); |
| | | damage.setWorkingProcedure("冷加工"); |
| | | damage.setWorkingProcedure("钢化"); |
| | | damage.setLine(3001); |
| | | damage.setRemark("大理片笼破损"); |
| | | damage.setStatus(2); |
| | |
| | | |
| | | spring: |
| | | profiles: |
| | | active: cz |
| | | active: dev |
| | | application: |
| | | name: cacheVerticalGlass |
| | | liquibase: |
| | | enabled: false |
| | | mybatis-plus: |
| | | mapper-locations: classpath*:mapper/*.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # configuration: |
| | | # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | mes: |
| | | sequence: |
| | | order: false |
| | |
| | | package com.mes; |
| | | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.mes.bigstorage.entity.BigStorageCage; |
| | | import com.mes.bigstorage.service.BigStorageCageDetailsService; |
| | | import com.mes.bigstorage.service.BigStorageCageService; |
| | |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Author : zhoush |
| | |
| | | public void ca(){ |
| | | try { |
| | | // 目标系统的API URL |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSave"; |
| | | String url = "http://192.168.3.119:8086/reportingWork/mesSaveReportingWorkWorn"; |
| | | URL obj = new URL(url); |
| | | HttpURLConnection con = (HttpURLConnection) obj.openConnection(); |
| | | |
| | |
| | | con.setRequestProperty("Accept", "application/json"); |
| | | con.setDoOutput(true); |
| | | |
| | | // 创建消息体 |
| | | String jsonInputString = "小廖"; |
| | | ReportingWork reportingWork=new ReportingWork(); |
| | | // 创建 JSON 对象 |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | ReportingWork reportingWork = new ReportingWork(); |
| | | reportingWork.setOrderId("NG24042301"); |
| | | reportingWork.setProductionId("NG24042301A"); |
| | | reportingWork.setProcessId("NG24042301A001"); |
| | |
| | | reportingWork.setTeamsGroupsName("小廖一号"); |
| | | reportingWork.setCreator("小廖"); |
| | | |
| | | ReportingWorkDetail reportingWorkDetail=new ReportingWorkDetail(); |
| | | List<ReportingWorkDetail> reportingWorkDetails = new ArrayList<>(); |
| | | ReportingWorkDetail reportingWorkDetail = new ReportingWorkDetail(); |
| | | reportingWorkDetail.setTechnologyNumber(1); |
| | | reportingWorkDetail.setOrderNumber(1); |
| | | reportingWorkDetail.setCompletedQuantity(1); |
| | | reportingWorkDetail.setBreakageQuantity(0); |
| | | reportingWorkDetails.add(reportingWorkDetail); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | // 将 ReportingWork 转换为 JSONObject |
| | | JSONObject reportingWorkJson = new JSONObject(objectMapper.writeValueAsString(reportingWork)); |
| | | reportingWorkJson.put("reportingWorkTime", reportingWork.getReportingWorkTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); |
| | | // 将 ReportingWorkDetail 列表转换为 JSONArray |
| | | JSONArray detailsJsonArray = new JSONArray(objectMapper.writeValueAsString(reportingWorkDetails)); |
| | | |
| | | // 将 JSON 对象和数组添加到结果对象中 |
| | | result.put("title", reportingWorkJson); |
| | | result.put("detail", detailsJsonArray); |
| | | result.put("type", 0); |
| | | result.put("userId", "admin"); |
| | | result.put("userName", "admin"); |
| | | result.put("qualityInsStatus", 0); |
| | | |
| | | // 将 result 对象转换为字符串 |
| | | String jsonInputString = result.toString(); |
| | | System.out.println("jsonInputString : " + result); |
| | | // 发送请求 |
| | | try (OutputStream os = con.getOutputStream()) { |
| | | byte[] input = jsonInputString.getBytes("utf-8"); |
| | |
| | | // 获取响应码 |
| | | int responseCode = con.getResponseCode(); |
| | | System.out.println("Response Code : " + responseCode); |
| | | |
| | | // 获取响应内容 |
| | | try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"))) { |
| | | StringBuilder response = new StringBuilder(); |
| | |
| | | @ApiOperation("//钢化破损拿走放回") |
| | | @PostMapping("/updateTemperingState") //钢化后显示出炉的版图信息 |
| | | public Result <Integer> updateTemperingState(@RequestBody Damage damage) { |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | temperingGlassInfo.setState(damage.getStatus()); |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | if(damage.getStatus()>5) { |
| | | damage.setType(damage.getStatus()); |
| | | damage.setStatus(1); |
| | | damageService.insertDamage(damage); |
| | | } |
| | | TemperingGlassInfo temperingGlassInfo=new TemperingGlassInfo(); |
| | | temperingGlassInfo.setState(damage.getType()); |
| | | temperingGlassInfo.setGlassId(damage.getGlassId()); |
| | | int result=temperingGlassInfoService.updateTemperingState(temperingGlassInfo); |
| | | return Result.build(200, "破损成功", result); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public List<DownWorkstation> queryWorkStationIsFull() { |
| | | |
| | | //查询可以落架的玻璃信息且已绑定流程卡的工位信息 |
| | | List<DownWorkstation> list = downWorkstationService.list(new LambdaQueryWrapper<DownWorkstation>().eq(DownWorkstation::getEnableState, Const.SLOT_ON) |
| | | .isNotNull(DownWorkstation::getFlowCardId).ne(DownWorkstation::getFlowCardId, "")); |
| | |
| | | //可以落架的玻璃信息且已绑定流程卡的所有的工位 - 玻璃未满流程卡及层数的工位 = 已满工位 |
| | | workstationFull = list.stream().filter(item -> !flowCardIdList.contains(item.getFlowCardId() + ":" + item.getLayer())).collect(Collectors.toList()); |
| | | //是否需要将已满的工位置为不可落架 |
| | | if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | } |
| | | // if (CollectionUtils.isNotEmpty(workstationFull)) { |
| | | // List<Integer> workstationIds = workstationFull.stream().map(DownWorkstation::getWorkstationId).collect(Collectors.toList()); |
| | | // downWorkstationService.update(new LambdaUpdateWrapper<DownWorkstation>().set(DownWorkstation::getEnableState, Const.SLOT_OFF) |
| | | // .in(DownWorkstation::getWorkstationId, workstationIds)); |
| | | // } |
| | | } |
| | | return workstationFull; |
| | | } |
| | |
| | | log.info("打印参数:{}", downGlassInfo); |
| | | QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | queryWrapper.eq("flow_card_id", downGlassInfo.getFlowCardId()) |
| | | .eq("layer", downGlassInfo.getLayer()) |
| | | .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity") |
| | | .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id") |
| | | .orderByAsc("id"); |
| | | int printLayer = 1; |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | queryWrapper.select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity"); |
| | | queryWrapper.groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id"); |
| | | queryWrapper.eq("layer", downGlassInfo.getLayer()); |
| | | printLayer = downGlassInfo.getLayer(); |
| | | } else { |
| | | queryWrapper.select("flow_card_id", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity"); |
| | | queryWrapper.groupBy("flow_card_id", "width", "height", "filmsid", "thickness", "glass_type", "id"); |
| | | } |
| | | List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | log.info("MES落架数据:{}", resultList); |
| | | |
| | | List<Map<String, Object>> projectInfo = flowCardService.selectProject(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> projectInfo = flowCardService.selectProject(downGlassInfo.getFlowCardId(), printLayer); |
| | | log.info("流程卡头部数据:{}", projectInfo); |
| | | List<Map<String, Object>> flowCardInfo = flowCardService.selectFlowCard(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | log.info("流程卡玻璃数据:{}", flowCardInfo); |
| | | for (Map<String, Object> row : flowCardInfo) { |
| | | int order_number = (int) row.get("order_number"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | |
| | | int quantity1 = 0; |
| | | for (Map<String, Object> row1 : resultList) { |
| | | int glass_type = (int) row1.get("glass_type"); |
| | | int layer = (int) row1.get("layer"); |
| | | // String child_width = (String) row1.get("child_width"); |
| | | // Long quantity = (Long) row1.get("quantity"); |
| | | // BigDecimal total_area = (BigDecimal) row1.get("total_area"); |
| | | // String separation = (String) row1.get("separation"); |
| | | // String perimeter = (String) row1.get("perimeter"); |
| | | // BigDecimal width = (BigDecimal) row1.get("width"); |
| | | // String other_columns = (String) row1.get("other_columns"); |
| | | // String remarks = (String) row1.get("remarks"); |
| | | // BigDecimal height = (BigDecimal) row1.get("height"); |
| | | if (order_number == glass_type && technology_number == layer) { |
| | | quantity1 += 1; |
| | | // row.put("quantity", quantity); |
| | | // row.put("order_number", order_number); |
| | | // row.put("technology_number", technology_number); |
| | | // row.put("child_width", child_width); |
| | | // row.put("total_area", total_area); |
| | | // row.put("separation", separation); |
| | | // row.put("perimeter", perimeter); |
| | | // row.put("width", width); |
| | | // row.put("other_columns", other_columns); |
| | | // row.put("remarks", remarks); |
| | | // row.put("height", height); |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | int layer = (int) row1.get("layer"); |
| | | int technology_number = (int) row.get("technology_number"); |
| | | if (order_number == glass_type && technology_number == layer) { |
| | | quantity1 += 1; |
| | | } |
| | | } else { |
| | | if (order_number == glass_type) { |
| | | quantity1 += 1; |
| | | } |
| | | } |
| | | } |
| | | row.put("quantity1", quantity1); |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> downGlassLabelPrint(DownGlassInfo downGlassInfo) { |
| | | //获取下片玻璃的顺序 |
| | | // QueryWrapper<DownGlassInfo> queryWrapper = Wrappers.query(); |
| | | // queryWrapper |
| | | // .eq("flow_card_id", downGlassInfo.getFlowCardId()) |
| | | // .eq("layer", downGlassInfo.getLayer()) |
| | | // .select("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "COUNT(*) AS quantity") |
| | | // .groupBy("flow_card_id", "layer", "width", "height", "filmsid", "thickness", "glass_type", "id") |
| | | // .orderByAsc("id"); |
| | | // List<Map<String, Object>> resultList = baseMapper.selectMaps(queryWrapper); |
| | | |
| | | List<Map<String, Object>> resultList = baseMapper.downGlassLabelPrint(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | log.info("MES落架数据:{}", resultList); |
| | | //获取ERP标签所需的信息 |
| | | List<Map<String, Object>> labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | List<Map<String, Object>> labelInfo; |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), downGlassInfo.getLayer()); |
| | | } else { |
| | | labelInfo = flowCardService.selectLabel(downGlassInfo.getFlowCardId(), 1); |
| | | } |
| | | log.info("标签数据:{}", labelInfo); |
| | | |
| | | for (Map<String, Object> row : resultList) { |
| | |
| | | for (Map<String, Object> row1 : labelInfo) { |
| | | int orderNumber = (int) row1.get("orderNumber"); |
| | | int technologyNumber = (int) row1.get("technologyNumber"); |
| | | if (orderNumber == glass_type && technologyNumber == layer) { |
| | | if (downGlassInfo.getLayer() != 0) { |
| | | if (orderNumber == glass_type && technologyNumber == layer) { |
| | | |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | } |
| | | } else { |
| | | if (orderNumber == glass_type) { |
| | | |
| | | String order_id = (String) row1.get("order_id"); |
| | | String project = (String) row1.get("project"); |
| | | Long customer_id = (Long) row1.get("customer_id"); |
| | | BigDecimal width = (BigDecimal) row1.get("width"); |
| | | BigDecimal height = (BigDecimal) row1.get("height"); |
| | | Long quantity = (Long) row1.get("quantity"); |
| | | String glass_child = (String) row1.get("glass_child"); |
| | | String process = (String) row1.get("process"); |
| | | String customer_name = (String) row1.get("customer_name"); |
| | | String processing_note = (String) row1.get("processing_note"); |
| | | String other_colunmns = (String) row1.get("other_colunmns"); |
| | | String building_number = (String) row1.get("building_number"); |
| | | String bend_radius = (String) row1.get("bend_radius"); |
| | | |
| | | row.put("orderNumber", orderNumber); |
| | | row.put("technology_number", technologyNumber); |
| | | row.put("order_id", order_id); |
| | | row.put("project", project); |
| | | row.put("customer_id", customer_id); |
| | | row.put("width", width); |
| | | row.put("height", height); |
| | | row.put("quantity", quantity); |
| | | row.put("glass_child", glass_child); |
| | | row.put("process", process); |
| | | row.put("customer_name", customer_name); |
| | | row.put("processing_note", processing_note); |
| | | row.put("other_colunmns", other_colunmns); |
| | | row.put("building_number", building_number); |
| | | row.put("bend_radius", bend_radius); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @Scheduled(fixedDelay = 300) |
| | | public void plcShelfFull() { |
| | | List<DownWorkstation> list = downGlassInfoService.queryWorkStationIsFull(); |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | if (CollectionUtils.isNotEmpty(list)) { |
| | | S7control s7control = S7object.getinstance().plccontrol; |
| | | PlcParameterObject plcMesObject = S7object.getinstance().PlcMesObject; |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 1); |
| | | }else{ |
| | | s7control.writeWord(plcMesObject.getPlcParameter("alarm_signal").getAddress(), 0); |
| | | } |
| | | } |
| | | |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | } else { |
| | | if (downStorageCageDetails.getWidth() > maxWidth || downStorageCageDetails.getHeight() > maxHeight) { |
| | | double firstLength = Math.max(downStorageCageDetails.getWidth(), downStorageCageDetails.getHeight()); |
| | | double secondLength = Math.min(downStorageCageDetails.getWidth(), downStorageCageDetails.getHeight()); |
| | | if (firstLength > maxWidth || secondLength > maxHeight) { |
| | | endCell = Const.G13_WORK_STATION; |
| | | } else { |
| | | DownWorkstation workstation; |
| | |
| | | .select("Top 1 *")
|
| | | .eq("end_cell", Const.G13_WORK_STATION)
|
| | | .lt("task_status", Const.UNLOAD_GLASS_DOWN)
|
| | | .orderByDesc("id")
|
| | | .orderByAsc("id")
|
| | | );
|
| | | jsonObject4.append("takeGlass", takeGlass);
|
| | | if(takeGlass!=null){
|
| | | jsonObject4.append("takeGlass", takeGlass);
|
| | | }
|
| | |
|
| | | ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
|
| | | if (sendwServer4 != null) {
|