Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | materialAdditionReport:"物料新增报表", |
| | | materialOutboundReport:"物料出库报表", |
| | | materialReturnReport:"物料返库报表", |
| | | optimizeOutboundReport:"优化出库报表", |
| | | optimizeQuantity:"优化使用数量", |
| | | }, |
| | | components:{ |
| | | addNewSignature :'أضف اسم جديد', |
| | |
| | | materialAdditionReport:"Material addition report", |
| | | materialOutboundReport:"Material delivery report", |
| | | materialReturnReport:"Material return report", |
| | | optimizeOutboundReport:"优化出库报表", |
| | | optimizeQuantity:"优化使用数量", |
| | | }, |
| | | components:{ |
| | | addNewSignature :'Add label name', |
| | |
| | | materialAdditionReport:"物料新增报表", |
| | | materialOutboundReport:"物料出库报表", |
| | | materialReturnReport:"物料返库报表", |
| | | optimizeOutboundReport:"优化出库报表", |
| | | optimizeQuantity:"优化使用数量", |
| | | }, |
| | | components:{ |
| | | addNewSignature :'Добавить имя метки', |
| | |
| | | materialAdditionReport:"物料新增报表", |
| | | materialOutboundReport:"物料出库报表", |
| | | materialReturnReport:"物料返库报表", |
| | | optimizeOutboundReport:"优化出库报表", |
| | | optimizeQuantity:"优化使用数量", |
| | | }, |
| | | components:{ |
| | | addNewSignature :'新增标签名', |
| | |
| | | component: () => import('../views/mm/stockReport/MaterialOutboundReport.vue'), |
| | | }, |
| | | { |
| | | path: 'optimizeOutboundReport', |
| | | name: 'optimizeOutboundReport', |
| | | component: () => import('../views/mm/stockReport/OptimizeOutboundReport.vue'), |
| | | }, |
| | | { |
| | | path: 'materialReturnReport', |
| | | name: 'materialReturnReport', |
| | | component: () => import('../views/mm/stockReport/MaterialReturnReport.vue'), |
| New file |
| | |
| | | <script setup> |
| | | |
| | | import BasicTable from "@/components/BasicTable.vue" |
| | | import request from "@/utils/request" |
| | | import { ref} from "vue" |
| | | import { useI18n } from 'vue-i18n' |
| | | |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | |
| | | const childrenData = ref({ |
| | | columns:[ |
| | | {type: 'seq',fixed:"left", title: t('basicData.Number'), width: '80' }, |
| | | {field: 'operationOrderNumber', width:'150', title: t('productStock.operationOrderNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'projectNo', width: '120',title:t('ingredientsStock.projectNo'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity', width: '140',title: t('ingredientsStock.outboundQuantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'useCount', width: '140',title: t('stockReport.optimizeQuantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'inventoryId',width: '100', title: t('ingredientsStock.id'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'materialName',width: '140', title: t('ingredientsStock.materialName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'width', width: '100',title: t('order.width'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'height',width: '100', title: t('order.height'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'thickness', width: '100',title: t('order.totalThickness'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'unit', width:'140', title: t('ingredients.unit'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operator', width: '100',title: t('productStock.creator'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'operateTime', width:'140', title: t('productStock.productionDate'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | |
| | | ],//表格表头字段 |
| | | data:[],//表格数据 |
| | | url :'/materialInventory/getOptimizeOutboundReport/物料出库', |
| | | exportUrl :'/materialInventory/exportMaterialLogReport/物料出库', |
| | | exportName:t('stockReport.materialOutboundReport'), |
| | | footList:['quantity'] |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | | <basic-table |
| | | :childrenData="childrenData"/> |
| | | </template> |
| | | |
| | | <style scoped> |
| | | </style> |
| | |
| | | <el-dropdown-item command="/main/stockReport/materialAdditionReport" >{{$t('stockReport.materialAdditionReport')}}</el-dropdown-item> |
| | | <el-dropdown-item command="/main/stockReport/materialOutboundReport" >{{ $t('stockReport.materialOutboundReport') }}</el-dropdown-item> |
| | | <el-dropdown-item command="/main/stockReport/materialReturnReport" >{{ $t('stockReport.materialReturnReport') }}</el-dropdown-item> |
| | | <el-dropdown-item command="/main/stockReport/optimizeOutboundReport" >{{ $t('stockReport.optimizeOutboundReport') }}</el-dropdown-item> |
| | | </el-dropdown-menu> |
| | | </template> |
| | | </el-dropdown> |
| | |
| | | {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(() => { |
| | | selectMaterialStore(); |
| | | 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 = () => { |
| | | const amountData = { |
| | | quicksetTop: quicksetTop.value, |
| | | quicksetRight: quicksetRight.value, |
| | | quicksetBottom: quicksetBottom.value, |
| | | quicksetLeft: quicksetLeft.value |
| | | }; |
| | | emit('set-amount', amountData); |
| | | props.closeDialog(2); |
| | | 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, |
| | | 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 = () => { |
| | | const dataToSend = { |
| | | quicksetTop: quicksetTop.value, |
| | | quicksetRight: quicksetRight.value, |
| | | quicksetBottom: quicksetBottom.value, |
| | | quicksetLeft: quicksetLeft.value |
| | | }; |
| | | emit('send-data-event', dataToSend); |
| | | props.closeDialog(3); |
| | | 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, |
| | | quicksetBottom: quicksetBottom.value, |
| | | quicksetLeft: quicksetLeft.value |
| | | }; |
| | | emit('send-data-event', dataToSend); |
| | | props.closeDialog(3); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }); |
| | | |
| | | }; |
| | | |
| | | </script> |
| | |
| | | {title: t('basicData.operate'), width: 140, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: t('basicData.Number'), width: 50 }, |
| | | {field: 'reportingWorkId', width: 120, title: t('reportingWorks.reportingWorkId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'reportingWorkTime',width: 120, title: t('reportingWorks.reportingWorkTime') ,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'reportingWorkTime',width: 120, title: t('reportingWorks.reportingWorkTime') ,showOverflow:"ellipsis" ,}, |
| | | {field: 'orderId', width: 130,title: t('order.orderId') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'processId', width: 160,title: t('processCard.processId') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project',width: 150, title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | |
| | | return Result.seccess(materialInventoryService.cancelMaterialAdditionRecord(object)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("优化物料库存记录查询接口") |
| | | @SaCheckPermission("warehouseReport.search") |
| | | @PostMapping("/getOptimizeOutboundReport/{type}/{pageNum}/{pageSize}/{selectDate}") |
| | | public Result getOptimizeOutboundReport(@PathVariable String type,@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody MaterialLog materialLog){ |
| | | return Result.seccess(materialInventoryService.getOptimizeOutboundReport(type,pageNum,pageSize,selectDate,materialLog)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | //库存信息 |
| | | @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)); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | @ExcelProperty("创建时间") |
| | | private LocalDate operateTime; |
| | | |
| | | @ExcelProperty("优化使用数量") |
| | | private Integer useCount; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | String selectProjectNo(@Param("useId") Integer useId); |
| | | |
| | | List<MaterialLog> getOptimizeOutboundReport(Integer offset, Integer pageSize, String startDate, String endDate, MaterialLog materialLog, String type); |
| | | |
| | | Map<String,Integer> getOptimizeOutboundReportTotal(Integer offset, Integer pageSize, String startDate, String endDate, MaterialLog materialLog, String 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); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public Map<String, Object> getOptimizeOutboundReport(String type, Integer pageNum, Integer pageSize, List<String> selectDate, MaterialLog materialLog) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | String endDate = LocalDate.now().toString(); |
| | | String startDate = LocalDate.now().minusDays(15).toString(); |
| | | if(selectDate !=null && selectDate.size()==2){ |
| | | if(!selectDate.get(0).isEmpty()){ |
| | | startDate = selectDate.get(0); |
| | | } |
| | | if(!selectDate.get(1).isEmpty()){ |
| | | endDate = selectDate.get(1); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", materialInventoryMapper.getOptimizeOutboundReport(offset, pageSize,startDate, endDate, materialLog,type)); |
| | | map.put("total", materialInventoryMapper.getOptimizeOutboundReportTotal(offset, pageSize,startDate, endDate, materialLog,type)); |
| | | List<String> list = new ArrayList<>(); |
| | | list.add(startDate); |
| | | list.add(endDate); |
| | | map.put("selectDate",list); |
| | | return map; |
| | | } |
| | | } |
| | |
| | | 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<>(); |
| | | map.put("data", glassOptimizeMapper.projectInfoMp(projectNo)); |
| | | 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<>(); |
| | | map.put("data", glassOptimizeMapper.materialStoreMp(thickness,model)); |
| | | 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; |
| | | |
| | | } |
| | | } |
| | |
| | | select project_no from pp.optimize_use where id=#{useId}; |
| | | </select> |
| | | |
| | | <select id="getOptimizeOutboundReport"> |
| | | SELECT |
| | | ml.operation_order_number, |
| | | ml.project_no, |
| | | ml.inventory_id, |
| | | ml.material_name, |
| | | ml.unit, |
| | | ml.width, |
| | | ml.height, |
| | | ml.thickness, |
| | | ml.quantity, |
| | | round(ml.width*ml.height*ml.quantity/1000000,2) as area, |
| | | ou.use_count, |
| | | ou.not_use_count, |
| | | ml.operator, |
| | | ml.operate_time |
| | | |
| | | FROM |
| | | mm.material_log AS ml |
| | | LEFT JOIN pp.optimize_use AS ou ON ou.project_no = ml.project_no |
| | | AND ou.raw_stock_code = ml.inventory_id |
| | | WHERE |
| | | ou.project_no IS NOT NULL |
| | | AND date( ml.operate_time )>= #{startDate} and date(ml.operate_time) <= #{endDate} |
| | | and ml.operate_type=#{type} |
| | | |
| | | <if test="materialLog.operationOrderNumber != null and materialLog.operationOrderNumber != ''"> |
| | | and ml.operation_order_number regexp #{materialLog.operationOrderNumber} |
| | | </if> |
| | | <if test="materialLog.useCount != null and materialLog.useCount != ''"> |
| | | and ou.use_count regexp #{materialLog.useCount} |
| | | </if> |
| | | <if test="materialLog.quantity != null and materialLog.quantity != ''"> |
| | | and ml.quantity regexp #{materialLog.quantity} |
| | | </if> |
| | | <if test="materialLog.width != null and materialLog.width != ''"> |
| | | and ml.width regexp REGEXP_REPLACE(#{materialLog.width},'\\.0+$','') |
| | | </if> |
| | | <if test="materialLog.height != null and materialLog.height != ''"> |
| | | and ml.height regexp REGEXP_REPLACE(#{materialLog.height},'\\.0+$','') |
| | | </if> |
| | | <if test="materialLog.thickness != null and materialLog.thickness != ''"> |
| | | and ml.thickness regexp REGEXP_REPLACE(#{materialLog.thickness},'\\.0+$','') |
| | | </if> |
| | | |
| | | <if test="materialLog.inventoryId != null and materialLog.inventoryId != ''"> |
| | | and ml.inventory_id regexp #{materialLog.inventoryId} |
| | | </if> |
| | | |
| | | <if test="materialLog.materialName != null and materialLog.materialName != ''"> |
| | | and ml.material_name regexp #{materialLog.materialName} |
| | | </if> |
| | | <if test="materialLog.producer != null and materialLog.producer != ''"> |
| | | and ml.producer regexp #{materialLog.producer} |
| | | </if> |
| | | <if test="materialLog.unit != null and materialLog.unit != ''"> |
| | | and ml.unit regexp #{materialLog.unit} |
| | | </if> |
| | | <if test="materialLog.operator != null and materialLog.operator != ''"> |
| | | and ml.operator regexp #{materialLog.operator} |
| | | </if> |
| | | <if test="materialLog.remarks != null and materialLog.remarks != ''"> |
| | | and ml.remarks regexp #{materialLog.remarksr} |
| | | </if> |
| | | order by ml.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getOptimizeOutboundReportTotal"> |
| | | SELECT |
| | | CEILING(count(ml.id)/#{pageSize}) as 'pageTotal', |
| | | count(ml.id) as 'total' |
| | | |
| | | FROM |
| | | mm.material_log AS ml |
| | | LEFT JOIN pp.optimize_use AS ou ON ou.project_no = ml.project_no |
| | | AND ou.raw_stock_code = ml.inventory_id |
| | | WHERE |
| | | ou.project_no IS NOT NULL |
| | | AND date( ml.operate_time )>= #{startDate} and date(ml.operate_time) <= #{endDate} |
| | | and ml.operate_type=#{type} |
| | | </select> |
| | | </mapper> |
| | |
| | | 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> |