| | |
| | | <database-info product="MySQL" version="8.0.19" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-java-8.0.25 (Revision: 08be9e9b4cba6aa115f9b27b215887af40b159e0)" dbms="MYSQL" exact-version="8.0.19" exact-driver-version="8.0"> |
| | | <extra-name-characters>#@</extra-name-characters> |
| | | <identifier-quote-string>`</identifier-quote-string> |
| | | <jdbc-catalog-is-schema>true</jdbc-catalog-is-schema> |
| | | </database-info> |
| | | <case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" /> |
| | | <secret-storage>master_key</secret-storage> |
| | |
| | | state: () =>{ |
| | | let user=ref({ |
| | | userName:null, |
| | | id:null |
| | | userId:null |
| | | }) |
| | | return { |
| | | user |
| | |
| | | //定义表头数据 |
| | | const titleUploadData = ref({ |
| | | //流程卡号 |
| | | processId: 'NG24030501A01/1', |
| | | processId: 'NG24030501A01/2', |
| | | //销售单号 |
| | | orderId: '', |
| | | //生产单号 |
| | |
| | | //设备类型 |
| | | deviceName: '', |
| | | //班组名称 |
| | | teamsgroupsName: '', |
| | | teamsGroupsName: '', |
| | | //生产日期 |
| | | reportingWorkTime: '', |
| | | //报工工序 |
| | |
| | | }, |
| | | { |
| | | field: 'breakageQuantity', title: '次破数量', |
| | | |
| | | }, |
| | | // {field: 'available', width: 80, title: '可利用', editRender: {name: 'input', attrs: {placeholder: ''}}}, |
| | | // {field: 'returnProcess', width: 100, title: '退回工序', editRender: {name: 'input', attrs: {placeholder: ''}}}, |
| | | // { |
| | | // field: 'reasonType', width: 100, title: '次破类型', |
| | | // editRender: {name: 'input', attrs: {placeholder: '', type: 'selected'}} |
| | | // }, |
| | | // { |
| | | // field: 'reasonDamage', width: 100, title: '次破原因', |
| | | // editRender: {name: 'input', attrs: {placeholder: ''}} |
| | | // }, |
| | | // { |
| | | // field: 'responsibleProcess', width: 100, title: '责任工序', |
| | | // editRender: {}, |
| | | // slots: {default: 'reportingWordSort_default', edit: 'reportingWordSort'} |
| | | // //editRender: {name: 'input', attrs: {placeholder: '',type: 'selected'}}, |
| | | // |
| | | // }, |
| | | // { |
| | | // field: 'responsibleEquipment', |
| | | // width: 100, |
| | | // title: '责任设备', |
| | | // editRender: {}, |
| | | // slots: {default: 'reportingDeviceSort_default', edit: 'reportingDeviceSort'} |
| | | // // editRender: {name: 'input', attrs: {placeholder: ''}} |
| | | // }, |
| | | // |
| | | // { |
| | | // field: 'responsibleTeam', width: 100, title: '责任班组', |
| | | // editRender: {name: 'input', attrs: {placeholder: ''}} |
| | | // }, |
| | | // { |
| | | // field: 'responsibilityPersonnel', |
| | | // width: 100, |
| | | // title: '责任人员', |
| | | // editRender: {name: 'input', attrs: {placeholder: ''}} |
| | | // |
| | | // }, |
| | | {field: 'completed', width: 90, title: '已完工',}, |
| | | {field: 'onceBroken', width: 90, title: '已次破',}, |
| | | |
| | | ], |
| | | //表单验证 |
| | | editRules: {}, |
| | | editRules: { |
| | | completedQuantity: [ |
| | | { |
| | | validator ({ row }) { |
| | | 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}`)) |
| | | } |
| | | |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | toolbarConfig: {//表头按钮 |
| | | buttons: [ |
| | | // {code: 'empty', name: '清空报工数量'}, |
| | |
| | | custom: true |
| | | }, |
| | | //脚部求和 |
| | | // footerMethod({columns, data}) {//页脚函数 |
| | | // let footList = ['', '', '', '', ''] |
| | | // return [ |
| | | // columns.map((column, columnIndex) => { |
| | | // if (columnIndex === 0) { |
| | | // return '合计:' |
| | | // } |
| | | // if (footList.includes(column.field)) { |
| | | // return sumNum(data, column.field) |
| | | // } |
| | | // return '' |
| | | // }) |
| | | // ] |
| | | // } |
| | | footerMethod({columns, data}) {//页脚函数 |
| | | let footList = ['', '', '', '', ''] |
| | | return [ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | | return '合计:' |
| | | } |
| | | return '' |
| | | }) |
| | | ] |
| | | } |
| | | |
| | | }) |
| | | |
| | | let brokenRow = ref() |
| | | const gridEvents = { |
| | | toolbarButtonClick({code}) { |
| | | async toolbarButtonClick({code}) { |
| | | const $grid = xGrid.value |
| | | 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() |
| | | break |
| | | } |
| | |
| | | slots: {default: 'returnProcess_default', edit: 'returnProcess'} |
| | | }, |
| | | { |
| | | field: 'reasonType', title: '次破类型', |
| | | field: 'breakageType', title: '次破类型', |
| | | editRender: {}, |
| | | slots: {default: 'reasonType_default', edit: 'reasonType'} |
| | | slots: {default: 'breakageType_default', edit: 'breakageType'} |
| | | }, |
| | | { |
| | | field: 'reasonDamage', title: '次破原因', |
| | | field: 'breakageReason', title: '次破原因', |
| | | editRender: {}, |
| | | slots: {default: 'reasonDamage_default', edit: 'reasonDamage'} |
| | | slots: {default: 'breakageReason_default', edit: 'breakageReason'} |
| | | }, |
| | | { |
| | | field: 'responsibleProcess', title: '责任工序', |
| | |
| | | slots: {default: 'responsibleTeam_default', edit: 'responsibleTeam'} |
| | | }, |
| | | { |
| | | field: 'responsibilityPersonnel', |
| | | field: 'responsiblePersonnel', |
| | | title: '责任人员', |
| | | editRender: {name: 'input', attrs: {placeholder: ''}} |
| | | |
| | |
| | | } |
| | | } |
| | | ], |
| | | reasonType: [ |
| | | breakageType: [ |
| | | { required: true, message: '请选择次破类型' } |
| | | ], |
| | | reasonDamage: [ |
| | | breakageReason: [ |
| | | { required: true, message: '请选择次破原因' } |
| | | ], |
| | | responsibleProcess: [ |
| | |
| | | }) |
| | | |
| | | const saveReportingWork = () => { |
| | | |
| | | titleUploadData.value.creator = user.user.userName |
| | | titleUploadData.value.creatorId = user.user.id |
| | | 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 !== '') |
| | | return (a || b) |
| | | }) |
| | | if(requestDetailData.length === 0){ |
| | | ElMessage.warning('请填写至少一条损耗数和完工数') |
| | | return false |
| | | } |
| | | |
| | | const requestData = { |
| | | title:titleUploadData.value, |
| | | detail: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()}}) |
| | | } |
| | | }).catch(err =>{ |
| | | ElMessage.error(err.message) |
| | | }) |
| | | } |
| | | |
| | |
| | | titleSelectJson.value.breakageType = res.data.breakageType |
| | | //次破原因 |
| | | titleSelectJson.value.breakageReason = res.data.breakageReason |
| | | console.log(res.data) |
| | | |
| | | //console.log(res.data) |
| | | titleUploadData.value.classes='早班' |
| | | |
| | | |
| | | titleUploadData.value.reportingWorkTime = formatCurrentTime() |
| | |
| | | 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='晚班' |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; // 返回格式化后的时间字符串 |
| | | } |
| | | |
| | |
| | | <el-text>报工班组:</el-text> |
| | | </el-col> |
| | | <el-col :span="3"> |
| | | <el-select v-model="titleUploadData.teamsgroupsName" clearable placeholder="请选择班组"> |
| | | <el-select v-model="titleUploadData.teamsGroupsName" clearable placeholder="请选择班组"> |
| | | <el-option |
| | | v-for="item in titleSelectJson['teamsType']" |
| | | :key="item.id" |
| | |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @filter-change="filterChanged" |
| | | @edit-closed="verifyNum" |
| | | |
| | | > |
| | | |
| | |
| | | <template #responsibleProcess_default="{ row }"> |
| | | <span>{{ row.responsibleProcess }}</span> |
| | | </template> |
| | | <!-- 刺破类型reasonType --> |
| | | <template #reasonType="{ row }"> |
| | | <vxe-select v-model="row.reasonType " |
| | | <!-- 刺破类型breakageType --> |
| | | <template #breakageType="{ row }"> |
| | | <vxe-select v-model="row.breakageType " |
| | | filterable |
| | | clearable |
| | | placeholder=""> |
| | | <vxe-option v-for="item in titleSelectJson.breakageType" :key="item.id" :label="item.basic_name" :value="item.basic_name"/> |
| | | </vxe-select> |
| | | </template> |
| | | <template #reasonType_default="{ row }"> |
| | | <span>{{ row.reasonType }}</span> |
| | | <template #breakageType_default="{ row }"> |
| | | <span>{{ row.breakageType }}</span> |
| | | </template> |
| | | |
| | | <!--次破原因--> |
| | | <template #reasonDamage="{ row }"> |
| | | <vxe-select v-model="row.reasonDamage " |
| | | <template #breakageReason="{ row }"> |
| | | <vxe-select v-model="row.breakageReason " |
| | | filterable |
| | | clearable |
| | | placeholder=""> |
| | | <vxe-option v-for="item in titleSelectJson.breakageReason" :key="item.id" :label="item.basic_name" :value="item.basic_name"/> |
| | | </vxe-select> |
| | | </template> |
| | | <template #reasonDamage_default="{ row }"> |
| | | <span>{{ row.reasonDamage }}</span> |
| | | <template #breakageReason_default="{ row }"> |
| | | <span>{{ row.breakageReason }}</span> |
| | | </template> |
| | | |
| | | |
| | |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {useRouter} from "vue-router"; |
| | | import {useRouter,useRoute} from "vue-router"; |
| | | import GlassType from '@/components/basic/product/GlassType.vue' |
| | | |
| | | |
| | | const router = useRouter() |
| | | const route = useRoute() |
| | | let indexFlag=$ref(1) |
| | | function changeRouter(index){ |
| | | indexFlag=index |
| | |
| | | </div> |
| | | |
| | | <div id="main-body"> |
| | | <router-view /> |
| | | <router-view :key="route.fullPath" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | //工艺确认序号 |
| | | private String technologyNumber; |
| | | //完工数量 |
| | | private Integer completedQuantity; |
| | | private int completedQuantity; |
| | | //次破数量 |
| | | private Integer breakageQuantity; |
| | | private int breakageQuantity; |
| | | //次破原因 |
| | | private String breakageReason; |
| | | //类型 |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @TableName("sd.order_process_detail") |
| | | public class OrderProcessDetail { |
| | | @TableId(type = IdType.AUTO) |
| | | |
| | |
| | | private String orderNumber; |
| | | private Integer technologyNumber; |
| | | private String process; |
| | | private Integer reportingworkNum; |
| | | private Integer brokenNum; |
| | | private int reportingWorkNumCount; |
| | | private int reportingWorkNum; |
| | | private int brokenNum; |
| | | |
| | | // private Order order; |
| | | // private OrderDetail orderDetail; |
| | |
| | | |
| | | String SelectWorkTechnologyMp(String processIdStr); |
| | | |
| | | List<Map<String,String>> SelectTechnologicalNumMp(String processIdStr, String technologyStr); |
| | | List<Map<String,String>> SelectTechnologicalNumMp(String processIdStr, String technologyStr,String process); |
| | | |
| | | List<Map<String,String>> SelectReworlDetailMp(String processIdStr, String technologyStr, String previousProcess); |
| | | |
| | |
| | | package com.example.erp.mapper.sd; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @DS("sd") |
| | | public interface OrderProcessDetailMapper extends BaseMapper<OrderProcessDetail> { |
| | | boolean insertOrderProcessDetail(@Param("processDetailList") List<OrderProcessDetail> processDetailList); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | 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.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.ReportingWork; |
| | | import com.example.erp.entity.pp.ReportingWorkDetail; |
| | |
| | | import com.example.erp.mapper.pp.ReportingWorkDetailMapper; |
| | | import com.example.erp.mapper.pp.ReportingWorkMapper; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import com.example.erp.service.sd.OrderProcessDetailService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | |
| | | final |
| | | DamageDetailsMapper damageDetailsMapper; |
| | | final |
| | | OrderProcessDetailMapper orderProcessDetailMapper; |
| | | final |
| | | ReportingWorkDetailMapper |
| | | reportingWorkDetailMapper; |
| | | |
| | | final |
| | | OrderProcessDetailService orderProcessDetailService; |
| | | |
| | | public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper) { |
| | | |
| | | |
| | | public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService) { |
| | | this.reportingWorkMapper = reportingWorkMapper; |
| | | this.basicDateProduceMapper = basicDateProduceMapper; |
| | | this.damageDetailsMapper = damageDetailsMapper; |
| | | this.reportingWorkDetailMapper = reportingWorkDetailMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | this.orderProcessDetailService = orderProcessDetailService; |
| | | } |
| | | |
| | | 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; |
| | |
| | | //判断本工序是不是第一道工序 |
| | | if (interceptProcess.equals(process)) { |
| | | //是第一道工序,查询流程卡数据 |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr,technologyStr)); |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr,technologyStr,process)); |
| | | } |
| | | else { |
| | | //不是第一道工序,查询报工数据 |
| | |
| | | return map; |
| | | } |
| | | |
| | | //报工新增 |
| | | @Transactional |
| | | public boolean SaveReportingWorkSv(Map<String, Object> reportingWorkMap) { |
| | | //接收解析主附表信息 |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | | ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class); |
| | | List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class); |
| | | //System.out.println(reportingWork); |
| | | //获取当前最大报工单号生成报工单号 |
| | | String formattedNumber = String.format("%04d", reportingWorkMapper.selectMaxReportingWorkId()+1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | |
| | | String reportingWorkId = "BG"+formattedDate+formattedNumber; |
| | | reportingWork.setReportingWorkId(reportingWorkId); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0,13)); |
| | | |
| | | //主表插入 |
| | | reportingWorkMapper.insert(reportingWork); |
| | | |
| | | //副表循环插入,并且插入次破信息表。再根据次破信息修改订单玻璃流程表的完工数量与刺破数量 |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | reportingWorkDetail.setReportingWorkId(reportingWorkId); |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | |
| | | }); |
| | | } |
| | | //System.out.println(reportingWorkDetail); |
| | | 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::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 =reporting_work_num +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum()); |
| | | |
| | | orderProcessDetailMapper.update(null,updateWrapper); |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | }); |
| | | |
| | | |
| | | |
| | | return false; |
| | | } |
| | | } |
New file |
| | |
| | | package com.example.erp.service.sd; |
| | | |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.example.erp.entity.sd.OrderProcessDetail; |
| | | import com.example.erp.mapper.sd.OrderProcessDetailMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | |
| | | @Service |
| | | @DS("sd") |
| | | public class OrderProcessDetailService { |
| | | final |
| | | OrderProcessDetailMapper orderProcessDetailMapper; |
| | | |
| | | public OrderProcessDetailService(OrderProcessDetailMapper orderProcessDetailMapper) { |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | } |
| | | |
| | | public void updateReportingWork(OrderProcessDetail orderProcessDetail, LambdaUpdateWrapper<OrderProcessDetail> updateWrapper) { |
| | | orderProcessDetailMapper.update(orderProcessDetail,updateWrapper); |
| | | } |
| | | } |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) |
| | | as quantity |
| | | fc.quantity -odpd.reporting_work_num 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 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 |
| | | 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 |
| | | 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 |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND position( |
| | | fc.technology_number IN #{technologyStr}) |
| | | |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity |
| | | 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 |
| | |
| | | </select> |
| | | |
| | | <select id="SelectProcessMp"> |
| | | select * from sd.basic_data where basic_type="product" and basic_category="process" |
| | | select * from sd.basic_data where basic_type='product' and basic_category='process' |
| | | |
| | | </select> |
| | | |
| | | <select id="historyProcessMp"> |
| | | select ifnull(GROUP_CONCAT(distinct rw.this_process),"") from reporting_work as rw where rw.process_id=#{processIdStr} |
| | | select ifnull(GROUP_CONCAT(distinct rw.this_process),'') from reporting_work as rw where rw.process_id=#{processIdStr} |
| | | </select> |
| | | |
| | | <select id="historyDeviceMp"> |
| | |
| | | sd.basic_data AS bd |
| | | LEFT JOIN `basic_data_produce` AS bdp ON bd.id = bdp.basic_category |
| | | WHERE |
| | | bd.basic_category = "process" |
| | | AND bdp.basic_type = "teamsgroups" |
| | | bd.basic_category = 'process' |
| | | AND bdp.basic_type = 'teamsgroups' |
| | | AND POSITION(bd.basic_name in CONCAT(#{historyProcess},#{process})) |
| | | </select> |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <!--返工数据--> |
| | | |
| | | <mapper namespace="com.example.erp.mapper.pp.PatchLogMapper"> |
| | | |
| | | |
| | | |
| | | <!--获取补片数据--> |
| | | <select id="SelectReplenish" > |
| | | select |
| | | r.id, |
| | | r.review_status, |
| | | r.reporting_work_id, |
| | | r.patch_id, |
| | | r.process_id, |
| | | r.order_id, |
| | | r.order_sort, |
| | | o.project, |
| | | o.batch, |
| | | od.building_number, |
| | | od.product_name, |
| | | ogd.technology_number, |
| | | ogd.glass_address, |
| | | r.patch_num, |
| | | od.width, |
| | | od.height, |
| | | od.shape, |
| | | r.patch_type, |
| | | r.patch_reason, |
| | | r.responsible_team, |
| | | r.responsible_personnel, |
| | | r.responsible_equipment, |
| | | r.patch_area, |
| | | r.quality_inspector, |
| | | r.patch_processes, |
| | | r.reviewer, |
| | | date(r.create_time) as create_time, |
| | | date(r.update_time) as update_time |
| | | from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number |
| | | left join sd.`order` o on r.order_id = o.order_id |
| | | left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd |
| | | on r.order_id = ogd.order_id and r.order_sort = ogd.order_number |
| | | <where> |
| | | date(r.create_time)>=#{startDate} and date(r.create_time) <= #{endDate} |
| | | </where> |
| | | order by r.review_status |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="SelectReplenishPageTotal" > |
| | | select CEILING(count(zu.id)/#{pageSize}) as 'pageTotal', |
| | | count(zu.id) as 'total' |
| | | from (select r.id as id |
| | | from pp.patch_log r left join sd.order_detail od on r.order_id=od.order_id and r.order_sort=od.order_number |
| | | left join sd.`order` o on r.order_id = o.order_id |
| | | left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd |
| | | on r.order_id = ogd.order_id and r.order_sort = ogd.order_number |
| | | <where> |
| | | date(r.create_time)>=#{startDate} and date(r.create_time) <= #{endDate} |
| | | </where> |
| | | ) as zu |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="getMaximum" > |
| | | select count(*) from pp.patch_log where date(create_time)=CURDATE() |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertReplenish" useGeneratedKeys="true" > |
| | | insert into pp.patch_log(patch_id,reporting_work_id,process_id,order_id, order_sort, technology_number, responsible_team, |
| | | responsible_personnel, patch_type, patch_reason, patch_processes, patch_num, |
| | | patch_area,responsible_equipment,quality_inspector, reviewer, review_status, create_time) |
| | | values ( |
| | | #{oddNumber}, #{patchLog.reportingWorkId},#{patchLog.processId},#{patchLog.orderId},#{patchLog.orderSort},#{patchLog.technologyNumber}, |
| | | #{patchLog.responsibleTeam},#{patchLog.responsiblePersonnel},#{patchLog.patchType},#{patchLog.patchReason}, |
| | | #{patchLog.patchProcesses},#{patchLog.patchNum},#{patchLog.patchArea},#{patchLog.responsibleEquipment},#{patchLog.qualityInspector},"",0,now() |
| | | ) |
| | | </insert> |
| | | |
| | | <update id="updateReplenish" > |
| | | update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id} |
| | | </update> |
| | | |
| | | <update id="updateDamageDetails" > |
| | | update pp.damage_details set quantity=quantity+#{patchLog.patchNum},patch_status=1 where id=#{patchLog.reviewer} |
| | | </update> |
| | | |
| | | |
| | | <select id="getSelectReplenish"> |
| | | select date(rw.reporting_work_time) as reportingWorkTime, |
| | | o.order_id as orderId, |
| | | dd.reporting_work_id as reportingWorkId, |
| | | rw.production_id as productionId, |
| | | rw.process_id as processId, |
| | | o.project, |
| | | o.batch, |
| | | dd.id as reviewer, |
| | | od.building_number as buildingNumber, |
| | | dd.order_number as orderSort, |
| | | od.product_name as productName, |
| | | dd.technology_number as technologyNumber, |
| | | ogd.glass_address as glassAddress, |
| | | dd.breakage_quantity-dd.quantity as patchNum, |
| | | od.width, |
| | | od.height, |
| | | od.shape, |
| | | dd.breakage_quantity-dd.quantity as breakageQuantity, |
| | | dd.return_process as patchProcesses, |
| | | dd.breakage_reason as patchReason, |
| | | dd.breakage_type as patchType, |
| | | dd.responsible_personnel as responsiblePersonnel, |
| | | dd.responsible_equipment as responsibleEquipment, |
| | | dd.responsible_team as responsibleTeam, |
| | | ROUND((dd.breakage_quantity-dd.quantity) * od.width * od.height / 1000000, 2) as patchArea, |
| | | rw.qualityIns_pector as qualityInsPector |
| | | from pp.damage_details dd |
| | | left join pp.reporting_work_detail rwd on dd.reporting_work_id = rwd.reporting_work_id and dd.order_number=rwd.order_number and dd.technology_number=rwd.technology_number |
| | | left join pp.reporting_work rw on dd.reporting_work_id = rw.reporting_work_id |
| | | |
| | | left join sd.`order` o on rw.order_id = o.order_id |
| | | left join sd.order_detail od on rw.order_id = od.order_id and dd.order_number = od.order_number |
| | | left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd |
| | | on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number |
| | | |
| | | where dd.breakage_quantity-dd.quantity>0 and dd.available=0 |
| | | |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | fc.quantity - IFNULL(fc.number_patches,0)-IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) |
| | | as quantity |
| | | fc.quantity -odpd.reporting_work_num 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 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 |
| | | 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 |
| | | 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 |
| | | WHERE |
| | | fc.process_id = #{processIdStr} |
| | | AND position( |
| | | fc.technology_number IN #{technologyStr}) |
| | | |
| | | AND fc.technology_number = #{technologyStr} |
| | | AND odpd.process = #{process} |
| | | order by fc.order_number |
| | | </select> |
| | | |
| | |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | od.shape, |
| | | reportingwork_num -IFNULL(rwd.completed_quantity,0)-IFNULL(rwd.breakage_quantity,0)-IFNULL((rwd.wait_rework_quantity),0) as quantity |
| | | 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 |
| | |
| | | </select> |
| | | |
| | | <select id="SelectProcessMp"> |
| | | select * from sd.basic_data where basic_type="product" and basic_category="process" |
| | | select * from sd.basic_data where basic_type='product' and basic_category='process' |
| | | |
| | | </select> |
| | | |
| | | <select id="historyProcessMp"> |
| | | select ifnull(GROUP_CONCAT(distinct rw.this_process),"") from reporting_work as rw where rw.process_id=#{processIdStr} |
| | | select ifnull(GROUP_CONCAT(distinct rw.this_process),'') from reporting_work as rw where rw.process_id=#{processIdStr} |
| | | </select> |
| | | |
| | | <select id="historyDeviceMp"> |
| | |
| | | sd.basic_data AS bd |
| | | LEFT JOIN `basic_data_produce` AS bdp ON bd.id = bdp.basic_category |
| | | WHERE |
| | | bd.basic_category = "process" |
| | | AND bdp.basic_type = "teamsgroups" |
| | | bd.basic_category = 'process' |
| | | AND bdp.basic_type = 'teamsgroups' |
| | | AND POSITION(bd.basic_name in CONCAT(#{historyProcess},#{process})) |
| | | </select> |
| | | |