guoyujie
2025-04-17 1275eac767a6fe0b4dd68bab27e2b1fb78d55b51
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
11个文件已修改
280 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeParms.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/CheckInventory.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/GlassInventory.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/mapper/pp/GlassOptimizeMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/GlassOptimizeService.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml 61 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/GlassComputed.vue
@@ -107,9 +107,37 @@
      merge: item.merge,
      glass_details: []
    };
    request.post(`/glassOptimize/selectComputeDetail/${item.processId}/${item.technologyNumber}/${item.patch_state}`).then((res) => {
      if(Number(res.code) === 200){
        processCard.glass_details=res.data.data
        res.data.data.forEach(items=>{
          const detail={
            process_id:null,
            technology_number:null,
            order_number:null,
            layers_number:null,
            max_width:null,
            max_height:null,
            child_width:null,
            child_height:null,
            quantity:null,
            patch_state:null
          }
          detail.process_id=items.process_id
          detail.technology_number=items.technology_number
          detail.order_number=items.order_number
          detail.layers_number=item.total_layers
          detail.max_width=items.maxwidth
          detail.max_height=items.maxheight
          detail.child_width=items.width
          detail.child_height=items.height
          detail.quantity=items.quantity
          detail.patch_state=item.patch_state
          processCard.glass_details.push(detail)
        })
      }else{
        ElMessage.warning(res.msg)
      }
@@ -117,6 +145,12 @@
    computed.value.process_cards.push(processCard)
  })
  console.log(computed.value)
  /*request.post(`/glassOptimize/simulationCalculate`,computed.value).then((res) => {
    if(Number(res.code) === 200){
    }
  })*/
  /*try {
    const responses = await Promise.all(requests);
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeParms.vue
@@ -312,11 +312,11 @@
            <input type="number" v-model="settings.tempering.maxPieceCount" step="1" />
          </div>
          <div class="form-group">
            <label>X轴默认间隔(mm)</label>
            <label>长轴默认间隔(mm)</label>
            <input type="number" v-model="settings.tempering.xAxisInterval" step="1" />
          </div>
          <div class="form-group">
            <label>Y轴默认间隔(mm)</label>
            <label>宽轴默认间隔(mm)</label>
            <input type="number" v-model="settings.tempering.yAxisInterval" step="1" />
          </div>
        </div>
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/OptimizeProject.vue
@@ -33,9 +33,9 @@
//获取GlassInventory的值(查询库存)
const sendDataGlassInventory = ref()
const handleInventoyData = (selectedLabel1,selectedLabel2) => {
const handleInventoyData = (selectedLabel1,selectedLabel2,type) => {
  sendDataGlassInventory.value = {
    selectedLabel1, selectedLabel2
    selectedLabel1, selectedLabel2,type
  };
};
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/CheckInventory.vue
@@ -1,6 +1,7 @@
<script setup>
import {defineEmits, ref} from "vue";
const value1 = ref('')
const value2 = ref('')
@@ -43,15 +44,20 @@
const emit = defineEmits(['send-data-inventory',]);
const props = defineProps({
  closeDialog: Function
  closeDialog: Function,
  thickNess:null,
  model:null
});
value1.value=props.thickNess
value2.value=props.model
const CheckInventory = () => {
  const selectedLabel1 = options1.find((option) => option.value === value1.value)?.label || '';
  const selectedLabel2 = options2.find((option) => option.value === value2.value)?.label || '';
  const selectedLabel1 = value1.value;
  const selectedLabel2 = value2.value;
  // 判断两个值是否都被选择了,如果有一个为空字符串,则提示并返回,不执行后续操作
  if (!selectedLabel1 ||!selectedLabel2) {
    window.alert('请选择相关选项');
  if (selectedLabel1==="" || selectedLabel2==="") {
    window.alert('请输入');
    return;
  }
  props.closeDialog(1);
@@ -63,27 +69,15 @@
<template>
  <div id="box">
    <div>
      <span>厚度(mm):</span>
      <el-select v-model="value1" clearable style="width: 240px">
        <el-option
            v-for="item in options1"
            :key="item.value"
            :label="item.label"
            :value="item.value"
        />
      </el-select>
      <span>厚度(mm):</span>
      <el-input v-model="value1"  style="width: 140px"></el-input>
    </div>
    <div style="margin-top: 30px">
    <span>玻璃类型:</span>
      <el-select v-model="value2"  clearable  style="width: 240px; margin-left: 23px">
        <el-option
            v-for="item in options2"
            :key="item.value"
            :label="item.label"
            :value="item.value"
        />
      </el-select>
      <el-input v-model="value2" style="width: 140px">
      </el-input>
    </div>
    <div style="float: right; margin:-55px 35px 0 0;">
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/Compute.vue
@@ -118,28 +118,13 @@
})
const firstLoading = async() => {
    request.post(`/glassOptimize/getConfiguration/钢化`).then((res) => {
    request.post(`/glassOptimize/selectOptimizeParms/${username}`).then((res) => {
      if (res.code == "200") {
        const rawData = res.data.data;
        if (Array.isArray(rawData) && rawData.length > 0) {
          const formattedData = rawData.map(item => {
            const formattedItem = {};
            for (const key in item) {
              if (typeof item[key] === 'string') {
                //去除字符串属性值开头和结尾的双引号
                formattedItem[key] = item[key].replace(/^\"|\"$/g, '');
              } else {
                formattedItem[key] = item[key];
              }
            }
            return formattedItem;
          });
          furnaceWidth.value=formattedData[0].load_width
          furnaceLength.value=formattedData[0].load_length
          spacingLong.value=formattedData[0].x_space
          spacingWidth.value=formattedData[0].y_space
        }
        const parsedData = JSON.parse(res.data);
          furnaceWidth.value=parsedData.tempering.furnaceWidth
          furnaceLength.value=parsedData.tempering.furnaceLength
          spacingLong.value=parsedData.tempering.xAxisInterval
          spacingWidth.value=parsedData.tempering.yAxisInterval
      } else {
        ElMessage.warning(res.msg)
      }
@@ -169,7 +154,27 @@
  }
})
const inputValues = {
  project_no:inputValue.value,
  glass_thickness:"",
  glass_type:"",
  chaos_pct: optionVal.value*0.01,//混排等级
  cage_free:percentage2.value*0.01,//理片龙空闲度
  tempering_time:heatingTime.value,//钢化加热时间
  heat_mode: 0,//模式选择
  max_load_pct: percentage1.value*0.01,//最大装载率
  max_area: 0,//最大面积
  max_qty:0,//最大片数
  load_width:null,
  load_length: null,
  x_space: null,
  y_space: null,
  load_rate: null,
  furnaces_qty:"",
  rotate_mode:0,
  polys_allow_rotate: 0,
  process_cards:[]
};
// let emit = defineEmits(['fetch-data']);
@@ -182,27 +187,13 @@
 
};
const handleSimulationClick = () => {
  const inputValues = {
    project_no:inputValue.value,
    glass_thickness:"",
    glass_type:"",
    chaos_pct: optionVal.value*0.01,//混排等级
    cage_free:percentage2.value*0.01,//理片龙空闲度
    tempering_time:heatingTime.value,//钢化加热时间
    heat_mode: 0,//模式选择
    max_load_pct: percentage1.value*0.01,//最大装载率
    max_area: 0,//最大面积
    max_qty:0,//最大片数
    load_width:furnaceWidth.value,
    load_length: furnaceLength.value,
    x_space: spacingWidth.value,
    y_space: spacingLong.value,
    load_rate: null,
    furnaces_qty:"",
    rotate_mode:0,
    polys_allow_rotate: rotateMode.value,
    process_cards:[]
  };
      inputValues.load_width = furnaceWidth.value
      inputValues.load_length = furnaceLength.value
      inputValues.x_space = spacingWidth.value
      inputValues.y_space = spacingLong.value
      inputValues.polys_allow_rotate = parseInt(rotateMode.value.value)
  emit('sendData', {
    ...inputValues
  })
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/GlassInventory.vue
@@ -158,9 +158,10 @@
const thickness = ref(route.params.thickNess);
const model = ref(route.params.model);
let projectNo = ref(null);
let type = ref(1);
const selectMaterialStore = async () =>{
  request.post(`/glassOptimize/materialStore/${thickness.value}/${model.value}/${projectNo}`).then((res) => {
  request.get(`/glassOptimize/materialStore/${thickness.value}/${model.value}/${projectNo}?type=${type.value}`).then((res) => {
    if (Number(res.code) === 200) {
      const rawData = res.data.data;
      const edgeTrimming = res.data.edgeTrimming;
@@ -240,6 +241,7 @@
  if (newInventoryData) {
    thickness.value = newInventoryData.selectedLabel1;
    model.value = newInventoryData.selectedLabel2;
    type.value=newInventoryData.type
    // 由于 thickness 和 model 的值改变了,更新表格,调用 selectMaterialStore 重新获取数据
    selectMaterialStore();
  }
@@ -262,6 +264,7 @@
    properties: {
      selectedLabel1: { type: String },
      selectedLabel2: { type: String },
      type: { type: String }
    }
  }
});
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProjectDetail.vue
@@ -354,6 +354,9 @@
  await emit('changeDialog', command)
}
let originalFilm=ref(true)
let surplusMaterial=ref(false)
//优化计算
const dialogVisible = ref({});
const openDialog = (index) => {
@@ -378,6 +381,8 @@
//工程号
const projectNo = ref(route.params.projectNo);
const projectName = ref('');
const thickNess = ref(route.params.thickNess);
const model = ref(route.params.model);
onBeforeUnmount(() => {
  localStorage.setItem('projectNo', projectNo.value);
});
@@ -502,7 +507,17 @@
//中转站接受CheckInventory的值(查询库存)
const handleInventory = (selectedLabel1, selectedLabel2) => {
  emit('send-inventory-to-op', selectedLabel1, selectedLabel2);
  let type=0;
  if(originalFilm.value===true&&surplusMaterial.value===true){
    type=3
  }else if(originalFilm.value===true&&surplusMaterial.value===false){
    type=1
  }else if(originalFilm.value===false&&surplusMaterial.value===true){
    type=2
  }else{
    type=1
  }
  emit('send-inventory-to-op', selectedLabel1, selectedLabel2,type);
}
</script>
@@ -529,10 +544,13 @@
        <span>工程编号:</span>
        <el-input readonly placeholder="" style="width: 150px" v-model="projectNo"></el-input>&nbsp;
        <span>工程名称:</span>
        <el-input readonly placeholder="" style="width: 150px; margin-right: 340px;" v-model="projectName" ></el-input>
        <el-input readonly placeholder="" style="width: 150px; margin-right: 140px;" v-model="projectName" ></el-input>
        原片<el-checkbox v-model="originalFilm" ></el-checkbox>
        余料<el-checkbox v-model="surplusMaterial" ></el-checkbox>&nbsp;&nbsp;
        <el-button id="checkinventory" type="primary" @click="openDialog(1)">查询库存</el-button>
        <el-dialog v-model="dialogVisible[1]" title="查询库存" destroy-on-close style="width: 35%;height:35%;">
          <check-inventory :closeDialog="closeDialog" @send-data-inventory="handleInventory"/>
          <check-inventory :closeDialog="closeDialog" :thickNess="thickNess" :model="model"
                           @send-data-inventory="handleInventory"/>
        </el-dialog>
        <el-button id="button" type="primary" @click="openDialog(2)">设置磨量</el-button>
        <el-dialog v-model="dialogVisible[2]" title="设置磨量(mm)" destroy-on-close
north-glass-erp/src/main/java/com/example/erp/controller/pp/GlassOptimizeController.java
@@ -49,11 +49,12 @@
    //库存信息
    @ApiOperation("库存信息接口")
    @PostMapping  ("/materialStore/{thickness}/{model}/{projectNumber}")
    @GetMapping  ("/materialStore/{thickness}/{model}/{projectNumber}")
    public Result materialStore(
            @PathVariable  String thickness,
            @PathVariable  String model,@PathVariable  String projectNumber ){
        return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model,projectNumber));
            @PathVariable  String model,@PathVariable  String projectNumber,
            @RequestParam(name = "type", required = false) Integer type ){
        return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model,projectNumber,type));
    }
north-glass-erp/src/main/java/com/example/erp/mapper/pp/GlassOptimizeMapper.java
@@ -32,6 +32,10 @@
    //库存信息
    List<Map<String, Object>>  materialStoreMp(String thickness, String model);
    List<Map<String, Object>>  surplusMaterialsMp(String thickness, String model);
    List<Map<String, Object>>  materialStoreSurplusMp(String thickness, String model);
    List<Map<String, Object>>  materialStoreOptimizeUse(String projectNumber);
    //工单管理查询未转工单数据
north-glass-erp/src/main/java/com/example/erp/service/pp/GlassOptimizeService.java
@@ -45,10 +45,10 @@
            // 获取 computeData 和 cardData
            Object computeData = message.get("computeData");
            Object cardData = message.get("cardData");
            /*Object computeData = message.get("computeData");
            Object cardData = message.get("cardData");*/
           rabbitMQUtil.sendMessage("6");
           rabbitMQUtil.sendMessage(message.toString());
            System.out.println("send message: " + message);
            String date = rabbitMQUtil.receiveMessages();
            System.out.println("Received message: " + date);
