Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
| | |
| | | add:'Add', |
| | | delete:'Delete', |
| | | edit:'Edit', |
| | | cancel:'cancel', |
| | | restore:'restore', |
| | | selectSame:'Select same', |
| | | sameAfterwards:'Same afterwards', |
| | | clearSelection:'Clear selection', |
| | |
| | | importMaxCheckFailFirst:'Import ', |
| | | importMaxCheckFailMid:' the data can not exceed ', |
| | | importMaxCheckFailLast:' pieces, please import in multiple orders', |
| | | updateAmountSuccessfully:'Updated amount successfully' |
| | | updateAmountSuccessfully:'Updated amount successfully', |
| | | updateOrderState:'Order status update succeeded', |
| | | } |
| | | |
| | | }, |
| | |
| | | add:'添加', |
| | | delete:'删除', |
| | | edit:'编辑', |
| | | cancel:'作废', |
| | | restore:'还原', |
| | | selectSame:'选中相同', |
| | | sameAfterwards:'之后相同', |
| | | clearSelection:'清除选中', |
| | |
| | | importMaxCheckFailFirst:'导入', |
| | | importMaxCheckFailMid:'条,$数据不能超过', |
| | | importMaxCheckFailLast:'条,请分订单导入', |
| | | updateAmountSuccessfully:'更新金额成功' |
| | | updateAmountSuccessfully:'更新金额成功', |
| | | updateOrderState:'更新订单状态成功', |
| | | } |
| | | |
| | | }, |
| | |
| | | formEl.validate((valid) => { |
| | | if (valid) { |
| | | loginLoadings.value=true |
| | | userForm.pass = btoa(userForm.pass) |
| | | request.post('/user/login', |
| | | userForm).then((res) => { |
| | | if(res['code']==200){ |
| | |
| | | formEl.validate((valid) => { |
| | | if (valid) { |
| | | loginLoadings.value=true |
| | | register.passWord = btoa(register.passWord) |
| | | request.post('/user/register', |
| | | register).then((res) => { |
| | | if(res['code']==200){ |
| | |
| | | index = leftData[0].landingSequence + 1 |
| | | //index = index.toString().padStart(2, '0') |
| | | } |
| | | const processId = productionId + index.toString().padStart(2, '0') |
| | | const processId = productionId + index.toString().padStart(3, '0') |
| | | const regex = /^(\d+|)$/; |
| | | if (!regex.test(checkedNum.value)) { |
| | | ElMessage.warning(t('processCard.schedulingNo')) |
| | |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | </li> |
| | | </ul> |
| | | </template> |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'edit')">打印</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'setType')">排版</el-button> |
| | | <el-button link size="small" type="primary" @click="getTableRow(row,'delete')">删除</el-button> |
| | | </template> |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | pageSize : 100 |
| | | }) |
| | | //第一次加载数据 |
| | | |
| | | request.post(`/processCard/flowCard/1/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | |
| | | |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/processCard/flowCard/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | request.post(`/processCard/flowCard/${pageNum.value}/${total.pageSize}/${startTime}/${endTime}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | |
| | | pageTotal.value = res.data.total |
| | |
| | | request.post(`/processCard/detailsSelect/${id}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data) |
| | | pageTotal.value = res.data.total |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | |
| | | name: '修改', |
| | | status: 'primary', |
| | | } |
| | | if(route.query.reviewStatus === "1"){ |
| | | button.name='审核' |
| | | titleUploadData.value.qualityInspector=user.user.userName |
| | | } |
| | | |
| | | gridOptions.toolbarConfig.buttons.push(button) |
| | | } |
| | | inputDisabled.value = true |
| | |
| | | } |
| | | gridOptions.toolbarConfig.buttons[0].disabled=true |
| | | gridOptions.toolbarConfig.buttons[1].disabled=true |
| | | //判断保存还是修改 |
| | | if(saveType==='save'){ |
| | | saveReportingWorkRequest(requestData) |
| | | }else{ |
| | |
| | | |
| | | //更新报工数据 |
| | | const updateReportingWorkRequest = (requestData) =>{ |
| | | request.post(`/reportingWork/updateReportingWork`,requestData).then(res =>{ |
| | | let reviewState = 'update' |
| | | if(route.query.reviewStatus==="1"){ |
| | | reviewState = 'review' |
| | | } |
| | | request.post(`/reportingWork/updateReportingWork/${reviewState}`,requestData).then(res =>{ |
| | | if (res.code == 200){ |
| | | ElMessage.success("报工修改成功") |
| | | router.push({path:'/main/reportingWorks/AddReportingWork', |
| | |
| | | } |
| | | let indexOfChar = processId.indexOf("/") |
| | | let leftString = processId.slice(0, indexOfChar) |
| | | if (leftString.length !== 13) { |
| | | if (leftString.length !== 14) { |
| | | ElMessage.warning("请输入正确位数的流程卡") |
| | | return |
| | | } |
| | |
| | | ElMessage.warning("此工序不属于该流程卡") |
| | | return |
| | | } |
| | | //匹配“/”前后字符串 |
| | | const regex = /([^\/]+)\/([^\/]+)/; |
| | | //查找匹配的字符串 |
| | | const result = processId.match(regex); |
| | | //流程卡号 |
| | | let processIdStr = processId.substring(0, 13); |
| | | let processIdStr = result[1]; |
| | | //层号 |
| | | let technologyStr = processId.substring(14); |
| | | let technologyStr = result[2]; |
| | | |
| | | request.post(`/reportingWork/addSelectLastWork/${processIdStr}/${technologyStr}/${process}`).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | <script setup> |
| | | |
| | | import {reactive} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | let router=useRouter() |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | | alert('我接收到子组件传送的删除信息') |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的反审状态') |
| | | break |
| | | } |
| | | } |
| | | } |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElMessage} from "element-plus"; |
| | | import {changeFilterEvent, filterChanged} from "@/hook" |
| | | import { useI18n } from 'vue-i18n' |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router = useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | }) |
| | | return count.toFixed(2) |
| | | } |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | |
| | | orderGlassDetail: { |
| | | glassChild: '', |
| | | glassAddress: '', |
| | | childWidth: '', |
| | | childHeight: '', |
| | | }, |
| | | orderDetail:{ |
| | | shape:'', |
| | | }, |
| | | damageDetails: { |
| | | qualityInsStatus: '', |
| | | breakageQuantity: '', |
| | | available: '', |
| | | returnProcess: '', |
| | | breakageType: '', |
| | | breakageReason: '', |
| | | responsibleEquipment: '', |
| | | responsibleProcess: '', |
| | | responsibleTeam: '', |
| | | responsiblePersonnel: '', |
| | | }, |
| | | |
| | | |
| | | }) |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //首次加载 |
| | | |
| | | const { currentRoute } = useRouter() |
| | | const route = currentRoute.value |
| | | |
| | | let reportingWorkId=route.query.reportingWorkId |
| | | let processId=route.query.processId |
| | | let thisProcess=route.query.thisProcess |
| | | |
| | | request.post(`/reportingWork/detailsQuality/${reportingWorkId}/${processId}/${thisProcess}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | produceList = produceList.value.concat(deepClone(res.data.data)) |
| | | xGrid.value.reloadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //子组件接收参数 |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | useKey: true |
| | | }, |
| | | filterConfig: { //筛选配置项 |
| | | remote: true |
| | | // remote: true |
| | | }, |
| | | customConfig: { |
| | | storage: true |
| | |
| | | },//表头参数 |
| | | columns:[ |
| | | {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'serialNumber', width: 120, title: '序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'singlePieceName',width: 120, title: '单片名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'marking', width: 130,title: '标记', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'pieces',width: 120, title: '片标记',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'processCardNumber', width: 100,title: '流程卡数量', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'width', width: 100,title: '宽', sortable: true}, |
| | | {field: 'height',width: 100, title: '高', sortable: true}, |
| | | // { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | {field: 'order_number',fixed:"left", width: 120, title: '序号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'glass_child',fixed:"left",width: 120, title: '单片名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'technology_number', width: 130,title: '小片顺序', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'glass_address',width: 120, title: '片标记',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'child_width', width: 100,title: '宽', sortable: true}, |
| | | {field: 'child_height',width: 100, title: '高', sortable: true}, |
| | | {field: 'shape',width: 120, title: '形状', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'upCompletedQuantity', width: 120,title: '上工完工数量', sortable: true}, |
| | | {field: 'completedQuantity',width: 120, title: '完工数量', sortable: true}, |
| | | {field: 'numberBroken',width: 120, title: '次破数量', sortable: true}, |
| | | {field: 'availableUse',width: 120, title: '可利用', sortable: true}, |
| | | {field: 'returnProcess',width: 120, title: '退回工序', sortable: true}, |
| | | {field: 'reasonType',width: 120, title: '次破类型', sortable: true}, |
| | | {field: 'reasonDamage',width: 120, title: '次破原因', sortable: true}, |
| | | {field: 'responsibilityDevice',width: 120, title: '责任设备', sortable: true}, |
| | | {field: 'responsibilityProcess',width: 120, title: '责任工序', sortable: true}, |
| | | {field: 'responsibilityTeams',width: 120, title: '责任班组', sortable: true}, |
| | | {field: 'responsibilityPersonnel',width: 120, title: '责任人员', sortable: true}, |
| | | {field: 'completed',width: 90, title: '已完工', sortable: true}, |
| | | {field: 'onceBroken',width: 90, title: '已次破', sortable: true}, |
| | | {field: 'completed_quantity',width: 120, title: '完工数量', sortable: true}, |
| | | {field: 'breakage_quantity',width: 120, title: '次破数量', sortable: true}, |
| | | {field: 'available',width: 120, title: '可利用', sortable: true}, |
| | | {field: 'return_process',width: 120, title: '退回工序', sortable: true}, |
| | | {field: 'breakage_type',width: 120, title: '次破类型', sortable: true}, |
| | | {field: 'breakage_reason',width: 120, title: '次破原因', sortable: true}, |
| | | {field: 'responsible_equipment',width: 120, title: '责任设备', sortable: true}, |
| | | {field: 'responsible_process',width: 120, title: '责任工序', sortable: true}, |
| | | {field: 'responsible_team',width: 120, title: '责任班组', sortable: true}, |
| | | {field: 'responsible_personnel',width: 120, title: '责任人员', sortable: true}, |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | serialNumber:'1', |
| | | singlePieceName: '6mm白玻平钢(外)', |
| | | marking: '1', |
| | | pieces: '(外)', |
| | | processCardNumber: '11', |
| | | width: '575', |
| | | height:"2241", |
| | | shape: '普形', |
| | | upCompletedQuantity: '12', |
| | | completedQuantity: '1', |
| | | numberBroken:'', |
| | | availableUse:'', |
| | | returnProcess:'', |
| | | |
| | | reasonType: '机器', |
| | | reasonDamage:'气泡超标', |
| | | available:'', |
| | | reworkProcess:'', |
| | | responsibilityProcess:'中空', |
| | | responsibilityTeams:'中空一班', |
| | | responsibilityPersonnel:'', |
| | | responsibilityDevice:'中空3#线', |
| | | completed:'', |
| | | onceBroken:'', |
| | | }, |
| | | { |
| | | serialNumber:'1', |
| | | singlePieceName: '6mm白玻平钢(内)', |
| | | marking: '2', |
| | | pieces: '(内)', |
| | | processCardNumber: '11', |
| | | width: '575', |
| | | height:"2241", |
| | | shape: '普形', |
| | | upCompletedQuantity: '12', |
| | | completedQuantity: '1', |
| | | numberBroken:'', |
| | | availableUse:'', |
| | | returnProcess:'', |
| | | |
| | | reasonType: '机器', |
| | | reasonDamage:'气泡超标', |
| | | available:'', |
| | | reworkProcess:'', |
| | | responsibilityProcess:'中空', |
| | | responsibilityTeams:'中空一班', |
| | | responsibilityPersonnel:'', |
| | | responsibilityDevice:'中空3#线', |
| | | completed:'', |
| | | onceBroken:'', |
| | | }, |
| | | { |
| | | serialNumber:'2', |
| | | singlePieceName: '8mm白玻平钢(外)', |
| | | marking: '1', |
| | | pieces: '(外)', |
| | | processCardNumber: '11', |
| | | width: '575', |
| | | height:"2241", |
| | | shape: '普形', |
| | | upCompletedQuantity: '12', |
| | | completedQuantity: '1', |
| | | numberBroken:'', |
| | | availableUse:'', |
| | | returnProcess:'', |
| | | |
| | | reasonType: '机器', |
| | | reasonDamage:'气泡超标', |
| | | available:'', |
| | | reworkProcess:'', |
| | | responsibilityProcess:'中空', |
| | | responsibilityTeams:'中空一班', |
| | | responsibilityPersonnel:'', |
| | | responsibilityDevice:'中空3#线', |
| | | completed:'', |
| | | onceBroken:'', |
| | | }, |
| | | { |
| | | serialNumber:'2', |
| | | singlePieceName: '8mm白玻平钢(内)', |
| | | marking: '2', |
| | | pieces: '(内)', |
| | | processCardNumber: '11', |
| | | width: '575', |
| | | height:"2241", |
| | | shape: '普形', |
| | | upCompletedQuantity: '12', |
| | | completedQuantity: '1', |
| | | numberBroken:'', |
| | | availableUse:'', |
| | | returnProcess:'', |
| | | |
| | | reasonType: '机器', |
| | | reasonDamage:'气泡超标', |
| | | available:'', |
| | | reworkProcess:'', |
| | | responsibilityProcess:'中空', |
| | | responsibilityTeams:'中空一班', |
| | | responsibilityPersonnel:'', |
| | | responsibilityDevice:'中空3#线', |
| | | completed:'', |
| | | onceBroken:'', |
| | | }, |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['processCardNumber','upCompletedQuantity','completedQuantity','numberBroken','completed','onceBroken'] |
| | | let footList=[''] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | </ul> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button> |
| | | <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button> |
| | | </template> |
| | | |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | <script setup> |
| | | |
| | | import {reactive} from "vue"; |
| | | import {reactive, ref} from "vue"; |
| | | import {useRouter} from 'vue-router' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone"; |
| | | import {ElDatePicker, ElMessage} from "element-plus"; |
| | | import {Search} from "@element-plus/icons-vue"; |
| | | import { useI18n } from 'vue-i18n' |
| | | import useUserInfoStore from "@/stores/userInfo"; |
| | | //语言获取 |
| | | const { t } = useI18n() |
| | | let router=useRouter() |
| | | const userStore = useUserInfoStore() |
| | | const username = userStore.user.userName |
| | | const getTableRow = (row,type) =>{ |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | router.push({path: '/main/reportingWorks/QualityInReviewDetail', query: { id: row.id }}) |
| | | router.push({path: '/main/reportingWorks/AddReportingWork', query: { reportingWorkId: row.reportingWorkId,reviewStatus:"1" }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | break |
| | | } |
| | | case 'setType':{ |
| | | alert('我接收到子组件传送的审核状态') |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let state = optionVal.value |
| | | let inputVal = form.processId |
| | | request.post(`/reportingWork/updateQualityStatus/${row.reportingWorkId}/${username}`).then((res) => { |
| | | if (res.code == 200) { |
| | | ElMessage.success(t('processCard.modifySuccessfully')) |
| | | router.push({path: '/main/reportingWorks/QualityInspectionReview', query: {startTime:startTime,endTime:endTime,state:state,inputVal:inputVal, random:Math.random()}}) |
| | | } else { |
| | | |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | break |
| | | } |
| | | } |
| | | } |
| | | |
| | | //定义时间 |
| | | const form = reactive({ |
| | | date1: '', |
| | | processId:'', |
| | | }) |
| | | |
| | | |
| | | //定义转单状态 |
| | | const optionVal = ref('1') |
| | | const options = [ |
| | | { |
| | | value: '1', |
| | | label: '未质检', |
| | | }, |
| | | { |
| | | value: '2', |
| | | label: '已质检', |
| | | }, |
| | | ] |
| | | |
| | | |
| | | //表尾求和 |
| | | const sumNum = (list, field) => { |
| | |
| | | return count.toFixed(2) |
| | | } |
| | | |
| | | //定义滚动条高度 |
| | | let scrollTop = ref(null) |
| | | let scrollHeight = ref(null) |
| | | let clientHeight = ref(null) |
| | | const scrollEvnt = (row) => { |
| | | // 内容高度 |
| | | scrollTop.value = row.$event.target.scrollTop |
| | | scrollHeight.value = row.$event.target.scrollHeight |
| | | clientHeight.value = row.$event.target.clientHeight |
| | | } |
| | | //筛选条件,有外键需要先定义明细里面的数据 |
| | | let filterData = ref({ |
| | | order: { |
| | | project: '', |
| | | customerName:'' |
| | | }, |
| | | damageDetails: { |
| | | qualityInsStatus: '', |
| | | }, |
| | | |
| | | }) |
| | | //定义页面总页数 |
| | | let pageTotal = ref('') |
| | | //定义数据返回结果 |
| | | let produceList = ref([]) |
| | | //定义当前页数 |
| | | const pageNum = $ref(1) |
| | | let pageState = null |
| | | |
| | | //获取七天前到当前时间 |
| | | function getNowTime() { |
| | | const start = new Date(new Date().getTime() - 3600 * 1000 * 24 * 3) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10) //默认开始时间7天前 |
| | | const end = new Date(new Date().getTime()+3600 * 1000 * 24) |
| | | .toISOString() |
| | | .replace('T', ' ') |
| | | .slice(0, 10)//默认结束时间当前时间 |
| | | return [start, end] |
| | | } |
| | | |
| | | |
| | | //第一次加载获取近七天时间和默认状态 |
| | | form.date1 = getNowTime() |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let state = optionVal.value |
| | | let total = reactive({ |
| | | pageTotal : 0, |
| | | dataTotal : 0, |
| | | pageSize : 100 |
| | | }) |
| | | let inputVal = form.processId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | |
| | | //第一次加载数据 |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, 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) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | |
| | | //页脚翻页查询 |
| | | const selectPageList = ()=>{ |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.reloadData(produceList) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //点击查询 |
| | | const getWorkOrder = () => { |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let state = optionVal.value |
| | | let inputVal = form.processId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | request.post(`/reportingWork/selectQualityTesting/${pageNum}/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, 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 |
| | | xGrid.value.loadData(res.data.data) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | //页脚跳转 |
| | | const handlePageChange = ({ currentPage, pageSize }) => { |
| | | pageNum.value=currentPage |
| | | total.pageTotal = pageSize |
| | | selectPageList() |
| | | } |
| | | |
| | | /*使用筛选,后端获取数据*/ |
| | | const changeFilterEvent = (event, option, $panel,) => { |
| | | // 手动触发筛选 |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | | let value = column.datas[0] != undefined ? column.datas[0] : '' |
| | | value = value.trim() |
| | | //判断是否存在外键 |
| | | if (column.property.indexOf('.') > -1) { |
| | | const columnArr = column.property.split('.') |
| | | filterData.value[columnArr[0]] = { |
| | | [columnArr[1]]: value |
| | | } |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | //获取选中时间和是否转单状态 |
| | | let startTime = form.date1[0] |
| | | let endTime = form.date1[1] |
| | | let state = optionVal.value |
| | | let inputVal = form.processId |
| | | if (inputVal == '') { |
| | | inputVal = null |
| | | } |
| | | |
| | | request.post(`/reportingWork/selectQualityTesting/1/${total.pageSize}/${startTime}/${endTime}/${state}/${inputVal}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | | pageTotal.value=res.data.total |
| | | total.pageTotal=parseInt(res.data.total) |
| | | |
| | | produceList = deepClone(res.data.data) |
| | | xGrid.value.loadData(produceList) |
| | | gridOptions.loading = false |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /*后端返回结果多层嵌套展示*/ |
| | | const hasDecimal = (value) => { |
| | | const regex = /\./; // 定义正则表达式,查找小数点 |
| | | return regex.test(value); // 返回true/false |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | border: "full",//表格加边框 |
| | | keepSource: true,//保持源数据 |
| | | align: 'center',//文字居中 |
| | | stripe:true,//斑马纹 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮 |
| | | rowConfig: {isCurrent: true, isHover: true,height: 30},//鼠标移动或选择高亮 |
| | | id: 'CustomerList', |
| | | showFooter: true,//显示脚 |
| | | printConfig: {}, |
| | |
| | | {title: '操作', width: 120, slots: { default: 'button_slot' },fixed:"left"}, |
| | | { type: 'seq',fixed:"left", title: '自序', width: 50 }, |
| | | |
| | | {field: 'reportingWorkNo',width: 120, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, |
| | | {field: 'reportingWorkTime',width: 120, title: '报工时间', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'entryName',width: 120, title: '项目名称', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'customerName',width: 120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, |
| | | {field: 'thisProcess',width: 100, title: '本工序', sortable: true,showOverflow:"ellipsis"}, |
| | | {field: 'teamName',width: 110, title: '报工班组', sortable: true}, |
| | | {field: 'finishedNumber',width: 100, title: '完工数量', sortable: true}, |
| | | {field: 'wornNumber', width: 100,title: '次破数量', sortable: true}, |
| | | {field: 'responsibilityProcess',width: 100, title: '责任工序', sortable: true}, |
| | | {field: 'previousProcess', width: 100,title: '上工序', sortable: true}, |
| | | {field: 'nextProcess',width: 100, title: '下工序', sortable: true}, |
| | | {field: 'qualityInspector',width: 120, title: '质检员', sortable: true}, |
| | | {field: 'qualityState',width: 120, title: '质检状态', sortable: true}, |
| | | {field: 'notes',width: 120, title: '备注', sortable: true} |
| | | {field: 'reportingWorkId',width: 130, title: '报工编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, }, |
| | | {field: 'reportingWorkTime',width: 120, title: '报工时间',showOverflow:"ellipsis" }, |
| | | {field: 'processId',width: 130, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.project',width: 120, title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order.customerName',width: 120, title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'thisProcess',width: 100, title: '本工序',showOverflow:"ellipsis"}, |
| | | {field: 'thisCompletedQuantity',width: 100, title: '完工数量'}, |
| | | {field: 'thisWornQuantity', width: 100,title: '次破数量'}, |
| | | {field: 'teamsGroupsName',width: 110, title: '报工班组'}, |
| | | {field: 'deviceName',width: 110, title: '报工设备'}, |
| | | {field: 'previousProcess', width: 100,title: '上工序'}, |
| | | {field: 'nextProcess',width: 100, title: '下工序'}, |
| | | {field: 'qualityInspector',width: 120, title: '质检员'}, |
| | | {field: 'qualityInsTime',width: 120, title: '质检时间'}, |
| | | {field: 'damageDetails.qualityInsStatus',width: 120, title: '质检状态'} |
| | | ],//表头按钮 |
| | | |
| | | toolbarConfig: { |
| | |
| | | custom: true |
| | | }, |
| | | data: [ |
| | | { |
| | | reportingWorkNo: 'BG2312070001', |
| | | reportingWorkTime: '2023-12-01 08:01:22', |
| | | processCard: 'NG231207A01', |
| | | entryName: '信合春天里', |
| | | customerName: 'XXXX', |
| | | thisProcess: '中空', |
| | | teamName:"中空一班", |
| | | finishedNumber: '11', |
| | | wornNumber: '1', |
| | | responsibilityProcess: '钢化', |
| | | previousProcess:'钢化', |
| | | nextProcess:'包装', |
| | | qualityInspector: 'XXX', |
| | | qualityState: '1', |
| | | notes: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312070002', |
| | | reportingWorkTime: '2023-12-01 08:01:22', |
| | | processCard: 'NG231207A01', |
| | | entryName: '信合春天里', |
| | | customerName: 'XXXX', |
| | | thisProcess: '中空', |
| | | teamName:"中空一班", |
| | | finishedNumber: '11', |
| | | wornNumber: '1', |
| | | responsibilityProcess: '钢化', |
| | | previousProcess:'钢化', |
| | | nextProcess:'包装', |
| | | qualityInspector: 'XXX', |
| | | qualityState: '1', |
| | | notes: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312070003', |
| | | reportingWorkTime: '2023-12-01 08:01:22', |
| | | processCard: 'NG231207A01', |
| | | entryName: '信合春天里', |
| | | customerName: 'XXXX', |
| | | thisProcess: '中空', |
| | | teamName:"中空一班", |
| | | finishedNumber: '11', |
| | | wornNumber: '1', |
| | | responsibilityProcess: '钢化', |
| | | previousProcess:'钢化', |
| | | nextProcess:'包装', |
| | | qualityInspector: 'XXX', |
| | | qualityState: '1', |
| | | notes: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | { |
| | | reportingWorkNo: 'BG2312070004', |
| | | reportingWorkTime: '2023-12-01 08:01:22', |
| | | processCard: 'NG231207A01', |
| | | entryName: '信合春天里', |
| | | customerName: 'XXXX', |
| | | thisProcess: '中空', |
| | | teamName:"中空一班", |
| | | finishedNumber: '11', |
| | | wornNumber: '1', |
| | | responsibilityProcess: '钢化', |
| | | previousProcess:'钢化', |
| | | nextProcess:'包装', |
| | | qualityInspector: 'XXX', |
| | | qualityState: '1', |
| | | notes: '1)按企标2)每片玻璃标签贴室外面。内片玻璃打“3C商标”,统一打在玻璃“宽度”方向右下角4)按批次单独落架。', |
| | | }, |
| | | |
| | | ],//table body实际数据 |
| | | //脚部求和 |
| | | footerMethod ({ columns, data }) {//页脚函数 |
| | | let footList=['finishedNumber','wornNumber'] |
| | | let footList=['',''] |
| | | return[ |
| | | columns.map((column, columnIndex) => { |
| | | if (columnIndex === 0) { |
| | |
| | | |
| | | <template> |
| | | <div class="main-div-customer"> |
| | | <div style="width: 600px"> |
| | | <div id="selectForm"> |
| | | <el-row :gutter="0"> |
| | | <!-- <el-input placeholder="流程卡号" v-model="form.name" style="width: 200px"/>--> |
| | | <!-- --> |
| | | <!-- <select class="processesSt">--> |
| | | <!-- <option value="未审核">未审核</option>--> |
| | | <!-- <option value="已审核">已审核</option>--> |
| | | <!-- </select>--> |
| | | |
| | | <el-date-picker |
| | | v-model="value" |
| | | v-model="form.date1" |
| | | type="daterange" |
| | | start-placeholder="开始时间" |
| | | end-placeholder="结束时间" |
| | | format="YYYY/MM/DD" |
| | | value-format="YYYY-MM-DD" |
| | | :start-placeholder="$t('basicData.startDate')" |
| | | :end-placeholder="$t('basicData.endDate')" |
| | | :default-time="defaultTime" |
| | | |
| | | /> |
| | | |
| | | <el-button type="primary">查询</el-button> |
| | | <el-select :default-first-option="true" ref="getSelect" style="width: 100px" v-model="optionVal" class="m-2" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | |
| | | <el-input v-model="form.processId" clearable placeholder="流程卡号" style="width: 130px"></el-input> |
| | | |
| | | <el-button |
| | | @click="getWorkOrder" |
| | | id="select" |
| | | type="primary" :icon="Search">{{$t('basicData.search')}} |
| | | |
| | | </el-button> |
| | | </el-row> |
| | | |
| | | </div> |
| | | <vxe-grid |
| | | max-height="100%" |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined "> |
| | | <span style="font-weight: bold">{{ item.title + ': ' }}</span> |
| | | <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span> |
| | | <span v-else>{{ row[item.field] }}</span> |
| | | |
| | | </li> |
| | | </ul> |
| | | </template> |
| | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button> |
| | | <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button> |
| | | <el-button v-if="row.damageDetails.qualityInsStatus===1" @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button> |
| | | <el-button v-else disabled @click="getTableRow(row,'setType')" link type="primary" size="small">审核</el-button> |
| | | </template> |
| | | |
| | | <template #num1_filter="{ column, $panel }"> |
| | |
| | | </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> |
| | |
| | | width: 99%; |
| | | height: 100%; |
| | | } |
| | | #selectForm { |
| | | width: 60%; |
| | | text-align: center; |
| | | } |
| | | </style> |
| | |
| | | switch (type) { |
| | | case 'edit' :{ |
| | | //alert('我接收到子组件传送的编辑信息') |
| | | // router.push({path: '/main/reportingWorks/AddReportingWork', query: { id: row.id }}) |
| | | router.push({path: '/main/reportingWorks/AddReportingWork', query: { reportingWorkId: row.reportingWorkId }}) |
| | | break |
| | | } |
| | | case 'delete':{ |
| | |
| | | request.post(`/reportingWork/selectReportingWork/1/${total.pageSize}/${startTime}/${endTime}/${inputVal}`, filterData.value).then((res) => { |
| | | |
| | | if (res.code == 200) { |
| | | console.log(res.data.data); |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal= res.data.total.pageTotal |
| | | pageTotal.value = res.data.total |
| | |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | //筛选时查询 |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | |
| | | } else { |
| | | filterData.value[column.property] = value |
| | | } |
| | | |
| | | |
| | | request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => { |
| | | if (res.code == 200) { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | function padLeftZero(str) { |
| | | return ('00' + str).substr(str.length) |
| | | } |
| | | |
| | | //定义时间 |
| | | const form = reactive({ |
| | | date1: '', |
| | |
| | | $panel.changeOption(event, !!option.data, option) |
| | | } |
| | | |
| | | //筛选时查询 |
| | | function filterChanged(column) { |
| | | gridOptions.loading = true |
| | | //筛选条件发生变化条件发生变化 |
| | |
| | | } |
| | | |
| | | //子组件接收参数 |
| | | |
| | | const xGrid = ref() |
| | | const gridOptions = reactive({ |
| | | loading: true, |
| | |
| | | reviewOrder(0) |
| | | break |
| | | } |
| | | case 'cancelOrder':{ |
| | | cancelOrder() |
| | | break |
| | | } |
| | | case 'saveOrder': { |
| | | if ($grid.getTableData().tableData.length === 0){ |
| | | ElMessage.error( t('order.msg.tableLengthNot')) |
| | |
| | | } |
| | | |
| | | //按钮审核过后变为反审 |
| | | if(res.data.order.orderReview === 2){ |
| | | if(Math.abs(res.data.order.orderReview) === 2){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = false |
| | | gridOptions.toolbarConfig.buttons[2].code='reviews' |
| | | gridOptions.toolbarConfig.buttons[2].name=t('basicData.cancelReview') |
| | | gridOptions.toolbarConfig.buttons[3].disabled = false |
| | | const button = {'code': 'cancelOrder', |
| | | status: 'primary', |
| | | 'name': (res.data.order.orderReview>0?t('basicData.cancel'):t('basicData.restore'))} |
| | | gridOptions.toolbarConfig.buttons.push(button) |
| | | } |
| | | if(res.data.order.productionOrder !==0 ){ |
| | | gridOptions.toolbarConfig.buttons[2].disabled = true |
| | | |
| | | } |
| | | |
| | | //加载副表数据 |
| | |
| | | }) |
| | | }) |
| | | |
| | | const cancelOrder = () => { |
| | | request.post(`/order/cancelOrder/${titleUploadData.value.orderId}`).then((res) =>{ |
| | | if (res.code== 200){ |
| | | ElMessage.success(t('order.msg.updateOrderState')) |
| | | router.push({path:'/main/order/createOrder',query:{orderId:titleUploadData.value.orderId,random:Math.random()}}) |
| | | }else{ |
| | | ElMessage.error(res.msg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | |
| | | //页面第一次加载执行 |
| | | request.get(`/basicData/orderBasicData`).then((res) => { |
| | | |
| | |
| | | <script setup> |
| | | import {Search} from "@element-plus/icons-vue" |
| | | import {useRouter} from "vue-router" |
| | | import {reactive, ref} from "vue" |
| | | import {computed, reactive, ref} from "vue" |
| | | import ProcessCardProgress from '@/views/pp/report/ProcessCardProgress.vue' |
| | | import request from "@/utils/request"; |
| | | import deepClone from "@/utils/deepClone" |
| | |
| | | } |
| | | request.post(`/order/getOrderList/1/${total.pageSize}/${orderType.value}/${selectDate.value}`,filterData.value).then((res) => { |
| | | if(res.code==200){ |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal=parseInt(res.data.total) |
| | | pageNum.value=1 |
| | | orderList.value = deepClone(res.data.data) |
| | |
| | | request.post(`/order/getOrderList/${pageNum.value}/${total.pageSize}/${orderType.value}/${selectDate.value}` |
| | | ,filterData).then((res) => { |
| | | if(res.code==200){ |
| | | //total.pageTotal = res.data.total.pageTotal |
| | | total.dataTotal = res.data.total.total*1 |
| | | total.pageTotal = res.data.total.pageTotal |
| | | selectDate.value=res.data.selectDate |
| | | orderList.value = deepClone(res.data.data) |
| | | xGrid.value.loadData(orderList.value) |
| | | console.log(xGrid.value.getTableData().fullData) |
| | | }else{ |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | const showCheckbox = computed(()=>(item)=>{ //计算属性传递参数 |
| | | return 2 === item |
| | | }) |
| | | |
| | | |
| | | </script> |
| | | |
| | |
| | | <!-- 下拉显示所有信息插槽--> |
| | | <template #content="{ row }"> |
| | | <ul class="expand-wrapper"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!=undefined && index>9"> |
| | | <li v-for="(item,index) in gridOptions.columns" v-show="item.field!==undefined && index>9"> |
| | | <span style="font-weight: bold">{{item.title+': '}}</span> |
| | | <span>{{ row[item.field] }}</span> |
| | | </li> |
| | |
| | | </template> |
| | | |
| | | <template #state="{ row,column}"> |
| | | <el-checkbox @click.native.prevent :indeterminate="row[column.field]===1" :checked="row[column.field]===2"/> |
| | | <el-checkbox |
| | | v-if="row[column.field] === 2" |
| | | @click.native.prevent |
| | | :indeterminate="row[column.field]===1" |
| | | :checked="true"/> |
| | | <el-checkbox |
| | | v-else |
| | | @click.native.prevent |
| | | :indeterminate="row[column.field]===1" |
| | | :checked="false"/> |
| | | </template> |
| | | |
| | | <!--左边固定显示的插槽--> |
| | | <template #button_slot="{ row }"> |
| | | <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('basicData.edit') }}</el-button> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('basicData.deleteConfirm')"> |
| | | <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')"> |
| | | <template #reference> |
| | | <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button> |
| | | </template> |
| | |
| | | {field: 'process',width:120, title: t('craft.process'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'icon',width:120, title: t('order.icon'),editRender: { name: 'input'},filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderDetail.processingNote',width:120, title: t('order.processingNote'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderDetail.remarks',width:120, title: t('order.remarks'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderDetail.remarks',width:120, title: t('basicData.remarks'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged}, |
| | | {field: 'orderDetail.edgingType',width:120, title: t('order.edgingType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true,filterMethod:filterChanged} |
| | | ],//表头按钮 |
| | | mergeCells: [ |
| | | /*{ row: 0, col: 1, rowspan: 4, colspan: 1 }, |
| | | { row: 0, col: 2, rowspan: 4, colspan: 1 }, |
| | | { row: 0, col: 4, rowspan: 4, colspan: 1 }, |
| | | { row: 0, col: 5, rowspan: 4, colspan: 1 }, |
| | | { row: 0, col: 6, rowspan: 4, colspan: 1 }, |
| | | { row: 0, col: 7, rowspan: 4, colspan: 1 }, |
| | | { row: 0, col: 8, rowspan: 4, colspan: 1 },*/ |
| | | // { row: 0, col: 1, rowspan: 4, colspan: 1 }, |
| | | // { row: 0, col: 2, rowspan: 4, colspan: 1 }, |
| | | // { row: 0, col: 4, rowspan: 4, colspan: 1 }, |
| | | // { row: 0, col: 5, rowspan: 4, colspan: 1 }, |
| | | // { row: 0, col: 6, rowspan: 4, colspan: 1 }, |
| | | // { row: 0, col: 7, rowspan: 4, colspan: 1 }, |
| | | // { row: 0, col: 8, rowspan: 4, colspan: 1 }, |
| | | ], |
| | | toolbarConfig: { |
| | | buttons: [ |
| | |
| | | this.reportingWorkService = reportingWorkService; |
| | | } |
| | | |
| | | |
| | | @ApiOperation("报工新增查询") |
| | | @PostMapping ("/addSelectLastWork/{processIdStr}/{technologyStr}/{process}") |
| | | public Result AddSelectLastWork( |
| | | @PathVariable String processIdStr, |
| | |
| | | @PathVariable String process) { |
| | | return Result.seccess(reportingWorkService.AddSelectLastWorkSv(processIdStr,technologyStr,process)); |
| | | } |
| | | @ApiOperation("查询工序") |
| | | @PostMapping ("/selectProcess") |
| | | public Result SelectProcess() { |
| | | return Result.seccess(reportingWorkService.SelectProcessSv()); |
| | |
| | | return Result.seccess(reportingWorkService.selectUpdateReportingWorkSv(reportingWorkId)); |
| | | } |
| | | @ApiOperation("报工修改") |
| | | @PostMapping ("/updateReportingWork") |
| | | public Result updateReportingWork(@RequestBody Map<String,Object> reportingWork) { |
| | | return Result.seccess(reportingWorkService.updateReportingWork(reportingWork)); |
| | | @PostMapping ("/updateReportingWork/{reviewState}") |
| | | public Result updateReportingWork(@PathVariable String reviewState,@RequestBody Map<String,Object> reportingWork) { |
| | | return Result.seccess(reportingWorkService.updateReportingWork(reportingWork,reviewState)); |
| | | } |
| | | |
| | | @ApiOperation("报工查询接口") |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("质检审核查询接口") |
| | | @PostMapping ("/selectQualityTesting/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{state}/{processId}") |
| | | public Result selectQualityTesting( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable Integer state, |
| | | @PathVariable String processId, |
| | | @RequestBody ReportingWork reportingWork){ |
| | | return Result.seccess(reportingWorkService.selectQualityTestingSv(pageNum,pageSize,selectTime1,selectTime2,state,processId,reportingWork)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("质检审核审核") |
| | | @PostMapping ("/updateQualityStatus/{reportingWorkId}/{username}") |
| | | public Result updateQualityStatus(@PathVariable String reportingWorkId,@PathVariable String username) { |
| | | if(reportingWorkService.updateQualityStatusSv(reportingWorkId,username)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"审核失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("质检审核明细查询接口") |
| | | @PostMapping ("/detailsQuality/{reportingWorkId}/{processId}/{thisProcess}") |
| | | public Result detailsQuality( |
| | | @PathVariable String reportingWorkId, |
| | | @PathVariable String processId, |
| | | @PathVariable String thisProcess, |
| | | @RequestBody ReportingWork reportingWork){ |
| | | return Result.seccess(reportingWorkService.detailsQualitySv(reportingWorkId,processId,thisProcess,reportingWork)); |
| | | |
| | | } |
| | | } |
| | |
| | | public Result deleteOrder(@PathVariable String id) { |
| | | return Result.seccess(orderService.deleteOrder(id)); |
| | | } |
| | | |
| | | @ApiOperation("订单作废") |
| | | @PostMapping("/cancelOrder/{id}") |
| | | public Result cancelOrder(@PathVariable String id) { |
| | | return Result.seccess(orderService.cancelOrder(id)); |
| | | } |
| | | |
| | | @ApiOperation("根据id获取订单信息") |
| | | @PostMapping("/getOrderById/{id}") |
| | | public Result getOrderById(@PathVariable String id) { |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.example.erp.entity.sd.DeliveryDetail; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime reportingWorkTime; |
| | | //审核时间 |
| | | private LocalDate examineTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime examineTime; |
| | | //质检时间 |
| | | private LocalDate qualityInsTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime qualityInsTime; |
| | | //建立时间 |
| | | private LocalDate createTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime createTime; |
| | | //修改时间 |
| | | private LocalDate updateTime; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime updateTime; |
| | | |
| | | //创建者 |
| | | private String creatorId ; |
| | |
| | | @TableField(select = false,exist= false) |
| | | private OrderGlassDetail orderGlassDetail; |
| | | |
| | | @TableField(select = false,exist= false) |
| | | private DamageDetails damageDetails; |
| | | |
| | | @TableField(select = false,exist= false) |
| | | private OrderDetail orderDetail ; |
| | | |
| | | |
| | | //定义的完工面积 |
| | | @TableField(select = false,exist= false) |
| | |
| | | Boolean updateInventoryQuantity(String processId, Object orderNumber, Object technologyNumber, Object completedQuantity); |
| | | |
| | | List<ReportingWork> selectReportingWorkMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, String orderId, ReportingWork reportingWork); |
| | | |
| | | List<ReportingWork> selectQualityTestingMp(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, Integer state, String processId, ReportingWork reportingWork); |
| | | |
| | | Map<String, Integer> getQualityPageTotal(Integer offset, Integer pageSize, Date selectTime1, Date selectTime2, Integer state, String processId, ReportingWork reportingWork); |
| | | |
| | | Boolean updateQualityStatusMp(String reportingWorkId,String username); |
| | | |
| | | List<Map<String,String>> detailsQualityMp(String reportingWorkId, ReportingWork reportingWork); |
| | | } |
| | |
| | | boolean reviewProcessById(String id, Integer status); |
| | | |
| | | boolean updateMoney(@Param("order") Order order); |
| | | |
| | | Integer cancelOrder(String id); |
| | | } |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | |
| | | OrderProcessDetailMapper orderProcessDetailMapper; |
| | | final |
| | | ReportingWorkDetailMapper |
| | | reportingWorkDetailMapper; |
| | | reportingWorkDetailMapper; |
| | | final OrderMapper |
| | | orderMapper; |
| | | orderMapper; |
| | | |
| | | final |
| | | FlowCardMapper flowCardMapper; |
| | | |
| | | final |
| | | OrderProcessDetailService orderProcessDetailService; |
| | | |
| | | |
| | | |
| | | public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService, OrderMapper orderMapper, FlowCardMapper flowCardMapper) { |
| | |
| | | //查询流程卡工艺流程 |
| | | String technologicalProcess = reportingWorkMapper.SelectTechnologicalProcess(processIdStr); |
| | | |
| | | //定义-的位置 |
| | | int index = technologicalProcess.indexOf("-"); |
| | | //获取工艺流程第一个工序 |
| | | String interceptProcess = technologicalProcess.substring(0, index); |
| | |
| | | } else { |
| | | nextProcess = processList[i + 1]; |
| | | } |
| | | //System.out.println("当前工序:" + process + " 上一道工序:" + previousProcess + " 下一道工序:" + nextProcess); |
| | | //查询当前工序的表头数据 |
| | | //System.out.println(reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process)); |
| | | map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr,previousProcess,nextProcess,process)); |
| | | map.put("data", reportingWorkMapper.AddSelectLastWorkMp(processIdStr, technologyStr, previousProcess, nextProcess, process)); |
| | | map.put("thisProcess", processList); |
| | | break; |
| | | } |
| | |
| | | //班组下拉框 |
| | | map.put("teams", reportingWorkMapper.SelectWorkBasicTeamsMp(process)); |
| | | |
| | | map.put("breakageType",reportingWorkMapper.selectBasicNameByType("breakagetype")); |
| | | map.put("breakageReason",reportingWorkMapper.selectBasicNameByType("breakagereason")); |
| | | map.put("breakageType", reportingWorkMapper.selectBasicNameByType("breakagetype")); |
| | | map.put("breakageReason", reportingWorkMapper.selectBasicNameByType("breakagereason")); |
| | | |
| | | //查询本工序报工需要哪几层,上工序是什么 |
| | | String obtainTechnology = reportingWorkMapper.SelectWorkTechnologyMp(processIdStr); |
| | | String obtainTechnology = reportingWorkMapper.SelectWorkTechnologyMp(processIdStr); |
| | | |
| | | //判断本工序是不是第一道工序 |
| | | if (interceptProcess.equals(process)) { |
| | | //是第一道工序,查询流程卡数据 |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr,technologyStr,process)); |
| | | } |
| | | else { |
| | | map.put("Detail", reportingWorkMapper.SelectTechnologicalNumMp(processIdStr, technologyStr, process)); |
| | | } else { |
| | | //不是第一道工序,查询报工数据 |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr,technologyStr,process)); |
| | | map.put("Detail", reportingWorkMapper.SelectReworlDetailMp(processIdStr, technologyStr, process)); |
| | | } |
| | | |
| | | // 第一道工序(流程卡数+补片数量-完工数-次破数-返工未完成数-禁用数量) |
| | |
| | | // 后续工序(上工序报工数-完工数-次破数-返工未完成数) |
| | | |
| | | //获取该流程卡号历史报工工序 |
| | | String historyProcess =reportingWorkMapper.historyProcessMp(processIdStr); |
| | | String historyProcess = reportingWorkMapper.historyProcessMp(processIdStr); |
| | | //历史报工工序设备 |
| | | map.put("historyDevice",reportingWorkMapper.historyDeviceMp(historyProcess,process)); |
| | | map.put("historyDevice", reportingWorkMapper.historyDeviceMp(historyProcess, process)); |
| | | //历史报工工序班组 |
| | | map.put("historyTeams",reportingWorkMapper.historyTeamsMp(processIdStr,process)); |
| | | map.put("historyTeams", reportingWorkMapper.historyTeamsMp(processIdStr, process)); |
| | | //历史工序 |
| | | map.put("historyProcess",reportingWorkMapper.SelectHistoryProcessMp(historyProcess,process)); |
| | | |
| | | |
| | | |
| | | map.put("historyProcess", reportingWorkMapper.SelectHistoryProcessMp(historyProcess, process)); |
| | | return map; |
| | | } |
| | | |
| | | //查询工序 |
| | | public Map<String, Object> SelectProcessSv() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("process", reportingWorkMapper.SelectProcessMp()); |
| | |
| | | ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class); |
| | | List<ReportingWorkDetail> reportingWorkDetails = JSONArray.parseArray(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class); |
| | | //获取当前最大报工单号生成报工单号 |
| | | String formattedNumber = String.format("%04d", reportingWorkMapper.selectMaxReportingWorkId()+1); |
| | | String formattedNumber = String.format("%04d", reportingWorkMapper.selectMaxReportingWorkId() + 1); |
| | | //格式化当前日期 |
| | | Date currentDate = new Date(); |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd"); |
| | | String formattedDate = dateFormat.format(currentDate); |
| | | String reportingWorkId = "BG"+formattedDate+formattedNumber; |
| | | String reportingWorkId = "BG" + formattedDate + formattedNumber; |
| | | reportingWork.setReportingWorkId(reportingWorkId); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0,13)); |
| | | reportingWork.setProcessId(reportingWork.getProcessId().substring(0, 14)); |
| | | |
| | | int reviewState = (int) reportingWorkJson.get("type"); |
| | | if(reviewState==1){ |
| | | if (reviewState == 1) { |
| | | reportingWork.setReviewed(reportingWork.getCreator()); |
| | | reportingWork.setReviewedState(1); |
| | | }else{ |
| | | } else { |
| | | reportingWork.setReviewedState(0); |
| | | } |
| | | //主表插入 |
| | |
| | | reportingWorkDetail.setReportingWorkId(reportingWorkId); |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //次破明细表插入数据 |
| | | if(damageDetails!=null && !damageDetails.isEmpty()){ |
| | | damageDetails.forEach(damageDetail ->{ |
| | | if (damageDetails != null && !damageDetails.isEmpty()) { |
| | | damageDetails.forEach(damageDetail -> { |
| | | damageDetail.setReportingWorkId(reportingWorkId); |
| | | damageDetail.setOrderNumber(reportingWorkDetail.getOrderNumber()); |
| | | damageDetail.setProcessId(reportingWork.getProcessId()); |
| | | damageDetail.setTechnologyNumber(reportingWorkDetail.getTechnologyNumber()); |
| | | if(damageDetail.getResponsibleProcess()!=reportingWork.getThisProcess()){ |
| | | if (damageDetail.getResponsibleProcess() != reportingWork.getThisProcess()) { |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | damageDetailsMapper.insert(damageDetail); |
| | |
| | | reportingWork.getProcessId(), |
| | | reportingWork.getThisProcess() |
| | | ); |
| | | }else{ |
| | | } else { |
| | | processNum = reportingWorkMapper.selectGlassProcessNum( |
| | | reportingWorkDetail.getOrderNumber(), |
| | | reportingWorkDetail.getTechnologyNumber(), |
| | |
| | | |
| | | |
| | | //判断是否大于当前数量并且抛出异常 |
| | | if(processNum<(reportingWorkDetail.getBreakageQuantity()+reportingWorkDetail.getCompletedQuantity())){ |
| | | 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()); |
| | | if (processNum < (reportingWorkDetail.getBreakageQuantity() + reportingWorkDetail.getCompletedQuantity())) { |
| | | 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); |
| | | throw new ServiceException(Constants.Code_600, msg); |
| | | } |
| | | |
| | | OrderProcessDetail orderProcessDetail = new OrderProcessDetail(); |
| | |
| | | //根据订单id,订单序号,以及小片序号 更新小片流程的完工数量以及刺破数量 |
| | | LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber()) |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0,13)) |
| | | .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0, 14)) |
| | | .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 =reporting_work_num +"+orderProcessDetail.getReportingWorkNum()) |
| | | .setSql("broken_num =broken_num +"+orderProcessDetail.getBrokenNum()); |
| | | orderProcessDetailMapper.update(null,updateWrapper); |
| | | .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); |
| | | |
| | | //判断完工数量和刺破数量是否为0,为0则不插入到数据库 |
| | | if(!(reportingWorkDetail.getCompletedQuantity()==0 && reportingWorkDetail.getBreakageQuantity()==0)){ |
| | | if (!(reportingWorkDetail.getCompletedQuantity() == 0 && reportingWorkDetail.getBreakageQuantity() == 0)) { |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | } |
| | | |
| | | //更新流程卡表的报工数量 |
| | | if(Objects.equals(reportingWork.getNextProcess(), "")){ |
| | | 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); |
| | | .setSql("inventory_quantity = inventory_quantity +" + orderProcessDetail.getReportingWorkNum()); |
| | | flowCardMapper.update(null, flowCardLambdaUpdateWrapper); |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | return true; |
| | | return true; |
| | | } |
| | | |
| | | //下工序审核方法 |
| | | public boolean ReviewReportingWorkSv(Map<String, String> reportingWork) { |
| | | |
| | | String processId = reportingWork.get("processId"); |
| | | 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) |
| | | .eq(ReportingWork::getProcessId, processId.substring(0, 14)) |
| | | .eq(ReportingWork::getThisProcess, reportingWork.get("process")) |
| | | .eq(ReportingWork::getReviewedState, 0) |
| | | .setSql("reviewed_state =1"); |
| | | reportingWorkMapper.update(null,updateWrapper); |
| | | reportingWorkMapper.update(null, updateWrapper); |
| | | |
| | | |
| | | return true; |
| | | return true; |
| | | } |
| | | |
| | | //报工修改查询 |
| | | public Map<String,Object> selectUpdateReportingWorkSv(String reportingWorkId) { |
| | | public Map<String, Object> selectUpdateReportingWorkSv(String reportingWorkId) { |
| | | //查询报工主表信息 |
| | | ReportingWork reportingWork =reportingWorkMapper.selectOne(new LambdaQueryWrapper<ReportingWork>() |
| | | .eq(ReportingWork::getReportingWorkId,reportingWorkId)); |
| | | ReportingWork reportingWork = reportingWorkMapper.selectOne(new LambdaQueryWrapper<ReportingWork>() |
| | | .eq(ReportingWork::getReportingWorkId, reportingWorkId)); |
| | | //根据报工信息查询订单主表信息 |
| | | reportingWork.setOrder( |
| | | orderMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getOrderId,reportingWork.getOrderId()))); |
| | | orderMapper.selectOne(new LambdaQueryWrapper<Order>() |
| | | .eq(Order::getOrderId, reportingWork.getOrderId()))); |
| | | reportingWork.setFlowCard(new FlowCard()); |
| | | |
| | | List<Map<String,Object>> reportingWorkDetails = reportingWorkMapper.selectByReportingWorkId(reportingWorkId,reportingWork.getNextProcess()); |
| | | reportingWorkDetails.forEach(reportingWorkDetail ->{ |
| | | List<DamageDetails> damageDetailsList = new ArrayList<>(); |
| | | List<Map<String, Object>> reportingWorkDetails = reportingWorkMapper.selectByReportingWorkId(reportingWorkId, reportingWork.getNextProcess()); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | List<DamageDetails> damageDetailsList = new ArrayList<>(); |
| | | damageDetailsList = damageDetailsMapper.selectList(new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getReportingWorkId,reportingWorkId) |
| | | .eq(DamageDetails::getOrderNumber,reportingWorkDetail.get("order_number")) |
| | | .eq(DamageDetails::getTechnologyNumber,reportingWorkDetail.get("technology_number")) |
| | | .eq(DamageDetails::getReportingWorkId, reportingWorkId) |
| | | .eq(DamageDetails::getOrderNumber, reportingWorkDetail.get("order_number")) |
| | | .eq(DamageDetails::getTechnologyNumber, reportingWorkDetail.get("technology_number")) |
| | | ); |
| | | reportingWorkDetail.put("damageDetails",damageDetailsList); |
| | | reportingWorkDetail.put("damageDetails", damageDetailsList); |
| | | }); |
| | | |
| | | |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("reportingWork",reportingWork); |
| | | map.put("reportingWorkDetails",reportingWorkDetails); |
| | | map.put("basic",getReportingWorkBase(reportingWork.getProcessId(),reportingWork.getThisProcess())); |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("reportingWork", reportingWork); |
| | | map.put("reportingWorkDetails", reportingWorkDetails); |
| | | map.put("basic", getReportingWorkBase(reportingWork.getProcessId(), reportingWork.getThisProcess())); |
| | | |
| | | |
| | | return map; |
| | | |
| | | } |
| | | |
| | | private Map<String,Object> getReportingWorkBase(String processId, String thisProcess) { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | //报工下拉框数据 |
| | | private Map<String, Object> getReportingWorkBase(String processId, String thisProcess) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //设备下拉框 |
| | | map.put("deviceType", reportingWorkMapper.SelectWorkBasicDeviceMp(thisProcess)); |
| | | //班组下拉框 |
| | | map.put("teamsType", reportingWorkMapper.SelectWorkBasicTeamsMp(thisProcess)); |
| | | |
| | | map.put("breakageType",reportingWorkMapper.selectBasicNameByType("breakagetype")); |
| | | map.put("breakageReason",reportingWorkMapper.selectBasicNameByType("breakagereason")); |
| | | map.put("breakageType", reportingWorkMapper.selectBasicNameByType("breakagetype")); |
| | | map.put("breakageReason", reportingWorkMapper.selectBasicNameByType("breakagereason")); |
| | | |
| | | //获取该流程卡号历史报工工序 |
| | | String historyProcess =reportingWorkMapper.historyProcessMp(processId); |
| | | String historyProcess = reportingWorkMapper.historyProcessMp(processId); |
| | | //历史报工工序设备 |
| | | map.put("historyDevice",reportingWorkMapper.historyDeviceMp(historyProcess,thisProcess)); |
| | | map.put("historyDevice", reportingWorkMapper.historyDeviceMp(historyProcess, thisProcess)); |
| | | //历史报工工序班组 |
| | | map.put("historyTeams",reportingWorkMapper.historyTeamsMp(processId,thisProcess)); |
| | | map.put("historyTeams", reportingWorkMapper.historyTeamsMp(processId, thisProcess)); |
| | | //历史工序 |
| | | map.put("historyProcess",reportingWorkMapper.SelectHistoryProcessMp(historyProcess,thisProcess)); |
| | | map.put("historyProcess", reportingWorkMapper.SelectHistoryProcessMp(historyProcess, thisProcess)); |
| | | |
| | | return map; |
| | | } |
| | |
| | | |
| | | @Transactional |
| | | //报工修改 |
| | | public Boolean updateReportingWork(Map<String, Object> reportingWorkMap) { |
| | | public Boolean updateReportingWork(Map<String, Object> reportingWorkMap, String reviewState) { |
| | | //接收解析主附表信息 |
| | | JSONObject reportingWorkJson = new JSONObject(reportingWorkMap); |
| | | ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class); |
| | |
| | | //删除刺破明细表刺破数据 |
| | | damageDetailsMapper.delete( |
| | | new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getReportingWorkId,reportingWork.getReportingWorkId()) |
| | | .eq(DamageDetails::getReportingWorkId, reportingWork.getReportingWorkId()) |
| | | ); |
| | | //修改小片流程表数量 |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(),reportingWork.getThisProcess(),"delete"); |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "delete"); |
| | | //删除报工明细表数据 |
| | | reportingWorkDetailMapper |
| | | .delete(new LambdaQueryWrapper<ReportingWorkDetail>() |
| | | .eq(ReportingWorkDetail::getReportingWorkId,reportingWork.getReportingWorkId())); |
| | | .eq(ReportingWorkDetail::getReportingWorkId, reportingWork.getReportingWorkId())); |
| | | |
| | | //更细报工主表 |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | reportingWorkDetails.forEach(reportingWorkDetail->{ |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | reportingWorkDetails.forEach(reportingWorkDetail -> { |
| | | List<DamageDetails> damageDetails = reportingWorkDetail.getDamageDetails(); |
| | | //每一条报工数据循环插入次破明细表 |
| | | if(damageDetails!=null && !damageDetails.isEmpty()){ |
| | | damageDetails.forEach(damageDetail->{ |
| | | if(!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess())){ |
| | | if (damageDetails != null && !damageDetails.isEmpty()) { |
| | | damageDetails.forEach(damageDetail -> { |
| | | if (!Objects.equals(reportingWork.getThisProcess(), damageDetail.getResponsibleProcess())) { |
| | | damageDetail.setQualityInsStatus(1); |
| | | } |
| | | if (Objects.equals(reviewState, "review")) { |
| | | damageDetail.setQualityInsStatus(2); |
| | | } |
| | | |
| | | damageDetailsMapper.insert(damageDetail); |
| | | }); |
| | | } |
| | | //插入报工数据 |
| | | reportingWorkDetailMapper.insert(reportingWorkDetail); |
| | | }); |
| | | //获取质检时间 |
| | | if (Objects.equals(reviewState, "review")) { |
| | | LocalDateTime |
| | | currentDate = LocalDateTime.now(); |
| | | reportingWork.setQualityInsTime(currentDate); |
| | | reportingWorkMapper.updateById(reportingWork); |
| | | } |
| | | |
| | | //修改小片流程表数量为报工明细表数量 |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(),reportingWork.getThisProcess(),"add"); |
| | | return true; |
| | | orderProcessDetailMapper.updateQuantity(reportingWork.getReportingWorkId(), reportingWork.getThisProcess(), "add"); |
| | | return true; |
| | | } |
| | | |
| | | //报工管理查询 |
| | | public Map<String, Object> selectReportingWorkSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, String orderId, ReportingWork reportingWork) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportingWorkMapper.selectReportingWorkMp(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork)); |
| | | map.put("total", reportingWorkMapper.getPageTotal(offset, pageSize, selectTime1, selectTime2, orderId, reportingWork)); |
| | | //System.out.println(map.get("data")); |
| | | return map; |
| | | } |
| | | |
| | | //删除报工 |
| | | public Boolean deleteWorkSv(String reportingWorkId, String processId, String thisProcess) { |
| | | if (!reportingWorkId.isEmpty() && !processId.isEmpty() && !thisProcess.isEmpty()) { |
| | | //获取当前报工编号下工序 |
| | |
| | | if (lastProcess.equals(thisProcess)) {//是入库工序 |
| | | //查询该流程卡数量、可入库数量、已入库数量 |
| | | Map<String, Object> list = reportingWorkMapper.selectReceiptQuantity(processId); |
| | | // System.out.println(list.get("quantity")+"--"+list.get("inventoryQuantity")+"---"+list.get("receivedQuantity")); |
| | | if (list.get("quantity") == list.get("receiptQuantity")) { |
| | | return false; |
| | | } else { |
| | |
| | | //查询该报工编号本工序完工数量 |
| | | Integer completedQuantity = reportingWorkMapper.selectCompletedQuantity(reportingWorkId); |
| | | //当该工序完工数量小于等于已入库数量时 |
| | | //System.out.println("inventoryQuantity:" + inventoryQuantity +"completedQuantity:" + completedQuantity + "---receiptQuantity:" + receiptQuantity); |
| | | //可入库数量-已入库数量>=报工编号本工序完工数量 |
| | | if (inventoryQuantity - receiptQuantity >= completedQuantity) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | |
| | | //更新流程卡可入库数量 |
| | | reportingWorkMapper.updateInventoryQuantity(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity")); |
| | | //更新报工流程表数据 |
| | |
| | | } |
| | | } |
| | | |
| | | } else {//不是入库工序 |
| | | if (count == 0) { |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList = reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId, item.get("order_number"), item.get("technology_number"), item.get("completed_quantity"), item.get("breakage_quantity"), thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | else{//不是入库工序 |
| | | if (count==0){ |
| | | //查询当前报工编号完工次破数量的数据 |
| | | List<Map<String, Object>> workDateList=reportingWorkMapper.reportingWorkDate(reportingWorkId); |
| | | for (Map<String, Object> item : workDateList) { |
| | | //更新报工流程表数据 |
| | | reportingWorkMapper.updateWorkProcess(processId,item.get("order_number"),item.get("technology_number"),item.get("completed_quantity"),item.get("breakage_quantity"),thisProcess); |
| | | } |
| | | //删除报工,将审核状态改为-1 |
| | | reportingWorkMapper.deleteWork(reportingWorkId); |
| | | return true; |
| | | } |
| | | else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //查询质检审核 |
| | | public Map<String, Object> selectQualityTestingSv(Integer pageNum, Integer pageSize, java.sql.Date selectTime1, java.sql.Date selectTime2, Integer state, String processId, ReportingWork reportingWork) { |
| | | Integer offset = (pageNum - 1) * pageSize; |
| | | if (processId.equals("null")) { |
| | | processId = ""; |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportingWorkMapper.selectQualityTestingMp(offset, pageSize, selectTime1, selectTime2, state, processId, reportingWork)); |
| | | map.put("total", reportingWorkMapper.getQualityPageTotal(offset, pageSize, selectTime1, selectTime2, state, processId, reportingWork)); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | //修改质检审核状态 |
| | | public Boolean updateQualityStatusSv(String reportingWorkId, String username) { |
| | | if (!reportingWorkId.isEmpty()) { |
| | | reportingWorkMapper.updateQualityStatusMp(reportingWorkId, username); |
| | | return true; |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //查询质检明细(未使用) |
| | | public Map<String, Object> detailsQualitySv(String reportingWorkId, String processId, String thisProcess, ReportingWork reportingWork) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("data", reportingWorkMapper.detailsQualityMp(reportingWorkId, reportingWork)); |
| | | map.put("basic", getReportingWorkBase(processId, thisProcess)); |
| | | |
| | | return map; |
| | | } |
| | | } |
| | |
| | | @Autowired |
| | | WorkOrderMapper workOrderMapper; |
| | | |
| | | //查询工单 |
| | | public Map<String, Object> defaultDateWork(Date selectTime1, Date selectTime2, Integer state, OrderGlassDetail orderGlassDetail) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | // System.out.println(workOrderMapper.selectWordOrder( selectTime1,selectTime2,state, orderGlassDetail)); |
| | |
| | | return map; |
| | | } |
| | | |
| | | //转生产订单查询 |
| | | 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) { |
| | | String userName = ""; |
| | | if (object.get("userName") != null) { |
| | | userName = object.get("userName").toString(); |
| | | } |
| | | |
| | | //定义生产订单号生成需要的条件 |
| | | char lettr = 'A'; |
| | | char letters = '1'; |
| | | int count = 25; |
| | | String productIdVl = ""; |
| | | |
| | | |
| | | //将接收到的信息解析成list |
| | | List<OrderDetail> orderDetaillist = JSONArray.parseArray(JSONObject.toJSONString(object.get("orderdetail")), OrderDetail.class); |
| | | String orderID = orderDetaillist.get(0).getOrderId(); |
| | | |
| | | if (!orderDetaillist.isEmpty()) { |
| | | for (OrderDetail orderDetail : orderDetaillist) { |
| | | //生成生产订单号 |
| | | |
| | | for (int i = 0; i < count; i++) { |
| | | letters = lettr++; |
| | | productIdVl = orderID + letters; |
| | | //查询生成的生产订单号是否存在 |
| | | |
| | | Integer workCount = workOrderMapper.selectOrderNumber(productIdVl); |
| | | if (workCount < 1 ) { |
| | | if (workCount < 1) { |
| | | break; |
| | | } |
| | | |
| | | } |
| | | |
| | | //添加生产订单 |
| | | workOrderMapper.addOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName); |
| | | Integer State = 2; |
| | |
| | | workOrderMapper.updateWorkType(orderDetail.getOrderId(), States); |
| | | } |
| | | } |
| | | |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | |
| | | } |
| | | |
| | | //删除生产订单 |
| | | public Boolean deleteOrderWorkSv(String orderId, String productName) { |
| | | if (!orderId.isEmpty() && !productName.isEmpty()) { |
| | | //删除订单小片表生产订单号 |
| | | workOrderMapper.deleteOrderWorkMp(orderId, productName); |
| | | Integer State = 0; |
| | | Integer States = 1; |
| | | //查询该订单未转生产订单的条数 |
| | | Integer NoWorkCount = workOrderMapper.selectWorkCount(orderId); |
| | | //查询该订单转生产订单的条数 |
| | | Integer YesWorkCount = workOrderMapper.selectYesWorkCount(orderId); |
| | | if (NoWorkCount ==YesWorkCount) { |
| | | if (NoWorkCount == YesWorkCount) { |
| | | workOrderMapper.updateWorkType(orderId, State); |
| | | } else { |
| | | workOrderMapper.updateWorkType(orderId, States); |
| | |
| | | } |
| | | |
| | | |
| | | public Integer cancelOrder(String id) { |
| | | return orderMapper.cancelOrder(id); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | <result property="processId" column="process_id"/> |
| | | <result property="completedArea" column="completedArea"/> |
| | | <result property="wornArea" column="wornArea"/> |
| | | <result property="qualityInspector" column="quality_inspector"/> |
| | | <result property="qualityInsTime" column="quality_ins_time"/> |
| | | |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | |
| | | <result property="project" column="project"/> |
| | | <result property="batch" column="batch"/> |
| | | </association> |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result property="shape" column="shape"/> |
| | | </association> |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="productionId" column="production_id"/> |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | | <result property="orderNumber" column="order_number"/> |
| | | <result property="technologyNumber" column="technology_number"/> |
| | | </association> |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result property="area" column="area"/> |
| | | <result property="glassChild" column="glass_child"/> |
| | | <result property="glassAddress" column="glass_address"/> |
| | | <result property="childWidth" column="child_width"/> |
| | | <result property="childHeight" column="child_height"/> |
| | | </association> |
| | | <association property="damageDetails" javaType="com.example.erp.entity.pp.DamageDetails"> |
| | | <result property="qualityInsStatus" column="quality_ins_status"/> |
| | | <result property="breakageQuantity" column="breakage_quantity"/> |
| | | <result property="available" column="available"/> |
| | | <result property="returnProcess" column="return_process"/> |
| | | <result property="breakageType" column="breakage_type"/> |
| | | <result property="breakageReason" column="breakage_reason"/> |
| | | <result property="responsibleEquipment" column="responsible_equipment"/> |
| | | <result property="responsibleProcess" column="responsible_process"/> |
| | | <result property="responsibleTeam" column="responsible_team"/> |
| | | <result property="responsiblePersonnel" column="responsible_personnel"/> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- 查询当前工序的表头数据--> |
| | | <select id="AddSelectLastWorkMp" resultMap="reportingWorkMap"> |
| | | select o.order_id, |
| | | fc.production_id, |
| | |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | a.process_id=SUBSTR(#{processId} from 1 for 14) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | a.process_id=SUBSTR(#{processId} from 1 for 14) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | |
| | | o.batch, |
| | | rw.this_process, |
| | | rw.this_completed_quantity, |
| | | (ogd.area * rw.this_completed_quantity) as completedArea, |
| | | round(ogd.area * rw.this_completed_quantity,2) as completedArea, |
| | | rw.this_worn_quantity, |
| | | (ogd.area * rw.this_worn_quantity) as wornArea, |
| | | round(ogd.area * rw.this_worn_quantity,2) as wornArea, |
| | | rw.device_name, |
| | | rw.teams_groups_name, |
| | | rw.reviewed_state |
| | |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | </update> |
| | | <!-- 质检审核查询--> |
| | | <select id="selectQualityTestingMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | | rw.reporting_work_time, |
| | | rw.process_id, |
| | | o.project, |
| | | o.customer_name, |
| | | rw.this_process, |
| | | ifnull(rw.this_completed_quantity,0) as this_completed_quantity, |
| | | rw.this_worn_quantity, |
| | | rw.teams_groups_name, |
| | | rw.device_name, |
| | | rw.previous_process, |
| | | rw.next_process, |
| | | rw.quality_inspector, |
| | | rw.quality_ins_time, |
| | | dd.quality_ins_status |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | |
| | | left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processId} in rw.process_id) |
| | | and position(#{state} in dd.quality_ins_status) |
| | | and rw.reviewed_state!=-1 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | | </if> |
| | | <if test="reportingWork.processId != null and reportingWork.processId != ''"> |
| | | and rw.process_id regexp #{reportingWork.processId} |
| | | </if> |
| | | <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> |
| | | and o.project regexp #{reportingWork.order.project} |
| | | </if> |
| | | <if test="reportingWork.order.customerName != null and reportingWork.order.customerName != ''"> |
| | | and o.customer_name regexp #{reportingWork.order.customerName} |
| | | </if> |
| | | GROUP BY rw.reporting_work_id |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getQualityPageTotal" > |
| | | select CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct rw.reporting_work_id) as 'total' |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | |
| | | left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processId} in rw.process_id) |
| | | and position(#{state} in dd.quality_ins_status) |
| | | and rw.reviewed_state!=-1 |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <!-- 修改质检状态--> |
| | | <update id="updateQualityStatusMp"> |
| | | update reporting_work as rw left join damage_details as dd on rw.reporting_work_id = dd.reporting_work_id |
| | | set dd.quality_ins_status = 2, |
| | | rw.quality_inspector=#{username}, |
| | | rw.examine_time=NOW() |
| | | where rw.reporting_work_id = #{reportingWorkId} |
| | | </update> |
| | | |
| | | <!-- 质检明细查询--> |
| | | <select id="detailsQualityMp"> |
| | | select rwd.order_number, |
| | | ogd.glass_child, |
| | | rwd.technology_number, |
| | | ogd.glass_address, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | ifnull(od.shape,'') as shape, |
| | | rwd.completed_quantity, |
| | | dd.breakage_quantity, |
| | | dd.available, |
| | | ifnull(dd.return_process,'') as return_process, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | dd.responsible_equipment, |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | ifnull(dd.responsible_personnel,'') as responsible_personnel |
| | | from sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = od.order_id and ogd.order_number = od.order_number |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | left join reporting_work_detail as rwd |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | left join damage_details as dd |
| | | on dd.reporting_work_id = rw.reporting_work_id and dd.order_number = rwd.order_number and |
| | | dd.technology_number = rwd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_id = #{reportingWorkId} |
| | | and rw.reviewed_state != -1 |
| | | GROUP BY rwd.order_number, ogd.glass_child, rwd.technology_number, dd.id |
| | | ORDER BY rwd.order_number |
| | | </select> |
| | | </mapper> |
| | |
| | | <resultMap id="reworkAdd" type="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <id column="id" property="id"/> |
| | | <result column="rework_team" property="reworkTeam"/> |
| | | <result column="breakage_number" property="breakageNumber"/> |
| | | <result column="breakage_quantity" property="breakageQuantity"/> |
| | | <result column="return_process" property="returnProcess"/> |
| | | <result column="breakage_reason" property="breakageReason"/> |
| | | <result column="responsible_equipment" property="responsibleEquipment"/> |
| | |
| | | pd.glass_sort, |
| | | if(pd.glass_sort=1,'(外)',if(pd2.glass_sort=pd.glass_sort,'(内)','')), |
| | | pd.detail, |
| | | od.width, |
| | | if( od.bend_radius!='', |
| | | round(od.width*(od.bend_radius-round(sum(t.thicknessCount),2))/od.bend_radius,0), |
| | | od.width |
| | | ), |
| | | od.height, |
| | | od.area, |
| | | od.gross_area, |
| | |
| | | on od.product_id = pd.prod_id and pd.detail_type='glass' |
| | | LEFT JOIN (SELECT max(id) as id ,max(glass_sort) as glass_sort from product_detail GROUP BY prod_id)as pd2 |
| | | on pd2.id=pd.id |
| | | left join ( |
| | | select |
| | | a.prod_id, |
| | | a.sort_num, |
| | | a.glass_sort, |
| | | (case |
| | | when a.sort_num=1 |
| | | then left(detail,LOCATE('mm',detail)-1)/2 |
| | | else |
| | | left(detail,LOCATE('mm',detail)-1) |
| | | end) as 'thicknessCount' |
| | | |
| | | from product_detail as a |
| | | group by prod_id,a.sort_num |
| | | ) as t |
| | | ON t.prod_id = od.product_id and t.sort_num <=pd.sort_num |
| | | |
| | | |
| | | where od.order_id = #{orderId} |
| | | group by od.order_number,pd.glass_sort |
| | | ORDER BY od.order_number |
| | | </insert> |
| | | |
| | |
| | | update `order` set money = #{order.money} where order_id = #{order.orderId} |
| | | </update> |
| | | |
| | | <update id="cancelOrder"> |
| | | update `order` as a set |
| | | a.create_order = - a.create_order, |
| | | a.process_review = - a.process_review, |
| | | a.order_review = - a.order_review, |
| | | a.production_order = - a.production_order, |
| | | a.processing_card = - a.processing_card, |
| | | a.warehousing = - a.warehousing, |
| | | a.delivery = - a.delivery |
| | | where order_id = #{order.orderId} |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <result property="processId" column="process_id"/> |
| | | <result property="completedArea" column="completedArea"/> |
| | | <result property="wornArea" column="wornArea"/> |
| | | <result property="qualityInspector" column="quality_inspector"/> |
| | | <result property="qualityInsTime" column="quality_ins_time"/> |
| | | |
| | | <association property="order" javaType="com.example.erp.entity.sd.Order"> |
| | | <result property="customerId" column="customer_id"/> |
| | |
| | | <result property="project" column="project"/> |
| | | <result property="batch" column="batch"/> |
| | | </association> |
| | | <association property="orderDetail" javaType="com.example.erp.entity.sd.OrderDetail"> |
| | | <result property="shape" column="shape"/> |
| | | </association> |
| | | <association property="flowCard" javaType="com.example.erp.entity.pp.FlowCard"> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="productionId" column="production_id"/> |
| | | </association> |
| | | <association property="reportingWorkDetail" javaType="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <result property="completedQuantity" column="completed_quantity"/> |
| | | <result property="orderNumber" column="order_number"/> |
| | | <result property="technologyNumber" column="technology_number"/> |
| | | </association> |
| | | <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> |
| | | <result property="area" column="area"/> |
| | | <result property="glassChild" column="glass_child"/> |
| | | <result property="glassAddress" column="glass_address"/> |
| | | <result property="childWidth" column="child_width"/> |
| | | <result property="childHeight" column="child_height"/> |
| | | </association> |
| | | <association property="damageDetails" javaType="com.example.erp.entity.pp.DamageDetails"> |
| | | <result property="qualityInsStatus" column="quality_ins_status"/> |
| | | <result property="breakageQuantity" column="breakage_quantity"/> |
| | | <result property="available" column="available"/> |
| | | <result property="returnProcess" column="return_process"/> |
| | | <result property="breakageType" column="breakage_type"/> |
| | | <result property="breakageReason" column="breakage_reason"/> |
| | | <result property="responsibleEquipment" column="responsible_equipment"/> |
| | | <result property="responsibleProcess" column="responsible_process"/> |
| | | <result property="responsibleTeam" column="responsible_team"/> |
| | | <result property="responsiblePersonnel" column="responsible_personnel"/> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | <!-- 查询当前工序的表头数据--> |
| | | <select id="AddSelectLastWorkMp" resultMap="reportingWorkMap"> |
| | | select o.order_id, |
| | | fc.production_id, |
| | |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | a.process_id=SUBSTR(#{processId} from 1 for 14) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | |
| | | and c.technology_number = a.technology_number |
| | | |
| | | where |
| | | a.process_id=SUBSTR(#{processId} from 1 for 13) |
| | | a.process_id=SUBSTR(#{processId} from 1 for 14) |
| | | and a.order_number = #{orderNumber} |
| | | and a.technology_number = #{technologyNumber} |
| | | </select> |
| | |
| | | o.batch, |
| | | rw.this_process, |
| | | rw.this_completed_quantity, |
| | | (ogd.area * rw.this_completed_quantity) as completedArea, |
| | | round(ogd.area * rw.this_completed_quantity,2) as completedArea, |
| | | rw.this_worn_quantity, |
| | | (ogd.area * rw.this_worn_quantity) as wornArea, |
| | | round(ogd.area * rw.this_worn_quantity,2) as wornArea, |
| | | rw.device_name, |
| | | rw.teams_groups_name, |
| | | rw.reviewed_state |
| | |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id) |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{orderId} in rw.order_id) |
| | | and rw.reviewed_state!=-1 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | |
| | | and order_number = #{orderNumber} |
| | | and technology_number = #{technologyNumber} |
| | | </update> |
| | | <!-- 质检审核查询--> |
| | | <select id="selectQualityTestingMp" resultMap="reportingWorkMap"> |
| | | select rw.reporting_work_id, |
| | | rw.reporting_work_time, |
| | | rw.process_id, |
| | | o.project, |
| | | o.customer_name, |
| | | rw.this_process, |
| | | ifnull(rw.this_completed_quantity,0) as this_completed_quantity, |
| | | rw.this_worn_quantity, |
| | | rw.teams_groups_name, |
| | | rw.device_name, |
| | | rw.previous_process, |
| | | rw.next_process, |
| | | rw.quality_inspector, |
| | | rw.quality_ins_time, |
| | | dd.quality_ins_status |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | |
| | | left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processId} in rw.process_id) |
| | | and position(#{state} in dd.quality_ins_status) |
| | | and rw.reviewed_state!=-1 |
| | | <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''"> |
| | | and rw.reporting_work_id regexp #{reportingWork.reportingWorkId} |
| | | </if> |
| | | <if test="reportingWork.processId != null and reportingWork.processId != ''"> |
| | | and rw.process_id regexp #{reportingWork.processId} |
| | | </if> |
| | | <if test="reportingWork.order.project != null and reportingWork.order.project != ''"> |
| | | and o.project regexp #{reportingWork.order.project} |
| | | </if> |
| | | <if test="reportingWork.order.customerName != null and reportingWork.order.customerName != ''"> |
| | | and o.customer_name regexp #{reportingWork.order.customerName} |
| | | </if> |
| | | GROUP BY rw.reporting_work_id |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <select id="getQualityPageTotal" > |
| | | select CEILING(count(rw.reporting_work_id)/#{pageSize}) as 'pageTotal', |
| | | count(distinct rw.reporting_work_id) as 'total' |
| | | from sd.order as o |
| | | left join sd.order_glass_detail as ogd on ogd.order_id = o.order_id |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | |
| | | left join damage_details as dd on dd.reporting_work_id=rw.reporting_work_id |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_time between #{selectTime1} and #{selectTime2} |
| | | and position(#{processId} in rw.process_id) |
| | | and position(#{state} in dd.quality_ins_status) |
| | | and rw.reviewed_state!=-1 |
| | | ORDER BY rw.reporting_work_id desc |
| | | limit #{offset},#{pageSize}; |
| | | </select> |
| | | |
| | | <!-- 修改质检状态--> |
| | | <update id="updateQualityStatusMp"> |
| | | update reporting_work as rw left join damage_details as dd on rw.reporting_work_id = dd.reporting_work_id |
| | | set dd.quality_ins_status = 2, |
| | | rw.quality_inspector=#{username}, |
| | | rw.examine_time=NOW() |
| | | where rw.reporting_work_id = #{reportingWorkId} |
| | | </update> |
| | | |
| | | <!-- 质检明细查询--> |
| | | <select id="detailsQualityMp"> |
| | | select rwd.order_number, |
| | | ogd.glass_child, |
| | | rwd.technology_number, |
| | | ogd.glass_address, |
| | | ogd.child_width, |
| | | ogd.child_height, |
| | | ifnull(od.shape,'') as shape, |
| | | rwd.completed_quantity, |
| | | dd.breakage_quantity, |
| | | dd.available, |
| | | ifnull(dd.return_process,'') as return_process, |
| | | dd.breakage_type, |
| | | dd.breakage_reason, |
| | | dd.responsible_equipment, |
| | | dd.responsible_process, |
| | | dd.responsible_team, |
| | | ifnull(dd.responsible_personnel,'') as responsible_personnel |
| | | from sd.order_detail as od |
| | | left join sd.order_glass_detail as ogd |
| | | on ogd.order_id = od.order_id and ogd.order_number = od.order_number |
| | | left join reporting_work as rw on rw.order_id = ogd.order_id and rw.production_id = ogd.production_id |
| | | left join reporting_work_detail as rwd |
| | | on rwd.reporting_work_id = rw.reporting_work_id and rwd.order_number = ogd.order_number and |
| | | rwd.technology_number = ogd.technology_number |
| | | left join damage_details as dd |
| | | on dd.reporting_work_id = rw.reporting_work_id and dd.order_number = rwd.order_number and |
| | | dd.technology_number = rwd.technology_number |
| | | where rw.reviewed_state != 2 |
| | | and rw.reporting_work_id = #{reportingWorkId} |
| | | and rw.reviewed_state != -1 |
| | | GROUP BY rwd.order_number, ogd.glass_child, rwd.technology_number, dd.id |
| | | ORDER BY rwd.order_number |
| | | </select> |
| | | </mapper> |
| | |
| | | <resultMap id="reworkAdd" type="com.example.erp.entity.pp.ReportingWorkDetail"> |
| | | <id column="id" property="id"/> |
| | | <result column="rework_team" property="reworkTeam"/> |
| | | <result column="breakage_number" property="breakageNumber"/> |
| | | <result column="breakage_quantity" property="breakageQuantity"/> |
| | | <result column="return_process" property="returnProcess"/> |
| | | <result column="breakage_reason" property="breakageReason"/> |
| | | <result column="responsible_equipment" property="responsibleEquipment"/> |
| | |
| | | pd.glass_sort, |
| | | if(pd.glass_sort=1,'(外)',if(pd2.glass_sort=pd.glass_sort,'(内)','')), |
| | | pd.detail, |
| | | od.width, |
| | | if( od.bend_radius!='', |
| | | round(od.width*(od.bend_radius-round(sum(t.thicknessCount),2))/od.bend_radius,0), |
| | | od.width |
| | | ), |
| | | od.height, |
| | | od.area, |
| | | od.gross_area, |
| | |
| | | on od.product_id = pd.prod_id and pd.detail_type='glass' |
| | | LEFT JOIN (SELECT max(id) as id ,max(glass_sort) as glass_sort from product_detail GROUP BY prod_id)as pd2 |
| | | on pd2.id=pd.id |
| | | left join ( |
| | | select |
| | | a.prod_id, |
| | | a.sort_num, |
| | | a.glass_sort, |
| | | (case |
| | | when a.sort_num=1 |
| | | then left(detail,LOCATE('mm',detail)-1)/2 |
| | | else |
| | | left(detail,LOCATE('mm',detail)-1) |
| | | end) as 'thicknessCount' |
| | | |
| | | from product_detail as a |
| | | group by prod_id,a.sort_num |
| | | ) as t |
| | | ON t.prod_id = od.product_id and t.sort_num <=pd.sort_num |
| | | |
| | | |
| | | where od.order_id = #{orderId} |
| | | group by od.order_number,pd.glass_sort |
| | | ORDER BY od.order_number |
| | | </insert> |
| | | |
| | |
| | | update `order` set money = #{order.money} where order_id = #{order.orderId} |
| | | </update> |
| | | |
| | | <update id="cancelOrder"> |
| | | update `order` as a set |
| | | a.create_order = - a.create_order, |
| | | a.process_review = - a.process_review, |
| | | a.order_review = - a.order_review, |
| | | a.production_order = - a.production_order, |
| | | a.processing_card = - a.processing_card, |
| | | a.warehousing = - a.warehousing, |
| | | a.delivery = - a.delivery |
| | | where order_id = #{order.orderId} |
| | | </update> |
| | | |
| | | </mapper> |