Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | {type: 'checkbox', fixed: "left", title: '选择'}, |
| | | {field: 'orderNumber', title: '订序', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'shape', title: '形状', showOverflow: "ellipsis", filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'width', title: '宽', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'height', title: '高', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis"}, |
| | | {field: 'computeGrossArea', title: '待分面积'}, |
| | | {field: 'totalThickness', title: '总厚度'}, |
| | | {field: 'thickness', title: '玻璃厚度'}, |
| | | {field: 'width', title: '宽', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged,width:'60px'}, |
| | | {field: 'height', title: '高', sortable: true, filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged,width:'60px'}, |
| | | {field: 'baiscQuantity', title: '待分数量', showOverflow: "ellipsis",width:'60px'}, |
| | | {field: 'computeGrossArea', title: '待分面积',width:'60px'}, |
| | | {field: 'totalThickness', title: '总厚度',width:'80px'}, |
| | | {field: 'thickness', title: '玻璃厚度',width:'60px'}, |
| | | {field: 'weight', title: '重量'} |
| | | ],//表头按钮 |
| | | |
| | |
| | | slots: {filter: 'num1_filter'} |
| | | ,filterMethod:filterChanged |
| | | }, |
| | | {field: 'landingSequence', title: '落架顺序', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'landingSequence', title: '小片顺序', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'shape', title: '形状', filters: [{data: ''}], slots: {filter: 'num1_filter'},filterMethod:filterChanged}, |
| | | {field: 'width', title: '宽', showOverflow: "ellipsis"}, |
| | | {field: 'height', title: '高'}, |
| | |
| | | if (res.code == 200) { |
| | | ElMessage.success("保存成功") |
| | | //router.push('/main/processCard/SplittingDetails?orderId=${orderId}') |
| | | router.push({path: '/main/processCard/SplittingDetails', query: {orderId: orderId}}) |
| | | router.push({path: '/main/processCard/AddProcessCard', query: {orderId: orderId,productionId:productionId,random:Math.random()}}) |
| | | |
| | | //location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | router.push("/login") |
| | | } |
| | | }) |
| | | |
| | |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <div style="width: 100%;height: 100%"> |
| | | |
| | | <div class="common-layout" style="height: 100%"> |
| | | <div class="header"> |
| | | <div class="common-layout" style="width: 100%;height: 100%"> |
| | | <div class="header" style="height: 5%;width: 100%"> |
| | | |
| | | <el-button |
| | | style="float: left" |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <el-container height="600px"> |
| | | <el-aside width="44%" > |
| | | <el-container style="height: 100%;width: 100%"> |
| | | <el-aside style="width: 44%;height: 100%" > |
| | | <vxe-grid |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | |
| | | |
| | | </el-aside> |
| | | |
| | | <el-main width="12%" style=""> |
| | | <div width="12%"> |
| | | <el-main style=""> |
| | | <span>选中数量:<el-input type="number" v-model="checkedNum"></el-input></span><br> |
| | | <el-button type="primary" @click="addRight"> →</el-button> |
| | | <br> |
| | |
| | | <br> |
| | | <el-button @click="createProcessCard" type="primary">建立流程卡</el-button> |
| | | </el-main> |
| | | </div> |
| | | |
| | | |
| | | <!-- 右侧--> |
| | | <el-aside width="45%" height="500px" style=""> |
| | | <div style="height: 100%;width: 100%"> |
| | | |
| | | <el-aside style="width: 100%;height: 100%"> |
| | | <vxe-grid |
| | | |
| | | max-height="97%" |
| | | max-height="100%" |
| | | class="mytable-scrollbar" |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | |
| | | </template> |
| | | </vxe-grid> |
| | | </el-aside> |
| | | </div> |
| | | </el-container> |
| | | </div> |
| | | </div> |
| | |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {useRouter} from "vue-router"; |
| | | import {useRouter,useRoute,onBeforeRouteUpdate} from "vue-router"; |
| | | import GlassType from '@/components/basic/product/GlassType.vue' |
| | | |
| | | |
| | | const route = useRoute() |
| | | const router = useRouter() |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | |
| | | </div> |
| | | |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | <router-view :key="route.fullPath" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | |
| | | //点击时查询 |
| | | const getWorkOrder = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let selectProcesses = value.value |
| | | let selectState = stateValue.value |
| | | let inputVal = form.orderId |
| | |
| | | //禁用删除、保存按钮 |
| | | 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/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | pageTotal.value = res.data.total |
| | |
| | | //禁用删除、保存按钮 |
| | | 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 == 2) { |
| | | //根据时间查询已排产数据 |
| | | console.log(startTime, endTime, selectProcesses, selectState) |
| | | request.post(`/productionScheduling/selectScheduling/${startTime}/${endTime}/${inputVal}/${selectProcesses}/${selectState}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | pageTotal.value = res.data.total |
| | |
| | | } |
| | | const type = await VXETable.modal.confirm('您确定要删除该数据?') |
| | | if (type === 'confirm') { |
| | | //保存排产数据 |
| | | request.post("/productionScheduling/deleteScheduling").then((res) => { |
| | | let schedulingData = ref({ |
| | | scheduling: selectRecords, |
| | | }) |
| | | |
| | | request.post("/productionScheduling/deleteScheduling",schedulingData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("保存成功") |
| | | ElMessage.success("删除成功") |
| | | location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | }) |
| | | } |
| | | } |
| | | return; |
| | | } |
| | | case 'review': { |
| | | const $table = xGrid.value |
| | | const selectRecords = $table.getCheckboxRecords() |
| | | if ($table) { |
| | | if (selectRecords.length == 0) { |
| | | ElMessage.warning("请勾选排产数据") |
| | | return; |
| | | } |
| | | let schedulingData = ref({ |
| | | scheduling: selectRecords, |
| | | userName: username//审核人 |
| | | }) |
| | | request.post("/productionScheduling/examineScheduling",schedulingData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success("审核成功") |
| | | location.reload(); |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | |
| | | } |
| | | }) |
| | | |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | form.date1=getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | //第一次加载数据 |
| | | |
| | | request.post(`/processCard/flowCard/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | selectOrderList() |
| | | } |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['总数量','总面积','分箱数'] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | if (footList.includes(column.field)) { |
| | | return sumNum(data, column.field) |
| | | } |
| | | // if (props.tableProp.footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | return '' |
| | | }) |
| | | ] |
| | |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <template #pager> |
| | | <!--使用 pager 插槽--> |
| | | <!-- 'PrevJump','NextJump', --> |
| | | <vxe-pager |
| | | @page-change="handlePageChange" |
| | | :layouts="[ 'PrevPage', 'Jump','PageCount', 'NextPage', 'Total']" |
| | | v-model:current-page="pageNum" |
| | | v-model:page-size="total.pageSize" |
| | | v-model:pager-count="total.pageTotal" |
| | | :total="total.dataTotal" |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |
| | |
| | | //定义表头数据 |
| | | const titleUploadData = ref({ |
| | | //流程卡号 |
| | | processId: 'NG24030501A01/2', |
| | | processId: 'NG24030701B01/1', |
| | | //销售单号 |
| | | orderId: '', |
| | | //生产单号 |
| | |
| | | const regex = /^[0-9]\d*$/ |
| | | const brokenNum = |
| | | (row.breakageQuantity === undefined || row.breakageQuantity===null) ? 0 : row.breakageQuantity |
| | | |
| | | if (row.completedQuantity && !regex.test(row.completedQuantity)) { |
| | | return new Error('请输入整数,并且大于-1') |
| | | }else if(row.completedQuantity+brokenNum>row.quantity){ |
| | | return new Error((`${row.completedQuantity}+$(brokenNum)>${row.quantity}`)) |
| | | return new Error('请输入整数,并且大于等于0') |
| | | }else if((row.completedQuantity*1+brokenNum*1)>row.quantity*1){ |
| | | return new Error((`${row.completedQuantity}+${brokenNum}>${row.quantity}`)) |
| | | } |
| | | |
| | | } |
| | |
| | | titleUploadData.value.creator = user.user.userName |
| | | titleUploadData.value.creatorId = user.user.userId |
| | | const requestDetailData = xGrid.value.getTableData().fullData.filter((row) => { |
| | | const a = (row.completedQuantity !== undefined && row.completedQuantity !== null && row.completedQuantity !== '') |
| | | const b = (row.breakageQuantity !== undefined && row.breakageQuantity !== null && row.breakageQuantity !== '') |
| | | const a = (row.completedQuantity !== undefined && row.completedQuantity !== null && row.completedQuantity !== '' && row.completedQuantity*1!==0) |
| | | const b = (row.breakageQuantity !== undefined && row.breakageQuantity !== null && row.breakageQuantity !== '' && row.breakageQuantity*1!==0) |
| | | return (a || b) |
| | | }) |
| | | if(requestDetailData.length === 0){ |
| | | ElMessage.warning('请填写至少一条损耗数和完工数') |
| | | ElMessage.warning('请填写至少一条损耗数和完工数大于0') |
| | | return false |
| | | } |
| | | |
| | |
| | | title:titleUploadData.value, |
| | | detail:xGrid.value.getTableData().fullData |
| | | } |
| | | console.log(xGrid.value.getTableData().fullData) |
| | | request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{ |
| | | if (res.code == 200){ |
| | | ElMessage.success("报工成功") |
| | | router.push({path:'/main/reportingWorks/AddReportingWork',query:{random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | } |
| | | }).catch(err =>{ |
| | | ElMessage.error(err.message) |
| | |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.FlowCardService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @Api(value="流程卡controller",tags={"流程卡操作接口"}) |
| | | @RequestMapping("/processCard") |
| | | public class ProcessCardController { |
| | | @Autowired |
| | | FlowCardService flowCardService; |
| | | |
| | | //流程卡管理查询 |
| | | @PostMapping ("/flowCard/{selectTime1}/{selectTime2}") |
| | | public Result DateProcess( |
| | | @ApiOperation("流程卡管理查询接口") |
| | | @PostMapping ("/flowCard/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}") |
| | | public Result dateProcess( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(flowCardService.selectProcessCard(selectTime1,selectTime2,flowCard)); |
| | | return Result.seccess(flowCardService.selectProcessCard(pageNum,pageSize,selectTime1,selectTime2,flowCard)); |
| | | |
| | | } |
| | | |
| | | //分架查询 |
| | | @ApiOperation("分架查询接口") |
| | | @PostMapping ("/selectAddProcess/{selectTime1}/{selectTime2}") |
| | | public Result SelectAddProcess( |
| | | public Result selectAddProcess( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody FlowCard flowCard){ |
| | |
| | | } |
| | | |
| | | //分架明细查询 |
| | | @ApiOperation("分架明细查询接口") |
| | | @PostMapping ("/detailsSelect/{orderId}") |
| | | |
| | | public Result DetailsSelect( |
| | | public Result detailsSelect( |
| | | @PathVariable String orderId, |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard)); |
| | | return Result.seccess(flowCardService.detailsSelectSv(orderId,flowCard)); |
| | | |
| | | } |
| | | |
| | | |
| | | //删除工单 |
| | | @ApiOperation("删除工单接口") |
| | | @PostMapping("/deleteFlowCard/{orderId}/{processId}") |
| | | public Result deleteOrderWork( |
| | | @PathVariable String orderId, |
| | | @PathVariable String processId |
| | | ){ |
| | | if(flowCardService.DeleteFlowCardSv(orderId,processId)){ |
| | | if(flowCardService.deleteFlowCardSv(orderId,processId)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败"); |
| | |
| | | } |
| | | |
| | | //修改排版状态 |
| | | @ApiOperation("修改排版状态接口") |
| | | @PostMapping("/updateLayoutStatus/{processId}") |
| | | public Result updateLayoutStatus( |
| | | @PathVariable String processId |
| | | ){ |
| | | if(flowCardService.UpdateLayoutStatusSv(processId)){ |
| | | if(flowCardService.updateLayoutStatusSv(processId)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"修改失败"); |
| | |
| | | } |
| | | |
| | | //分架新增明细查询 |
| | | @ApiOperation("分架明细新增接口") |
| | | @PostMapping ("/selectNoCard/{orderId}/{productionId}") |
| | | public Result SelectNoCard( |
| | | @PathVariable String orderId, |
| | | @PathVariable String productionId, |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard)); |
| | | return Result.seccess(flowCardService.selectNoCardSv(orderId,productionId,flowCard)); |
| | | |
| | | } |
| | | |
| | | //添加流程卡 |
| | | @ApiOperation("流程卡创建接口") |
| | | @PostMapping("/addFlowCard") |
| | | public Result AddOrderWork( @RequestBody Map<String,Object> object){ |
| | | if(flowCardService.AddFlowCardSv(object)){ |
| | | if(flowCardService.addFlowCardSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | |
| | | } |
| | | } |
| | | |
| | | //查询第一次排版数据 |
| | | //查询第一次排产数据 |
| | | @ApiOperation("排产界面加载查询接口") |
| | | @PostMapping ("/selectLastScheduling/{selectTime1}/{selectTime2}") |
| | | public Result selectLastScheduling( |
| | | @PathVariable String selectTime1, |
| | |
| | | return Result.seccess(flowCardService.selectLastScheduling(selectTime1,selectTime2,flowCard)); |
| | | |
| | | } |
| | | //查询排版数据 |
| | | //查询排产数据 |
| | | @ApiOperation("排产点击按钮查询接口") |
| | | @PostMapping ("/selectScheduling/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result selectScheduling( |
| | | @PathVariable String selectTime1, |
| | |
| | | @PathVariable String processes, |
| | | @PathVariable Integer state, |
| | | @RequestBody FlowCard flowCard){ |
| | | return Result.seccess(flowCardService.SelectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard)); |
| | | return Result.seccess(flowCardService.selectSchedulingSv(selectTime1,selectTime2,orderId,processes,state,flowCard)); |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | //点击查询排版数据(带订单号查询) |
| | | @PostMapping ("/selectSchedulingNot/{selectTime1}/{selectTime2}/{orderId}/{processes}/{state}") |
| | | public Result SelectSchedulingNot( |
| | | 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)); |
| | | return Result.seccess(productionSchedulingService.selectSchedulingNotSv(selectTime1,selectTime2,orderId,processes,state,productionScheduling)); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //添加排产数据 |
| | | //删除排产数据 |
| | | @PostMapping("/deleteScheduling") |
| | | public Result DeleteScheduling( @RequestBody Map<String,Object> object){ |
| | | public Result deleteScheduling( @RequestBody Map<String,Object> object) throws Exception{ |
| | | |
| | | if(productionSchedulingService.AddSchedulingSv(object)){ |
| | | if(productionSchedulingService.deleteSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | throw new ServiceException(Constants.Code_500,"删除失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/examineScheduling") |
| | | public Result ExamineScheduling( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(productionSchedulingService.ExamineSchedulingSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"审核失败"); |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | //查询工单 |
| | | @PostMapping ("/orderGlassDetail/{selectTime1}/{selectTime2}/{state}") |
| | | public Result DateWork( |
| | | public Result dateWork( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable Integer state, |
| | |
| | | //转生产订单查询 |
| | | @PostMapping ("/addWork/{orderId}") |
| | | |
| | | public Result AddWork( |
| | | public Result addWork( |
| | | @PathVariable String orderId, |
| | | @RequestBody OrderDetail orderDetail){ |
| | | return Result.seccess(workOrderService.AddDateWork(orderId,orderDetail)); |
| | | return Result.seccess(workOrderService.addDateWork(orderId,orderDetail)); |
| | | |
| | | } |
| | | |
| | | |
| | | //添加工单 |
| | | @PostMapping("/addOrderWork") |
| | | public Result AddOrderWork( @RequestBody Map<String,Object> object){ |
| | | public Result addOrderWork( @RequestBody Map<String,Object> object){ |
| | | |
| | | if(workOrderService.AddOrderWorkSv(object)){ |
| | | if(workOrderService.addOrderWorkSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | |
| | | @PathVariable String orderId, |
| | | @PathVariable String productName |
| | | ){ |
| | | if(workOrderService.DeleteOrderWorkSv(orderId,productName)){ |
| | | if(workOrderService.deleteOrderWorkSv(orderId,productName)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败"); |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @TableName("sd.order_glass_detail") |
| | | public class OrderGlassDetail { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | |
| | | private Integer group; |
| | | private LocalDate productionTime; |
| | | private LocalDate createTime; |
| | | // @TableField(select = false) |
| | | @TableField(select = false,exist = false) |
| | | private Order order; |
| | | //@TableField(select = false) |
| | | // @ManyToOne(fetch = FetchType.LAZY) |
| | | @TableField(select = false,exist = false) |
| | | private OrderDetail orderDetail; |
| | | |
| | | |
| | |
| | | |
| | | private Long id; |
| | | private String orderId; |
| | | private String processId; |
| | | private String orderNumber; |
| | | private Integer technologyNumber; |
| | | private String process; |
| | |
| | | @Mapper |
| | | public interface FlowCardMapper { |
| | | //流程卡管理查询 |
| | | List<FlowCard> selectFlowCard(Date selectTime1, Date selectTime2,FlowCard flowCard); |
| | | List<FlowCard> selectFlowCard(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, FlowCard flowCard); |
| | | |
| | | //分页查询 |
| | | Map<String, Integer> getPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, FlowCard flowCard); |
| | | |
| | | //分架数据查询 |
| | | List<FlowCard> selectFlowCardMp(Date selectTime1, Date selectTime2, FlowCard flowCard); |
| | | |
| | | //分架明细查询 |
| | | List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard); |
| | | List<FlowCard> detailsSelectMp(String orderId, FlowCard flowCard); |
| | | |
| | | //删除流程卡 |
| | | Boolean DeleteFlowCardMp(String orderId, String processId); |
| | | Boolean deleteFlowCardMp(String orderId, String processId); |
| | | |
| | | //分架新增明细查询 |
| | | List<Map<String,String>> SelectNoCardMp(String orderId, String productionId, FlowCard flowCard); |
| | | List<Map<String, String>> selectNoCardMp(String orderId, String productionId, FlowCard flowCard); |
| | | |
| | | //修改排版状态 |
| | | Boolean UpdateLayoutStatusMp(String processId); |
| | | Boolean updateLayoutStatusMp(String processId); |
| | | |
| | | Integer SelectLayoutStatus(String processId); |
| | | Integer selectLayoutStatus(String processId); |
| | | |
| | | //查询报工表内是否存在对应流程卡的数据 |
| | | Integer ReportingWorkCount(String processId); |
| | | Integer reportingWorkCount(String processId); |
| | | |
| | | //插入Flow_card表 |
| | | Boolean AddFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName,Integer layer); |
| | | Boolean addFlowCardMp(String processId, Integer orderNumber, Integer landingSequence, Integer quantity, String productionId, String userName, Integer layer); |
| | | |
| | | Boolean UpdateFlowState(String productionId, Integer orderNumber); |
| | | Boolean updateFlowState(String productionId, Integer orderNumber); |
| | | |
| | | Integer SelectFlowCount(String productionId); |
| | | Integer selectFlowCount(String productionId); |
| | | |
| | | |
| | | Boolean UpdateProcessingCard(String productionId, int state); |
| | | Boolean updateProcessingCard(String productionId, int state); |
| | | |
| | | Boolean UpdateDeleteState(String orderId, String processId); |
| | | Boolean updateDeleteState(String orderId, String processId); |
| | | |
| | | List<FlowCard> SelectOkSchedulingMp(String selectTime1, String selectTime2, String orderId,String processes, FlowCard flowCard); |
| | | List<FlowCard> selectOkSchedulingMp(String selectTime1, String selectTime2, String orderId, String processes, FlowCard flowCard); |
| | | |
| | | List<FlowCard> SelectNoSchedulingMp(String selectTime1, String selectTime2, String orderId,String processes, FlowCard flowCard); |
| | | List<FlowCard> selectNoSchedulingMp(String selectTime1, String selectTime2, String orderId, String processes, FlowCard flowCard); |
| | | |
| | | List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, FlowCard flowCard); |
| | | |
| | | Integer SelectLayer(String productionId, Integer orderNumber); |
| | | Integer selectLayer(String productionId, Integer orderNumber); |
| | | |
| | | |
| | | } |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface ProductionSchedulingMapper { |
| | | public interface ProductionSchedulingMapper extends BaseMapper<ProductionScheduling> { |
| | | |
| | | |
| | | List<Map<String,String>> SelectOkSchedulingMp(String selectTime1, String selectTime2,String orderId,String processes, ProductionScheduling productionScheduling); |
| | |
| | | |
| | | List<Map<String,String>> selectLastSchedulingMp(String selectTime1, String selectTime2, ProductionScheduling productionScheduling); |
| | | |
| | | List<Map<String,String>> SelectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | List<Map<String,String>> selectSchedulingNotMp(String selectTime1, String selectTime2, String orderId, String processes, ProductionScheduling productionScheduling); |
| | | |
| | | Integer selectMaxId(); |
| | | |
| | | Boolean insertSelective(String schedulingId, String orderId, String orderNumber, String processes, Integer schedulingQuantity, LocalDate scheduledStartTime, LocalDate planEndTime, String notes); |
| | | |
| | | Boolean ExamineSchedulingMp(String schedulingId, String userName); |
| | | |
| | | Boolean deleteSchedulingMp(String schedulingId); |
| | | } |
| | |
| | | List<ReportingWorkDetail> reworkDataManage2(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, |
| | | @Param("sDate") String startTime,@Param("eDate") String endTime,ReportingWorkDetail reportingWorkDetail); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | List<Map<String,String>> SelectTechnologicalNumMp(String processIdStr, String technologyStr,String process); |
| | | |
| | | List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String previousProcess); |
| | | List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String process); |
| | | |
| | | List<Map<String,String>> SelectProcessMp(); |
| | | |
| | |
| | | List<Map<String,BasicDataProduce>> selectBasicNameByType(String type); |
| | | |
| | | Integer selectMaxReportingWorkId(); |
| | | |
| | | int selectGlassProcessNum(String orderNumber, String technologyNumber, String processId, String thisProcess); |
| | | |
| | | int selectFlowCardNum(String orderNumber, String technologyNumber, String processId, String thisProcess); |
| | | } |
| | |
| | | List<OrderDetail> addWordOrder(String orderId, OrderDetail orderDetail); |
| | | |
| | | //转工单 |
| | | Boolean AddOrderWorkMp(String productIdVl, |
| | | Boolean addOrderWorkMp(String productIdVl, |
| | | @Param("orderId") String orderId, |
| | | @Param("productId") Integer productId, |
| | | @Param("productName") String productName, |
| | | String userName); |
| | | //查询对应订单号订序 |
| | | Integer SelectOrderNumber(String productIdVl); |
| | | Integer selectOrderNumber(String productIdVl); |
| | | |
| | | //删除工单,将对应产品生产订单号改为null |
| | | Boolean DeleteOrderWorkMp(String orderId, String productName); |
| | | Boolean deleteOrderWorkMp(String orderId, String productName); |
| | | |
| | | Integer SelectWorkCount(String orderId); |
| | | Integer selectWorkCount(String orderId); |
| | | |
| | | Boolean UpdateWorkType(String orderId, Integer state); |
| | | Boolean updateWorkType(String orderId, Integer state); |
| | | |
| | | Integer SelectYesWorkCount(String orderId); |
| | | Integer selectYesWorkCount(String orderId); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | 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.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.mapper.pp.FlowCardMapper; |
| | | import com.example.erp.mapper.sd.OrderGlassDetailMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import static com.example.erp.service.sd.OrderService.getOrderProcessDetails; |
| | | |
| | | @Service |
| | | @DS("pp") |
| | | public class FlowCardService { |
| | | @Autowired |
| | | final |
| | | FlowCardMapper flowCardMapper; |
| | | final |
| | | OrderGlassDetailMapper orderGlassDetailMapper; |
| | | final |
| | | OrderProcessDetailMapper orderProcessDetailMapper; |
| | | |
| | | public FlowCardService(FlowCardMapper flowCardMapper, OrderGlassDetailMapper orderGlassDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper) { |
| | | this.flowCardMapper = flowCardMapper; |
| | | this.orderGlassDetailMapper = orderGlassDetailMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | } |
| | | |
| | | //流程卡管理查询 |
| | | public Map<String, Object> selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) { |
| | | public Map<String, Object> selectProcessCard(Integer pageNum, Integer pageSize,Date selectTime1, Date selectTime2, FlowCard flowCard) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard)); |
| | | map.put("data", flowCardMapper.selectFlowCard(selectTime1, selectTime2, flowCard)); |
| | | map.put("data", flowCardMapper.selectFlowCard(offset, pageSize,selectTime1, selectTime2, flowCard)); |
| | | map.put("total",flowCardMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //分架明细查询 |
| | | public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) { |
| | | public Map<String, Object> detailsSelectSv(String orderId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.DetailsSelectMp(orderId, flowCard)); |
| | | map.put("data", flowCardMapper.detailsSelectMp(orderId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | | //删除流程卡 |
| | | public Boolean DeleteFlowCardSv(String orderId, String processId) { |
| | | public Boolean deleteFlowCardSv(String orderId, String processId) { |
| | | if (!orderId.isEmpty() && !processId.isEmpty()) { |
| | | Integer count = flowCardMapper.ReportingWorkCount(processId); |
| | | Integer count = flowCardMapper.reportingWorkCount(processId); |
| | | if (count == 0) { |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | flowCardMapper.UpdateProcessingCard(orderId, 1); |
| | | flowCardMapper.updateProcessingCard(orderId, 1); |
| | | //修改分架状态 |
| | | flowCardMapper.UpdateDeleteState(orderId, processId); |
| | | flowCardMapper.updateDeleteState(orderId, processId); |
| | | //删除分架明细 |
| | | flowCardMapper.DeleteFlowCardMp(orderId, processId); |
| | | flowCardMapper.deleteFlowCardMp(orderId, processId); |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | } |
| | | |
| | | //分架新增明细查询 |
| | | public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) { |
| | | public Map<String, Object> selectNoCardSv(String orderId, String productionId, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", flowCardMapper.SelectNoCardMp(orderId, productionId, flowCard)); |
| | | map.put("data", flowCardMapper.selectNoCardMp(orderId, productionId, flowCard)); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | //修改排版状态 |
| | | public Boolean UpdateLayoutStatusSv(String processId) { |
| | | public Boolean updateLayoutStatusSv(String processId) { |
| | | |
| | | if (!processId.isEmpty()) { |
| | | Integer Status = flowCardMapper.SelectLayoutStatus(processId); |
| | | Integer Status = flowCardMapper.selectLayoutStatus(processId); |
| | | if (Status == 1) { |
| | | flowCardMapper.UpdateLayoutStatusMp(processId); |
| | | flowCardMapper.updateLayoutStatusMp(processId); |
| | | } else { |
| | | return false; |
| | | } |
| | |
| | | } |
| | | |
| | | //保存流程卡数据 |
| | | public Boolean AddFlowCardSv(Map<String, Object> object) { |
| | | public Boolean addFlowCardSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | |
| | | if (!FlowCardList.isEmpty()) { |
| | | for (FlowCard flowCard : FlowCardList) { |
| | | //查询每个序号的层数 |
| | | Integer layer = flowCardMapper.SelectLayer(productionId, flowCard.getOrderNumber()); |
| | | Integer layer = flowCardMapper.selectLayer(productionId, flowCard.getOrderNumber()); |
| | | //添加流程卡数据 |
| | | flowCardMapper.AddFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName,layer); |
| | | flowCardMapper.addFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName,layer); |
| | | //修改分架状态,将状态改为1 |
| | | flowCardMapper.UpdateFlowState(productionId, flowCard.getOrderNumber()); |
| | | flowCardMapper.updateFlowState(productionId, flowCard.getOrderNumber()); |
| | | //查询该订单未分架数量 |
| | | Integer FlowCount = flowCardMapper.SelectFlowCount(productionId); |
| | | Integer FlowCount = flowCardMapper.selectFlowCount(productionId); |
| | | if (FlowCount == 0) { |
| | | //修改订单表分架状态为2 |
| | | flowCardMapper.UpdateProcessingCard(productionId, 2); |
| | | flowCardMapper.updateProcessingCard(productionId, 2); |
| | | } else { |
| | | //修改订单表分架状态为1,未全部分架完成 |
| | | flowCardMapper.UpdateProcessingCard(productionId, 1); |
| | | flowCardMapper.updateProcessingCard(productionId, 1); |
| | | } |
| | | //查询订单小片表获取工艺传入小片工艺表 |
| | | List<OrderGlassDetail> orderGlassDetailList = |
| | | orderGlassDetailMapper.selectList( |
| | | new QueryWrapper<OrderGlassDetail>() |
| | | .eq("order_id", flowCard.getProcessId().substring(0,10)) |
| | | .eq("order_number", flowCard.getOrderNumber()) |
| | | ); |
| | | List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList); |
| | | orderProcessDetailList.forEach( |
| | | orderGlassDetail ->orderGlassDetail.setProcessId(flowCard.getProcessId())); |
| | | |
| | | |
| | | //赋值订单工艺表 |
| | | orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList); |
| | | } |
| | | |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public Map<String, Object> SelectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, FlowCard flowCard) { |
| | | public Map<String, Object> selectSchedulingSv(String selectTime1, String selectTime2, String orderId,String processes, Integer state, FlowCard flowCard) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if (state==2){//已排产 |
| | | map.put("data", flowCardMapper.SelectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard)); |
| | | map.put("data", flowCardMapper.selectOkSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard)); |
| | | |
| | | }else if (state==1){//未排产 |
| | | map.put("data", flowCardMapper.SelectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard)); |
| | | map.put("data", flowCardMapper.selectNoSchedulingMp(selectTime1, selectTime2,orderId,processes, flowCard)); |
| | | |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.example.erp.entity.pp.ProductionScheduling; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.mapper.pp.ProductionSchedulingMapper; |
| | |
| | | } |
| | | |
| | | //带订单号查询 |
| | | public Map<String, Object> SelectSchedulingNotSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, ProductionScheduling productionScheduling) { |
| | | 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)); |
| | | map.put("data", productionSchedulingMapper.selectSchedulingNotMp(selectTime1, selectTime2,orderId,processes, productionScheduling)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | public boolean deleteSchedulingSv(Map<String, Object> object) throws Exception { |
| | | JSONObject objJson = new JSONObject(object); |
| | | List<ProductionScheduling> Scheduling = JSONArray.parseArray(JSONObject.toJSONString(objJson.get("scheduling")), ProductionScheduling.class); |
| | | if (!Scheduling.isEmpty()) { |
| | | for (ProductionScheduling productionScheduling : Scheduling) { |
| | | productionSchedulingMapper.deleteSchedulingMp(productionScheduling.getSchedulingId()); |
| | | // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId()); |
| | | } |
| | | return true; |
| | | } |
| | | else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | public boolean ExamineSchedulingSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | List<ProductionScheduling> schedulinglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("scheduling")), ProductionScheduling.class); |
| | | |
| | | if (!schedulinglist.isEmpty()) { |
| | | for (ProductionScheduling productionScheduling : schedulinglist) { |
| | | productionSchedulingMapper.ExamineSchedulingMp(productionScheduling.getSchedulingId(),userName); |
| | | // System.out.println(productionScheduling.getOrderNumber()+"***"+productionScheduling.getOrderId()); |
| | | } |
| | | return true; |
| | | } |
| | | else { |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.mapper.pp.BasicDateProduceMapper; |
| | | import com.example.erp.mapper.pp.DamageDetailsMapper; |
| | | import com.example.erp.mapper.pp.ReportingWorkDetailMapper; |
| | |
| | | } |
| | | else { |
| | | //不是第一道工序,查询报工数据 |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,previousProcess)); |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,process)); |
| | | } |
| | | |
| | | // 第一道工序(流程卡数+补片数量-完工数-次破数-返工未完成数-禁用数量) |
| | |
| | | } |
| | | |
| | | //报工新增 |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean SaveReportingWorkSv(Map<String, Object> reportingWorkMap) { |
| | | //接收解析主附表信息 |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //System.out.println(reportingWorkDetail); |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(reportingWork.getProcessId()); |
| | | |
| | | int index = technologicalProcess.indexOf("-"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = technologicalProcess.substring(0, index); |
| | | |
| | | //判断当前工序是否为第一道工序工序,使用流程卡表数量或者小片流程表上工序数量 |
| | | int processNum = 0; |
| | | if (interceptProcess.equals(reportingWork.getThisProcess())) { |
| | | processNum = reportingWorkMapper.selectFlowCardNum( |
| | | reportingWorkDetail.getOrderNumber(), |
| | | reportingWorkDetail.getTechnologyNumber(), |
| | | reportingWork.getProcessId(), |
| | | reportingWork.getThisProcess() |
| | | ); |
| | | }else{ |
| | | processNum = reportingWorkMapper.selectGlassProcessNum( |
| | | reportingWorkDetail.getOrderNumber(), |
| | | reportingWorkDetail.getTechnologyNumber(), |
| | | reportingWork.getProcessId(), |
| | | reportingWork.getThisProcess() |
| | | ); |
| | | } |
| | | |
| | | |
| | | //判断是否大于当前数量并且抛出异常 |
| | | if(processNum<(reportingWorkDetail.getBreakageQuantity()+reportingWorkDetail.getCompletedQuantity())){ |
| | | // System.out.println(processNum); |
| | | // System.out.println(reportingWorkDetail.getBreakageQuantity()); |
| | | // System.out.println(reportingWorkDetail.getCompletedQuantity()); |
| | | throw new ServiceException(Constants.Code_600,"当前工序数量大于流程卡表数量"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | OrderProcessDetail orderProcessDetail = new OrderProcessDetail(); |
| | | orderProcessDetail.setBrokenNum(reportingWorkDetail.getBreakageQuantity()); |
| | | orderProcessDetail.setReportingWorkNum(reportingWorkDetail.getCompletedQuantity()); |
| | | orderProcessDetail.setReportingWorkNumCount(reportingWorkDetail.getCompletedQuantity()); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //根据订单id,订单序号,以及小片序号 更新小片流程的完工数量以及刺破数量 |
| | | LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0,13)) |
| | | .eq(OrderProcessDetail::getOrderId, reportingWork.getOrderId()) |
| | | .eq(OrderProcessDetail::getProcess, reportingWork.getThisProcess()) |
| | | .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber()) |
| | | .setSql("reporting_work_num_count =reporting_work_num_count +"+orderProcessDetail.getReportingWorkNumCount()) |
| | | .setSql("reporting_work_num_count =reporting_work_num_count +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("reporting_work_num =reporting_work_num +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum()); |
| | | |
| | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> AddDateWork(String orderId, OrderDetail orderDetail) { |
| | | public Map<String, Object> addDateWork(String orderId, OrderDetail orderDetail) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | |
| | | map.put("data", workOrderMapper.addWordOrder(orderId, orderDetail)); |
| | | return map; |
| | | } |
| | | |
| | | public Boolean AddOrderWorkSv(Map<String, Object> object) { |
| | | public Boolean addOrderWorkSv(Map<String, Object> object) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | |
| | | productIdVl = orderID + letters; |
| | | //查询生成的生产订单号是否存在 |
| | | |
| | | Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl); |
| | | Integer workCount = workOrderMapper.selectOrderNumber(productIdVl); |
| | | if (workCount < 1 ) { |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | //添加生产订单 |
| | | workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName); |
| | | workOrderMapper.addOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName); |
| | | Integer State = 2; |
| | | Integer States = 1; |
| | | //查询该订单未转生产订单的条数 |
| | | Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderDetail.getOrderId()); |
| | | Integer NoWorkCount = workOrderMapper.selectWorkCount(orderDetail.getOrderId()); |
| | | if (NoWorkCount == 0) { |
| | | //条数为0修改转生产订单状态为2,否则为1 |
| | | workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), State); |
| | | workOrderMapper.updateWorkType(orderDetail.getOrderId(), State); |
| | | } else { |
| | | workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), States); |
| | | workOrderMapper.updateWorkType(orderDetail.getOrderId(), States); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | public Boolean DeleteOrderWorkSv(String orderId, String productName) { |
| | | public Boolean deleteOrderWorkSv(String orderId, String productName) { |
| | | if (!orderId.isEmpty() && !productName.isEmpty()) { |
| | | workOrderMapper.DeleteOrderWorkMp(orderId, productName); |
| | | workOrderMapper.deleteOrderWorkMp(orderId, productName); |
| | | Integer State = 0; |
| | | Integer States = 1; |
| | | Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderId); |
| | | Integer YesWorkCount = workOrderMapper.SelectYesWorkCount(orderId); |
| | | Integer NoWorkCount = workOrderMapper.selectWorkCount(orderId); |
| | | Integer YesWorkCount = workOrderMapper.selectYesWorkCount(orderId); |
| | | if (NoWorkCount ==YesWorkCount) { |
| | | workOrderMapper.UpdateWorkType(orderId, State); |
| | | workOrderMapper.updateWorkType(orderId, State); |
| | | } else { |
| | | workOrderMapper.UpdateWorkType(orderId, States); |
| | | workOrderMapper.updateWorkType(orderId, States); |
| | | } |
| | | return true; |
| | | } else { |
| | |
| | | //删除订单小片表 |
| | | orderGlassDetailMapper.delete(new LambdaQueryWrapper<OrderGlassDetail>().eq(OrderGlassDetail::getOrderId, order.getOrderId())); |
| | | //删除订单工艺表 |
| | | orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId())); |
| | | // orderProcessDetailMapper.delete(new LambdaQueryWrapper<OrderProcessDetail>().eq(OrderProcessDetail::getOrderId, order.getOrderId())); |
| | | insertOtherDetail(order.getOrderId(),OrderDetails); |
| | | } |
| | | |
| | |
| | | //往小片表传入产品数据 |
| | | orderGlassDetailMapper.insertOrderGlassDetail(orderId); |
| | | //查询订单小片表获取工艺传入小片工艺表 |
| | | List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId); |
| | | List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails); |
| | | //List<OrderGlassDetail> orderGlassDetails = orderGlassDetailMapper.selectOrderGlassDetail(orderId); |
| | | /*List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetails); |
| | | //赋值订单工艺表 |
| | | orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList); |
| | | orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);*/ |
| | | } |
| | | |
| | | private static List<OrderProcessDetail> getOrderProcessDetails(List<OrderGlassDetail> orderGlassDetails) { |
| | | public static List<OrderProcessDetail> getOrderProcessDetails(List<OrderGlassDetail> orderGlassDetails) { |
| | | List<OrderProcessDetail> orderProcessDetailList = new ArrayList<>(); |
| | | for (OrderGlassDetail orderGlassDetail : orderGlassDetails) { |
| | | String[] processList = orderGlassDetail.getProcess().split("->"); |
| | |
| | | orderGlassDetailMapper.updateSizeAndProcess(orderGlassDetails); |
| | | orderProcessDetailMapper.delete(new QueryWrapper<OrderProcessDetail>().eq("order_id",id)); |
| | | //查询订单小片表获取工艺传入小片工艺表 |
| | | List<OrderGlassDetail> orderGlassDetailList = orderGlassDetailMapper.selectOrderGlassDetail(id); |
| | | List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList); |
| | | //赋值订单工艺表 |
| | | orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList); |
| | | //List<OrderGlassDetail> orderGlassDetailList = orderGlassDetailMapper.selectOrderGlassDetail(id); |
| | | // List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList); |
| | | // //赋值订单工艺表 |
| | | // orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList); |
| | | } |
| | | |
| | | return orderMapper.reviewProcessById(id,status); |
| | |
| | | </if> |
| | | |
| | | |
| | | group by a.process_Id; |
| | | group by a.process_Id |
| | | ORDER BY a.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | | <select id="getPageTotal"> |
| | | select |
| | | CEILING(count(a.process_Id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct a.process_Id) as 'total' |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.productionId != null and flowCard.productionId != ''"> |
| | | and a.process_Id regexp #{flowCard.productionId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and c.product_id regexp #{flowCard.orderDetail.productId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''"> |
| | | and c.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | |
| | | <if test="flowCard.order.project != null and flowCard.order.project!= ''"> |
| | | and b.project regexp #{flowCard.order.project} |
| | | </if> |
| | | |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <!--分架查询--> |
| | |
| | | </select> |
| | | |
| | | <!-- 分架明细查询--> |
| | | <select id="DetailsSelectMp" resultMap="flowCardMap"> |
| | | <select id="detailsSelectMp" resultMap="flowCardMap"> |
| | | select od.order_id, |
| | | ogd.production_id, |
| | | od.product_id, |
| | |
| | | </select> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateDeleteState"> |
| | | <update id="updateDeleteState"> |
| | | update |
| | | sd.order_glass_detail as ogd left join flow_card as fc |
| | | on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number |
| | |
| | | </update> |
| | | |
| | | <!-- 删除流程卡--> |
| | | <update id="DeleteFlowCardMp"> |
| | | <update id="deleteFlowCardMp"> |
| | | delete from flow_card as fc where fc.process_id=#{processId} |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | | |
| | | <!--resultMap="flowCardMap"--> |
| | | <select id="SelectNoCardMp" > |
| | | <select id="selectNoCardMp" > |
| | | |
| | | select |
| | | od.order_number, |
| | |
| | | </select> |
| | | |
| | | <!--修改排版状态--> |
| | | <update id="UpdateLayoutStatusMp"> |
| | | <update id="updateLayoutStatusMp"> |
| | | update flow_card as fc |
| | | set fc.layout_status=2 |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | | <!-- 查询对应流程卡号排版状态--> |
| | | <select id="SelectLayoutStatus"> |
| | | <select id="selectLayoutStatus"> |
| | | select fc.layout_status |
| | | from flow_card as fc |
| | | where fc.process_id = #{processId} |
| | |
| | | </select> |
| | | |
| | | <!-- 查询报工表内是否有对应流程卡--> |
| | | <select id="ReportingWorkCount"> |
| | | <select id="reportingWorkCount"> |
| | | select COUNT(rw.process_id) |
| | | from reporting_work as rw |
| | | where rw.process_id = #{processId} |
| | | </select> |
| | | <!-- 插入Flow_card表--> |
| | | <insert id="AddFlowCardMp"> |
| | | <insert id="addFlowCardMp"> |
| | | insert into |
| | | flow_card ( |
| | | order_id, |
| | |
| | | </insert> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateFlowState"> |
| | | <update id="updateFlowState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.splitting_status=1 |
| | | where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber} |
| | | </update> |
| | | <!-- 查询未分架的条数--> |
| | | <select id="SelectFlowCount"> |
| | | <select id="selectFlowCount"> |
| | | select COUNT(*) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{productionId},10) |
| | | and ogd.splitting_status = 0 |
| | | </select> |
| | | <!-- 修改订单表分架状态--> |
| | | <update id="UpdateProcessingCard"> |
| | | <update id="updateProcessingCard"> |
| | | update sd.`order` as o |
| | | set o.processing_card=#{state} |
| | | where o.order_id=left(#{productionId},10) |
| | | </update> |
| | | |
| | | <!-- 查询已排版数据--> |
| | | <select id="SelectOkSchedulingMp"> |
| | | <select id="selectOkSchedulingMp"> |
| | | select 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), |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)), |
| | |
| | | |
| | | </select> |
| | | <!-- 查询未排版数据--> |
| | | <select id="SelectNoSchedulingMp"> |
| | | <select id="selectNoSchedulingMp"> |
| | | |
| | | </select> |
| | | <!-- 首次查询排版数据--> |
| | |
| | | </select> |
| | | |
| | | <!-- 查询对应序号的层数--> |
| | | <select id="SelectLayer"> |
| | | <select id="selectLayer"> |
| | | select COUNT(ogd.order_number) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productionId} |
| | |
| | | <result column="scheduling_quantity" property="schedulingQuantity"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="scheduling_id" property="schedulingId"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | |
| | | 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 od.create_time between #{selectTime1} and #{selectTime2} |
| | | |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | |
| | | </select> |
| | | |
| | | <!-- 查询已排产带订单编号的数据--> |
| | | <select id="SelectSchedulingNotMp"> |
| | | <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, |
| | |
| | | <select id="selectLastSchedulingMp"> |
| | | select 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, |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(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, |
| | | (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(sum(ps.scheduling_quantity),0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | 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 od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0 |
| | | group by od.order_id,od.order_number |
| | | </select> |
| | | |
| | | <select id="selectMaxId"> |
| | |
| | | now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="ExamineSchedulingMp"> |
| | | update production_scheduling set review_status=1,reviewer=#{userName} where |
| | | scheduling_id=#{schedulingId} |
| | | </update> |
| | | |
| | | <delete id="deleteSchedulingMp"> |
| | | delete from production_scheduling where scheduling_id=#{schedulingId} |
| | | </delete> |
| | | </mapper> |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num as quantity, |
| | | fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | left join |
| | | (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on c.process_id = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | |
| | | |
| | | <!-- 非第一道工序报工明细查询--> |
| | | <select id="SelectReworlDetailMp"> |
| | | SELECT fc.order_number, |
| | | SELECT |
| | | fc.order_number, |
| | | ogd.glass_child, |
| | | ogd.technology_number, |
| | | ogd.glass_address, |
| | | fc.quantity as quantity_card, |
| | | fc.quantity AS quantity_card, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | reporting_work_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity |
| | | FROM sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | 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 flow_card as fc on opd.order_id = fc.order_id and opd.order_number = fc.order_number and |
| | | opd.technology_number = fc.technology_number |
| | | left join reporting_work as rw on rw.order_id=fc.order_id and |
| | | rw.production_id=fc.production_id and rw.process_id=fc.process_id and rw.this_process = #{previousProcess} |
| | | left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id and |
| | | rwd.order_number=fc.order_number and rwd.technology_number=fc.technology_number |
| | | where fc.process_id = #{processIdStr} |
| | | and opd.process = #{previousProcess} |
| | | and position(ogd.technology_number in #{technologyStr}) |
| | | |
| | | odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | and fc.production_id=ogd.production_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | left join sd.order_process_detail as odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | left join sd.order_process_detail as odpds |
| | | ON odpds.id = odpd.id-1 |
| | | left join |
| | | (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on c.process_id = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | |
| | | order by id desc,reporting_work_id desc limit 1 |
| | | </select> |
| | | |
| | | <!-- 查询流程卡工序报工可报数量--> |
| | | <select id="selectReportingWorkNum"> |
| | | |
| | | </select> |
| | | <select id="selectGlassProcessNum" resultType="java.lang.Integer"> |
| | | select |
| | | d.reporting_work_num-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0) |
| | | from flow_card as a |
| | | left join sd.order_process_detail as b |
| | | on |
| | | b.order_number = a.order_number |
| | | and b.technology_number = a.technology_number |
| | | and b.order_id = SUBSTR(#{processId} from 1 for 10) |
| | | and b.process = #{thisProcess} |
| | | and b.process_id = a.process_id |
| | | left join sd.order_process_detail as d |
| | | on d.id=b.id-1 |
| | | left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on |
| | | c.process_id = a.process_id |
| | | and c.order_sort = a.order_number |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | | <select id="selectFlowCardNum" resultType="java.lang.Integer"> |
| | | select |
| | | a.quantity-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0) |
| | | from flow_card as a |
| | | left join sd.order_process_detail as b |
| | | on |
| | | b.order_number = a.order_number |
| | | and b.technology_number = a.technology_number |
| | | and b.order_id = SUBSTR(#{processId} from 1 for 10) |
| | | and b.process = #{thisProcess} |
| | | and b.process_id = a.process_id |
| | | left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on |
| | | c.process_id = a.process_id |
| | | and c.order_sort = a.order_number |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | | </mapper> |
| | |
| | | ; |
| | | </select> |
| | | |
| | | <select id="SelectOrderNumber" > |
| | | <select id="selectOrderNumber" > |
| | | select ifnull(count(ogd.production_id),0) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productIdVl} |
| | | </select> |
| | | |
| | | <update id="AddOrderWorkMp" > |
| | | <update id="addOrderWorkMp" > |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | |
| | |
| | | </update> |
| | | |
| | | <!-- 删除工单--> |
| | | <update id="DeleteOrderWorkMp"> |
| | | <update id="deleteOrderWorkMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | set ogd.production_id=null, |
| | |
| | | and od.product_name = #{productName} |
| | | </update> |
| | | |
| | | <select id="SelectWorkCount"> |
| | | <select id="selectWorkCount"> |
| | | select COUNT(distinct order_number) |
| | | from order_glass_detail |
| | | where ISNULL(production_id) |
| | | and order_id = #{orderId} |
| | | </select> |
| | | |
| | | <select id="SelectYesWorkCount"> |
| | | <select id="selectYesWorkCount"> |
| | | select COUNT(distinct order_number) |
| | | from order_glass_detail |
| | | where order_id = #{orderId} |
| | | </select> |
| | | |
| | | <update id="UpdateWorkType"> |
| | | <update id="updateWorkType"> |
| | | update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId} |
| | | </update> |
| | | </mapper> |
| | |
| | | order_id, |
| | | order_number, |
| | | technology_number, |
| | | process |
| | | process, |
| | | process_id |
| | | ) |
| | | values |
| | | <foreach collection ="processDetailList" item="processDetail" separator =","> |
| | |
| | | #{processDetail.orderId}, |
| | | #{processDetail.orderNumber}, |
| | | #{processDetail.technologyNumber}, |
| | | #{processDetail.process} |
| | | #{processDetail.process}, |
| | | #{processDetail.processId} |
| | | ) |
| | | </foreach> |
| | | |
| | |
| | | </if> |
| | | |
| | | |
| | | group by a.process_Id; |
| | | group by a.process_Id |
| | | ORDER BY a.id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | | <select id="getPageTotal"> |
| | | select |
| | | CEILING(count(a.process_Id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct a.process_Id) as 'total' |
| | | from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id |
| | | left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number |
| | | where a.create_time between #{selectTime1} and #{selectTime2} |
| | | <if test="flowCard.orderId != null and flowCard.orderId != ''"> |
| | | and a.order_id regexp #{flowCard.orderId} |
| | | </if> |
| | | <if test="flowCard.productionId != null and flowCard.productionId != ''"> |
| | | and a.process_Id regexp #{flowCard.productionId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''"> |
| | | and c.product_id regexp #{flowCard.orderDetail.productId} |
| | | </if> |
| | | <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''"> |
| | | and c.product_name regexp #{flowCard.orderDetail.productName} |
| | | </if> |
| | | |
| | | <if test="flowCard.order.project != null and flowCard.order.project!= ''"> |
| | | and b.project regexp #{flowCard.order.project} |
| | | </if> |
| | | |
| | | |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <!--分架查询--> |
| | |
| | | </select> |
| | | |
| | | <!-- 分架明细查询--> |
| | | <select id="DetailsSelectMp" resultMap="flowCardMap"> |
| | | <select id="detailsSelectMp" resultMap="flowCardMap"> |
| | | select od.order_id, |
| | | ogd.production_id, |
| | | od.product_id, |
| | |
| | | </select> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateDeleteState"> |
| | | <update id="updateDeleteState"> |
| | | update |
| | | sd.order_glass_detail as ogd left join flow_card as fc |
| | | on ogd.order_id=fc.order_id and ogd.order_number=fc.order_number |
| | |
| | | </update> |
| | | |
| | | <!-- 删除流程卡--> |
| | | <update id="DeleteFlowCardMp"> |
| | | <update id="deleteFlowCardMp"> |
| | | delete from flow_card as fc where fc.process_id=#{processId} |
| | | </update> |
| | | |
| | | <!-- 分架新增明细查询--> |
| | | |
| | | <!--resultMap="flowCardMap"--> |
| | | <select id="SelectNoCardMp" > |
| | | <select id="selectNoCardMp" > |
| | | |
| | | select |
| | | od.order_number, |
| | |
| | | </select> |
| | | |
| | | <!--修改排版状态--> |
| | | <update id="UpdateLayoutStatusMp"> |
| | | <update id="updateLayoutStatusMp"> |
| | | update flow_card as fc |
| | | set fc.layout_status=2 |
| | | where fc.process_id = #{processId} |
| | | </update> |
| | | |
| | | <!-- 查询对应流程卡号排版状态--> |
| | | <select id="SelectLayoutStatus"> |
| | | <select id="selectLayoutStatus"> |
| | | select fc.layout_status |
| | | from flow_card as fc |
| | | where fc.process_id = #{processId} |
| | |
| | | </select> |
| | | |
| | | <!-- 查询报工表内是否有对应流程卡--> |
| | | <select id="ReportingWorkCount"> |
| | | <select id="reportingWorkCount"> |
| | | select COUNT(rw.process_id) |
| | | from reporting_work as rw |
| | | where rw.process_id = #{processId} |
| | | </select> |
| | | <!-- 插入Flow_card表--> |
| | | <insert id="AddFlowCardMp"> |
| | | <insert id="addFlowCardMp"> |
| | | insert into |
| | | flow_card ( |
| | | order_id, |
| | |
| | | </insert> |
| | | |
| | | <!-- 更新分架状态--> |
| | | <update id="UpdateFlowState"> |
| | | <update id="updateFlowState"> |
| | | update sd.order_glass_detail as ogd |
| | | set ogd.splitting_status=1 |
| | | where ogd.production_id=#{productionId} and ogd.order_number=#{orderNumber} |
| | | </update> |
| | | <!-- 查询未分架的条数--> |
| | | <select id="SelectFlowCount"> |
| | | <select id="selectFlowCount"> |
| | | select COUNT(*) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.order_id = left(#{productionId},10) |
| | | and ogd.splitting_status = 0 |
| | | </select> |
| | | <!-- 修改订单表分架状态--> |
| | | <update id="UpdateProcessingCard"> |
| | | <update id="updateProcessingCard"> |
| | | update sd.`order` as o |
| | | set o.processing_card=#{state} |
| | | where o.order_id=left(#{productionId},10) |
| | | </update> |
| | | |
| | | <!-- 查询已排版数据--> |
| | | <select id="SelectOkSchedulingMp"> |
| | | <select id="selectOkSchedulingMp"> |
| | | select 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), |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)), |
| | |
| | | |
| | | </select> |
| | | <!-- 查询未排版数据--> |
| | | <select id="SelectNoSchedulingMp"> |
| | | <select id="selectNoSchedulingMp"> |
| | | |
| | | </select> |
| | | <!-- 首次查询排版数据--> |
| | |
| | | </select> |
| | | |
| | | <!-- 查询对应序号的层数--> |
| | | <select id="SelectLayer"> |
| | | <select id="selectLayer"> |
| | | select COUNT(ogd.order_number) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productionId} |
| | |
| | | <result column="scheduling_quantity" property="schedulingQuantity"/> |
| | | <result column="order_number" property="orderNumber"/> |
| | | <result column="scheduling_id" property="schedulingId"/> |
| | | <result column="order_id" property="orderId"/> |
| | | <!--接收其他外键实体类数据--> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result column="project" property="project"/> |
| | |
| | | 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 od.create_time between #{selectTime1} and #{selectTime2} |
| | | |
| | | and position(#{processes} in ps.processes) |
| | | and position(#{orderId} in ps.order_id) |
| | | |
| | | </select> |
| | | |
| | | <!-- 查询已排产带订单编号的数据--> |
| | | <select id="SelectSchedulingNotMp"> |
| | | <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, |
| | |
| | | <select id="selectLastSchedulingMp"> |
| | | select 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, |
| | | (od.quantity-IFNULL(ps.scheduling_quantity,0)) as pendingProductionQuantity, |
| | | round(od.width*od.height*(od.quantity-IFNULL(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, |
| | | (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(sum(ps.scheduling_quantity),0) as productionScheduledQuantity, |
| | | round(od.width*od.height*(IFNULL(sum(ps.scheduling_quantity),0))/1000000,2) as productionScheduledArea, |
| | | od.product_name,od.shape |
| | | 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 od.create_time between #{selectTime1} and #{selectTime2} and od.quantity-IFNULL(ps.scheduling_quantity,0)>0 |
| | | group by od.order_id,od.order_number |
| | | </select> |
| | | |
| | | <select id="selectMaxId"> |
| | |
| | | now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="ExamineSchedulingMp"> |
| | | update production_scheduling set review_status=1,reviewer=#{userName} where |
| | | scheduling_id=#{schedulingId} |
| | | </update> |
| | | |
| | | <delete id="deleteSchedulingMp"> |
| | | delete from production_scheduling where scheduling_id=#{schedulingId} |
| | | </delete> |
| | | </mapper> |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num as quantity, |
| | | fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | left join |
| | | (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on c.process_id = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | |
| | | |
| | | <!-- 非第一道工序报工明细查询--> |
| | | <select id="SelectReworlDetailMp"> |
| | | SELECT fc.order_number, |
| | | SELECT |
| | | fc.order_number, |
| | | ogd.glass_child, |
| | | ogd.technology_number, |
| | | ogd.glass_address, |
| | | fc.quantity as quantity_card, |
| | | fc.quantity AS quantity_card, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | reporting_work_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity |
| | | FROM sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | 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 flow_card as fc on opd.order_id = fc.order_id and opd.order_number = fc.order_number and |
| | | opd.technology_number = fc.technology_number |
| | | left join reporting_work as rw on rw.order_id=fc.order_id and |
| | | rw.production_id=fc.production_id and rw.process_id=fc.process_id and rw.this_process = #{previousProcess} |
| | | left join reporting_work_detail as rwd on rwd.reporting_work_id=rw.reporting_work_id and |
| | | rwd.order_number=fc.order_number and rwd.technology_number=fc.technology_number |
| | | where fc.process_id = #{processIdStr} |
| | | and opd.process = #{previousProcess} |
| | | and position(ogd.technology_number in #{technologyStr}) |
| | | |
| | | odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | | sd.order_detail AS od |
| | | LEFT JOIN sd.order_glass_detail AS ogd |
| | | ON od.order_id = ogd.order_id |
| | | AND od.order_number = ogd.order_number |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | and fc.production_id=ogd.production_id |
| | | AND fc.order_number = ogd.order_number |
| | | AND fc.technology_number = ogd.technology_number |
| | | left join sd.order_process_detail as odpd |
| | | ON odpd.order_id = fc.order_id |
| | | AND odpd.order_number = fc.order_number |
| | | AND odpd.technology_number = fc.technology_number |
| | | and odpd.process_id = fc.process_id |
| | | left join sd.order_process_detail as odpds |
| | | ON odpds.id = odpd.id-1 |
| | | left join |
| | | (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on c.process_id = fc.process_id |
| | | and c.order_sort = fc.order_number |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | |
| | | order by id desc,reporting_work_id desc limit 1 |
| | | </select> |
| | | |
| | | <!-- 查询流程卡工序报工可报数量--> |
| | | <select id="selectReportingWorkNum"> |
| | | |
| | | </select> |
| | | <select id="selectGlassProcessNum" resultType="java.lang.Integer"> |
| | | select |
| | | d.reporting_work_num-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0) |
| | | from flow_card as a |
| | | left join sd.order_process_detail as b |
| | | on |
| | | b.order_number = a.order_number |
| | | and b.technology_number = a.technology_number |
| | | and b.order_id = SUBSTR(#{processId} from 1 for 10) |
| | | and b.process = #{thisProcess} |
| | | and b.process_id = a.process_id |
| | | left join sd.order_process_detail as d |
| | | on d.id=b.id-1 |
| | | left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on |
| | | c.process_id = a.process_id |
| | | and c.order_sort = a.order_number |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | | <select id="selectFlowCardNum" resultType="java.lang.Integer"> |
| | | select |
| | | a.quantity-b.reporting_work_num-b.broken_num+ifnull(c.patchNumSum,0) |
| | | from flow_card as a |
| | | left join sd.order_process_detail as b |
| | | on |
| | | b.order_number = a.order_number |
| | | and b.technology_number = a.technology_number |
| | | and b.order_id = SUBSTR(#{processId} from 1 for 10) |
| | | and b.process = #{thisProcess} |
| | | and b.process_id = a.process_id |
| | | left join (select sum(patch_num) as patchNumSum,order_sort,technology_number,process_id |
| | | from patch_log |
| | | group by reporting_work_id,order_sort,technology_number) as c |
| | | on |
| | | c.process_id = a.process_id |
| | | and c.order_sort = a.order_number |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | | </mapper> |
| | |
| | | ; |
| | | </select> |
| | | |
| | | <select id="SelectOrderNumber" > |
| | | <select id="selectOrderNumber" > |
| | | select ifnull(count(ogd.production_id),0) |
| | | from sd.order_glass_detail as ogd |
| | | where ogd.production_id = #{productIdVl} |
| | | </select> |
| | | |
| | | <update id="AddOrderWorkMp" > |
| | | <update id="addOrderWorkMp" > |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | |
| | |
| | | </update> |
| | | |
| | | <!-- 删除工单--> |
| | | <update id="DeleteOrderWorkMp"> |
| | | <update id="deleteOrderWorkMp"> |
| | | update sd.order_detail as od left join sd.order_glass_detail as ogd |
| | | on od.order_id = ogd.order_id and od.order_number = ogd.order_number |
| | | set ogd.production_id=null, |
| | |
| | | and od.product_name = #{productName} |
| | | </update> |
| | | |
| | | <select id="SelectWorkCount"> |
| | | <select id="selectWorkCount"> |
| | | select COUNT(distinct order_number) |
| | | from order_glass_detail |
| | | where ISNULL(production_id) |
| | | and order_id = #{orderId} |
| | | </select> |
| | | |
| | | <select id="SelectYesWorkCount"> |
| | | <select id="selectYesWorkCount"> |
| | | select COUNT(distinct order_number) |
| | | from order_glass_detail |
| | | where order_id = #{orderId} |
| | | </select> |
| | | |
| | | <update id="UpdateWorkType"> |
| | | <update id="updateWorkType"> |
| | | update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId} |
| | | </update> |
| | | </mapper> |
| | |
| | | order_id, |
| | | order_number, |
| | | technology_number, |
| | | process |
| | | process, |
| | | process_id |
| | | ) |
| | | values |
| | | <foreach collection ="processDetailList" item="processDetail" separator =","> |
| | |
| | | #{processDetail.orderId}, |
| | | #{processDetail.orderNumber}, |
| | | #{processDetail.technologyNumber}, |
| | | #{processDetail.process} |
| | | #{processDetail.process}, |
| | | #{processDetail.processId} |
| | | ) |
| | | </foreach> |
| | | |