@@ -157,14 +157,26 @@
    }
    //库存信息
    public Map<String, Object> materialStoreSv(String thickness, String model, String projectNumber) {
    public Map<String, Object> materialStoreSv(String thickness, String model, String projectNumber,Integer type) {
        Map<String, Object> stringObjectMap = glassOptimizeMapper.selectProjectCount(projectNumber);
        Map<String, Object> map = new HashMap<>();
        if(Integer.parseInt(stringObjectMap.get("state").toString())<10){
            if(type==1){
            map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model));
            }else if(type==2){
                map.put("data", glassOptimizeMapper.surplusMaterialsMp(thickness,model));
            }else{
                map.put("data", glassOptimizeMapper.materialStoreSurplusMp(thickness,model));
            }
            map.put("edgeTrimming", glassOptimizeMapper.getEdgeTrimming());
        }else if(Integer.parseInt(stringObjectMap.get("state").toString())==10){
            if(type==1){
            map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model));
            }else if(type==2){
                map.put("data", glassOptimizeMapper.surplusMaterialsMp(thickness,model));
            }else{
                map.put("data", glassOptimizeMapper.materialStoreSurplusMp(thickness,model));
            }
            map.put("edgeTrimming", glassOptimizeMapper.getEdgeTrimming());
        }else{
            map.put("data", glassOptimizeMapper.materialStoreOptimizeUse(projectNumber));
north-glass-erp/src/main/resources/mapper/pp/GlassOptimize.xml
@@ -286,6 +286,67 @@
            `i`.`available_quantity` DESC ;
    </select>
    <!--余料信息-->
    <select id="surplusMaterialsMp">
        SELECT
            i.id AS id,
            '' AS producer,
            i.quantity AS available_quantity,
            i.width,
            i.height,
            i.thickness,
            i.colour AS name,
            i.colour
        FROM  mm.surplus_materials as i
        WHERE
            i.quantity>0 and i.colour=#{model} and i.thickness=#{thickness}
        ORDER BY
            i.quantity DESC ;
    </select>
    <!--库存余料信息-->
    <select id="materialStoreSurplusMp">
        (SELECT
            i.id AS id,
            i.producer AS producer,
            i.available_quantity-i.plan_quantity AS available_quantity,
            JSON_EXTRACT(s.json, '$.width') AS width,
            JSON_EXTRACT(s.json, '$.height') AS height,
            JSON_EXTRACT(s.json, '$.thickness') AS thickness,
            JSON_EXTRACT(s.json, '$.name') AS name,
            JSON_EXTRACT(s.json, '$.model') AS model
        FROM  mm.material_inventory as `i`
                  LEFT JOIN  mm.material_store  as s ON (
            (
                `i`.`material_code` = `s`.`id`
                )
            )
        WHERE
            (
                    (`s`.`type` = '原片')
                    AND (`i`.`optimize_state` = 1)
                    AND (`i`.`available_quantity`-i.plan_quantity > 0)
                    AND JSON_EXTRACT(s.json, '$.thickness') = #{thickness}
                    AND JSON_EXTRACT(s.json, '$.model') = #{model}
                )
        ORDER BY
            `i`.`available_quantity` DESC) union
        (SELECT
            i.id AS id,
            '' AS producer,
            i.quantity AS available_quantity,
            i.width,
            i.height,
            i.thickness,
            i.colour AS name,
            i.colour
        FROM  mm.surplus_materials as i
        WHERE
            i.quantity>0 and i.colour=#{model} and i.thickness=#{thickness}
        ORDER BY
            i.quantity DESC );
    </select>
    <select id="materialStoreOptimizeUse">
        select ms.id AS id,