Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | 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) |
| | | } |
| | |
| | | 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); |
| | | |
| | |
| | | <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>
|
| | |
| | | |
| | | //获取GlassInventory的值(查询库存) |
| | | const sendDataGlassInventory = ref() |
| | | const handleInventoyData = (selectedLabel1,selectedLabel2) => { |
| | | const handleInventoyData = (selectedLabel1,selectedLabel2,type) => { |
| | | sendDataGlassInventory.value = { |
| | | selectedLabel1, selectedLabel2 |
| | | selectedLabel1, selectedLabel2,type |
| | | }; |
| | | }; |
| | | |
| | |
| | | <script setup> |
| | | import {defineEmits, ref} from "vue"; |
| | | |
| | | |
| | | const value1 = ref('') |
| | | const value2 = ref('') |
| | | |
| | |
| | | |
| | | 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); |
| | |
| | | <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;"> |
| | |
| | | }) |
| | | |
| | | 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) |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | |
| | | 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']); |
| | |
| | | |
| | | }; |
| | | 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 |
| | | }) |
| | |
| | | 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; |
| | |
| | | if (newInventoryData) { |
| | | thickness.value = newInventoryData.selectedLabel1; |
| | | model.value = newInventoryData.selectedLabel2; |
| | | type.value=newInventoryData.type |
| | | // 由于 thickness 和 model 的值改变了,更新表格,调用 selectMaterialStore 重新获取数据 |
| | | selectMaterialStore(); |
| | | } |
| | |
| | | properties: { |
| | | selectedLabel1: { type: String }, |
| | | selectedLabel2: { type: String }, |
| | | type: { type: String } |
| | | } |
| | | } |
| | | }); |
| | |
| | | await emit('changeDialog', command) |
| | | } |
| | | |
| | | let originalFilm=ref(true) |
| | | let surplusMaterial=ref(false) |
| | | |
| | | //优化计算 |
| | | const dialogVisible = ref({}); |
| | | const openDialog = (index) => { |
| | |
| | | //工程号 |
| | | 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); |
| | | }); |
| | |
| | | |
| | | //中转站接受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> |
| | |
| | | <span>工程编号:</span> |
| | | <el-input readonly placeholder="" style="width: 150px" v-model="projectNo"></el-input> |
| | | <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> |
| | | <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 |
| | |
| | | |
| | | //库存信息 |
| | | @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)); |
| | | } |
| | | |
| | | |
| | |
| | | //库存信息 |
| | | 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); |
| | | |
| | | //工单管理查询未转工单数据 |
| | |
| | | |
| | | |
| | | // 获取 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); |
| | |
| | | } |
| | | |
| | | //库存信息 |
| | | 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)); |
| | |
| | | `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, |