UI-Project/src/lang/zh.js
@@ -525,6 +525,7 @@ startslot:'开始工位', endslot:'目标工位', slotid:'格子ID', slot:'格子号', width:'原片宽', widtha:'原片宽:', inwidth:'请输入原片宽', UI-Project/src/views/GlassStorage/rawfilmstorage.vue
@@ -17,24 +17,50 @@ const dialogFormVisiblea = ref(false) const dialogFormVisibleb = ref(false) const dialogFormVisiblec = ref(false) const timeRange = ref(["2022-01-01", "2025-01-01"]) const timeRange = ref(["2022-01-01 00:00:00", "2025-01-01 00:00:00"]) const selectValuesa = reactive([]); let webSocket: WebSocket | null = null; const patternWidth = ref(''); const patternHeight = ref(''); const patternThickness = ref(''); const filmsId = ref(''); const remainQuantity = ref(''); const slot = ref(''); let webSocket: WebSocket | null = null; const value = ref('') const options = [ { value: t('film.warehousing1'), value: 1, label: t('film.warehousing1'), }, { value: t('film.warehousing2'), value: 2, label: t('film.warehousing2'), } ] const report = ref({ enableType: '', enableState: '', taskType: '', taskState: '', }); // const response = await request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest", { // beginDate: timeRange.value[0], // endDate: timeRange.value[1], // taskState: stateList, // taskType: celllist // }) // if (response.code === 200) { // // tableDataa.value = response.data; request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest",{ beginDate: "2022-01-01 00:00:00", endDate: "2025-01-01 00:00:00", }).then((response) => { if (response.code == 200) { tableDataa.value = response.data console.log(tableDataa.value); } else { ElMessage.warning(response.msg) } }); onMounted(() => { socket = initializeWebSocket(socketUrl, handleMessage); }); @@ -48,11 +74,9 @@ const handleMessage = (data) => { if(data.tasks !=null){ tableDataa.value = data.tasks[0] console.log(data.tasks[0]); } if(data.rack !=null){ tableDatab.value = data.rack[0] if(data.rawStationDetailsList !=null){ tableDatab.value = data.rawStationDetailsList[0] } }; // 删除 @@ -141,18 +165,45 @@ stateList=[selectValuesa[1]]; } } const response = await request.post("/glassStorage/raw_glass_storage_task/selectRawglasstask", { createTime: timeRange.value[0], patternQuantity: timeRange.value[1], enableType: stateList, enableState: celllist const response = await request.post("/glassStorage/rawGlassStorageTask/setRawGlassTaskRequest", { beginDate: timeRange.value[0], endDate: timeRange.value[1], taskState: stateList, taskType: celllist }) if (response.code === 200) { tableDataa.value = response.data; // tableDataa.value = response.data; ElMessage.success(response.message); } else { ElMessage.error(response.message); } }; // 入库 const handleConfirma = async () => { try { const response = await request.post('/glassStorage/rawGlassStorageDetails/patternWarehousing', { patternWidth: patternWidth.value, patternHeight: patternHeight.value, patternThickness: patternThickness.value, filmsId: filmsId.value, remainQuantity: remainQuantity.value, slot: slot.value, }); if (response.code === 200) { ElMessage.success(response.message); dialogFormVisibleb.value = false; patternWidth.value = ''; patternHeight.value = ''; patternThickness.value = ''; filmsId.value = ''; remainQuantity.value = ''; slot.value = ''; } else { ElMessage.error(response.message); } } catch (error) { console.error(error); } }; // 是否禁用 @@ -178,8 +229,8 @@ const handleEdit = (row) => { dialogFormVisiblec.value = true; }; function getStatusType1(enableType) { switch (enableType) { function getStatusType1(taskType) { switch (taskType) { case 1: return 'info'; case 2: @@ -188,8 +239,8 @@ return 'success'; } } function getStatusText1(enableType) { switch (enableType) { function getStatusText1(taskType) { switch (taskType) { case 1: return t('film.stocke');//入库 case 2: @@ -198,8 +249,8 @@ return t('film.dispatch');//调度 } } function getStatusType2(enableState) { switch (enableState) { function getStatusType2(taskState) { switch (taskState) { case 1: return 'info'; case 2: @@ -208,8 +259,8 @@ return 'success'; } } function getStatusText2(enableState) { switch (enableState) { function getStatusText2(taskState) { switch (taskState) { case 1: return t('film.built');//新建 case 2: @@ -227,8 +278,12 @@ <div style="display: flex; flex-direction: row; align-items: center; margin-top: 20px;"> <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisiblea = true">{{ $t('film.mes') }}</el-button> <el-button style="margin-left: 20px;" id="searchButton" type="success" @click="dialogFormVisibleb = true">{{ $t('film.warehousing') }}</el-button> <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" :start-placeholder="$t('film.starttime')" :end-placeholder="$t('film.endtime')" :default-time="defaultTime" /> <el-date-picker style="margin-left: 10px;" v-model="timeRange" type="datetimerange" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" :start-placeholder="$t('film.starttime')" :end-placeholder="$t('film.endtime')" :default-time="defaultTime" /> <el-select v-model="selectValuesa[0]" clearable :placeholder="$t('film.taskstatus')" style="margin-left: 10px;" > <el-option :label="$t('film.built')" value="1"></el-option> <el-option :label="$t('film.execution')" value="2"></el-option> @@ -245,29 +300,29 @@ <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> <el-table height="300" ref="table" :data="tableDataa" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="enableId" align="center" :label="$t('film.enableid')"/> <el-table-column prop="id" align="center" :label="$t('film.enableid')"/> <el-table-column prop="originateSlot" align="center" :label="$t('film.originateslot')"/> <el-table-column prop="endSlot" align="center" :label="$t('film.endslot')"/> <el-table-column prop="patternQuantity" align="center" :label="$t('film.patternquantity')"/> <el-table-column align="center" :label="$t('film.enabletype')" prop="enableType" prop="taskType" > <template #default="scope"> <el-tag :type="getStatusType1(scope.row.enableType)"> {{ getStatusText1(scope.row.enableType) }} <el-tag :type="getStatusType1(scope.row.taskType)"> {{ getStatusText1(scope.row.taskType) }} </el-tag> </template> </el-table-column> <el-table-column align="center" :label="$t('film.enablestate')" prop="enableState" :label="$t('film.taskstatus')" prop="taskState" > <template #default="scope"> <el-tag :type="getStatusType2(scope.row.enableState)"> {{ getStatusText2(scope.row.enableState) }} <el-tag :type="getStatusType2(scope.row.taskState)"> {{ getStatusText2(scope.row.taskState) }} </el-tag> </template> </el-table-column> @@ -284,6 +339,7 @@ <el-table ref="table" style="margin-top: 20px;height: 700px;" :data="tableDatab" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> <el-table-column prop="deviceId" fixed align="center" :label="$t('film.station')" min-width="80"/> <el-table-column prop="slotId" fixed align="center" :label="$t('film.slot')" min-width="80"/> <el-table-column prop="patternWidth" align="center" :label="$t('film.width')" min-width="80" /> <el-table-column prop="patternHeight" align="center" :label="$t('film.height')" min-width="80" /> <el-table-column prop="patternThickness" align="center" :label="$t('film.thickness')" min-width="80" /> @@ -313,16 +369,16 @@ </el-table-column> </el-table> </el-dialog> <el-dialog v-model="dialogFormVisibleb" top="15vh" width="60%"> <div style="margin-top: 10px;margin-bottom: 10px;"> <el-form size="mini" label-width="150px"> <el-form label-width="70vm" label-position="right"> <el-row > <el-dialog v-model="dialogFormVisibleb" top="23vh" width="55%" :title="$t('basicData.addglass')" > <div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;"> <el-form size="mini" label-width="150px"> <el-form label-width="100px" label-position="right"> <el-row style="margin-top: -15px;margin-bottom: -2px;"> <el-col :span="6"> <div id="dt" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.widtha')" :required="true" style="width: 17vw;"> <el-input :placeholder="$t('film.inwidth')" v-model="number" autocomplete="off" /> <el-input :placeholder="$t('film.inwidth')" v-model="patternWidth" autocomplete="off" /> </el-form-item> </div></div> </el-col> @@ -330,7 +386,7 @@ <div id="dta" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.heighta')" :required="true" style="width: 17vw;"> <el-input :placeholder="$t('film.inheight')" v-model="number" autocomplete="off" /> <el-input :placeholder="$t('film.inheight')" v-model="patternHeight" autocomplete="off" /> </el-form-item></div> </div> </el-col> @@ -340,14 +396,14 @@ <div id="dt" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.thicknessa')" :required="true" style="width: 17vw;"> <el-input :placeholder="$t('film.inthickness')" v-model="number" autocomplete="off" /> <el-input :placeholder="$t('film.inthickness')" v-model="patternThickness" autocomplete="off" /> </el-form-item></div></div> </el-col> <el-col :span="9"> <div id="dta" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.filmsa')" :required="true" style="width: 17vw;"> <el-input :placeholder="$t('film.infilms')" v-model="number" autocomplete="off" /> <el-input :placeholder="$t('film.infilms')" v-model="filmsId" autocomplete="off" /> </el-form-item></div></div> </el-col> </el-row> @@ -355,24 +411,26 @@ <el-col :span="6"> <div id="dt" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.quantitya')" :required="true" style="width: 17vw;"> <el-input :placeholder="$t('film.inquantity')" v-model="number" autocomplete="off" /> <el-form-item :label="$t('film.quantitya')" :required="true" style="width: 17vw;"> <el-input :placeholder="$t('film.inquantity')" v-model="remainQuantity" autocomplete="off" /> </el-form-item></div></div> </el-col> <el-col :span="9"> <div id="dta" style="font-size: 15px;"> <div> <el-form-item :label="$t('film.inwarehousing')" :required="true" style="width: 17vw"> <el-select :placeholder="$t('film.selectwarehousing')"> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> <el-select :placeholder="$t('film.selectwarehousing')" style="width: 270px" v-model="slot"> <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" /> </el-select> </el-form-item></div> </div> </el-form-item></div></div> </el-col> </el-row> </el-form> @@ -380,13 +438,13 @@ </div> <template #footer> <div id="dialog-footer"> <el-button type="primary" @click="handleConfirm"> <el-button type="primary" @click="handleConfirma"> {{ $t('basicData.confirm') }} </el-button> <el-button @click="dialogFormVisibleb = false">{{ $t('basicData.cancel') }}</el-button> </div> </template> </el-dialog> </el-dialog> <el-dialog v-model="dialogFormVisiblec" top="21vh" width="40%"> <div style="margin-left: 50px;margin-top: 10px;margin-bottom: 10px;"> <el-form size="mini" label-width="100px"> @@ -399,7 +457,7 @@ </div> <template #footer> <div id="dialog-footer"> <el-button type="primary" @click="handleConfirm"> <el-button type="primary" @click="handleConfirmb"> {{ $t('reportWork.sure') }} </el-button> <el-button @click="dialogFormVisiblec = false">{{ $t('reportWork.cancel') }}</el-button> UI-Project/src/views/PurchaseReturn/purchaseReturn.vue
@@ -152,13 +152,15 @@ adjustedRects2.value = [] } // 进炉中左 if (data.intoGlass && data.intoGlass.length > 0) { const newGlassIds = new Set(data.intoGlass[0].map(rect => rect.glassId)); const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId)); const newRects = data.intoGlass[0].map(rect => { const scaleFactor = 810.89/5087; const scaleFactorY = 430/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta;; if (data.intoGlass && data.intoGlass.length > 0) { console.log(data.intoGlass); const newGlassIds = new Set(data.intoGlass[0].map(rect => rect.glassId)); const existingRects = adjustedRects1.value.filter(rect => newGlassIds.has(rect.glassId)); const newRects = data.intoGlass[0].map(rect => { const scaleFactor = 810.89/5087; const scaleFactorY = 430/2800; let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta,widtha,heighta; let newX = rect.yCoordinate; if (rect.width < rect.height) { widtha = rect.height; @@ -199,7 +201,7 @@ return oldRect; // 如果旧矩形在新数据中不存在,但保留在newGlassIds中,则保留原样 }).concat(newRects.filter(r => !existingRects.some(o => o.glassId === r.glassId))); } else if (data.overGlass == null) { else { adjustedRects1.value = [] } if (data.waitingGlass && data.waitingGlass.length > 0) { @@ -325,7 +327,21 @@ rect.state = 9; } }); } } function updateoutColorsc() { adjustedRects1.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 9; } }); } function updateoutColorsd() { adjustedRects2.value.forEach(rect => { if (rect.glassId === glassId) { rect.state = 9; } }); } function updateonColorsa() { adjustedRectsa.value.forEach(rect => { if (rect.glassId === glassId) { @@ -367,8 +383,28 @@ rect.state = 8; } }); } function getRectColora(state) { } function getRectColor1(state) { switch (state) { case 2: return 'lightblue'; case 8: return '#911005'; case 9: return '#4682B4'; } } function getRectColor2(state) { switch (state) { case 2: return 'lightblue'; case 8: return '#911005'; case 9: return '#4682B4'; } } function getRectColora(state) { switch (state) { case 0: return '#7AC5CD'; @@ -408,6 +444,11 @@ } else if (currentRect.value.state !== 8) { canSelectProject1.value = true; } if (currentRect.value.state == 9) { cantakea.value = false; } else if (currentRect.value.state !== 9) { cantakea.value = true; } } function showDialog2(rect) { const index = adjustedRects2.value.findIndex(r => r.glassId === rect.glassId); @@ -422,6 +463,11 @@ canSelectProject2.value = false; } else if (currentRect.value.state !== 8) { canSelectProject2.value = true; } if (currentRect.value.state == 9) { cantakea.value = false; } else if (currentRect.value.state !== 9) { cantakea.value = true; } } function showDialoga(rect) { @@ -613,6 +659,52 @@ console.error(error); } } // 进炉中人工拿走 const takeoutc = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, line: 4001, status: 9, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success('成功!'); blind1.value = false; updateoutColorsc(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 console.error(error); } } // 进炉zhong人工拿走 const takeoutd = async () => { try { const response = await request.post('/temperingGlass/temperingGlassInfo/updateTemperingState', { glassId: currentGlassId.value, line: 4001, status: 9, workingProcedure: '钢化', }) if (response.code == 200) { ElMessage.success('成功!'); blind2.value = false; updateoutColorsd(); } else { // 请求失败,显示错误消息 ElMessage.error(response.message); } } catch (error) { // 处理错误 console.error(error); } } // 已出炉破损 const handleDamageb = async () => { try { @@ -711,8 +803,7 @@ left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 8 ? '#911005' : 'lightblue' }" > backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor1(rect.state) }"> <div class="centered-text"> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> @@ -739,8 +830,7 @@ left: `${rect.xcoordinate}px`, width: `${rect.width}px`, height: `${rect.height}px`, backgroundColor: rect.isActive ? '#ADFF2F' : rect.state === 8 ? '#911005' : 'lightblue' }" > backgroundColor: rect.isActive ? '#ADFF2F' : getRectColor2(rect.state) }"> <div class="centered-text"> <div style="font-size: 15px;font-weight: bold;">{{ rect.glassId }}</div> <div style="font-size: 15px;font-weight: bold;">{{ rect.flowCardId }}</div> @@ -842,11 +932,19 @@ <el-button :disabled="!canSelectProject1" type="warning" plain :icon="Delete" @click="handleDamage1" style="width: 150px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> <el-button :disabled="!cantakea" type="danger" plain @click="takeoutc" style="width: 150px;margin-left: 10px;margin-top: 10px;"> <el-icon class="el-icon--right"><Upload /></el-icon> {{ $t('order.takeaway') }} </el-button> </el-dialog> <el-dialog v-model="blind2" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClose2"> <el-button :disabled="!canSelectProject2" type="warning" plain :icon="Delete" @click="handleDamage2" style="width: 150px;margin-left: 10px;"> {{ $t('order.dilapidation') }} </el-button> <el-button :disabled="!cantakea" type="danger" plain @click="takeoutd" style="width: 150px;margin-left: 10px;margin-top: 10px;"> <el-icon class="el-icon--right"><Upload /></el-icon> {{ $t('order.takeaway') }} </el-button> </el-dialog> <!-- 进炉前 --> <el-dialog v-model="blinda" top="30vh" width="15%" style="text-align: center;" @close="handleDialogClosea"> hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/controller/DamageController.java
@@ -27,7 +27,7 @@ @ResponseBody public class DamageController { @Autowired @Autowired(required=true) private DamageService damageService; @ApiOperation("报工数据查询") @PostMapping("/selectDamage") hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/service/DamageService.java
@@ -18,8 +18,12 @@ */ public interface DamageService extends MPJBaseService<Damage> { List<Damage> selectDamage(String startTime, String endTime, int type, String workingProcedure); List<Damage> selectDamage(String startTime, String endTime, int type, int status, String workingProcedure); // List<Damage> selectDamage(String startTime, String endTime, int type, int status, String workingProcedure); void submitDamage(List<Damage> damageList); Boolean submitReport(Damage damage); hangzhoumesParent/common/servicebase/src/main/java/com/mes/damage/service/impl/DamageServiceImpl.java
@@ -53,6 +53,11 @@ @Resource WorkAssignmentMapper workAssignmentMapper; @Override public List<Damage> selectDamage(String startTime, String endTime, int type, String workingProcedure) { return null; } /** * 查询报工信息 */ hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/RawGlassPushMessage.java
New file @@ -0,0 +1,53 @@ package com.mes.job; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.json.JSONObject; import com.mes.rawglassdetails.entity.RawGlassStorageDetails; import com.mes.rawglassstation.service.RawGlassStorageStationService; import com.mes.rawglasstask.entity.RawGlassStorageTask; import com.mes.rawglasstask.service.RawGlassStorageTaskService; import com.mes.tools.WebSocketServer; import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import javax.annotation.Resource; import java.util.List; /** * @author wangfei */ @Slf4j @Component public class RawGlassPushMessage { @Resource private RawGlassStorageStationService rawGlassStorageStationService; @Resource private RawGlassStorageTaskService rawGlassStorageTaskService; @Scheduled(fixedDelay = 2000) public void sendRawGlassMessage() { log.info("发送任务信息和架子信息"); JSONObject jsonObject = new JSONObject(); List<RawGlassStorageDetails> rawStationDetailsList = rawGlassStorageStationService.listRawGlassDetails(); List<RawGlassStorageTask> tasks = rawGlassStorageTaskService.listRawGlassTask(); jsonObject.append("rawStationDetailsList", rawStationDetailsList); jsonObject.append("tasks", tasks); log.info("获取到的工位详情及任务信息为:{}", jsonObject); List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("rawGlass"); if (CollectionUtil.isNotEmpty(sendwServer)) { if (sendwServer.get(0).session.isOpen()) { log.info("已发送"); sendwServer.get(0).sendMessage(String.valueOf(jsonObject)); } } } /** todo:入库任务:吊装位有玻璃,先去工位表查询空格子,生成入库任务从吊装位到目标格子 */ /** todo:出库任务:1、点出库,立马生成出片任务 2、点出库修改工位详情内的状态为待出库,定时任务扫描生成出库任务 */ /** todo:原片调度:1、查询工程原片表,按照顺序将原片放入上片1号位,后续原片放上片2号位,出现尺寸替换,判断原上片位是否有玻璃,有 先出后进,无 直接进片 */ } hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/job/push.java
File was deleted hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassdetails/controller/RawGlassStorageDetailsController.java
@@ -1,18 +1,18 @@ package com.mes.rawglassdetails.controller; import com.mes.rawglassdetails.entity.request.RawGlassRequest; import com.mes.rawglassdetails.service.RawGlassStorageDetailsService; import com.mes.utils.Result; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * <p> * 前端控制器 * </p> * * @author wf * @since 2024-09-10 @@ -21,27 +21,13 @@ @RequestMapping("/rawGlassStorageDetails") public class RawGlassStorageDetailsController { @Autowired private RawGlassStorageDetailsService rawGlassStorageDetailsService; @ApiOperation("工位状态") @PostMapping("/updateEnableState") @ResponseBody public Result<Boolean> updateStatus(@RequestBody Integer enableState) { boolean result = rawGlassStorageDetailsService.updateRawGlassStorageDetails(String.valueOf(enableState)); if (enableState == 1) { return Result.build(1, "启用", result); } else { return Result.build(0, "禁用", result); } } @Autowired private RawGlassStorageDetailsService rawGlassStorageDetailsService; @ApiOperation("原片入库") @PostMapping("/patternWarehousing") public Result<String> patternWarehousing(@Validated @RequestBody RawGlassRequest request) { @ApiOperation("原片入库") @PostMapping("/patternWarehousing") public Result<String> patternWarehousing(@Validated @RequestBody RawGlassRequest request) { return Result.build(200, "入库已完成,等待任务执行", rawGlassStorageDetailsService.patternWarehousing(request)); } return Result.build( 200, "入库已完成,等待任务执行", rawGlassStorageDetailsService.patternWarehousing(request)); } } hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassdetails/service/RawGlassStorageDetailsService.java
@@ -14,13 +14,6 @@ List<RawGlassStorageDetails> selectDetails(); /** * 要大写这个 * * @param films_id * @return */ boolean updateRawGlassStorageDetails(String films_id); /** * 删除表 先在这里创 然后点那个相关问题 @@ -44,4 +37,5 @@ * @return */ String patternWarehousing(RawGlassRequest request); } hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassdetails/service/impl/RawGlassStorageDetailsServiceImpl.java
@@ -1,7 +1,6 @@ package com.mes.rawglassdetails.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mes.common.config.Const; import com.mes.rawglassdetails.entity.RawGlassStorageDetails; @@ -21,18 +20,8 @@ @Service @Slf4j public class RawGlassStorageDetailsServiceImpl extends ServiceImpl<RawGlassStorageDetailsMapper, RawGlassStorageDetails> implements RawGlassStorageDetailsService { @Override public boolean updateRawGlassStorageDetails(String films_id) { UpdateWrapper<RawGlassStorageDetails> wrapper = new UpdateWrapper<>(); //这个类型定义错了,不应该是tasking wrapper.set("films_id", "1005") .eq("films_id", films_id); return update(wrapper);//这个方法默认返回的就是bool类型 所有可以直接return这个方法,ok了,你正常创建方法去上一层创 } @Override public boolean deleteRawGlassStorageDetails(String device_id) { @Override public boolean deleteRawGlassStorageDetails(String device_id) { QueryWrapper<RawGlassStorageDetails> queryWrapper = new QueryWrapper<>(); queryWrapper.eq("device_id", device_id); return remove(queryWrapper);//remove才是删除,delete得用另外的依赖,默认方法是remove返回bool hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassstation/controller/RawGlassStorageStationController.java
@@ -1,21 +1,34 @@ package com.mes.rawglassstation.controller; import com.mes.rawglassstation.service.RawGlassStorageStationService; import com.mes.utils.Result; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; /** * <p> * 前端控制器 * </p> * 前端控制器 * * @author wf * @since 2024-09-10 */ @RestController @RequestMapping("/raw-glass-storage-station") @RequestMapping("/rawGlassStorageStation") public class RawGlassStorageStationController { @Resource RawGlassStorageStationService rawGlassStorageStationService; @ApiOperation("工位状态") @PostMapping("/updateSlotState") @ResponseBody public Result<Boolean> updateSlotState(@RequestBody Integer enableState, Integer slot) { boolean result = rawGlassStorageStationService.updateSlotState(slot, enableState); if (enableState == 1) { return Result.build(1, "启用", result); } else { return Result.build(0, "禁用", result); } } } hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassstation/entity/RawGlassStorageStation.java
@@ -2,15 +2,12 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import java.io.Serializable; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; /** * <p> * * </p> * * @author wf * @since 2024-09-10 */ @@ -20,8 +17,8 @@ private static final long serialVersionUID = 1L; @TableId(value = "id", type = IdType.AUTO) private Long id; @TableId(value = "id", type = IdType.AUTO) private Long id; /** * 设备id hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassstation/mapper/RawGlassStorageStationMapper.java
@@ -1,8 +1,8 @@ package com.mes.rawglassstation.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mes.rawglassdetails.entity.RawGlassStorageDetails; import com.mes.rawglassstation.entity.RawGlassStorageStation; import com.mes.rawglasstask.entity.RawGlassStorageTask; import java.util.List; @@ -16,5 +16,5 @@ */ public interface RawGlassStorageStationMapper extends BaseMapper<RawGlassStorageStation> { List<RawGlassStorageTask> listRawGlassDetails(); List<RawGlassStorageDetails> listRawGlassDetails(); } hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassstation/service/RawGlassStorageStationService.java
@@ -1,8 +1,8 @@ package com.mes.rawglassstation.service; import com.baomidou.mybatisplus.extension.service.IService; import com.mes.rawglassdetails.entity.RawGlassStorageDetails; import com.mes.rawglassstation.entity.RawGlassStorageStation; import com.mes.rawglasstask.entity.RawGlassStorageTask; import java.util.List; @@ -19,5 +19,12 @@ boolean insertRawGlassStorageStation(RawGlassStorageStation rw); List<RawGlassStorageTask> listRawGlassDetails(); /** * 获取工位及对应的原片信息 * * @return */ List<RawGlassStorageDetails> listRawGlassDetails(); boolean updateSlotState(Integer slot, Integer enableState); } hangzhoumesParent/moduleService/GlassStorageModule/src/main/java/com/mes/rawglassstation/service/impl/RawGlassStorageStationServiceImpl.java
@@ -1,12 +1,13 @@ package com.mes.rawglassstation.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.mes.rawglassdetails.entity.RawGlassStorageDetails; import com.mes.rawglassstation.entity.RawGlassStorageStation; import com.mes.rawglassstation.mapper.RawGlassStorageStationMapper; import com.mes.rawglassstation.service.RawGlassStorageStationService; import com.mes.rawglasstask.entity.RawGlassStorageTask; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -43,10 +44,16 @@ return this.save(rw); } @Override public List<RawGlassStorageTask> listRawGlassDetails() { @Override public List<RawGlassStorageDetails> listRawGlassDetails() { return baseMapper.listRawGlassDetails(); } @Override public boolean updateSlotState(Integer slot, Integer enableState) { return update( new LambdaUpdateWrapper<RawGlassStorageStation>() .set(RawGlassStorageStation::getEnableState, enableState) .eq(RawGlassStorageStation::getSlot, slot)); } } hangzhoumesParent/moduleService/GlassStorageModule/src/test/java/mes/GlassStorageModuleApplicationTest.java
@@ -75,36 +75,36 @@ /** * 测试 */ @Test public void testWebSocket() { List<RawGlassStorageTask> list=rawGlassStorageTaskService.findAll(); log.info("返回内容:{}",list); } // @Test // public void testWebSocket() { // List<RawGlassStorageTask> list=rawGlassStorageTaskService.findAll(); // log.info("返回内容:{}",list); // } /** * 测试修改WebSocket 参数 */ @Test public void testWebSocketArgument() { RawGlassTaskRequest request=new RawGlassTaskRequest(); //设置参数: DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date startDate=null; Date endDate=null; try { startDate= df.parse("2022-01-01"); endDate= df.parse("2025-01-01"); }catch (ParseException e){ e.printStackTrace(); request.setCreateTime(startDate);// request.setPatternQuantity(endDate); request.setEnableState(new ArrayList<Integer>()); request.setEnableType(new ArrayList<Integer>()); String list=rawGlassStorageTaskService.setRawGlassTaskRequest(request); log.info("返回内容:{}",list); } } // @Test // public void testWebSocketArgument() { // RawGlassTaskRequest request=new RawGlassTaskRequest(); // //设置参数: // DateFormat df = new SimpleDateFormat("yyyy-MM-dd"); // Date startDate=null; // Date endDate=null; // try { // startDate= df.parse("2022-01-01"); // endDate= df.parse("2025-01-01"); // }catch (ParseException e){ // e.printStackTrace(); // // request.setCreateTime(startDate);// // request.setPatternQuantity(endDate); // request.setEnableState(new ArrayList<Integer>()); // request.setEnableType(new ArrayList<Integer>()); // String list=rawGlassStorageTaskService.setRawGlassTaskRequest(request); // log.info("返回内容:{}",list); // } // } hangzhoumesParent/moduleService/TemperingGlassModule/src/main/java/com/mes/job/TemperingTask.java
@@ -70,39 +70,29 @@ //将确认字置为0 plcControl.writeWord(plcParameterObject.getPlcParameter("confirmationWord").getAddress(), 0); //可能有几炉玻璃同时在钢,需要获取钢化小片表中的数据信息状态为2(旋转台玻璃已送出未钢化,正在钢化) List<TemperingGlassInfo> temperingGlassInfoList = temporaryGlassInfoService.list(new LambdaQueryWrapper<TemperingGlassInfo>() .eq(TemperingGlassInfo::getState, Const.TEMPERING_START)); List<TemperingGlassInfo> temperingGlassInfoList = temporaryGlassInfoService.list( new LambdaQueryWrapper<TemperingGlassInfo>() .inSql(TemperingGlassInfo::getTemperingLayoutId, "select distinct tempering_layout_id from tempering_glass_info where state=1") .lt(TemperingGlassInfo::getState, Const.TEMPERING_START) ); if (CollectionUtils.isEmpty(temperingGlassInfoList)) { log.info("当前系统没有需要钢化的玻璃信息"); return; } TemperingGlassInfo maxGlassInfo = temperingGlassInfoList.stream().max(Comparator.comparingLong(TemperingGlassInfo::getId)).get(); TemperingGlassInfo minGlassInfo = temperingGlassInfoList.stream().min(Comparator.comparingLong(TemperingGlassInfo::getState)).get(); if (minGlassInfo.getState() < Const.TEMPERING_DROP) { log.info("当前炉玻璃未到齐,稍后在执行"); return; } //拿到工程id及炉号 // List<EngineerTemperingDTO> engineerTemperingList = temperingGlassInfoList.stream().map(e -> { // EngineerTemperingDTO engineerTemperingDTO = new EngineerTemperingDTO(); // BeanUtils.copyProperties(e, engineerTemperingDTO); // return engineerTemperingDTO; // }).distinct().collect(Collectors.toList()); //将正在钢化的炉号过滤掉,仅获取待钢化的玻璃 // List<TemperingRecord> temperingRecords = temperingRecordService.list(new LambdaQueryWrapper<TemperingRecord>().and(i -> i.isNull(TemperingRecord::getCoolEnergy).or().eq(TemperingRecord::getCoolEnergy, ""))); // List<EngineerTemperingDTO> temperingList = new ArrayList<>(); // if (CollectionUtils.isNotEmpty(temperingRecords)) { // temperingList = temperingRecords.stream().map(e -> { // EngineerTemperingDTO engineerTemperingDTO = new EngineerTemperingDTO(); // BeanUtils.copyProperties(e, engineerTemperingDTO); // return engineerTemperingDTO; // }).collect(Collectors.toList()); // } // engineerTemperingList.removeAll(temperingList); // if (CollectionUtils.isEmpty(engineerTemperingList)) { // log.info("没有待钢化的任务,结束"); // return; // } // if (engineerTemperingList.size() > 1) { // log.info("存在多炉待钢化的任务,请检查现场是否有异常数据未处理"); // return; // } // EngineerTemperingDTO temperingDTO = engineerTemperingList.get(0); TemperingGlassInfo maxGlassInfo = temperingGlassInfoList.stream().max(Comparator.comparingLong(TemperingGlassInfo::getId)).get(); //将正在钢化的炉号过滤掉,仅获取待钢化的玻璃:判断待钢的玻璃是否已发送对接数据 List<TemperingRecord> temperingRecordList = temperingRecordService.list(new LambdaQueryWrapper<TemperingRecord>().eq(TemperingRecord::getEngineerId, maxGlassInfo.getEngineerId()) .eq(TemperingRecord::getTemperingLayoutId, maxGlassInfo.getTemperingLayoutId())); if (CollectionUtils.isNotEmpty(temperingRecordList)) { log.info("没有待钢化的任务,结束"); return; } //获取待钢化的所有玻璃信息 List<TemperingGlassInfo> temperingGlassList = temperingGlassInfoList.stream() .filter(e -> e.getEngineerId().equals(maxGlassInfo.getEngineerId())