ZengTao
2024-09-05 75c5e7ac09345c5ee636e16f1d54e903b9ef0859
下片添加显示扫码枪玻璃信息,添加下片任务状态
3个文件已修改
74 ■■■■ 已修改文件
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -17,10 +17,14 @@
const printLoading = ref(true)
const fullFlowCard = ref('')
const autoPrint = ref(false)
const takeGlass = ref([])
const scanGlass = ref([])
const dialogFormVisiblea = ref(false)
const dialogFormVisiblea2 = ref(false)
const dialogFormVisibleaDownGlass = ref(false)
const dialogFormVisibleaDownGlasss = ref(false)
// 数据
const loading = ref(false);
// 弹框显示控制
@@ -208,6 +212,12 @@
  }
  if (data.autoPrint != null) {
    autoPrint.value = data.autoPrint[0];
  }
  if (data.takeGlass != null) {
    takeGlass.value = data.takeGlass[0];
  }
  if (data.scanGlass != null) {
    scanGlass.value = data.scanGlass[0];
  }
  //自动打印
@@ -417,8 +427,11 @@
    <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
               @click="dialogFormVisibleaDownGlass = true">落架详情
    </el-button>
    <el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2" :inactive-text="$t('自动打印')"
               @change="handleChange"/>
    <el-button style="margin-top: 10px;margin-left: 10px;margin-bottom: 10px;" id="searchButton" type="primary"
      @click="dialogFormVisibleaDownGlasss = true">人工下片
    </el-button>
    <el-switch style="margin-top: 10px;margin-left: 15px;margin-bottom: 10px;" v-model="autoPrint" class="mb-2"
      :inactive-text="$t('自动打印')" @change="handleChange" />
    <el-card style="flex: 1;" v-loading="loading">
      <el-card style="flex: 1;margin-left: 4px;margin-top: 1px;" v-loading="loading">
        <div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
@@ -457,8 +470,7 @@
          </el-table>
        </div>
        <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%"
                   :title="$t('searchOrder.cageinformation')">
        <el-dialog v-model="dialogFormVisibleaDownGlass" top="2vh" width="97%" :title="$t('落架信息')">
          <el-select v-model="selectValuesa[0]" filterable :placeholder="$t('请选择工位')" clearable>
            <el-option label="全部" value="0"></el-option>
            <el-option label="1" value="1"></el-option>
@@ -476,8 +488,8 @@
          </el-select>
          <span class="demonstration">时间段</span>
          <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" start-placeholder="开始日期" value-format = "YYYY-MM-DD hh:mm:ss"
                          end-placeholder="结束日期">
          <el-date-picker v-model="timeRange" type="datetimerange" range-separator="至" start-placeholder="开始日期"
            value-format="YYYY-MM-DD hh:mm:ss" end-placeholder="结束日期">
          </el-date-picker>
          <el-button type="primary" style="margin-left: 10px;" @click="selectDownGlassData()">{{
@@ -496,10 +508,32 @@
            <el-table-column prop="Filmsid" align="center" :label="$t('膜系')" min-width="120"/>
            <el-table-column prop="thickness" align="center" label="厚度" min-width="120"/>
            <el-table-column prop="glassId" align="center" :label="$t('玻璃id')" min-width="120"/>
          </el-table>
        </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;">
              <div
                :style="{ width: takeGlass.width + 'px', height: takeGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (takeGlass.width > takeGlass.height ? takeGlass.width : takeGlass.height) + ')' }">
                <div style="font-size: 50px; text-align: center;">
                  <div>{{ takeGlass.flowCardId }}</div>
                  <div>{{ takeGlass.width }}</div>
                  <div>{{ takeGlass.height }}</div>
                </div>
              </div>
            </el-card>
            <el-card style="display: flex; justify-content: center; align-items: center; width: 800px; height: 800px;">
              <div
                :style="{ width: scanGlass.width + 'px', height: scanGlass.height + 'px', backgroundColor: '#e1f3d8', transform: 'scale(' + 800 / (scanGlass.width > scanGlass.height ? scanGlass.width : scanGlass.height) + ')' }">
                <div style="font-size: 50px; text-align: center;">
                  <div>{{ scanGlass.flowCardId }}</div>
                  <div>{{ scanGlass.width }}</div>
                  <div>{{ scanGlass.height }}</div>
                </div>
              </div>
            </el-card>
          </div>
        </el-dialog>
      </el-card>
      <!-- workstationId: '1',
    workstationId: '1005',
@@ -561,8 +595,7 @@
                style="width: 100%;height: 100%"/>
  </el-dialog>
  <el-dialog id="sizePrintCalrd1" v-model="dialogTableVisible1" destroy-on-close >
    <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer"
                style=""/>
    <print-label id="printFlowCard" :printFlowCardId="printFlowCardId" :printLayer="printLayer" style="" />
  </el-dialog>
</template>
hangzhoumesParent/common/servicebase/src/main/java/com/mes/common/config/Const.java
@@ -171,4 +171,13 @@
    public static final Integer SLOT_ON = 1;
    public static final Integer SLOT_OFF = 0;
    /**
     * 下片任务玻璃状态
     * 生成任务0
     * 出片任务2
     */
    public static final Integer UNLOAD_GLASS_CREATE = 0;
    public static final Integer UNLOAD_GLASS_OUT = 1;
    public static final Integer UNLOAD_GLASS_DOWN = 2;
}
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/job/Downpush.java
@@ -167,11 +167,10 @@
                new QueryWrapper<DownGlassTask>()
                        .select("Top 1 *")
                        .eq("end_cell", Const.G13_WORK_STATION)
                        .lt("task_status", Const.UNLOAD_GLASS_DOWN)
                        .orderByDesc("id")
        );
        jsonObject4.append("takeGlass", takeGlass);
        ArrayList<WebSocketServer> sendwServer4 = WebSocketServer.sessionMap.get("unloadglass");
        if (sendwServer4 != null) {
@@ -205,21 +204,24 @@
    @Scheduled(fixedDelay = Long.MAX_VALUE)
    public void scanCodeTask() {
        JSONObject jsonObject = new JSONObject();
        while (true) {
            try (Socket socket = new Socket(scanIp, scanPort);
                 BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {
                // 接收服务器响应
                socket.setSoTimeout(1000);
                String response;
                while ((response = in.readLine()) != null) {
                    List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("scanCode");
                    List<WebSocketServer> sendwServer = WebSocketServer.sessionMap.get("unloadglass");
                    if (CollectionUtils.isNotEmpty(sendwServer)) {
                        //按照玻璃id获取玻璃信息返回给前端界面,具体需要哪些数据待确认
                        GlassInfo glassInfo = glassInfoService.getOne(new LambdaQueryWrapper<GlassInfo>()
                                .eq(GlassInfo::getGlassId, response).last("limit 1"));
                                .eq(GlassInfo::getGlassId, response));
                        if (null == glassInfo) {
                            log.info("按照玻璃id:{},无法找到玻璃信息", response);
                        } else {
                            sendwServer.get(0).sendMessage(glassInfo.toString());
                            jsonObject.append("scanGlass",glassInfo);
                            sendwServer.get(0).sendMessage(jsonObject.toString());
                        }
                    }
                }