| | |
| | | {field: 'model', title: t('warehouseBasicData.type'),}, |
| | | {field: 'leftTrim', title: '左修边',}, |
| | | {field: 'downTrim', title: '下修边',}, |
| | | {field: 'rigthTrim', title: '右修边',}, |
| | | {field: 'rightTrim', title: '右修边',}, |
| | | {field: 'upTrim', title: '上修边',}, |
| | | {field: 'available_quantity', title: '库存数量',}, |
| | | {field: '', title: '加工数量',}, |
| | | {field: 'processingQuantity', title: '加工数量',}, |
| | | {field: 'name', title: '名称',}, |
| | | {field: 'producer', title: '供应商',} |
| | | ],//表头参数 |
| | |
| | | |
| | | const thickness = ref(route.params.thickNess); |
| | | const model = ref(route.params.model); |
| | | let projectNo = ref(null); |
| | | |
| | | |
| | | const selectMaterialStore = () =>{ |
| | | request.post(`/glassOptimize/materialStore/${thickness.value}/${model.value}`).then((res) => { |
| | | const selectMaterialStore = async () =>{ |
| | | request.post(`/glassOptimize/materialStore/${thickness.value}/${model.value}/${projectNo}`).then((res) => { |
| | | if (Number(res.code) === 200) { |
| | | const rawData = res.data.data; |
| | | const edgeTrimming = res.data.edgeTrimming; |
| | | if (Array.isArray(rawData) && rawData.length > 0) { |
| | | const formattedData = rawData.map(item => { |
| | | const formattedItem = {}; |
| | |
| | | } |
| | | return formattedItem; |
| | | }); |
| | | const data = formattedData; |
| | | data.forEach(item => { |
| | | item.leftTrim = 0; |
| | | item.downTrim = 0; |
| | | item.rigthTrim = 0; |
| | | item.upTrim = 0; |
| | | if(edgeTrimming!=null){ |
| | | const edgeTrimmingData = edgeTrimming.map(item => { |
| | | const edgeTrimmingItem = {}; |
| | | for (const key in item) { |
| | | if (typeof item[key] === 'string') { |
| | | //去除字符串属性值开头和结尾的双引号 |
| | | edgeTrimmingItem[key] = item[key].replace(/^\"|\"$/g, ''); |
| | | } else { |
| | | edgeTrimmingItem[key] = item[key]; |
| | | } |
| | | } |
| | | return edgeTrimmingItem; |
| | | }); |
| | | console.log(edgeTrimmingData) |
| | | formattedData.forEach(item => { |
| | | item.leftTrim = edgeTrimmingData[0].leftTrim; |
| | | item.downTrim = edgeTrimmingData[0].downTrim; |
| | | item.rightTrim = edgeTrimmingData[0].rightTrim; |
| | | item.upTrim = edgeTrimmingData[0].upTrim; |
| | | }); |
| | | } |
| | | |
| | | xGrid.value.loadData(formattedData); |
| | | gridOptions.data = formattedData; |
| | | } else { |
| | |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | if(route.params.projectNo!=null){ |
| | | projectNo=route.params.projectNo |
| | | selectMaterialStore(); |
| | | } |
| | | |
| | | }); |
| | | |
| | | watch(() => props.receivedData, (newData) => { |
| | |
| | | // 从 receivedData 中获取对应的值来更新表格数据项 |
| | | leftTrim: Number(receivedData.quicksetLeft), |
| | | downTrim: Number(receivedData.quicksetBottom), |
| | | rigthTrim: Number(receivedData.quicksetRight), |
| | | rightTrim: Number(receivedData.quicksetRight), |
| | | upTrim: Number(receivedData.quicksetTop), |
| | | }; |
| | | updatedData.push(updatedItem); |
| | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import {defineEmits} from 'vue'; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | onMounted(async() => { |
| | | await firstLoading() |
| | | }) |
| | | |
| | | const firstLoading = async() => { |
| | | request.post(`/glassOptimize/getConfiguration/磨量`).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; |
| | | }); |
| | | quicksetLeft.value=formattedData[0].leftEdge |
| | | quicksetTop.value=formattedData[0].upEdge |
| | | quicksetRight.value=formattedData[0].rightEdge |
| | | quicksetBottom.value=formattedData[0].downEdge |
| | | controlValue.value=formattedData[0].quickEdge |
| | | if(formattedData[0].autoFillEdge=="true"){ |
| | | check.value=true |
| | | }else{ |
| | | check.value=false |
| | | } |
| | | minAutoLenght.value=formattedData[0].minAutoLenght |
| | | |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }); |
| | | }; |
| | | function setupComponent() { |
| | | // 各个输入框绑定的值,初始化为0 |
| | | const quicksetTop = ref('0'); |
| | |
| | | const quicksetLeft = ref('0'); |
| | | // 用于控制的输入值,初始化为1 |
| | | const controlValue = ref('1'); |
| | | const minAutoLenght = ref('0'); |
| | | |
| | | const syncValues = () => { |
| | | // 将控制值赋给其他四个组件 |
| | |
| | | quicksetBottom, |
| | | quicksetLeft, |
| | | controlValue, |
| | | minAutoLenght, |
| | | syncValues |
| | | }; |
| | | } |
| | |
| | | quicksetBottom, |
| | | quicksetLeft, |
| | | controlValue, |
| | | minAutoLenght, |
| | | syncValues |
| | | } = setupComponent(); |
| | | |
| | | const check = ref(true) |
| | | const check = ref() |
| | | |
| | | const emit = defineEmits(['set-amount']); |
| | | const props = defineProps({ |
| | |
| | | }); |
| | | |
| | | const setAmount = () => { |
| | | let json = "{" |
| | | json+='"left_edge":"'+quicksetLeft.value+'",' |
| | | json+='"up_edge":"'+quicksetTop.value+'",' |
| | | json+='"right_edge":"'+quicksetRight.value+'",' |
| | | json+='"down_edge":"'+quicksetBottom.value+'",' |
| | | json+='"auto_fill_edge":"'+check.value+'",' |
| | | json+='"quick_edge":"'+controlValue.value+'",' |
| | | json+='"min_auto_lenght":"'+minAutoLenght.value+'"' |
| | | json+="}" |
| | | |
| | | let configuration={ |
| | | json:json, |
| | | } |
| | | |
| | | request.post(`/glassOptimize/saveConfiguration/磨量`,configuration).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | | const amountData = { |
| | | quicksetTop: quicksetTop.value, |
| | | quicksetRight: quicksetRight.value, |
| | | quicksetBottom: quicksetBottom.value, |
| | | quicksetLeft: quicksetLeft.value |
| | | quicksetLeft: quicksetLeft.value, |
| | | controlValue:controlValue.value, |
| | | minAutoLenght:minAutoLenght.value, |
| | | }; |
| | | emit('set-amount', amountData); |
| | | props.closeDialog(2); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | </script> |
| | |
| | | <div style="margin-top: 30px"> |
| | | <span>成品边长大于等于多少时自动填充(单位: mm)</span> |
| | | <el-checkbox v-model="check" style="margin: 5px 0 0 12px;"/> |
| | | <vxe-input style="width: 100px; height: 40px; margin-left: 5px" placeholder="0"/> |
| | | <vxe-input style="width: 100px; height: 40px; margin-left: 5px" v-model="minAutoLenght" placeholder=""/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <script setup> |
| | | import {ref} from "vue"; |
| | | import {onMounted, ref} from "vue"; |
| | | import {defineEmits} from 'vue'; |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | |
| | | |
| | | onMounted(async() => { |
| | | await firstLoading() |
| | | }) |
| | | |
| | | const firstLoading = async() => { |
| | | request.post(`/glassOptimize/getConfiguration/修边`).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; |
| | | }); |
| | | quicksetLeft.value=formattedData[0].leftTrim |
| | | quicksetTop.value=formattedData[0].upTrim |
| | | quicksetRight.value=formattedData[0].rightTrim |
| | | quicksetBottom.value=formattedData[0].downTrim |
| | | |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | function setupComponent() { |
| | | // 各个输入框绑定的值,初始化为0 |
| | |
| | | }); |
| | | |
| | | const setTrimming = () => { |
| | | let json = "{" |
| | | json+='"left_trim":"'+quicksetLeft.value+'",' |
| | | json+='"up_trim":"'+quicksetTop.value+'",' |
| | | json+='"right_trim":"'+quicksetRight.value+'",' |
| | | json+='"down_trim":"'+quicksetBottom.value+'",' |
| | | json+='"auto_fill_trim":"'+true+'",' |
| | | json+='"quick_trim":"'+15+'"' |
| | | json+="}" |
| | | |
| | | let configuration={ |
| | | json:json, |
| | | } |
| | | |
| | | request.post(`/glassOptimize/saveConfiguration/修边`,configuration).then((res) => { |
| | | if(res.code==200 && res.data===true){ |
| | | const dataToSend = { |
| | | quicksetTop: quicksetTop.value, |
| | | quicksetRight: quicksetRight.value, |
| | |
| | | }; |
| | | emit('send-data-event', dataToSend); |
| | | props.closeDialog(3); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | </script> |
| | |
| | | |
| | | //库存信息 |
| | | @ApiOperation("库存信息接口") |
| | | @PostMapping ("/materialStore/{thickness}/{model}") |
| | | @PostMapping ("/materialStore/{thickness}/{model}/{projectNumber}") |
| | | public Result materialStore( |
| | | @PathVariable String thickness, |
| | | @PathVariable String model ){ |
| | | return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model)); |
| | | @PathVariable String model,@PathVariable String projectNumber ){ |
| | | return Result.seccess(glassOptimizeService.materialStoreSv(thickness,model,projectNumber)); |
| | | } |
| | | |
| | | |
| | |
| | | return Result.seccess(glassOptimizeService.getConfiguration(type)); |
| | | } |
| | | |
| | | @ApiOperation("修片磨量修改") |
| | | @PostMapping("/saveConfiguration/{type}") |
| | | public Result saveConfiguration(@PathVariable String type, @RequestBody Map<String,Object> object){ |
| | | return Result.seccess(glassOptimizeService.saveConfiguration(object,type)); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | | import com.example.erp.entity.pp.OptimizeUse; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | |
| | | //库存信息 |
| | | List<Map<String, Object>> materialStoreMp(String thickness, String model); |
| | | |
| | | List<Map<String, Object>> materialStoreOptimizeUse(String projectNumber); |
| | | |
| | | //工单管理查询未转工单数据 |
| | | List<OrderGlassDetail> selectWordOrder(Date selectTime1, Date selectTime2, OrderGlassDetail orderGlassDetail); |
| | | List<Map<String, Object>> selectWordOrder(Date selectTime1, Date selectTime2, OrderGlassDetail orderGlassDetail); |
| | | |
| | | //创建工程膜系查询 |
| | | List<Map<String, Object>> getFlowCardListMp(String optionVal, Integer radio); |
| | |
| | | Integer sumQuantity, Double sumArea, String userName,Integer processIdCount, String processId, Integer type); |
| | | |
| | | List<Map<String, Object>> getTemperedConfiguration(); |
| | | |
| | | List<Map<String, Object>> getGrindingTrimming(); |
| | | |
| | | List<Map<String, Object>> getEdgeTrimming(); |
| | | |
| | | Boolean updateOptimizeConfig(String json,Integer type); |
| | | } |
| | |
| | | import com.example.erp.common.RabbitMQUtil; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.OptimizeProjectMange; |
| | | import com.example.erp.entity.userInfo.Log; |
| | | import com.example.erp.entity.userInfo.SysError; |
| | | import com.example.erp.mapper.pp.GlassOptimizeMapper; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.sql.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeoutException; |
| | | |
| | | @Service |
| | |
| | | |
| | | //工程信息 |
| | | public Map<String, Object> projectInfoSv(String projectNo) { |
| | | Map<String, Object> stringObjectMap = glassOptimizeMapper.selectProjectCount(projectNo); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(Integer.parseInt(stringObjectMap.get("state").toString())<10){ |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | }else if(stringObjectMap.get("state").equals(10)){ |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | map.put("grindingTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | map.put("grindingTrimming", null); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //库存信息 |
| | | public Map<String, Object> materialStoreSv(String thickness, String model) { |
| | | public Map<String, Object> materialStoreSv(String thickness, String model, String projectNumber) { |
| | | Map<String, Object> stringObjectMap = glassOptimizeMapper.selectProjectCount(projectNumber); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(Integer.parseInt(stringObjectMap.get("state").toString())<=10){ |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | map.put("edgeTrimming", glassOptimizeMapper.getEdgeTrimming()); |
| | | }else{ |
| | | map.put("data", glassOptimizeMapper.materialStoreOptimizeUse(projectNumber)); |
| | | map.put("edgeTrimming", null); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | |
| | | if(type.equals("钢化")){ |
| | | map.put("data", glassOptimizeMapper.getTemperedConfiguration()); |
| | | }else if(type.equals("磨量")){ |
| | | map.put("data", glassOptimizeMapper.getTemperedConfiguration()); |
| | | map.put("data", glassOptimizeMapper.getGrindingTrimming()); |
| | | }else if(type.equals("修边")){ |
| | | map.put("data", glassOptimizeMapper.getTemperedConfiguration()); |
| | | map.put("data", glassOptimizeMapper.getEdgeTrimming()); |
| | | } |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Boolean saveConfiguration(Map<String,Object> object,String type) { |
| | | String json = ""; |
| | | if (object.get("json") != null) { |
| | | json = object.get("json").toString(); |
| | | } |
| | | if(type.equals("钢化")){ |
| | | glassOptimizeMapper.updateOptimizeConfig(json,1); |
| | | } else if (type.equals("修边")) { |
| | | glassOptimizeMapper.updateOptimizeConfig(json,5); |
| | | }else if (type.equals("磨量")) { |
| | | glassOptimizeMapper.updateOptimizeConfig(json,4); |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | } |
| | |
| | | f.technology_number , |
| | | g.glass_child , |
| | | g.icon, |
| | | op.project_name |
| | | op.project_name, |
| | | d.processing_note |
| | | FROM |
| | | ((pp.flow_card AS f |
| | | LEFT JOIN sd.order_detail AS d ON (((f.order_id = d.order_id) AND (f.order_number = d.order_number)))) |
| | |
| | | SELECT |
| | | i.id AS id, |
| | | i.producer AS producer, |
| | | i.available_quantity AS available_quantity, |
| | | 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, |
| | |
| | | ( |
| | | (`s`.`type` = '原片') |
| | | AND (`i`.`optimize_state` = 1) |
| | | AND (`i`.`available_quantity` > 0) |
| | | 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 ; |
| | | </select> |
| | | |
| | | |
| | | <select id="materialStoreOptimizeUse"> |
| | | select ms.id AS id, |
| | | ou.use_count AS processingQuantity, |
| | | ou.width, |
| | | ou.height, |
| | | ou.left_trim as leftTrim, |
| | | ou.down_trim as downTrim, |
| | | ou.up_trim as upTrim, |
| | | ou.right_trim as rightTrim, |
| | | JSON_EXTRACT(ms.json, '$.thickness') AS thickness, |
| | | JSON_EXTRACT(ms.json, '$.name') AS name, |
| | | JSON_EXTRACT(ms.json, '$.model') AS model |
| | | from pp.optimize_use ou |
| | | left join mm.material_store ms on ou.raw_stock_code=ms.id where project_no=#{projectNumber} and state=1 |
| | | </select> |
| | | |
| | | <select id="selectWordOrder" resultMap="wordOrderMap"> |
| | |
| | | JSON_EXTRACT( oc.config_detail, '$.y_space' ) as y_space |
| | | from pp.optimize_admin oa left join pp.optimize_config oc on oa.h_id=oc.id where name='admin' |
| | | </select> |
| | | |
| | | <select id="getEdgeTrimming"> |
| | | select JSON_EXTRACT( oc.config_detail, '$.left_trim' ) as leftTrim, |
| | | JSON_EXTRACT( oc.config_detail, '$.up_trim' ) as upTrim, |
| | | JSON_EXTRACT( oc.config_detail, '$.right_trim' ) as rightTrim, |
| | | JSON_EXTRACT( oc.config_detail, '$.down_trim' ) as downTrim, |
| | | JSON_EXTRACT( oc.config_detail, '$.auto_fill_trim' ) as autoFillTrim, |
| | | JSON_EXTRACT( oc.config_detail, '$.quick_trim' ) as quickTrim |
| | | from pp.optimize_config oc where config_type=5 |
| | | </select> |
| | | |
| | | <select id="getGrindingTrimming"> |
| | | select JSON_EXTRACT( oc.config_detail, '$.left_edge' ) as leftEdge, |
| | | JSON_EXTRACT( oc.config_detail, '$.up_edge' ) as upEdge, |
| | | JSON_EXTRACT( oc.config_detail, '$.right_edge' ) as rightEdge, |
| | | JSON_EXTRACT( oc.config_detail, '$.down_edge' ) as downEdge, |
| | | JSON_EXTRACT( oc.config_detail, '$.auto_fill_edge' ) as autoFillEdge, |
| | | JSON_EXTRACT( oc.config_detail, '$.quick_edge' ) as quickEdge, |
| | | JSON_EXTRACT( oc.config_detail, '$.min_auto_lenght' ) as minAutoLenght |
| | | from pp.optimize_config oc where config_type=4 |
| | | </select> |
| | | |
| | | <update id="updateOptimizeConfig"> |
| | | UPDATE pp.optimize_config set config_detail=#{json},create_time=now() |
| | | where config_type=#{type} |
| | | </update> |
| | | </mapper> |