Merge remote-tracking branch 'origin/master'
# Conflicts:
# hangzhoumesParent/moduleService/CacheVerticalGlassModule/src/main/java/com/mes/job/OpcPlcStorageCageNewTask.java
| | |
| | | <el-icon><WarnTriangleFilled /></el-icon> |
| | | <span class="alert-text"> |
| | | {{ alertText }} (id:{{ alertMessage }}) |
| | | <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span> |
| | | </span> |
| | | </div> |
| | | <button @click="showAlert = false" class="close-btn">×</button> |
| | |
| | | max-width: 80%; /* 防止小屏幕溢出 */ |
| | | min-width: 400px; /* 最小宽度保证 */ |
| | | } |
| | | .confirm-text { |
| | | color: rgb(242, 121, 8); |
| | | display: block; /* 强制换行 */ |
| | | text-align: center; /* 水平居中 */ |
| | | margin-top: 4px; /* 与上一行保持间距 */ |
| | | font-weight: 500; /* 加粗突出 */ |
| | | } |
| | | </style> |
| | |
| | | <el-icon><WarnTriangleFilled /></el-icon> |
| | | <span class="alert-text"> |
| | | {{ alertText }} (id:{{ alertMessage }}) |
| | | <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span> |
| | | </span> |
| | | </div> |
| | | <button @click="showAlert = false" class="close-btn">×</button> |
| | |
| | | max-width: 80%; /* 防止小屏幕溢出 */ |
| | | min-width: 400px; /* 最小宽度保证 */ |
| | | } |
| | | </style> |
| | | .confirm-text { |
| | | color: rgb(242, 121, 8); |
| | | display: block; /* 强制换行 */ |
| | | text-align: center; /* 水平居中 */ |
| | | margin-top: 4px; /* 与上一行保持间距 */ |
| | | font-weight: 500; /* 加粗突出 */ |
| | | } |
| | | </style> |
| | |
| | | <el-icon><WarnTriangleFilled /></el-icon> |
| | | <span class="alert-text"> |
| | | {{ alertText }} (id:{{ alertMessage }}) |
| | | <!-- <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span> --> |
| | | <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span> |
| | | </span> |
| | | </div> |
| | | <button @click="showAlert = false" class="close-btn">×</button> |
| | |
| | | color: rgb(242, 121, 8); |
| | | display: block; /* 强制换行 */ |
| | | text-align: center; /* 水平居中 */ |
| | | margin-top: 4px; /* 与上一行保持间距,可选 */ |
| | | font-weight: 500; /* 可选,加粗突出 */ |
| | | margin-top: 4px; /* 与上一行保持间距 */ |
| | | font-weight: 500; /* 加粗突出 */ |
| | | } |
| | | </style> |
| | |
| | | }); |
| | | tableData.value = formattedTasks |
| | | }; |
| | | // 模拟数据 |
| | | // const generateMockData = () => { |
| | | // const mockList = [ |
| | | // { |
| | | // glassId: 'GL251209001', |
| | | // width: 520, |
| | | // height: 310, |
| | | // thickness: 10, |
| | | // filmsid: '钢化玻璃', |
| | | // line: 1, |
| | | // state: 2, // 未磨边 |
| | | // createTime: Date.now() - 3600 * 1000 * 2, // 2小时前的时间戳 |
| | | // formattedCreateTime: formatTimestamp(Date.now() - 3600 * 1000 * 2) |
| | | // }, |
| | | // { |
| | | // glassId: 'GL251209002', |
| | | // width: 600, |
| | | // height: 380, |
| | | // thickness: 12, |
| | | // filmsid: '浮法玻璃', |
| | | // line: 2, |
| | | // state: 1, // 磨边中 |
| | | // createTime: Date.now() - 3600 * 1000 * 1, // 1小时前的时间戳 |
| | | // formattedCreateTime: formatTimestamp(Date.now() - 3600 * 1000 * 1) |
| | | // }, |
| | | // { |
| | | // glassId: 'GL251209003', |
| | | // width: 480, |
| | | // height: 290, |
| | | // thickness: 8, |
| | | // filmsid: '夹胶玻璃', |
| | | // line: 1, |
| | | // state: 1, // 已磨边 |
| | | // createTime: Date.now() - 3600 * 1000 * 6, // 6小时前的时间戳 |
| | | // formattedCreateTime: formatTimestamp(Date.now() - 3600 * 1000 * 6) |
| | | // }, |
| | | // { |
| | | // glassId: 'GL251209004', |
| | | // width: 550, |
| | | // height: 330, |
| | | // thickness: 9, |
| | | // filmsid: '中空玻璃', |
| | | // line: 2, |
| | | // state: 0, |
| | | // createTime: Date.now() - 3600 * 1000 * 3, |
| | | // formattedCreateTime: formatTimestamp(Date.now() - 3600 * 1000 * 3) |
| | | // }, |
| | | // { |
| | | // glassId: 'GL251209005', |
| | | // width: 580, |
| | | // height: 350, |
| | | // thickness: 11, |
| | | // filmsid: '防弹玻璃', |
| | | // line: '1', |
| | | // state: 0, |
| | | // createTime: Date.now() - 3600 * 1000 * 4, |
| | | // formattedCreateTime: formatTimestamp(Date.now() - 3600 * 1000 * 4) |
| | | // } |
| | | |
| | | // ]; |
| | | // return mockList; |
| | | // }; |
| | | // tableData.value = generateMockData(); |
| | | // ElMessage.success('模拟数据加载成功!'); |
| | | // 历史任务 |
| | | const iframeUrl = ref(''); |
| | | const handlehistorical = (row) => { |
| | |
| | | closeWebSocket(socket); |
| | | } |
| | | }); |
| | | function getStatusTypeb(state) { |
| | | switch (state) { |
| | | case 0: |
| | | return 'info'; |
| | | case 1: |
| | | return 'success'; |
| | | case 1: |
| | | return 'danger'; |
| | | // function getStatusTypeb(state) { |
| | | // switch (state) { |
| | | // case 0: |
| | | // return 'info'; |
| | | // case 1: |
| | | // return 'success'; |
| | | // case 1: |
| | | // return 'danger'; |
| | | // } |
| | | // } |
| | | // 1. 辅助:获取行真实索引 |
| | | function getRowRealIndex(row) { |
| | | return tableData.value.findIndex(item => item.glassId === row.glassId); |
| | | } |
| | | |
| | | // 2. 辅助:获取指定线路最新行状态 |
| | | function getLineLatestState(line) { |
| | | const targetLine = String(line || '').trim(); |
| | | if (!targetLine) return -1; |
| | | for (const row of tableData.value) { |
| | | const rowLine = String(row.line || '').trim(); |
| | | if (rowLine === targetLine) { |
| | | return Number(row.state); |
| | | } |
| | | } |
| | | return -1; |
| | | } |
| | | |
| | | // 3. 核心判断:是否需要高亮/标红 |
| | | function isNeedHighlight(row) { |
| | | const currentState = Number(row.state); |
| | | const currentLine = String(row.line || '').trim(); |
| | | if (!currentLine) return false; |
| | | |
| | | // 原有逻辑:未磨边 + 前序有磨边中/已磨边 |
| | | if (currentState === 0) { |
| | | const currentIndex = getRowRealIndex(row); |
| | | if (currentIndex === -1) return false; |
| | | for (let i = 0; i < currentIndex; i++) { |
| | | const compareRow = tableData.value[i]; |
| | | const compareLine = String(compareRow?.line || '').trim(); |
| | | const compareState = Number(compareRow?.state); |
| | | if (compareLine === currentLine && [1, 2].includes(compareState)) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 新增逻辑:磨边中 + 同线路最新是已磨边 |
| | | if (currentState === 1) { |
| | | const latestState = getLineLatestState(currentLine); |
| | | if (latestState === 2) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | return false; |
| | | } |
| | | |
| | | // 4. 原始颜色映射 |
| | | function getOriginalColor(state) { |
| | | const stateNum = Number(state); |
| | | switch (stateNum) { |
| | | case 0: return 'info'; |
| | | case 1: return 'success'; |
| | | case 2: return 'primary'; |
| | | default: return 'info'; |
| | | } |
| | | } |
| | | |
| | | // 5. 标签类型函数(调用isNeedHighlight) |
| | | function getStatusTypeb(row) { |
| | | const currentState = Number(row.state); |
| | | if ([0, 1].includes(currentState) && isNeedHighlight(row)) { |
| | | return 'danger'; |
| | | } |
| | | return getOriginalColor(row.state); |
| | | } |
| | | |
| | | // 6. 行样式函数(调用isNeedHighlight) |
| | | function getTableRowClass({ row }) { |
| | | const currentState = Number(row.state); |
| | | if ([0, 1].includes(currentState) && isNeedHighlight(row)) { |
| | | return 'leak-edge-highlight'; |
| | | } |
| | | return ''; |
| | | } |
| | | |
| | | function getStatusTextb(state) { |
| | | switch (state) { |
| | | case 0: |
| | |
| | | <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;"> |
| | | <el-table height="750" ref="table" |
| | | @selection-change="handleSelectionChange" |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}"> |
| | | :data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}" |
| | | :row-class-name="getTableRowClass" |
| | | > |
| | | <el-table-column prop="glassId" align="center" :label="$t('workOrder.glassID')" min-width="180" /> |
| | | <el-table-column prop="width" align="center" :label="$t('workOrder.width')" min-width="120" /> |
| | | <el-table-column prop="height" align="center" :label="$t('workOrder.height')" min-width="80" /> |
| | |
| | | <!-- <template #default="scope"> |
| | | {{ scope.row.status==0?"未磨边":scope.row.status==1?"磨边中":"已磨边" }} |
| | | </template> --> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row.state)"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getStatusTypeb(scope.row || {}, scope.index)"> |
| | | {{ getStatusTextb(scope.row.state) }} |
| | | </el-tag> |
| | | </el-tag> |
| | | <!-- <el-tag :type="getStatusTypeb(scope.row.state)"> |
| | | {{ getStatusTextb(scope.row.state) }} |
| | | </el-tag> --> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" :label="$t('workOrder.operate')" align="center" width="200"> |
| | |
| | | height: 460px; |
| | | /* margin-top: -60px; */ |
| | | } |
| | | /* 漏磨边行整行高亮样式(穿透scoped) */ |
| | | :deep(.leak-edge-highlight) { |
| | | background-color: #fff1f0 !important; /* 浅红背景(和danger标签呼应) */ |
| | | } |
| | | /* 行内单元格文字标红 */ |
| | | :deep(.leak-edge-highlight > td) { |
| | | color: #f5222d !important; /* 红色文字 */ |
| | | font-weight: 500 !important; /* 可选:文字加粗,更醒目 */ |
| | | } |
| | | /* 鼠标悬浮时保持高亮(可选) */ |
| | | :deep(.el-table__row.leak-edge-highlight:hover > td) { |
| | | background-color: #fee2e2 !important; |
| | | } |
| | | </style> |
| | |
| | | <script setup> |
| | | import { Search, Lock } from "@element-plus/icons-vue"; // 新增Lock图标导入 |
| | | import { reactive, ref, onMounted } from "vue"; // 合并导入 |
| | | import { reactive, ref, onMounted } from "vue"; |
| | | import { useRouter } from "vue-router"; |
| | | const router = useRouter(); |
| | | import request from "@/utils/request"; |
| | | import { ElMessage, ElMessageBox } from "element-plus"; |
| | | import { useI18n } from "vue-i18n"; |
| | | const { t } = useI18n(); |
| | | |
| | | let language = ref(localStorage.getItem("lang") || "zh"); |
| | | const selectedProjectNoa = ref(null); |
| | | const userName = ref(""); |
| | | const password = ref(""); |
| | | const confirmPassword = ref(""); // 新增:确认密码 |
| | | const editPassword = ref(""); // 新增:编辑时的密码 |
| | | const editConfirmPassword = ref(""); // 新增:编辑时的确认密码 |
| | | const confirmPassword = ref(""); |
| | | const editPassword = ref(""); |
| | | const editConfirmPassword = ref(""); |
| | | const tableData = ref([]); |
| | | const slot = ref(""); |
| | | const add = ref(false); // 添加弹窗 |
| | | const adda = ref(false); // 编辑弹窗 |
| | | |
| | | const add = ref(false); |
| | | const adda = ref(false); |
| | | let language = ref(localStorage.getItem("lang") || "zh"); |
| | | // 获取用户列表 |
| | | const listByUserName = async () => { |
| | | try { |
| | |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error( ); |
| | | console.error("获取用户列表失败:", error); |
| | | } |
| | | }; |
| | | |
| | | // 重置密码 |
| | | const open = async (row) => { |
| | | try { |
| | |
| | | } |
| | | } |
| | | }; |
| | | |
| | | const titleSelectJsona = ref({ |
| | | processTypea: [], // 修正字段名拼写 |
| | | processTypea: [], |
| | | }); |
| | | |
| | | // 获取角色列表 |
| | | const fetchOptionsa = async () => { |
| | | try { |
| | |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error( ); |
| | | console.error("获取角色列表失败:", error); |
| | | } |
| | | }; |
| | | |
| | | // 处理编辑按钮点击 |
| | | function handleEdit(row) { |
| | | userName.value = row.userName; |
| | | editPassword.value = ""; // 清空编辑密码 |
| | | editConfirmPassword.value = ""; // 清空编辑确认密码 |
| | | editPassword.value = ""; |
| | | editConfirmPassword.value = ""; |
| | | if (row.roleList && row.roleList.length > 0) { |
| | | const firstRole = row.roleList[0]; |
| | | selectedProjectNoa.value = firstRole.id; |
| | |
| | | adda.value = true; |
| | | window.localStorage.setItem("id", row.id); |
| | | } |
| | | |
| | | // 关闭添加弹窗 |
| | | function closeDialog() { |
| | | add.value = false; |
| | | userName.value = ""; |
| | | password.value = ""; |
| | | confirmPassword.value = ""; // 清空确认密码 |
| | | confirmPassword.value = ""; |
| | | selectedProjectNoa.value = ""; |
| | | } |
| | | |
| | | // 关闭编辑弹窗 |
| | | function closeDialoga() { |
| | | adda.value = false; |
| | | userName.value = ""; |
| | | editPassword.value = ""; // 清空编辑密码 |
| | | editConfirmPassword.value = ""; // 清空编辑确认密码 |
| | | editPassword.value = ""; |
| | | editConfirmPassword.value = ""; |
| | | selectedProjectNoa.value = ""; |
| | | } |
| | | |
| | | // 添加用户 |
| | | const getTableRow = async () => { |
| | | // 验证用户名 |
| | |
| | | } |
| | | // 验证确认密码 |
| | | if (!confirmPassword.value) { |
| | | ElMessage.error(t("productStock.inconfirmpassword")); // 需在i18n中添加该字段 |
| | | ElMessage.error(t("productStock.inconfirmpassword")); |
| | | return; |
| | | } |
| | | // 验证密码一致性 |
| | | if (password.value !== confirmPassword.value) { |
| | | ElMessage.error(t("productStock.passwordNotMatch")); // 需在i18n中添加该字段 |
| | | ElMessage.error(t("productStock.passwordNotMatch")); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | const response = await request.post("/loadGlass/sys/user/saveUser", { |
| | | userName: userName.value, |
| | |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error( ); |
| | | console.error("添加用户失败:", error); |
| | | } |
| | | }; |
| | | |
| | | // 编辑用户 |
| | | const getTableRowa = async () => { |
| | | // 验证用户名 |
| | |
| | | ElMessage.error(t("productStock.inrole")); |
| | | return; |
| | | } |
| | | // 如果填写了密码,验证密码和确认密码 |
| | | if (editPassword.value || editConfirmPassword.value) { |
| | | if (!editPassword.value) { |
| | | ElMessage.error(t("productStock.inpassword")); |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let id = window.localStorage.getItem("id"); |
| | | if (!id) { |
| | | ElMessage.error(t("productStock.userIdError")); |
| | | return; |
| | | } |
| | | try { |
| | | // 构建请求参数 |
| | | const requestData = { |
| | | id: id, |
| | | userName: userName.value, |
| | |
| | | }, |
| | | ], |
| | | }; |
| | | // 如果填写了密码,添加到请求参数中 |
| | | if (editPassword.value) { |
| | | requestData.password = editPassword.value; |
| | | } |
| | | |
| | | const response = await request.post("/loadGlass/sys/user/updateUser", requestData); |
| | | if (response.code === 200) { |
| | | ElMessage.success(response.message); |
| | | closeDialoga(); // 关闭弹窗并清空表单 |
| | | listByUserName(); // 刷新列表 |
| | | closeDialoga(); |
| | | listByUserName(); |
| | | } else { |
| | | ElMessage.error(response.message); |
| | | } |
| | | } catch (error) { |
| | | ElMessage.error( ); |
| | | console.error("编辑用户失败:", error); |
| | | } |
| | | }; |
| | | |
| | | // 删除用户 |
| | | const opena = async (row) => { |
| | | try { |
| | |
| | | } catch (error) { |
| | | if (error !== "cancel") { |
| | | ElMessage.error( ); |
| | | console.error("删除用户失败:", error); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | fetchOptionsa(); |
| | | listByUserName(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <el-button |
| | |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | |
| | | <!-- 添加用户弹窗 --> |
| | | <el-dialog |
| | | v-model="add" |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <!-- 编辑用户弹窗 --> |
| | | <el-dialog |
| | | v-model="adda" |
| | |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | #dt { |
| | | display: block; |
| | |
| | | sums[index] = '合计'; |
| | | return; |
| | | } |
| | | |
| | | // 只对需要计算的列进行求和 |
| | | const needSumColumns = ['sumCount', 'pairCount', 'totalNumber', 'realCount']; |
| | | if (needSumColumns.includes(column.property)) { |
| | |
| | | <el-icon><WarnTriangleFilled /></el-icon> |
| | | <span class="alert-text"> |
| | | {{ alertText }} (id:{{ alertMessage }}) |
| | | <span class="confirm-text">{{ $t('hellow.pleaseConfirm') }}</span> |
| | | </span> |
| | | </div> |
| | | <button @click="showAlert = false" class="close-btn">×</button> |
| | |
| | | #app-container { |
| | | padding-top: 60px; /* 根据alert高度调整 */ |
| | | } |
| | | .confirm-text { |
| | | color: rgb(242, 121, 8); |
| | | display: block; /* 强制换行 */ |
| | | text-align: center; /* 水平居中 */ |
| | | margin-top: 4px; /* 与上一行保持间距 */ |
| | | font-weight: 500; /* 加粗突出 */ |
| | | } |
| | | </style> |
| | |
| | | List<PieChartVO> queryPieChart(); |
| | | |
| | | List<TemperingGlassInfo> queryEngineerAndLayoutId(); |
| | | |
| | | boolean saveBatch(List<TemperingGlassInfo> list); |
| | | } |
| | |
| | | public List<TemperingGlassInfo> queryEngineerAndLayoutId() { |
| | | return baseMapper.queryEngineerAndLayoutId(); |
| | | } |
| | | |
| | | @Override |
| | | public boolean saveBatch(List<TemperingGlassInfo> list) { |
| | | log.info("需要钢化的玻璃为:{}", list); |
| | | return baseMapper.saveBatch(list); |
| | | } |
| | | } |
| | |
| | | @ApiOperation("新增菜单") |
| | | @PostMapping("/save") |
| | | // @PreAuthorize("hasAuthority('sys:menu:save')") |
| | | public Result save(@Validated @RequestBody SysMenu sysMenu) { |
| | | sysMenuService.save(sysMenu); |
| | | GeneralRequest request = new GeneralRequest(); |
| | | return Result.success(sysMenuService.getMenuTree(request)); |
| | | public Result saveMenu(@Validated @RequestBody SysMenu sysMenu) { |
| | | sysMenuService.saveMenu(sysMenu); |
| | | return Result.build(200, "新增成功", Boolean.TRUE); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("修改菜单信息") |
| | | @PostMapping("/updateMenu") |
| | | // @PreAuthorize("hasAuthority('sys:menu:update')") |
| | | public Result<List<SysMenu>> updateMenu(@Validated @RequestBody SysMenu sysMenu) { |
| | | //return Result.success(sysMenu); |
| | | public Result<Boolean> updateMenu(@Validated @RequestBody SysMenu sysMenu) { |
| | | sysMenuService.updateMenu(sysMenu); |
| | | GeneralRequest request = new GeneralRequest(); |
| | | return Result.build(200, "修改成功", sysMenuService.getMenuTree(request)); |
| | | return Result.build(200, "修改成功", Boolean.TRUE); |
| | | } |
| | | |
| | | @ApiOperation("获取用户有权限的所有菜单") |
| | |
| | | */ |
| | | String batchDeleteMenu(List<Long> menuIds); |
| | | |
| | | Boolean saveMenu(SysMenu sysMenu); |
| | | } |
| | |
| | | import com.mes.role.service.SysRoleMenuService; |
| | | import com.mes.userinfo.entity.SysUser; |
| | | import com.mes.userinfo.entity.SysUserRole; |
| | | import com.mes.userinfo.mapper.SysUserRoleMapper; |
| | | import com.mes.userinfo.service.SysUserRoleService; |
| | | import com.mes.userinfo.service.SysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | SysUserService sysUserService; |
| | | |
| | | @Autowired |
| | | SysUserRoleMapper sysUserRoleMapper; |
| | | SysUserRoleService sysUserRoleService; |
| | | |
| | | @Autowired |
| | | SysRoleMenuService sysRoleMenuService; |
| | |
| | | .innerJoin(SysUser.class, SysUser::getId, SysUserRole::getUserId) |
| | | .innerJoin(SysRoleMenu.class, SysRoleMenu::getRoleId, SysUserRole::getRoleId) |
| | | .innerJoin(SysMenu.class, SysMenu::getId, SysRoleMenu::getMenuId) |
| | | .eq(SysUser::getId, user.getId()) |
| | | .like(StringUtils.isNotBlank(request.getKey()), SysMenu::getMenuName, request.getKey()) |
| | | .eq(StringUtils.isNotBlank(request.getKey()), SysUser::getId, user.getId()) |
| | | .orderByAsc(SysMenu::getListSort); |
| | | |
| | | // |
| | | List<SysMenu> menuList = sysUserRoleMapper.selectJoinList(SysMenu.class, wrapper); |
| | | List<SysMenu> menuList = sysUserRoleService.selectJoinList(SysMenu.class, wrapper); |
| | | log.info("userinfos:{}", menuList); |
| | | return create(menuList); |
| | | } |
| | |
| | | return "批量删除成功"; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean saveMenu(SysMenu sysMenu) { |
| | | this.save(sysMenu); |
| | | SysUser user = UserInfoUtils.get(); |
| | | SysUserRole one = sysUserRoleService.getOne(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, user.getId())); |
| | | sysRoleMenuService.save(new SysRoleMenu(one.getRoleId(), sysMenu.getId())); |
| | | return Boolean.TRUE; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 将数据库中查询出来的list集合传入此方法即可获得排成树形结构的list集合 |
| | |
| | | .map(item -> { |
| | | item.setChildren(getChildren(item, lists)); |
| | | return item; |
| | | }).collect(Collectors.toList()); |
| | | }).sorted((o1, o2) -> o1.getListSort() - o2.getListSort()).collect(Collectors.toList()); |
| | | return deptTreeList; |
| | | } |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | |
| | | * @since 2024-04-11 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | @EqualsAndHashCode(callSuper = false) |
| | | public class SysRoleMenu implements Serializable { |
| | | |
| | |
| | | return "success"; |
| | | } |
| | | List<SysRoleMenu> roleMenuList = menuList.stream().map(menu -> { |
| | | SysRoleMenu roleMenu = new SysRoleMenu(); |
| | | roleMenu.setRoleId(roleId); |
| | | roleMenu.setMenuId(menu.getId()); |
| | | SysRoleMenu roleMenu = new SysRoleMenu(roleId,menu.getId()); |
| | | return roleMenu; |
| | | }).collect(Collectors.toList()); |
| | | // 使用流处理菜单列表,提取 children 的 id,并设置到 SysRoleMenu 中 |
| | | List<SysRoleMenu> childrenList = menuList.stream() |
| | | .flatMap(menu -> menu.getChildren().stream()) // 扁平化处理 children 列表 |
| | | .map(child -> { |
| | | SysRoleMenu roleMenu = new SysRoleMenu(); |
| | | roleMenu.setRoleId(roleId); |
| | | roleMenu.setMenuId(child.getId()); // 设置 child 的 id 到 menuId |
| | | SysRoleMenu roleMenu = new SysRoleMenu(roleId,child.getId()); |
| | | return roleMenu; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | |
| | | public String saveUser(SysUserVO user) { |
| | | log.info("保存用户信息"); |
| | | // 默认密码 |
| | | String password = passwordEncoder.encode(Const.DEFULT_PASSWORD); |
| | | String password = passwordEncoder.encode(user.getPassword()); |
| | | user.setPassword(password); |
| | | SysUser sysUser = new SysUser(); |
| | | BeanUtils.copyProperties(user, sysUser); |
| | |
| | | List<TemperingGlassInfo> temperingGlassInfoList = temperingGlassInfoService.list(temperingGlassInfoWrapper); |
| | | log.info("1、查询钢化小片任务表是否有待出玻璃" + temperingGlassInfoList.size()); |
| | | if (temperingGlassInfoList.size() > 0) { |
| | | temperingGlassInfoService.addOutTask(temperingGlassInfoList); |
| | | // temperingGlassInfoService.addOutTask(temperingGlassInfoList); |
| | | log.info("2、添加任务到任务表"); |
| | | return true; |
| | | } else { |
| | |
| | | log.info("当前未收到出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | //获取出片任务表 |
| | | List<BigStorageCageTask> outTaskList = getOutTaskList(s7DataWLTwo); |
| | | if (CollectionUtil.isNotEmpty(outTaskList)) { |
| | |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | int outRequest = s7plcWZL.readUInt16("DB51.8"); |
| | | if (outRequest == 0){ |
| | | log.info("当前未收到卧转立允许出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("读取卧转立信号异常", e); |
| | | return; |
| | | } |
| | | |
| | | Integer temperingOutTargetPosition = sysConfigService.queryConfigValue(ConstSysConfig.VERTICAL_TEMPERING_OUT_TARGET_POSITION); |
| | | if (redisUtil.getCacheObject("temperingSwitch")) { |
| | | try { |
| | | int outRequest = s7plcWZL.readUInt16("DB51.8"); |
| | | if (outRequest == 0) { |
| | | log.info("当前未收到卧转立允许出片请求,结束出片任务"); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("读取卧转立信号异常", e); |
| | | return; |
| | | } |
| | | //是否允许钢化 |
| | | //是否有正在钢化的玻璃:钢化小片表关联历史任务表,筛选未出笼的玻璃信息 |
| | | // 获取当前钢化任务未完成出片的玻璃信息 |
| | |
| | | } else { |
| | | List<String> glassIdList = bigStorageGlassRelationInfoService.queryNeedOutGlassId( |
| | | list.get(0).getEngineerId(), list.get(0).getTemperingLayoutId(), list.get(0).getTemperingFeedSequence()); |
| | | if (CollectionUtil.isNotEmpty(glassIdList)) { |
| | | outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | } else { |
| | | outGlassList = list.subList(0, 1); |
| | | } |
| | | outGlassList = list.stream().filter(e -> glassIdList.contains(e.getGlassId())).collect(Collectors.toList()); |
| | | } |
| | | // } |
| | | Assert.isFalse(CollectionUtil.isEmpty(outGlassList), "未获取出片数据,结束出片任务"); |
| | |
| | | |
| | | |
| | | private void sortFlowCardIdList(List<HollowAllFlowCardVO> list) { |
| | | Pattern pattern = Pattern.compile("^NG(\\d+)([A-Za-z]+)(\\d+)$"); |
| | | Pattern pattern = Pattern.compile("^(NG|R)(\\d+)([A-Za-z]+)(\\d+)$"); |
| | | |
| | | list.sort((v1, v2) -> { |
| | | Matcher m1 = pattern.matcher(v1.getFlowCardId()); |
| | | Matcher m2 = pattern.matcher(v2.getFlowCardId()); |
| | | |
| | | if (!m1.find() || !m2.find()) { |
| | | throw new IllegalArgumentException("获取到的流程卡不符合校验规则"); |
| | | log.info("获取到的流程卡不符合校验规则:流程卡A:{},流程卡B:{}", v1.getFlowCardId(), v2.getFlowCardId()); |
| | | return -1; |
| | | } |
| | | |
| | | // 提取部分 |
| | | BigInteger order1 = new BigInteger(m1.group(1)); |
| | | BigInteger order2 = new BigInteger(m2.group(1)); |
| | | String layer1 = m1.group(2); |
| | | String layer2 = m2.group(2); |
| | | BigInteger seq1 = new BigInteger(m1.group(3)); |
| | | BigInteger seq2 = new BigInteger(m2.group(3)); |
| | | BigInteger order1 = new BigInteger(m1.group(2)); |
| | | BigInteger order2 = new BigInteger(m2.group(2)); |
| | | String layer1 = m1.group(3); |
| | | String layer2 = m2.group(3); |
| | | BigInteger seq1 = new BigInteger(m1.group(4)); |
| | | BigInteger seq2 = new BigInteger(m2.group(4)); |
| | | |
| | | // 优先级排序 |
| | | int cmp = order1.compareTo(order2); |
| | |
| | | } |
| | | } |
| | | // } |
| | | //超大尺寸 |
| | | // Integer slotMaxHeight = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_HEIGHT); |
| | | // Integer slotMaxthickness = sysConfigService.queryConfigValue(ConstSysConfig.HOLLOW_SLOT_MAX_THICKNESS); |
| | | // if (slotMaxHeight < Math.min(glassInfoList.get(0).getWidth(), glassInfoList.get(0).getHeight()) || glassInfoList.get(0).getThickness() >= slotMaxthickness) { |
| | | // int count = hollowBigStorageCageDetailsService.count(new LambdaQueryWrapper<HollowBigStorageCageDetails>() |
| | | // .eq(HollowBigStorageCageDetails::getSlot, THROUGH_SLOT) |
| | | // .in(HollowBigStorageCageDetails::getState, Const.GLASS_STATE_IN_ALL)); |
| | | // if (count > 0) { |
| | | // log.info("直通片台存在玻璃,结束本次进片"); |
| | | // //向plc发送报警:直通片台存在玻璃,无法继续直通 |
| | | // s7DataZKDLPOne = new S7DataZKDLPOne(); |
| | | // s7DataZKDLPOne.setAlramSignal(64); |
| | | // s7SerializerZKDLPOne.write(s7DataZKDLPOne); |
| | | // return; |
| | | // } |
| | | // } |
| | | |
| | | log.info("将钢化小片表内的状态改为钢化结束,玻璃id有:{}", glassIdList); |
| | | //修改钢化任务表中的状态 |
| | | temperingGlassInfoService.update(new LambdaUpdateWrapper<TemperingGlassInfo>() |
| | |
| | | //报工 |
| | | log.info("将接收到的玻璃进行钢化自动报工,玻璃id有:{}", glassIdList); |
| | | for (String glass : glassIdList) { |
| | | damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "钢化", "进中空理片笼", 1); |
| | | if (from.equals(910)) { |
| | | damageService.autoSubmitReport(glass, inTaskList.get(0).getStartSlot(), "钢化", "进中空理片笼", 1); |
| | | } |
| | | } |
| | | Map<String, List<GlassInfo>> glassListMap = glassInfoList.stream().collect(Collectors.groupingBy(GlassInfo::getGlassId)); |
| | | |
| | |
| | | break; |
| | | } |
| | | } |
| | | for (Integer i : resultList) { |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | cell = i; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | .orderByAsc(HollowGlassOutRelationInfo::getId) |
| | | .last("limit 1") |
| | | ); |
| | | } else { |
| | | break; |
| | | } |
| | | } |
| | | // for (Integer i : resultList) { |
| | | // if (null == hollowGlassOutRelationInfo) { |
| | | // cell = i; |
| | | // hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | // .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | // .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | // .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | // .orderByAsc(HollowGlassOutRelationInfo::getId) |
| | | // .last("limit 1") |
| | | // ); |
| | | // } else { |
| | | // break; |
| | | // } |
| | | // } |
| | | |
| | | if (null != hollowGlassOutRelationInfo) { |
| | | //是否允许中空 |
| | |
| | | t3.formula_name, |
| | | case |
| | | when t3.film_remove = 0 then 0 |
| | | else ifnull(t2.film_remove, 0) end as film_remove, |
| | | when t2.filmsid = t.film_remove then 1 |
| | | else 0 end as film_remove, |
| | | t3.top_remove, |
| | | t3.bottom_remove, |
| | | t3.left_remove, |