| | |
| | | break |
| | | } |
| | | |
| | | case 'setType': { |
| | | alert('我接收到子组件传送的排版状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //工序 |
| | | const value = ref('切割') |
| | | const processVal = ref('切割') |
| | | |
| | | |
| | | //排产状态 |
| | |
| | | }, |
| | | ] |
| | | |
| | | function padLeftZero(str) { |
| | | return ('00' + str).substr(str.length) |
| | | } |
| | | |
| | | //定义表单值 |
| | | const form = reactive({ |
| | | date1: '', |
| | |
| | | }) |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | count += Number(item[field]) |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectProcesses = value.value |
| | | let selectProcesses = processVal.value |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | |
| | | const getWorkOrder = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectProcesses = value.value |
| | | let selectProcesses = processVal.value |
| | | let selectState = stateValue.value |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | |
| | | if (selectProcesses == '') { |
| | | selectProcesses = null |
| | | } |
| | | // if (inputVal == null && selectState == 1) { |
| | | // //根据时间查询未排产数据 |
| | | // request.post(`/productionScheduling/selectLastScheduling/${startTime}/${endTime}/${selectProcesses}/${inputVal}`, filterData.value).then((res) => { |
| | | // |
| | | // if (res.code == 200) { |
| | | // pageTotal.value = res.data.total |
| | | // xGrid.value.loadData(res.data.data) |
| | | // gridOptions.loading = false |
| | | // //禁用删除、审核按钮 |
| | | // gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | // gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | // //启用保存 |
| | | // gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | // } else if (inputVal != null && selectState == 1) { |
| | | //根据工序查询未排产数据 |
| | | request.post(`/productionScheduling/selectScheduling/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | xGrid.value.loadData(res.data.data) |
| | | console.log(res.data.data) |
| | | gridOptions.loading = false |
| | | //禁用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | //启用保存 |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | if (selectState==1){ |
| | | //禁用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | //启用保存 |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | }else{ |
| | | //禁用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = false |
| | | gridOptions.toolbarConfig.buttons[1].disabled = false |
| | | //启用保存 |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | |
| | | } |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | // } else if (inputVal == null && selectState == 2) { |
| | | // //根据时间查询已排产数据 |
| | | // request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | | // if (res.code == 200) { |
| | | // pageTotal.value = res.data.total |
| | | // xGrid.value.loadData(res.data.data) |
| | | // gridOptions.loading = false |
| | | // //启用删除、审核按钮 |
| | | // gridOptions.toolbarConfig.buttons[0].disabled = false |
| | | // gridOptions.toolbarConfig.buttons[1].disabled = false |
| | | // //禁用保存 |
| | | // gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | // } else if (inputVal != null && selectState == 2) { |
| | | // //根据订单号查询已排产数据 |
| | | // request.post(`/productionScheduling/selectSchedulingNot/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | | // if (res.code == 200) { |
| | | // pageTotal.value = res.data.total |
| | | // xGrid.value.loadData(res.data.data) |
| | | // gridOptions.loading = false |
| | | // //启用删除、审核按钮 |
| | | // gridOptions.toolbarConfig.buttons[0].disabled = false |
| | | // gridOptions.toolbarConfig.buttons[1].disabled = false |
| | | // //禁用保存 |
| | | // gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | // } else { |
| | | // ElMessage.warning(res.msg) |
| | | // } |
| | | // }) |
| | | // } |
| | | |
| | | |
| | | } |
| | |
| | | //获取选中时间 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectProcesses = value.value |
| | | let selectProcesses = processVal.value |
| | | let selectState = stateValue.value |
| | | let inputVal = form.orderId |
| | | if (inputVal == '') { |
| | |
| | | if (selectProcesses == '') { |
| | | selectProcesses = null |
| | | } |
| | | |
| | | request.post(`/productionScheduling/selectScheduling/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total * 1 |
| | |
| | | pageNum.value = 1 |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | //禁用删除、审核按钮 |
| | | gridOptions.toolbarConfig.buttons[0].disabled = true |
| | | gridOptions.toolbarConfig.buttons[1].disabled = true |
| | | //启用保存 |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe: true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 30},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true, height: 50},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | customConfig: { |
| | | storage: true |
| | | }, |
| | | |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | |
| | | }, |
| | | //表头参数 |
| | | columns: [ |
| | | {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | {type: 'expand',fixed: "left", slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', fixed: "left", title: t('basicData.Number'), width: 50}, |
| | | {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80}, |
| | | { |
| | | field: 'scheduled_start_time', |
| | | width: 120, |
| | | editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}}, |
| | | field: 'scheduledStartTime', |
| | | width: 130, |
| | | editRender: {name: 'input', attrs: {placeholder: '', type: 'date'},}, |
| | | title: t('processCard.scheduledStartTime') |
| | | }, |
| | | { |
| | | field: 'plan_end_time', |
| | | width: 120, |
| | | field: 'planEndTime', |
| | | width: 130, |
| | | editRender: {name: 'input', attrs: {placeholder: '', type: 'date'}}, |
| | | title: t('processCard.planEndTime') |
| | | }, |
| | |
| | | title: t('order.orderId'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | width: 100, |
| | | width: 110, |
| | | }, |
| | | { |
| | | field: 'order.customerName', |
| | |
| | | title: t('order.OrderNum'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | width: 70, |
| | | width: 100, |
| | | }, |
| | | { |
| | | field: 'technologyNumber', |
| | | title: t('processCard.technologyNumber'), |
| | | filters: [{data: ''}], |
| | | slots: {filter: 'num1_filter'}, |
| | | width: 70, |
| | | width: 100, |
| | | }, |
| | | { |
| | | field: 'orderGlassDetail.childWidth', |
| | |
| | | title: t('order.height'), |
| | | width: 60, |
| | | }, |
| | | {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 70}, |
| | | {field: 'orderDetail.quantity', title: t('processCard.orderQuantity'), width: 90}, |
| | | {field: 'orderGlassDetail.area', title: t('processCard.orderArea'), width: 90}, |
| | | { |
| | | field: 'schedulingQuantity', |
| | |
| | | title: t('processCard.productionSchedulingQuantity'), |
| | | sortable: true |
| | | }, |
| | | {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 120}, |
| | | {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 120}, |
| | | {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 120}, |
| | | {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 120}, |
| | | {field: 'reviewStatus', title: t('processCard.reviewedState'), width: 140}, |
| | | {field: 'reviewer', title: t('processCard.reviewed'), width: 140}, |
| | | {field: 'orderGlassDetail.glassChild', title: t('order.product'), width: 140}, |
| | | {field: 'pendingProductionQuantity', title: t('processCard.quantityToScheduled'), width: 100}, |
| | | {field: 'pendingProductionArea', title: t('processCard.areaToScheduled'), width: 100}, |
| | | {field: 'productionScheduledQuantity', title: t('processCard.plannedProductionQuantity'), width: 100}, |
| | | {field: 'productionScheduledArea', title: t('processCard.plannedProductionArea'), width: 100}, |
| | | {field: 'reviewStatus', title: t('processCard.reviewedState'), width: 80}, |
| | | {field: 'reviewer', title: t('processCard.reviewed'), width: 80}, |
| | | {field: 'orderDetail.productName', title: t('order.product'), width: 140}, |
| | | {field: 'orderDetail.shape', title: t('order.shape'), width: 80}, |
| | | {field: 'notes', title: t('processCard.notes'), editRender: {name: 'input', attrs: {placeholder: ''}}, width: 120}, |
| | | {field: 'schedulingId', title: t('processCard.schedulingId'), width: 120}, |
| | |
| | | return; |
| | | } |
| | | for (let i = 0; i < selectRecords.length; i++) { |
| | | let start = selectRecords[i].scheduled_start_time |
| | | let end = selectRecords[i].plan_end_time |
| | | let number = selectRecords[i].scheduling_quantity |
| | | let start = selectRecords[i].scheduledStartTime |
| | | let end = selectRecords[i].planEndTime |
| | | let number = selectRecords[i].schedulingQuantity |
| | | //计划开始、结束时间,排产数量不能为空 |
| | | if (start == null || end == null || number == null) { |
| | | ElMessage.warning("请填入对应的值再进行保存") |
| | | return; |
| | | } |
| | | } |
| | | let selectProcesses = value.value |
| | | let selectProcesses = processVal.value |
| | | if (selectProcesses == null || selectProcesses == "") { |
| | | ElMessage.warning("请选择排产工序") |
| | | return; |
| | |
| | | switch (menu.code) { |
| | | case 'copyChecked' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "scheduled_start_time" || result.cell === "plan_end_time") { |
| | | if (result.cell === "scheduledStartTime" || result.cell === "planEndTime" || result.cell === "schedulingQuantity"){ |
| | | if (result) { |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | const val = dataList[result.start][result.cell] |
| | |
| | | } |
| | | case 'copyAll' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "scheduled_start_time" || result.cell === "plan_end_time") { |
| | | if (result.cell === "scheduledStartTime" || result.cell === "planEndTime"|| result.cell === "schedulingQuantity") { |
| | | if (result) { |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | const val = dataList[result.start][result.cell] |
| | |
| | | } |
| | | case 'clearChecked' : { |
| | | let result = toolbarButtonClickEvent() |
| | | if (result.cell === "scheduled_start_time" || result.cell === "plan_end_time") { |
| | | if (result.cell === "scheduledStartTime" || result.cell === "planEndTime"|| result.cell === "schedulingQuantity") { |
| | | if (result) { |
| | | const dataList = xGrid.value.getTableData().visibleData |
| | | dataList.forEach((item, index) => { |
| | |
| | | |
| | | <el-input v-model="form.orderId" :placeholder="$t('order.orderId')" clearable style="width: 110px"></el-input> |
| | | |
| | | <el-select v-model="value" clearable default-value="default_city" style="width: 120px"> |
| | | <el-select v-model="processVal" clearable default-value="default_city" style="width: 120px"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['processType']" |
| | | :key="item.id" |
| | |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | | <div ref="cellArea" class="vxe-table--cell-area"> |
| | | <span class="vxe-table--cell-main-area"></span> |
| | | |
| | | <span class="vxe-table--cell-active-area"></span> |
| | | </div> |
| | | </template> |
| | | |
| | | <style scoped> |
| | |
| | | //点击查询排版数据 |
| | | @ApiOperation("点击查询排版数据接口") |
| | | @SaCheckPermission("ProductionScheduling.search") |
| | | @PostMapping ("/selectScheduling/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | @PostMapping ("/selectScheduling/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{orderIds}/{processes}/{state}") |
| | | public Result selectScheduling( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable String orderId, |
| | | @PathVariable String orderIds, |
| | | @PathVariable String processes, |
| | | @PathVariable Integer state, |
| | | @RequestBody ProductionScheduling productionScheduling){ |
| | | |
| | | return Result.seccess(productionSchedulingService.selectSchedulingSv(pageNum, pageSize,selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | return Result.seccess(productionSchedulingService.selectSchedulingSv(pageNum, pageSize,selectTime1,selectTime2,orderIds,processes,state,productionScheduling)); |
| | | |
| | | } |
| | | |
| | | //点击查询排版数据(带订单号查询) |
| | | @ApiOperation("根据条件查询排版数据接口") |
| | | @SaCheckPermission("ProductionScheduling.search") |
| | | @PostMapping ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result selectSchedulingNot( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable String orderId, |
| | | @PathVariable String processes, |
| | | @PathVariable Integer state, |
| | | @RequestBody ProductionScheduling productionScheduling){ |
| | | return Result.seccess(productionSchedulingService.selectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | |
| | | } |
| | | |
| | | //添加排产数据 |
| | | @ApiOperation("添加排产数据接口") |
| | |
| | | |
| | | private Double productionScheduledArea; |
| | | |
| | | private String reviewer; |
| | | |
| | | //外键订单表 |
| | | private Order order; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.PrintSetup; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.sql.Date; |
| | |
| | | public interface ProductionSchedulingMapper extends BaseMapper<ProductionScheduling> { |
| | | |
| | | |
| | | List<Map<String,String>> selectOkSchedulingMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | List<ProductionScheduling> selectOkSchedulingMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderIds, String processes, ProductionScheduling productionScheduling); |
| | | |
| | | List<ProductionScheduling> selectNoSchedulingMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | |
| | | List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2,String processes,String orderId, ProductionScheduling productionScheduling); |
| | | |
| | | List<Map<String,String>> selectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | List<ProductionScheduling> selectNoSchedulingMp(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderIds, String processes, ProductionScheduling productionScheduling); |
| | | |
| | | Integer selectMaxId(); |
| | | |
| | |
| | | |
| | | Map<String, Integer> getPageTotal(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | |
| | | Map<String, Integer> getOkPageTotal(Integer offset, Integer pageSize, String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | |
| | | // Integer selectNumberMp(String orderId, String orderNumber, String processes); |
| | | } |
| | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.PrintSetup; |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | |
| | | ProductionSchedulingMapper productionSchedulingMapper; |
| | | |
| | | //未排产查询 |
| | | public Map<String, Object> selectSchedulingSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling ) { |
| | | public Map<String, Object> selectSchedulingSv(Integer pageNum, Integer pageSize, String selectTime1, String selectTime2, String orderIds, String processes, Integer state, ProductionScheduling productionScheduling ) { |
| | | |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if("null".equals(orderId)){ |
| | | orderId=""; |
| | | if("null".equals(orderIds)){ |
| | | orderIds=""; |
| | | } |
| | | if ("null".equals(processes)){ |
| | | |
| | |
| | | } |
| | | |
| | | if (state==2){//已排产 |
| | | map.put("data", productionSchedulingMapper.selectOkSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | map.put("data", productionSchedulingMapper.selectOkSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling)); |
| | | map.put("total", productionSchedulingMapper.getOkPageTotal(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling)); |
| | | |
| | | }else if (state==1){//未排产 |
| | | map.put("data", productionSchedulingMapper.selectNoSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | map.put("data", productionSchedulingMapper.selectNoSchedulingMp(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling)); |
| | | map.put("total", productionSchedulingMapper.getPageTotal(offset, pageSize,selectTime1, selectTime2,orderIds,processes, productionScheduling)); |
| | | |
| | | } |
| | | map.put("total", productionSchedulingMapper.getPageTotal(offset, pageSize,selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | //首次查询排产数据 |
| | | public Map<String, Object> selectLastScheduling(String selectTime1, String selectTime2,String processes,String orderId,ProductionScheduling productionScheduling ) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if("null".equals(orderId)){ |
| | | orderId=""; |
| | | } |
| | | if ("null".equals(processes)){ |
| | | |
| | | processes=""; |
| | | } |
| | | map.put("data", productionSchedulingMapper.selectLastSchedulingMp(selectTime1, selectTime2,processes,orderId, productionScheduling)); |
| | | map.put("process", productionSchedulingMapper.selectProcess()); |
| | | return map; |
| | | } |
| | | |
| | | //带订单号查询 |
| | | public Map<String, Object> selectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", productionSchedulingMapper.selectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | public Boolean addSchedulingSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | |
| | | //查询已排产工序数量 |
| | | // Integer num = productionSchedulingMapper.selectNumberMp(productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),processes); |
| | | |
| | | productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes()); |
| | | //System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getTechnologyNumber()); |
| | | productionSchedulingMapper.insertSelective(schedulingId,productionScheduling.getOrderGlassDetail().getOrderId(),productionScheduling.getOrderNumber(),productionScheduling.getTechnologyNumber(),processes,productionScheduling.getSchedulingQuantity(),productionScheduling.getScheduledStartTime(),productionScheduling.getPlanEndTime(),productionScheduling.getNotes()); |
| | | // System.out.println(productionScheduling.getOrderId()+"***"+productionScheduling.getOrderGlassDetail().getOrderId()+"--"+productionScheduling.getOrderDetail().getOrderId()); |
| | | } |
| | | return true; |
| | | } |
| | |
| | | <result column="productionScheduledQuantity" property="productionScheduledQuantity"/> |
| | | <result column="productionScheduledArea" property="productionScheduledArea"/> |
| | | <result column="review_status" property="reviewStatus"/> |
| | | <result column="scheduled_start_time" property="scheduledStartTime"/> |
| | | <result column="plan_end_time" property="planEndTime"/> |
| | | <result column="reviewer" property="reviewer"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <result column="project" property="order.project"/> |
| | | <result column="customer_name" property="order.customerName"/> |
| | |
| | | |
| | | |
| | | <!-- 查询已排版数据--> |
| | | <select id="selectOkSchedulingMp"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width * od.height * od.quantity / 1000000, 2) as area, |
| | | ps.scheduling_quantity, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity, 0) as productionScheduledQuantity, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | IF(ps.review_status = 0, "未审核", "已审核") as review_status, |
| | | ps.reviewer, |
| | | od.product_name, |
| | | od.shape, |
| | | ps.scheduling_id |
| | | <select id="selectOkSchedulingMp" resultMap="productionSchedulingMap"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | ps.order_number, |
| | | ps.technology_number, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.quantity, |
| | | round(od.width * od.height * od.quantity / 1000000, 2) as area, |
| | | ps.scheduling_quantity, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as pendingProductionQuantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, |
| | | 2) as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity, 0) as productionScheduledQuantity, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | IF(ps.review_status = 0, "未审核", "已审核") as review_status, |
| | | ps.reviewer, |
| | | od.product_name, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | ps.scheduling_id |
| | | from sd.order_detail as od |
| | | left join sd.order as o on od.order_id = o.order_id |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | left join sd.order as o on od.order_id = o.order_id |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number and |
| | | ogd.technology_number=ps.technology_number |
| | | where ps.scheduling_id IS NOT NULL |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | group by od.order_id, od.order_number |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderIds} in ps.order_id) |
| | | <if test="productionScheduling.orderId != null and productionScheduling.orderId != ''"> |
| | | and ogd.order_id regexp #{productionScheduling.orderId} |
| | | </if> |
| | | <if test="productionScheduling.order.customerName != null and productionScheduling.order.customerName != ''"> |
| | | and o.customer_name regexp #{productionScheduling.order.customerName} |
| | | </if> |
| | | <if test="productionScheduling.order.project != null and productionScheduling.order.project != ''"> |
| | | and o.project regexp #{productionScheduling.order.project} |
| | | </if> |
| | | <if test="productionScheduling.orderNumber != null and productionScheduling.orderNumber != ''"> |
| | | and ogd.order_number regexp #{productionScheduling.orderNumber} |
| | | </if> |
| | | <if test="productionScheduling.technologyNumber != null and productionScheduling.technologyNumber != ''"> |
| | | and ogd.technology_number regexp #{productionScheduling.technologyNumber} |
| | | </if> |
| | | group by ps.id |
| | | order by ps.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <!-- 查询已排产的数据--> |
| | | <select id="selectSchedulingNotMp"> |
| | | select date(ps.scheduled_start_time) as scheduled_start_time, |
| | | date(ps.plan_end_time) as plan_end_time, |
| | | od.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | od.order_number, |
| | | od.width, |
| | | od.height, |
| | | od.quantity, |
| | | round(od.width * od.height * od.quantity / 1000000, 2) as area, |
| | | ps.scheduling_quantity, |
| | | (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) as scheduling_quantity, |
| | | round(od.width * od.height * (od.quantity - IFNULL(sum(ps.scheduling_quantity), 0)) / 1000000, 2) |
| | | as pendingProductionArea, |
| | | IFNULL(ps.scheduling_quantity, 0) as productionScheduledQuantity, |
| | | round(od.width * od.height * (IFNULL(ps.scheduling_quantity, 0)) / 1000000, 2) |
| | | as productionScheduledArea, |
| | | IF(ps.review_status = 0, "未审核", "已审核") |
| | | as review_status, |
| | | ps.reviewer, |
| | | od.product_name, |
| | | od.shape, |
| | | ps.scheduling_id |
| | | from sd.order_detail as od |
| | | left join sd.order as o on od.order_id = o.order_id |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | where (ps.scheduling_id IS NOT NULL) |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | group by od.order_id, od.order_number |
| | | order by ps.id desc |
| | | </select> |
| | | |
| | | <!-- 查询未排产数据--> |
| | | <select id="selectNoSchedulingMp" resultMap="productionSchedulingMap"> |
| | | select ogd.order_id, |
| | |
| | | IFNULL(ps.schedulingQuantity, 0) as productionScheduledQuantity, |
| | | round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | ogd.glass_child, |
| | | od.shape |
| | | od.product_name, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape |
| | | from sd.order_glass_detail as ogd |
| | | |
| | | left join sd.order as o on ogd.order_id = o.order_id |
| | |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and opd.reporting_work_num_count = 0 |
| | | |
| | | and position(#{orderId} in ogd.order_id) |
| | | and position(#{orderIds} in ogd.order_id) |
| | | -- and position("切割" in ps.processes) |
| | | <if test="productionScheduling.orderId != null and productionScheduling.orderId != ''"> |
| | | and ogd.order_id regexp #{productionScheduling.orderId} |
| | |
| | | order by ogd.order_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | <!-- 首次查询排产数据--> |
| | | <select id="selectLastSchedulingMp"> |
| | | select ogd.order_id, |
| | | o.customer_name, |
| | | o.project, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.quantity, |
| | | round(ogd.child_width * ogd.child_height * od.quantity / 1000000, 2) as area, |
| | | (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as scheduling_quantity, |
| | | (od.quantity - IFNULL((ps.schedulingQuantity), 0)) as pendingProductionQuantity, |
| | | round(ogd.child_width * ogd.child_height * (od.quantity - IFNULL((ps.schedulingQuantity), 0)) / 1000000, |
| | | 2) |
| | | as pendingProductionArea, |
| | | IFNULL(ps.schedulingQuantity, 0) as productionScheduledQuantity, |
| | | round(ogd.child_width * ogd.child_height * (IFNULL(ps.schedulingQuantity, 0)) / 1000000, |
| | | 2) as productionScheduledArea, |
| | | ogd.glass_child, |
| | | od.shape |
| | | from sd.order_glass_detail as ogd |
| | | |
| | | left join sd.order as o on ogd.order_id = o.order_id |
| | | left join sd.order_detail as od on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | left join sd.order_process_detail as opd |
| | | on opd.order_id = ogd.order_id and opd.order_number = ogd.order_number and |
| | | opd.technology_number = ogd.technology_number |
| | | left join |
| | | (select order_id, order_number, technology_number, SUM(scheduling_quantity) as schedulingQuantity |
| | | from production_scheduling |
| | | where processes = #{processes} |
| | | group by order_id, order_number, technology_number) as ps |
| | | on ps.order_id = ogd.order_id and ps.order_number = ogd.order_number and |
| | | ps.technology_number = ogd.technology_number |
| | | |
| | | where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0 |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and opd.reporting_work_num_count = 0 |
| | | |
| | | and position(#{orderId} in ogd.order_id) |
| | | -- and position("切割" in ps.processes) |
| | | |
| | | group by ogd.order_id, ogd.order_number, ogd.technology_number |
| | | order by ogd.order_id desc |
| | | </select> |
| | | |
| | | <select id="selectMaxId"> |
| | | select COUNT(ps.scheduling_id) |
| | |
| | | order by ogd.order_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getOkPageTotal"> |
| | | select CEILING(count(ps.id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct ps.id) as 'total' |
| | | from sd.order_detail as od |
| | | left join sd.order as o on od.order_id = o.order_id |
| | | left join production_scheduling as ps |
| | | on ps.order_id = od.order_id and ps.order_number = od.order_number |
| | | left join sd.order_glass_detail as ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number and |
| | | ogd.technology_number=ps.technology_number |
| | | where ps.scheduling_id IS NOT NULL |
| | | and od.create_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | <if test="productionScheduling.orderId != null and productionScheduling.orderId != ''"> |
| | | and ogd.order_id regexp #{productionScheduling.orderId} |
| | | </if> |
| | | <if test="productionScheduling.order.customerName != null and productionScheduling.order.customerName != ''"> |
| | | and o.customer_name regexp #{productionScheduling.order.customerName} |
| | | </if> |
| | | <if test="productionScheduling.order.project != null and productionScheduling.order.project != ''"> |
| | | and o.project regexp #{productionScheduling.order.project} |
| | | </if> |
| | | <if test="productionScheduling.orderNumber != null and productionScheduling.orderNumber != ''"> |
| | | and ogd.order_number regexp #{productionScheduling.orderNumber} |
| | | </if> |
| | | <if test="productionScheduling.technologyNumber != null and productionScheduling.technologyNumber != ''"> |
| | | and ogd.technology_number regexp #{productionScheduling.technologyNumber} |
| | | </if> |
| | | order by ps.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | </mapper> |
| | |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | od.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.process, |
| | |
| | | ogd.child_height as childHeight, |
| | | fc.quantity, |
| | | round( ogd.child_width * ogd.child_height * fc.quantity / 1000000, 2 ) as area, |
| | | od.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | od.remarks |
| | | FROM |
| | | sd.ORDER AS o |
| | |
| | | <select id="productionScheduleMp"> |
| | | select |
| | | a.order_number, |
| | | a.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | a.product_name, |
| | | b.child_width, |
| | | b.child_height, |
| | |
| | | o.project, |
| | | o.order_id, |
| | | o.batch, |
| | | od.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | ogd.order_number, |
| | | ogd.technology_number, |
| | | ogd.process, |
| | |
| | | rwd.order_number, |
| | | MAX( ogd.child_width ) as width, |
| | | MAX( ogd.child_height ) as height, |
| | | od.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | sum( pd.thickness ) as thickness, |
| | | od.edging_type, |
| | | rwd.completed_quantity, |
| | |
| | | fc.quantity AS quantity_card, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num as completedQuantity, |
| | | odpd.reporting_work_num as completed, |
| | |
| | | fc.quantity AS quantity_card, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | if(od.shape=1,'普形',if(od.shape=2,'异形','')) as shape, |
| | | if((odpds.reporting_work_num_count + ifnull(c.patchNumSum,0) -odpd.reporting_work_num_count -odpd.broken_num ) < 0, |
| | | 0, |
| | | odpds.reporting_work_num_count + ifnull(c.patchNumSum,0) -odpd.reporting_work_num_count -odpd.broken_num) as quantity, |
| | |
| | | c.quantity as quantity_card, |
| | | d.child_width, |
| | | d.child_height, |
| | | e.shape, |
| | | if(e.shape=1,'普形',if(e.shape=2,'异形','')) as shape, |
| | | if(ifnull(a.completed_quantity+a.breakage_quantity,0)=0, |
| | | c.quantity-ifnull(a.completed_quantity+a.breakage_quantity,0), |
| | | ifnull(a.completed_quantity+a.breakage_quantity,0)) as 'quantity', -- 可报工数 |