wuyouming666
2024-05-15 f44c449c2f5ec5439d7df4145a28bc878018ba2b
前端工位显示
11个文件已修改
264 ■■■■■ 已修改文件
UI-Project/src/views/Returns/returns.vue 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/UnLoadGlass/Landingindication.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue 86 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/controller/DownWorkstationController.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/service/DownWorkstationService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/service/impl/DownWorkstationServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-prod.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
UI-Project/src/views/Returns/returns.vue
@@ -62,23 +62,25 @@
  }
};
request.get("/loadGlass/LoadGlass/list").then((res) => {
          if (res.code == 200) {
          console.log(res.data);
          tableDataa.value = res.data
      window.localStorage.setItem('patternWidth', res.data.patternWidth)
      window.localStorage.setItem('workstationId', res.data.workstationId)
      let workstationIda = window.localStorage.getItem('workstationId')
      let patternWidth = window.localStorage.getItem('patternWidth')
      if (patternWidth !== '' || workstationIda == '1') {
      flake.value = true
    } else if (patternWidth !== '' || workstationIda == '2') {
      flakea.value = true
  if (res.code === 200) {
    console.log(res.data);
    tableDataa.value = res.data;
    if (tableDataa.value.length === 2) {
      if (tableDataa.value[0].patternWidth > 0) {
        flake.value = true;
      }
      if (tableDataa.value[1].patternWidth > 0) {
        flakea.value = true;
      }
    }
          } else {
          ElMessage.warning(res.msg)
          // router.push("/login")
          }
          });
  } else {
    ElMessage.warning(res.msg);
    // router.push("/login");
  }
});
//定义接收加载表头下拉数据
const titleSelectJson = ref({
  processType: [],
UI-Project/src/views/UnLoadGlass/Landingindication.vue
@@ -4,7 +4,7 @@
      <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg">
        <g stroke="null" id="Layer_1">
          <!-- 使用 v-for 循环渲染数据 -->
          <g v-for="(rack, index) in racks" :key="index">
          <g v-for="(rack, index) in racks" :key="index"   :data="tableData">
            <rect 
              :x="rack.x" 
              :y="rack.y" 
@@ -31,17 +31,22 @@
  </div>
</template>
<script setup>
<script  setup>
import { ref, watchEffect } from 'vue';
import Swal from 'sweetalert2'
import request from "@/utils/request";
const racks = [
const racks = ref([
  { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } },
 
  { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } },
  { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } },
 
  { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } }
  { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } }
  
];
]);
watchEffect(() => {
  // 触发数据变化时重新渲染
});
const calculateItemXPosition = (rack, item, index) => {
@@ -68,25 +73,35 @@
const fetchFlowCardId = async () => {
  try {
    const response = await request.get('unLoadGlass/downWorkStation/getwo');
    console.log(response)
    if (response.code === 200) {
      console.log(response.data);
      console.log(response);
      // 遍历响应数据并替换racks数组中的item属性
      response.data.forEach((itemData, index) => {
        if (index < racks.length) {
          const rack = racks[index];
          const newItem = {
            content: itemData.item.content,
            fillColor: itemData.item.fillColor,
            width: itemData.item.width/10000,
            height: itemData.item.height/10000
          };
          rack.item == newItem;
        }
      });
  if (index < racks.value.length) {
    const rack = racks.value[index];
    const newItem = {
      content: itemData.item.content,
      fillColor: itemData.item.fillColor,
      width: itemData.item.width === "" ? "" : 10,
      height: itemData.item.height === "" ? "" : 90
    };
    if (index === 2 && itemData.item.width > 0) {
      newItem.width = 100;
      newItem.height = 20;
    }
    rack.item = newItem;
    console.log(racks.value); // 打印更新后的 racks 值
  }
});
      
      console.log(racks); // 查看更新后的racks数组
    } else {
      ElMessage.error(response.msg);
    }
@@ -97,25 +112,25 @@
fetchFlowCardId()
// setTimeout(fetchFlowCardId(),1000);
//setInterval(fetchFlowCardId, 2000)
const showCustomAlert = (content) => {
  var str="架号   :      111\n" +
    "长     :      111\n" +
    "宽     :      111\n" +
    "厚     :      111\n"+
    "玻璃ID :      111\n"+
    "膜系   :      111\n";
// const showCustomAlert = (content) => {
//   var str="架号   :      111\n" +
//     "长     :      111\n" +
//     "宽     :      111\n" +
//     "厚     :      111\n"+
//     "玻璃ID :      111\n"+
//     "膜系   :      111\n";
  Swal.fire({
    title: '玻璃信息',
    html: '<pre>' + str + '</pre>',
    customClass: {
      popup: 'format-pre'
    }
  });
};
//   Swal.fire({
//     title: '玻璃信息',
//     html: '<pre>' + str + '</pre>',
//     customClass: {
//       popup: 'format-pre'
//     }
//   });
// };
const showRectInfo = (rectInfo) => {
  const content = rectInfo.item.content;
UI-Project/src/views/UnLoadGlass/Landingindicationtwo.vue
@@ -32,13 +32,22 @@
</template>
<script setup>
import { ref, watchEffect } from 'vue';
import Swal from 'sweetalert2'
import request from "@/utils/request";
let racks = [
const racks = ref([
  { x: 50, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG123456' } },
  { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 30, width: 20, fillColor: 'yellow', content: 'NG12345678' } },
  { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 30, width: 100, fillColor: 'yellow', content: 'NG1234561454' } }
];
  { x: 280, y: 100, height: 100, width: 60, fillColor: '#6a6da9', item: { height: 90, width: 10, fillColor: 'yellow', content: 'NG12345678' } },
  { x: 140, y: 420, height: 60, width: 110, fillColor: '#6a6da9', item: { height: 20, width: 100, fillColor: 'yellow', content: 'NG1234561454' } }
]);
watchEffect(() => {
  // 触发数据变化时重新渲染
});
// 计算元素位置的函数
const calculateItemXPosition = (rack, item, index) => {
  if (index === 0) {
@@ -60,23 +69,66 @@
  }
};
const showCustomAlert = (content) => {
  var str="架号   :      111\n" +
    "长     :      111\n" +
    "宽     :      111\n" +
    "厚     :      111\n"+
    "玻璃ID :      111\n"+
    "膜系   :      111\n";
  Swal.fire({
    title: '玻璃信息',
    html: '<pre>' + str + '</pre>',
    customClass: {
      popup: 'format-pre'
const fetchFlowCardId = async () => {
  try {
    const response = await request.get('unLoadGlass/downWorkStation/getwo');
    if (response.code === 200) {
      console.log(response);
      // 遍历响应数据并替换racks数组中的item属性
      response.data.forEach((itemData, index) => {
  if (index < racks.value.length) {
    const rack = racks.value[index];
    const newItem = {
      content: itemData.item.content,
      fillColor: itemData.item.fillColor,
      width: itemData.item.width === "" ? "" : 10,
      height: itemData.item.height === "" ? "" : 90
    };
    if (index === 2 && itemData.item.width > 0) {
      newItem.width = 100;
      newItem.height = 20;
    }
  });
    rack.item = newItem;
    console.log(racks.value); // 打印更新后的 racks 值
  }
});
    } else {
      ElMessage.error(response.msg);
    }
  } catch (error) {
    console.error(error);
  }
};
fetchFlowCardId()
// const showCustomAlert = (content) => {
//   var str="架号   :      111\n" +
//     "长     :      111\n" +
//     "宽     :      111\n" +
//     "厚     :      111\n"+
//     "玻璃ID :      111\n"+
//     "膜系   :      111\n";
//   Swal.fire({
//     title: '玻璃信息',
//     html: '<pre>' + str + '</pre>',
//     customClass: {
//       popup: 'format-pre'
//     }
//   });
// };
const showRectInfo = (rectInfo) => {
  const content = rectInfo.item.content;
  showCustomAlert(content);
UI-Project/src/views/UnLoadGlass/loadmachinerack.vue
@@ -76,7 +76,7 @@
const workstationId = ref('');
const flowCardId = ref('');
const flowCardOptions = ref([]);
const tableData = reactive([]);
// 方法
const handleSelectionChange = () => {
@@ -140,10 +140,10 @@
const updatePageData = () => {
  // 假设你的页面上有一个名为 tableData 的 Vue 组件
  // 你可以直接更新 tableData 的数据
  tableData.flowCardId = flowCardId.value;
  fetchTableData()
  // 使用 $forceUpdate() 强制更新组件
  forceUpdate();
};
@@ -186,7 +186,7 @@
const tableData = reactive([]);
// 发送获取表格数据的请求
const fetchTableData = async () => {
hangzhoumesParent/moduleService/LoadGlassModule/src/main/java/com/mes/common/S7object.java
@@ -6,7 +6,6 @@
import com.mes.tools.S7control;
/**
 * @Author : zhoush
 * @Date: 2024/4/9 15:13
@@ -26,7 +25,7 @@
        if (plccontrol == null) {
            plccontrol = new S7control(plcType, ip, port, 0, 0);
            String PlcLoadGlass=S7object.class.getResource("/JsonFile/PlcLoadGlass.json").getPath();
            String PlcLoadGlass = S7object.class.getResource("/JsonFile/PlcLoadGlass.json").getPath();
            //log.info(PLCAutoMes.class.getResource("").getPath());
            PlcMesObject = InitUtil.initword(PlcLoadGlass);
        }
@@ -54,7 +53,7 @@
                e.printStackTrace();
            }
            byte[] getplcvlues=   plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(),PlcMesObject.getPlcAddressLength());
            byte[] getplcvlues = plccontrol.ReadByte(PlcMesObject.getPlcAddressBegin(), PlcMesObject.getPlcAddressLength());
            PlcMesObject.setPlcParameterList(getplcvlues);
        }
hangzhoumesParent/moduleService/LoadGlassModule/src/test/java/com/mes/LoadGlassModuleApplicationTest.java
@@ -65,12 +65,7 @@
        //更新状态
    }
    @Test
    public  void  textglassinfo(){
        List<GlassInfo> glass= glassInfoService.selectGlassInfo("P24032204");
        log.info("glassinfo:{}", Arrays.asList(glass));
        glassInfoService.saveGlassInfo(glass);
    }
    @Test
    public  void  textengineering(){
        List<Engineering> glass= engineeringService.selectEngineering("P24032204");
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/controller/DownWorkstationController.java
@@ -131,12 +131,12 @@
    @ApiOperation("获取工位显示图")
    @ApiOperation("获取工位显示图1")
    @GetMapping("/getwo")
    public ResponseEntity<Map<String, Object>> getwo() {
        Map<String, Object> responseData = new HashMap<>();
        try {
            List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation();
            List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
            responseData.put("code", 200);
            responseData.put("msg", "成功");
            responseData.put("data", data);
@@ -149,7 +149,23 @@
        }
    }
    @ApiOperation("获取工位显示图1")
    @GetMapping("/getwo2")
    public ResponseEntity<Map<String, Object>> getw2o() {
        Map<String, Object> responseData = new HashMap<>();
        try {
            List<Map<String, Object>> data = downWorkstationService.getTotalGlassDimensionsByWorkstation(4,6);
            responseData.put("code", 200);
            responseData.put("msg", "成功");
            responseData.put("data", data);
            return ResponseEntity.ok(responseData);
        } catch (Exception e) {
            responseData.put("code", 500);
            responseData.put("msg", "失败");
            responseData.put("data", null);
            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(responseData);
        }
    }
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/service/DownWorkstationService.java
@@ -61,7 +61,7 @@
     * @return //
     * 工位显示
     */
    List<Map<String, Object>> getTotalGlassDimensionsByWorkstation();
    List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start,int end);
    /**
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downworkstation/service/impl/DownWorkstationServiceImpl.java
@@ -62,11 +62,14 @@
    //工位显示
    @Override
    public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation() {
    public List<Map<String, Object>> getTotalGlassDimensionsByWorkstation(int start,int end) {
        MPJQueryWrapper<DownWorkstation> queryWrapper = new MPJQueryWrapper<>();
        queryWrapper.select("t.workstation_id", "t.flow_card_id", "COALESCE(SUM(b.width), 0) AS totalwidth", "COALESCE(SUM(b.height), 0) AS totalheight")
                .leftJoin("down_glass_info b on t.flow_card_id = b.flow_card_id")
                .groupBy("t.workstation_id", "t.flow_card_id");
                .groupBy("t.workstation_id", "t.flow_card_id")
                .orderByAsc("t.workstation_id").between("t.workstation_id", start, end)
        ;
    List<DownWorkstionAndDownGlassinfo> workstationList = downWorkstationMapper.selectJoinList(DownWorkstionAndDownGlassinfo.class, queryWrapper);
       // List<DownWorkstionAndDownGlassinfo> workstationList = null;
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/resources/application-prod.yml
@@ -5,7 +5,7 @@
      strict: false #设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源.
      datasource:
        hangzhoumes:
          url: jdbc:mysql://127.0.0.1:3306/hangzhoumes?serverTimezone=GMT%2b8
          url: jdbc:mysql://10.153.19.150:3306/hangzhoumes?serverTimezone=GMT%2b8
          username: root
          password: beibo.123/
          driver-class-name: com.mysql.cj.jdbc.Driver
hangzhoumesParent/moduleService/UnLoadGlassModule/src/test/java/mes/UnloadGlassModuleApplicationTest.java
@@ -125,7 +125,7 @@
    @Test
    public void getTotalGlassDimensionsByWorkstation() {
        log.info("工位显示");
        downWorkstationService.getTotalGlassDimensionsByWorkstation();
        downWorkstationService.getTotalGlassDimensionsByWorkstation(1,3);
    }