| | |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 报工管理 ----------------*/ |
| | | { |
| | | path: 'reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue'), |
| | | children:[ |
| | | { |
| | | path: '/ReportWork/reportWork', |
| | | name: 'reportWork', |
| | | component: () => import('../views/ReportWork/reportWork.vue') |
| | | }, |
| | | ] |
| | | }, |
| | | /*----------- 管理系统 ----------------*/ |
| | | { |
| | | path: 'sys', |
New file |
| | |
| | | <template> |
| | | <div style="height: 600px;"> |
| | | <span class="demonstration">生产时间</span> |
| | | <el-date-picker v-model="timeRange" type="daterange" format="YYYY/MM/DD" value-format="YYYY-MM-DD" |
| | | start-placeholder="开始时间" end-placeholder="结束时间" :default-time="defaultTime" /> |
| | | <el-select v-model="report.type" placeholder="清选择类型"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="完工" value="1"></el-option> |
| | | <el-option label="破损" value="2"></el-option> |
| | | <el-option label="拿走" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.status" placeholder="清选择状态"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="未报工" value="1"></el-option> |
| | | <el-option label="待报工" value="2"></el-option> |
| | | <el-option label="已报工" value="3"></el-option> |
| | | </el-select> |
| | | <el-select v-model="report.workProcedure" placeholder="清选择工序"> |
| | | <el-option label="全部" value="0"></el-option> |
| | | <el-option label="切割" value="1"></el-option> |
| | | <el-option label="磨边" value="2"></el-option> |
| | | <el-option label="钢化" value="3"></el-option> |
| | | </el-select> |
| | | <el-button type="primary" @click="selectReportData()">查询</el-button> |
| | | <el-button type="success">报工</el-button> |
| | | <el-table height="100%" ref="table" :data="reportData" |
| | | :header-cell-style="{ background: '#F2F3F5 ', color: '#1D2129' }"> |
| | | <el-table-column prop="reportData.line" align="center" label="线路" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="工序" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="玻璃id" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="工程号" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="钢化版图id" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="生产时间" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="备注" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="类型" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="状态" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="流程卡" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="序号" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="层" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="破损类型" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="破损原因" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任工序" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任人员" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任班组" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="责任设备" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="报工班组" min-width="120" /> |
| | | <el-table-column prop="reportData.line" align="center" label="报工设备" min-width="120" /> |
| | | </el-table> |
| | | </div> |
| | | </template> |
| | | <script setup> |
| | | import { Delete, Upload } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { ref, onMounted, onBeforeUnmount, reactive, computed, shallowRef, onUnmounted, watchEffect } from "vue"; |
| | | import request from "@/utils/request" |
| | | import { WebSocketHost, host } from '@/utils/constants' |
| | | import { initializeWebSocket, closeWebSocket } from '@/utils/WebSocketService'; |
| | | import { useI18n } from 'vue-i18n' |
| | | const { t } = useI18n() |
| | | const report = ref({ |
| | | type: '', |
| | | status: '', |
| | | workProcedure: '', |
| | | }); |
| | | const reportData = ref([]) |
| | | const timeRange = ref([new Date(2000, 10, 10), new Date(2200, 10, 11)]) |
| | | |
| | | |
| | | // 查询数据 |
| | | const selectReportData = async () => { |
| | | console.log(timeRange.value[0]) |
| | | const response = await request.post("/loadGlass/damage/selectDamage", { |
| | | startTime: timeRange.value[0], |
| | | endTime: timeRange.value[1], |
| | | type: report.value.type, |
| | | status: report.value.status, |
| | | workProcedure: report.value.workProcedure, |
| | | }) |
| | | if (response.code === 200) { |
| | | reportData.value = response.data; |
| | | ElMessage.success(response.message); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | }; |
| | | |
| | | 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); |
| | | |
| | | // updateCharts(); |
| | | }; |
| | | // }; |
| | | }); |
| | | |
| | | |
| | | |
| | | |
| | | onUnmounted(() => { |
| | | socket.close(); |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | // fetchFlowCardId(); |
| | | // fetchTableData(); // 获取数据 |
| | | initializeWebSocket(socketUrl, handleMessage); |
| | | }); |
| | | onBeforeUnmount(() => { |
| | | console.log("关闭了") |
| | | closeWebSocket(); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped></style> |
| | |
| | | tableDatab.value = data.temperingGlassInfoList[0] |
| | | tableDatae.value = data.bigStorageCageUsage[0] |
| | | carPosition.value = data.carPostion[0] |
| | | console.log(carPosition.value); |
| | | window.localStorage.setItem('length', data.data.bigStorageCageInfos[0][1].length) |
| | | |
| | | // console.log(carPosition.value); |
| | | window.localStorage.setItem('length', data.bigStorageCageInfos[0][1].length) |
| | | let length = window.localStorage.getItem('length') |
| | | adjustedRects.value = data.data.bigStorageCageInfos[0][1].map(rect => ({ |
| | | // alert(length); |
| | | |
| | | adjustedRects.value = data.bigStorageCageInfos[0][1].map(rect => ({ |
| | | ...rect, |
| | | height: 20/length, |
| | | top: 29/length |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author wu |
| | | * @since 2024-06-25 |
| | | */ |
| | | @Api(description = "报工信息") |
| | | @RestController |
| | | @RequestMapping("/damage") |
| | | public class DamageController { |
| | |
| | | @Autowired |
| | | private DamageService damageService; |
| | | @ApiOperation("报工数据查询") |
| | | @GetMapping("/selectDamage") |
| | | public Result selectDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedureId)); |
| | | @ResponseBody |
| | | @PostMapping("/selectDamage") |
| | | public Result selectDamage(@RequestBody Map map) { |
| | | String startTime=map.get("startTime").toString(); |
| | | String endTime=map.get("endTime").toString(); |
| | | int type =Integer.parseInt(map.get("type").toString()); |
| | | int status =Integer.parseInt(map.get("status").toString()); |
| | | int workingProcedure =Integer.parseInt(map.get("workingProcedure").toString()); |
| | | // String startTime , String endTime, int type, int status, int workingProcedure |
| | | return Result.build(200,"查询成功",damageService.selectDamage(startTime,endTime,type,status,workingProcedure)); |
| | | } |
| | | |
| | | @ApiOperation("报工") |
| | | @GetMapping("/submitDamage") |
| | | @PostMapping("/submitDamage") |
| | | public Result submitDamage(DateTime startTime , DateTime endTime,int type,int status,int workingProcedureId) { |
| | | damageService.submitDamage(startTime,endTime,type,status,workingProcedureId); |
| | | return Result.build(200,"报工成功",1); |
| | | } |
| | | |
| | | @ApiOperation("报工数据修改") |
| | | @GetMapping("/updateDamage") |
| | | @PostMapping("/updateDamage") |
| | | public Result updateDamage(List<Damage> damageList) { |
| | | damageService.updateBatchById(damageList); |
| | | return Result.build(200,"修改成功",1); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import java.time.LocalDateTime; |
| | | import java.io.Serializable; |
| | | import java.sql.Timestamp; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | /** |
| | | * 生产时间 |
| | | */ |
| | | private LocalDateTime damageTime; |
| | | private Timestamp damageTime; |
| | | |
| | | /** |
| | | * 备注 |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface DamageService extends IService<Damage> { |
| | | |
| | | List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | List<Damage> selectDamage(String startTime, String endTime, int type, int status, int workingProcedureId); |
| | | |
| | | void submitDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId); |
| | | |
| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.sql.Timestamp; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | |
| | |
| | | * 查询报工信息 |
| | | */ |
| | | @Override |
| | | public List<Damage> selectDamage(DateTime startTime, DateTime endTime, int type, int status, int workingProcedureId){ |
| | | public List<Damage> selectDamage(String startTime, String endTime, int type, int status, int workingProcedure){ |
| | | LambdaQueryWrapper<Damage> damageSelectWrapper =new LambdaQueryWrapper<>(); |
| | | damageSelectWrapper.between(Damage::getDamageTime,startTime,endTime); |
| | | if (type!=0){ |
| | |
| | | if (status!=0){ |
| | | damageSelectWrapper.eq(Damage::getStatus,status); |
| | | } |
| | | if(workingProcedureId!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedureId); |
| | | if(workingProcedure!=0){ |
| | | damageSelectWrapper.eq(Damage::getWorkingProcedure,workingProcedure); |
| | | } |
| | | return baseMapper.selectList(damageSelectWrapper); |
| | | } |
| | |
| | | damage.setProcessId(glassInfo.getFlowCardId()); |
| | | damage.setOrderNumber(glassInfo.getGlassType()); |
| | | damage.setTechnologyNumber(glassInfo.getLayer()); |
| | | damage.setDamageTime(LocalDateTime.now()); |
| | | damage.setDamageTime(Timestamp.valueOf(LocalDateTime.now())); |
| | | damage.setType(2); |
| | | baseMapper.insert(damage); |
| | | } |
| | |
| | | */ |
| | | void saveGlassInfo(List<GlassInfo> glassinfo); |
| | | |
| | | int getGlassInfoCountByFlowCardId(String flowCardId,int layer); |
| | | // int getGlassInfoCountByFlowCardId(String flowCardId,int layer); |
| | | |
| | | /** |
| | | * @return |
| | | * 查询所有工程状态不为300不同流程卡号 |
| | | */ |
| | | List<Map<String, Object>> getFlowCardId(); |
| | | // List<Map<String, Object>> getFlowCardId(); |
| | | |
| | | |
| | | |
| | |
| | | * |
| | | * @param message 客户端发送过来的消息 |
| | | */ |
| | | @OnMessage |
| | | @OnMessage(maxMessageSize = 5242880) |
| | | public void onMessage(String message, Session session, @PathParam("username") String username) { |
| | | log.info("服务端收到用户username={}的消息:{}", username, message); |
| | | JSONObject obj = JSONUtil.parseObj(message); |
| | |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.utils.Result; |
| | | import com.mes.work_assignment.service.WorkAssignmentService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | * @author wu |
| | | * @since 2024-07-01 |
| | | */ |
| | | @Api(description = "值班信息") |
| | | @RestController |
| | | @RequestMapping("/work_assignment/work-assignment") |
| | | @RequestMapping("/work_assignment") |
| | | public class WorkAssignmentController { |
| | | |
| | | @Autowired |
| | | private WorkAssignmentService workAssignmentService; |
| | | @ApiOperation("值班数据查询") |
| | | @GetMapping("/selectWorkAssignment") |
| | | @PostMapping("/selectWorkAssignment") |
| | | public Result selectWorkAssignment(int line,String workingProcedure) { |
| | | return Result.build(200,"查询成功",workAssignmentService.selectWorkAssignment(line,workingProcedure)); |
| | | } |
| | |
| | | /** |
| | | * 启用状态 |
| | | */ |
| | | @ApiModelProperty(value = "启用状态", position = 5) |
| | | @ApiModelProperty(value = "最大厚度", position = 5) |
| | | private Integer maxThickness; |
| | | |
| | | /** |
| | | * 剩余宽度 |
| | | */ |
| | | @ApiModelProperty(value = "最小厚度", position = 6) |
| | | private Integer minThickness; |
| | | |
| | | /** |
| | | * 启用状态 |
| | | */ |
| | | @ApiModelProperty(value = "启用状态", position = 7) |
| | | private Integer enableState; |
| | | |
| | | /** |
| | | * 剩余宽度 |
| | | */ |
| | | @ApiModelProperty(value = "剩余宽度", position = 6) |
| | | @ApiModelProperty(value = "剩余宽度", position = 8) |
| | | private Integer remainWidth; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | |
| | | glassInfoWrapper.eq(GlassInfo::getGlassId,bigStorageCageFeedTask.getGlassId()); |
| | | GlassInfo glassInfo= glassInfoMapper.selectOne(glassInfoWrapper); |
| | | BeanUtils.copyProperties(glassInfo, bigStorageCageDetails); |
| | | bigStorageCageDetails.setBigStorageCageFeedTask(bigStorageCageFeedTask); |
| | | bigStorageCageDetailsList.add(bigStorageCageDetails); |
| | | } |
| | | return bigStorageCageDetailsList; |
| | |
| | | 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)); |
| | | .in(BigStorageCageDetails::getState, Const.GLASS_STATE_IN, Const.GLASS_STATE_ARTIFICIAL)) |
| | | .orderByAsc(BigStorageCage::getDeviceId) |
| | | .orderByAsc(BigStorageCage::getSlot); |
| | | return bigStorageCageMapper.selectJoinList(BigStorageCage.class, wrapper); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<Map<String, Object>> selectBigStorageCageUsage() { |
| | | QueryWrapper<BigStorageCage> wrapper = new QueryWrapper<>(); |
| | | 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") |
| | | wrapper.select("device_id,ROUND(1 - SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) / COUNT(device_id), 2) AS percentage,SUM(CASE WHEN remain_width = 5000 THEN 1 ELSE 0 END) AS count") |
| | | |
| | | .groupBy("device_id"); |
| | | List<Map<String, Object>> bigStorageCageUsages = baseMapper.selectMaps(wrapper); |
| | |
| | | carPostion.add(0.5); |
| | | jsonObject.append("carPostion",carPostion); |
| | | //界面展示笼子信息 |
| | | jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | // jsonObject.append("bigStorageCageInfos", bigStorageCageService.querybigStorageCageDetail()); |
| | | |
| | | //进片任务数据 |
| | | List<BigStorageCageDetails> bigStorageCageDetailsFeedTask=bigStorageCageDetailsService.selectTask(1); |
| | |
| | | if (sendwServer != null) { |
| | | for (WebSocketServer webserver : sendwServer) { |
| | | if (webserver != null) { |
| | | |
| | | webserver.sendMessage(jsonObject.toString()); |
| | | List<String> messages = webserver.getMessages(); |
| | | if (!messages.isEmpty()) { |