| | |
| | | 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: '高'}, |
| | |
| | | <script setup> |
| | | import {computed, nextTick, onMounted, reactive, ref, toRefs} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import {useRouter,useRoute} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | |
| | | let brokenVisible = ref(false) |
| | | const xGrid = ref() |
| | | const brokenGrid =ref() |
| | | let router = useRouter() |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | const user=userInfo() |
| | | |
| | | //定义表头数据 |
| | | const titleUploadData = ref({ |
| | | //流程卡号 |
| | | processId: 'NG24030701B01/1', |
| | | processId: 'NG24030804A02/1', |
| | | //销售单号 |
| | | orderId: '', |
| | | reviewedState:0, |
| | | //生产单号 |
| | | productionId: '', |
| | | //设备类型 |
| | |
| | | |
| | | }) |
| | | |
| | | |
| | | onMounted(() =>{ |
| | | if(route.query.processId !== undefined && route.query.processId!=='' && route.query.processId!=null ){ |
| | | titleUploadData.value.processId = route.query.processId |
| | | } |
| | | //判断是否传入报工编号 |
| | | if(route.query.reportingWorkId!== undefined && route.query.reportingWorkId!=='' && route.query.reportingWorkId!=null){ |
| | | request.post(`reportingWork/selectUpdateReportingWork/${route.query.reportingWorkId}`).then(res=>{ |
| | | if(res.code === '200'){ |
| | | titleUploadData.value = res.data.reportingWork |
| | | console.log(res.data) |
| | | xGrid.value.reloadData(res.data.reportingWorkDetails) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | | let count = 0 |
| | |
| | | |
| | | |
| | | const optionVal = ref('') |
| | | const options = [ |
| | | { |
| | | value: '切割', |
| | | label: '切割', |
| | | }, |
| | | { |
| | | value: '磨边', |
| | | label: '磨边', |
| | | }, |
| | | { |
| | | value: '钢化', |
| | | label: '钢化', |
| | | }, |
| | | ] |
| | | |
| | | //班次 |
| | | const classesVal = ref('早班') |
| | |
| | | showOverflow: "ellipsis", |
| | | filterMethod: filterChanged |
| | | }, |
| | | {field: 'quantity', title: '上工完工数量',}, |
| | | {field: 'quantity', title: '可报数量',}, |
| | | { |
| | | field: 'completedQuantity', title: '完工数量', |
| | | field: 'completedQuantity', title: '完工数量',width: 120, |
| | | editRender: { |
| | | name: 'input', |
| | | attrs: {placeholder: ''}, |
| | | attrs: {placeholder: ''} |
| | | }, |
| | | |
| | | }, |
| | |
| | | // {code: 'sameDamage', name: '次破相同'}, |
| | | // {code: 'sameOneCompletion', name: '完工一列相同'}, |
| | | // {code: 'sameOneDamage', name: '次破一列相同'}, |
| | | {code: 'saveReportingWork', name: '保存', status: 'primary', icon: 'vxe-icon-save'}, |
| | | {code: 'print_lck', name: '保存并审核', status: 'primary', icon: 'vxe-icon-save'}, |
| | | {code: 'saveReportingWork', name: '保存', status: 'primary', icon: 'vxe-icon-save',disabled:true}, |
| | | {code: 'saveReportingWorkReview', name: '保存并审核', status: 'primary', icon: 'vxe-icon-save',disabled:true}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | |
| | | if ($grid) { |
| | | switch (code) { |
| | | case 'saveReportingWork': { |
| | | if($grid.getTableData().fullData.length===0){ |
| | | ElMessage.warning(`请选择流程卡数据`) |
| | | return false |
| | | } |
| | | const device = titleUploadData.value.deviceName |
| | | if(device === null || device === undefined || device === ''){ |
| | | ElMessage.error('请选择报工设备!') |
| | | return |
| | | } |
| | | const teamsGroupsName = titleUploadData.value.teamsGroupsName |
| | | if(teamsGroupsName === null || teamsGroupsName === undefined || teamsGroupsName === ''){ |
| | | ElMessage.error('请选择报工设备!') |
| | | return |
| | | } |
| | | const errMap = await $grid.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | | return |
| | | } |
| | | saveReportingWork() |
| | | saveReportingWork(0) |
| | | break |
| | | } |
| | | case 'saveReportingWorkReview': { |
| | | const errMap = await $grid.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | | return |
| | | } |
| | | saveReportingWork(1) |
| | | break |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | const checkClose = async (done) => { |
| | | if(brokenGrid.value.getTableData().fullData.length===0){ |
| | | done() |
| | | return true |
| | | } |
| | | const errMap = await brokenGrid.value.validate(true) |
| | | if (errMap) { |
| | | ElMessage.error(`校验不通过!`) |
| | |
| | | }) |
| | | |
| | | let reportingWorkNum = isNaN(brokenRow.value.completedQuantity*1)?0:brokenRow.value.completedQuantity*1 |
| | | if(breakageQuantityCount+reportingWorkNum>brokenRow.value.quantity*1){ |
| | | if((breakageQuantityCount+reportingWorkNum>brokenRow.value.quantity*1) ){ |
| | | ElMessage.warning(`损耗数:'${breakageQuantityCount}' |
| | | 完工数:'${reportingWorkNum}'之和${breakageQuantityCount+reportingWorkNum} |
| | | 不能大于${brokenRow.value.quantity*1}`) |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | //第一次加载数据 |
| | | |
| | | request.post(`/reportingWork/selectProcess`).then((res) => { |
| | |
| | | } |
| | | }) |
| | | |
| | | const saveReportingWork = () => { |
| | | const saveReportingWork = (type) => { |
| | | |
| | | if(xGrid.value.getTableData().fullData.length===0){ |
| | | ElMessage.warning(`请选择流程卡数据`) |
| | | return false |
| | | } |
| | | const device = titleUploadData.value.deviceName |
| | | if(device === null || device === undefined || device === ''){ |
| | | ElMessage.error('请选择报工设备!') |
| | | return |
| | | } |
| | | const teamsGroupsName = titleUploadData.value.teamsGroupsName |
| | | if(teamsGroupsName === null || teamsGroupsName === undefined || teamsGroupsName === ''){ |
| | | ElMessage.error('请选择报工设备!') |
| | | return |
| | | } |
| | | |
| | | titleUploadData.value.creator = user.user.userName |
| | | titleUploadData.value.creatorId = user.user.userId |
| | |
| | | |
| | | const requestData = { |
| | | title:titleUploadData.value, |
| | | detail:xGrid.value.getTableData().fullData |
| | | detail:xGrid.value.getTableData().fullData, |
| | | type:type//审核状态 |
| | | } |
| | | gridOptions.toolbarConfig.buttons[0].disabled=true |
| | | gridOptions.toolbarConfig.buttons[1].disabled=true |
| | | request.post(`/reportingWork/saveReportingWork`,requestData).then(res =>{ |
| | | if (res.code == 200){ |
| | | ElMessage.success("报工成功") |
| | | router.push({path:'/main/reportingWorks/AddReportingWork',query:{random:Math.random()}}) |
| | | router.push({path:'/main/reportingWorks/AddReportingWork',query:{processId:titleUploadData.value.processId,random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | const errorObj = JSON.parse(res.msg) |
| | | const msg = "序号:"+errorObj.orderNumber+'\n' |
| | | +'小片顺序:'+errorObj.technologyNumber+'\n' |
| | | +"实际可报工数量:"+errorObj.processNum+'<'+ |
| | | "报工数量:"+errorObj.sumNum+'\n' |
| | | +"请刷新界面重新报工" |
| | | |
| | | ElMessage.error(msg) |
| | | } |
| | | }).catch(err =>{ |
| | | ElMessage.error(err.message) |
| | | }).finally(()=>{ |
| | | gridOptions.toolbarConfig.buttons[0].disabled=false |
| | | gridOptions.toolbarConfig.buttons[1].disabled=false |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | let loadingFlag = ref(false) |
| | | let disabledFlag = ref(true) |
| | | const reviewReportingWork = () => { |
| | | const processId = titleUploadData.value.processId |
| | | if (processId.indexOf("/") < 0) { |
| | | ElMessage.warning("请输入正确格式流程卡") |
| | | return |
| | | } |
| | | let indexOfChar = processId.indexOf("/") |
| | | let leftString = processId.slice(0, indexOfChar) |
| | | if (leftString.length !== 13) { |
| | | ElMessage.warning("请输入正确位数的流程卡") |
| | | return |
| | | } |
| | | //工序 |
| | | let process = titleUploadData.value.thisProcess |
| | | if (process === "" || process == null) { |
| | | ElMessage.warning("请选择工序") |
| | | return |
| | | } |
| | | if(titleUploadData.value.previousProcess===''){ |
| | | ElMessage.warning("第一道工序不需要审核") |
| | | return |
| | | } |
| | | const reportWork = { |
| | | process: titleUploadData.value.previousProcess, |
| | | processId:processId |
| | | } |
| | | loadingFlag.value= true |
| | | request.post("/reportingWork/reviewReportingWork",reportWork).then((res) =>{ |
| | | if(res.code === '200'){ |
| | | ElMessage.success("审核成功") |
| | | router.push({path:'/main/reportingWorks/AddReportingWork', |
| | | query:{ |
| | | processId:titleUploadData.value.processId, |
| | | random:Math.random() |
| | | } |
| | | }) |
| | | } |
| | | }).finally( |
| | | loadingFlag.value= false |
| | | ) |
| | | |
| | | } |
| | | |
| | | |
| | | //下拉款选择工序时查询 |
| | | const getWork = () => { |
| | |
| | | //工序 |
| | | let process = titleUploadData.value.thisProcess |
| | | if (process == "" || process == null) { |
| | | |
| | | ElMessage.warning("请选择工序") |
| | | return |
| | | } |
| | |
| | | |
| | | request.post(`/reportingWork/addSelectLastWork/${processIdStr}/${technologyStr}/${process}`).then((res) => { |
| | | if (res.code == 200) { |
| | | if(res.data.data===null){ |
| | | ElMessage.error("未查询到此流程卡数据") |
| | | return |
| | | } |
| | | //表头赋值 |
| | | titleUploadData.value = res.data.data |
| | | titleUploadData.value.processId = processId |
| | |
| | | titleSelectJson.value.breakageType = res.data.breakageType |
| | | //次破原因 |
| | | titleSelectJson.value.breakageReason = res.data.breakageReason |
| | | //console.log(res.data) |
| | | if(titleUploadData.value.reviewedState==1){ |
| | | gridOptions.toolbarConfig.buttons[0].disabled=false |
| | | gridOptions.toolbarConfig.buttons[1].disabled=false |
| | | disabledFlag.value=true |
| | | }else { |
| | | gridOptions.toolbarConfig.buttons[0].disabled=true |
| | | gridOptions.toolbarConfig.buttons[1].disabled=true |
| | | disabledFlag.value=false |
| | | } |
| | | |
| | | //判断早晚班 |
| | | titleUploadData.value.classes='早班' |
| | | |
| | | |
| | | titleUploadData.value.reportingWorkTime = formatCurrentTime() |
| | | //绑定下方表格 |
| | | detail.value = res.data.Detail |
| | |
| | | let hours = dateObj.getHours().toString().padStart(2, '0'); // 小时 |
| | | let minutes = dateObj.getMinutes().toString().padStart(2, '0'); // 分钟 |
| | | let seconds = dateObj.getSeconds().toString().padStart(2, '0'); // 秒数 |
| | | if(parseInt(hours)>=17)titleUploadData.value.classes='晚班' |
| | | if(parseInt(hours)>=17 && parseInt(hours)<8)titleUploadData.value.classes='晚班' |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; // 返回格式化后的时间字符串 |
| | | } |
| | | |
| | | const ptypeChangeEvent = (row) => { |
| | | // for (let i = 0; i < row.length; i++){ |
| | | // |
| | | // let process=row[i].responsibleProcess |
| | | // } |
| | | const editClosedEvent = ({ row, column }) => { |
| | | if (column.property==='completedQuantity') { |
| | | xGrid.value.getTableData().fullData.forEach((item, index) =>{ |
| | | if(item.order_number===row.order_number){ |
| | | item.completedQuantity=row.completedQuantity |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-button type="primary">审核通过</el-button> |
| | | <el-button type="primary">审核不通过</el-button> |
| | | <el-button :disabled="disabledFlag" :loading="loadingFlag" @click="reviewReportingWork" type="primary">审核通过</el-button> |
| | | <!-- <el-button type="primary">审核不通过</el-button>--> |
| | | |
| | | <label>流程卡面积:xxx平方米</label> |
| | | </div> |
| | |
| | | <el-text>可报工数量:</el-text> |
| | | </el-col> |
| | | <el-col :span="2"> |
| | | <el-text>{{ titleUploadData.flowCard.quantity }}</el-text> |
| | | <el-text>{{ titleUploadData.previousProcessQuantity }}</el-text> |
| | | |
| | | </el-col> |
| | | <el-col :span="2"> |
| | |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | @edit-closed="editClosedEvent" |
| | | |
| | | > |
| | | |
| | |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.ReportingWorkService; |
| | | 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.sql.Date; |
| | | @RestController |
| | | @RequestMapping("/reportingWork") |
| | | @Api(value="报工controller",tags={"报工控制器"}) |
| | | public class ReportingWorkController { |
| | | @Autowired |
| | | final |
| | | ReportingWorkService reportingWorkService; |
| | | |
| | | public ReportingWorkController(ReportingWorkService reportingWorkService) { |
| | | this.reportingWorkService = reportingWorkService; |
| | | } |
| | | |
| | | |
| | | @PostMapping ("/addSelectLastWork/{processIdStr}/{technologyStr}/{process}") |
| | |
| | | return Result.seccess(reportingWorkService.SelectProcessSv()); |
| | | } |
| | | |
| | | @ApiOperation("报工新增") |
| | | @PostMapping ("/saveReportingWork") |
| | | public Result SaveReportingWork(@RequestBody Map<String,Object> reportingWork) { |
| | | return Result.seccess(reportingWorkService.SaveReportingWorkSv(reportingWork)); |
| | | } |
| | | |
| | | @ApiOperation("报工审核") |
| | | @PostMapping ("/reviewReportingWork") |
| | | public Result ReviewReportingWork(@RequestBody Map<String,String> reportingWork) { |
| | | return Result.seccess(reportingWorkService.ReviewReportingWorkSv(reportingWork)); |
| | | } |
| | | |
| | | @ApiOperation("报工修改查询") |
| | | @PostMapping ("/selectUpdateReportingWork/{reportingWorkId}") |
| | | public Result SelectUpdateReportingWork(@PathVariable String reportingWorkId) { |
| | | return Result.seccess(reportingWorkService.selectUpdateReportingWorkSv(reportingWorkId)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | //备注 |
| | | private String notes; |
| | | //质检员 |
| | | private String qualityInsPector; |
| | | private String qualityInspector; |
| | | //包装方式 |
| | | private String packagingMethod; |
| | | //报工时间 |
| | |
| | | //待返工数量 |
| | | private Integer waitReworkQuantity; |
| | | //返工审核状态 |
| | | private Integer reviewerState; |
| | | private Integer reviewStatus; |
| | | //返工审核人 |
| | | private String reviewer; |
| | | //返工时间 |
| | |
| | | import java.time.LocalDate; |
| | | |
| | | @Data |
| | | @TableName("`order`") |
| | | @TableName("sd.`order`") |
| | | public class Order { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | public interface FlowCardMapper { |
| | | public interface FlowCardMapper extends BaseMapper<FlowCard> { |
| | | //流程卡管理查询 |
| | | List<FlowCard> selectFlowCard(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, FlowCard flowCard); |
| | | |
| | |
| | | @Param("sDate") String startTime,@Param("eDate") String endTime,ReportingWorkDetail reportingWorkDetail); |
| | | |
| | | |
| | | List<ReportingWorkDetail> selectByreportingWorkId(String reportingWorkId); |
| | | } |
| | |
| | | /*获取返工新增功能数据*/ |
| | | public Map<String,Object> queryRework (Integer pageNum, Integer pageSize,ReportingWorkDetail reportingWorkDetail ) { |
| | | Integer offset = (pageNum-1)*pageSize; |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("data",reportingWorkDetailMapper.queryReworkAdd(offset,pageSize, reportingWorkDetail)); |
| | | return map; |
| | |
| | | package com.example.erp.service.pp; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.FlowCard; |
| | | 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; |
| | | import com.example.erp.mapper.pp.ReportingWorkMapper; |
| | | import com.example.erp.mapper.pp.*; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.mapper.sd.OrderMapper; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import com.example.erp.service.sd.OrderProcessDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @DS("pp") |
| | |
| | | final |
| | | ReportingWorkDetailMapper |
| | | reportingWorkDetailMapper; |
| | | final OrderMapper |
| | | orderMapper; |
| | | |
| | | final |
| | | FlowCardMapper flowCardMapper; |
| | | |
| | | final |
| | | OrderProcessDetailService orderProcessDetailService; |
| | | |
| | | |
| | | |
| | | public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService) { |
| | | public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService, OrderMapper orderMapper, FlowCardMapper flowCardMapper) { |
| | | this.reportingWorkMapper = reportingWorkMapper; |
| | | this.basicDateProduceMapper = basicDateProduceMapper; |
| | | this.damageDetailsMapper = damageDetailsMapper; |
| | | this.reportingWorkDetailMapper = reportingWorkDetailMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | this.orderProcessDetailService = orderProcessDetailService; |
| | | this.orderMapper = orderMapper; |
| | | this.flowCardMapper = flowCardMapper; |
| | | } |
| | | |
| | | public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process) { |
| | |
| | | } |
| | | //System.out.println("当前工序:" + process + " 上一道工序:" + previousProcess + " 下一道工序:" + nextProcess); |
| | | //查询当前工序的表头数据 |
| | | // System.out.println(reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process)); |
| | | //System.out.println(reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process)); |
| | | map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process)); |
| | | map.put("thisProcess", processList); |
| | | break; |
| | |
| | | String reportingWorkId = "BG"+formattedDate+formattedNumber; |
| | | reportingWork.setReportingWorkId(reportingWorkId); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0,13)); |
| | | |
| | | int reviewState = (int) reportingWorkJson.get("type"); |
| | | if(reviewState==1){ |
| | | reportingWork.setReviewed(reportingWork.getCreator()); |
| | | reportingWork.setReviewedState(1); |
| | | }else{ |
| | | reportingWork.setReviewedState(0); |
| | | } |
| | | //主表插入 |
| | | reportingWorkMapper.insert(reportingWork); |
| | | |
| | |
| | | |
| | | //判断是否大于当前数量并且抛出异常 |
| | | 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,"当前工序数量大于流程卡表数量"); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("orderNumber",reportingWorkDetail.getOrderNumber()); |
| | | map.put("technologyNumber",reportingWorkDetail.getOrderNumber()); |
| | | map.put("processNum",processNum); |
| | | map.put("sumNum",reportingWorkDetail.getBreakageQuantity()+reportingWorkDetail.getCompletedQuantity()); |
| | | String msg = JSON.toJSONString(map); |
| | | throw new ServiceException(Constants.Code_600,msg); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | OrderProcessDetail orderProcessDetail = new OrderProcessDetail(); |
| | | orderProcessDetail.setBrokenNum(reportingWorkDetail.getBreakageQuantity()); |
| | | orderProcessDetail.setReportingWorkNum(reportingWorkDetail.getCompletedQuantity()); |
| | | orderProcessDetail.setReportingWorkNumCount(reportingWorkDetail.getCompletedQuantity()); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //根据订单id,订单序号,以及小片序号 更新小片流程的完工数量以及刺破数量 |
| | | LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>(); |
| | |
| | | .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.getReportingWorkNum()) |
| | | .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()); |
| | | |
| | | orderProcessDetailMapper.update(null,updateWrapper); |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | //更新流程卡表的报工数量 |
| | | if(Objects.equals(reportingWork.getNextProcess(), "")){ |
| | | LambdaUpdateWrapper<FlowCard> flowCardLambdaUpdateWrapper = |
| | | new LambdaUpdateWrapper<>(); |
| | | flowCardLambdaUpdateWrapper |
| | | .eq(FlowCard::getProcessId, reportingWork.getProcessId()) |
| | | .eq(FlowCard::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(FlowCard::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber()) |
| | | .setSql("inventory_quantity = inventory_quantity +"+orderProcessDetail.getReportingWorkNum()); |
| | | flowCardMapper.update(null,flowCardLambdaUpdateWrapper); |
| | | } |
| | | |
| | | |
| | | }); |
| | | return false; |
| | | return true; |
| | | } |
| | | |
| | | //下工序审核方法 |
| | | public boolean ReviewReportingWorkSv(Map<String, String> reportingWork) { |
| | | |
| | | String processId = reportingWork.get("processId"); |
| | | |
| | | LambdaUpdateWrapper |
| | | <ReportingWork> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper |
| | | .eq(ReportingWork::getProcessId, processId.substring(0,13)) |
| | | .eq(ReportingWork::getThisProcess,reportingWork.get("process")) |
| | | .eq(ReportingWork::getReviewedState,0) |
| | | .setSql("reviewed_state =1"); |
| | | reportingWorkMapper.update(null,updateWrapper); |
| | | |
| | | |
| | | return true; |
| | | } |
| | | |
| | | public Map<String,Object> selectUpdateReportingWorkSv(String reportingWorkId) { |
| | | ReportingWork reportingWork =reportingWorkMapper.selectOne(new LambdaQueryWrapper<ReportingWork>() |
| | | .eq(ReportingWork::getReportingWorkId,reportingWorkId)); |
| | | reportingWork.setOrder( |
| | | orderMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getOrderId,reportingWork.getOrderId()))); |
| | | reportingWork.setFlowCard(new FlowCard()); |
| | | |
| | | List<ReportingWorkDetail> reportingWorkDetails = reportingWorkDetailMapper.selectByreportingWorkId(reportingWorkId); |
| | | |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("reportingWork",reportingWork); |
| | | map.put("reportingWorkDetails",reportingWorkDetails); |
| | | return map; |
| | | |
| | | } |
| | | } |
| | |
| | | <result property="previousProcess" column="previous_process"/> |
| | | <result property="nextProcess" column="next_process"/> |
| | | <result property="thisProcess" column="this_process"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="previousProcessQuantity" column="previous_process_quantity"/> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | | <result property="customerName" column="customer_name"/> |
| | |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="productionId" column="production_id"/> |
| | | <result property="quantity" column="quantity"/> |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | |
| | | o.customer_id, |
| | | o.customer_name, |
| | | o.project, |
| | | SUM(fc.quantity) as quantity, |
| | | SUM(fc.quantity) as previous_process_quantity, |
| | | #{previousProcess} as previous_process, |
| | | #{nextProcess} as next_process, |
| | | #{process} as this_process |
| | | #{process} as this_process, |
| | | ifnull((rw.reviewed_state),1) as reviewed_state -- 下工序审核状态 |
| | | from sd.order as o |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join (select if(count(reviewed_state)>0 and process_id=null,1,0) as reviewed_state , |
| | | process_id |
| | | from reporting_work |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}) as rw |
| | | on rw.process_id = fc.process_id |
| | | where fc.process_id = #{processIdStr} |
| | | and position(fc.technology_number in #{technologyStr}) |
| | | and fc.technology_number = #{technologyStr} |
| | | GROUP BY fc.process_id |
| | | </select> |
| | | |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group` |
| | | |
| | | |
| | | 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 |
| | | <if test="process == '夹胶'"> |
| | | AND ogd.`group` = (select `group` |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | | and order_number = ogd.order_number |
| | | and technology_number =#{technologyStr} |
| | | limit 1) |
| | | </if> |
| | | |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | and fc.production_id=ogd.production_id |
| | |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装'"> |
| | | AND fc.technology_number = #{technologyStr} |
| | | </if> |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | |
| | | <!--查询detail明细--> |
| | | <select id="reportingWorkId"> |
| | | select * from reporting_work_detail |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | |
| | | |
| | | <!--<where> |
| | | |
| | | create_time <![CDATA[>=]]> #{startTime} and create_time <![CDATA[<=]]> #{endTime}} |
| | |
| | | <result property="previousProcess" column="previous_process"/> |
| | | <result property="nextProcess" column="next_process"/> |
| | | <result property="thisProcess" column="this_process"/> |
| | | <result property="reviewedState" column="reviewed_state"/> |
| | | <result property="previousProcessQuantity" column="previous_process_quantity"/> |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | | <result property="customerName" column="customer_name"/> |
| | |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="productionId" column="production_id"/> |
| | | <result property="quantity" column="quantity"/> |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | |
| | | o.customer_id, |
| | | o.customer_name, |
| | | o.project, |
| | | SUM(fc.quantity) as quantity, |
| | | SUM(fc.quantity) as previous_process_quantity, |
| | | #{previousProcess} as previous_process, |
| | | #{nextProcess} as next_process, |
| | | #{process} as this_process |
| | | #{process} as this_process, |
| | | ifnull((rw.reviewed_state),1) as reviewed_state -- 下工序审核状态 |
| | | from sd.order as o |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join flow_card as fc on fc.order_id = o.order_id |
| | | left join (select if(count(reviewed_state)>0 and process_id=null,1,0) as reviewed_state , |
| | | process_id |
| | | from reporting_work |
| | | where this_process=#{previousProcess} and reviewed_state=0 and process_id=#{processIdStr}) as rw |
| | | on rw.process_id = fc.process_id |
| | | where fc.process_id = #{processIdStr} |
| | | and position(fc.technology_number in #{technologyStr}) |
| | | and fc.technology_number = #{technologyStr} |
| | | GROUP BY fc.process_id |
| | | </select> |
| | | |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | fc.quantity -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | FROM |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | odpds.reporting_work_num -odpd.reporting_work_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpds.reporting_work_num -odpd.reporting_work_num -odpd.broken_num + ifnull(c.patchNumSum,0) as quantity, |
| | | odpd.reporting_work_num_count as completed, |
| | | odpd.broken_num as onceBroken |
| | | odpd.broken_num as onceBroken, |
| | | ogd.`group` |
| | | |
| | | |
| | | 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 |
| | | <if test="process == '夹胶'"> |
| | | AND ogd.`group` = (select `group` |
| | | from sd.order_glass_detail |
| | | where order_id = ogd.order_id |
| | | and order_number = ogd.order_number |
| | | and technology_number =#{technologyStr} |
| | | limit 1) |
| | | </if> |
| | | |
| | | LEFT JOIN flow_card AS fc |
| | | ON fc.order_id = ogd.order_id |
| | | and fc.production_id=ogd.production_id |
| | |
| | | and c.technology_number = fc.technology_number |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | <if test="process != '中空' and process != '夹胶' and process != '包装'"> |
| | | AND fc.technology_number = #{technologyStr} |
| | | </if> |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | |
| | | <!--查询detail明细--> |
| | | <select id="reportingWorkId"> |
| | | select * from reporting_work_detail |
| | | where reporting_work_id = #{reportingWorkId} |
| | | </select> |
| | | |
| | | |
| | | <!--<where> |
| | | |
| | | create_time <![CDATA[>=]]> #{startTime} and create_time <![CDATA[<=]]> #{endTime}} |