From c6b112564e0a97fc20db23e67dae0adee03f941c Mon Sep 17 00:00:00 2001 From: chenlu <1320612696@qq.com> Date: 星期四, 22 二月 2024 08:22:15 +0800 Subject: [PATCH] 工单管理模块修改 --- north-glass-erp/target/classes/mapper/pp/WordOrder.xml | 121 +++-- north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue | 75 ++ north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue | 351 ++++++++++++---- north-glass-erp/target/classes/mapper/pp/FolwCard.xml | 154 +++++-- north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue | 32 north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java | 2 north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java | 13 north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java | 3 north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java | 41 + north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml | 154 +++++-- north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue | 6 north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java | 16 north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue | 64 ++ north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml | 121 +++-- north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java | 35 + north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue | 21 north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java | 3 north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java | 30 + 18 files changed, 874 insertions(+), 368 deletions(-) diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue index 94408ab..a0760c6 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/AddProcessCard.vue @@ -1,89 +1,232 @@ <script setup> -import {ArrowLeftBold} from "@element-plus/icons-vue"; -import {useRouter} from "vue-router"; -const router = useRouter() -let flag = $ref(true) -function intoCreateProduct(){ - if(flag){ - router.push('/main/processCard/SplittingDetails') - }else { - router.push('/main/processCard/SplittingDetails') + +import request from "@/utils/request" +import deepClone from "@/utils/deepClone" +import {ElDatePicker, ElMessage} from "element-plus" +import useProductGlassTypeStore from "@/stores/sd/product/productGlassType" +import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue" +import {Search} from "@element-plus/icons-vue" +import GlassType from "@/components/sd/product/GlassType.vue" +import {useRouter} from 'vue-router' +import Sortable from 'sortablejs' +import BasicTable from '@/components/basic/BasicTable.vue' +import {VXETable} from "vxe-table"; + +let productGlassTypeStore = useProductGlassTypeStore() +let router = useRouter() +const getTableRow = (row, type) => { + switch (type) { + case 'edit' : { + router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}}) + break + } + case 'setType': { + alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅') + break + } + case 'delete': { + request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => { + if (res.code == 200) { + ElMessage.success("鍒犻櫎鎴愬姛") + location.reload(); + } else { + ElMessage.warning(res.msg) + router.push("/login") + } + }) + break + } } - flag=!flag } -const tableData = [ - { - processCard: 'NG231201A01', - orderSequence: '1', - landingSequence: '1', - floorNumber: '14-BSGB05', - shape: '鏅舰', - longSide: '5000', - shortSide: '4400', - total: '24', - totalThickness: '26', + + +//瀹氫箟鏃堕棿 +const form = reactive({ + date1: '', +}) + +//琛ㄥ熬姹傚拰 +const sumNum = (list, field) => { + let count = 0 + list.forEach(item => { + count += Number(item[field]) + }) + return count.toFixed(2) +} + +//瀹氫箟婊氬姩鏉¢珮搴� +let scrollTop = ref(null) +let scrollHeight = ref(null) +let clientHeight = ref(null) +const scrollEvnt = (row) => { + // 鍐呭楂樺害 + scrollTop.value = row.$event.target.scrollTop + scrollHeight.value = row.$event.target.scrollHeight + clientHeight.value = row.$event.target.clientHeight +} +//绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹� +let filterData = ref({ + product: { + thickness: '', + totalThickness:'' }, - { - processCard: 'NG231201A01', - orderSequence: '2', - landingSequence: '2', - floorNumber: '15-BSGB05', - shape: '鏅舰', - longSide: '5000', - shortSide: '4400', - total: '24', - totalThickness: '26', + orderDetail: { + orderNumber: '', + height: '', + computeGrossArea: '', + quantity: '', + shape:'', + width:'', + weight:'' + } + +}) +//瀹氫箟椤甸潰鎬婚〉鏁� +let pageTotal = ref('') +//瀹氫箟鏁版嵁杩斿洖缁撴灉 +let produceList = ref([]) +//瀹氫箟褰撳墠椤垫暟 +let pageNum = $ref(1) +let pageState = null + +const {currentRoute} = useRouter() +const route = currentRoute.value + +let orderId = route.query.orderId +let productionId = route.query.productionId +//绗竴娆″姞杞芥暟鎹� + +request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => { + + if (res.code == 200) { + console.log(res.data.data) + 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 changeFilterEvent = (event, option, $panel,) => { + // 鎵嬪姩瑙﹀彂绛涢�� + $panel.changeOption(event, !!option.data, option) +} +function padLeftZero(str) { + return ('00' + str).substr(str.length) +} +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 + } + + + request.post(`/processCard/selectNoCard/${orderId}/${productionId}`, filterData.value).then((res) => { + if(res.code==200){ + pageTotal.value=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 = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐� + 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: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒 + id: 'CustomerList', + showFooter: true,//鏄剧ず鑴� + printConfig: {}, + importConfig: {}, + exportConfig: {}, + scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔� + showOverflow:true, + columnConfig: { + resizable: true, + useKey: true }, - { - processCard: 'NG231201A02', - orderSequence: '3', - landingSequence: '3', - floorNumber: '16-BSGB05', - shape: '鏅舰', - longSide: '5000', - shortSide: '4400', - total: '24', - totalThickness: '26', + filterConfig: { //绛涢�夐厤缃」 + remote: true }, -] -const tableData2 = [ - { - orderSequence: '4', - floorNumber: '17-BSGB08', - shape: '鏅舰', - longSide: '4600', - shortSide: '3880', - undividedQuantity: '15', - undividedArea: '99.84', - totalThickness:'28', - glassThickness:'24', - undividedWeight:'111' + customConfig: { + storage: true }, - { - orderSequence: '5', - floorNumber: '18-BSGB08', - shape: '鏅舰', - longSide: '4600', - shortSide: '3880', - undividedQuantity: '15', - undividedArea: '99.84', - totalThickness:'28', - glassThickness:'24', - undividedWeight:'111' + editConfig: { + trigger: 'click', + mode: 'row', + showStatus: true + },//琛ㄥご鍙傛暟 + columns:[ + {type: 'checkbox', fixed: "left", title: '閫夋嫨'}, + {field: 'orderDetail.orderNumber', title: '璁㈠簭',filters:[{ data: '' }],slots: { filter: 'num1_filter' } }, + {field: 'orderDetail.shape', title: '褰㈢姸', showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'orderDetail.width', title: '瀹�', filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'orderDetail.height', title: '楂�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'orderDetail.quantity', title: '鏁伴噺', showOverflow:"ellipsis"}, + {field: 'orderDetail.computeGrossArea', title: '闈㈢Н'}, + {field: 'product.totalThickness', title: '鎬诲帤搴�'}, + {field: 'product.thickness', title: '鐜荤拑鍘氬害'}, + {field: 'orderDetail.weight', title: '閲嶉噺'} + ],//琛ㄥご鎸夐挳 + + toolbarConfig: { + // buttons: [{ + // + // }], + import: false, + export: true, + print: true, + zoom: true, + custom: true }, - { - orderSequence: '6', - floorNumber: '19-BSGB08', - shape: '鏅舰', - longSide: '4600', - shortSide: '3880', - undividedQuantity: '15', - undividedArea: '99.84', - totalThickness:'28', - glassThickness:'24', - undividedWeight:'111' - }, -] + data: [ + + ],//table body瀹為檯鏁版嵁 + //鑴氶儴姹傚拰 + footerMethod ({ columns, data }) {//椤佃剼鍑芥暟 + let footList=['鎬绘暟閲�','鎬婚潰绉�','鍒嗙鏁�'] + return[ + columns.map((column, columnIndex) => { + if (columnIndex === 0) { + return '鍚堣:' + } + if (footList.includes(column.field)) { + return sumNum(data, column.field) + } + return '' + }) + ] + } + +}) + + + </script> <template> @@ -123,7 +266,7 @@ <el-main width="12%" style=""> <span>鏈垎鏁伴噺:45</span><br> <span>鏈垎閲嶉噺:333</span><br> - <span>閫変腑鏁伴噺:</span><br> + <span>閫変腑鏁伴噺:<el-input></el-input></span><br> <el-button type="primary"> 鈫� </el-button> <br> <br> @@ -134,19 +277,45 @@ </el-main> <el-aside width="44%" style=""> - <el-table :data="tableData2" border style="width: 100%" height="100%"> - <el-table-column prop="orderSequence" label="璁㈠簭" width="60" /> - <el-table-column prop="floorNumber" label="妤煎眰缂栧彿" :show-overflow-tooltip='true' width="100" /> - <el-table-column prop="shape" label="褰㈢姸" width="65" /> - <el-table-column prop="longSide" label="闀胯竟" width="60" /> - <el-table-column prop="shortSide" label="鐭竟" width="60" /> - <el-table-column prop="undividedQuantity" label="寰呭垎鏁伴噺" width="85" /> - <el-table-column prop="undividedArea" label="寰呭垎闈㈢Н" width="85" /> - <el-table-column prop="totalThickness" label="鎬诲帤搴�" width="75" /> - <el-table-column prop="glassThickness" label="鐜荤拑鍘氬害" width="85" /> - <el-table-column prop="undividedWeight" label="寰呭垎閲嶉噺" width="85" /> - </el-table><!-- <h1>{{msg}}</h1> --> + <vxe-grid + max-height="100%" + @filter-change="filterChanged" + class="mytable-scrollbar" + ref="xGrid" + v-bind="gridOptions" + + > + <!-- @toolbar-button-click="toolbarButtonClickEvent"--> + <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�--> + <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 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 @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</el-button> + </template> + + <template #num1_filter="{ column, $panel }"> + <div> + <div v-for="(option, index) in column.filters" :key="index"> + <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/> + </div> + </div> + </template> + + + </vxe-grid> </el-aside> </el-container> </div> diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue index 5233edf..c5b29b8 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectAddProcess.vue @@ -79,7 +79,7 @@ .toISOString() .replace('T', ' ') .slice(0, 10) //榛樿寮�濮嬫椂闂�7澶╁墠 - const end = new Date(new Date().getTime()) + const end = new Date(new Date().getTime()+ 3600 * 1000 * 24) .toISOString() .replace('T', ' ') .slice(0, 10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿 @@ -205,16 +205,16 @@ {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, {title: '鎿嶄綔', width: 80, slots: { default: 'button_slot' },fixed:"left"}, { type: 'seq',fixed:"left", title: '鑷簭', width: 50 }, - {field: 'orderId', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, - {field: 'customerName', title: '瀹㈡埛鍚嶇О', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: 'project', title: '椤圭洰鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: 'batch', title: '鎵规',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, - {field: 'otherRemarks', title: '鍘熺墖瑕佹眰', sortable: true,showOverflow:"ellipsis"}, - {field: 'icon', title: '鍟嗘爣閫夐」', sortable: true}, - {field: 'orderType', title: '璁㈠崟绫诲瀷', sortable: true}, - {field: 'salesman', title: '涓氬姟鍛�', sortable: true}, - {field: 'processingNote', title: '鍔犲伐瑕佹眰', sortable: true,showOverflow:"ellipsis"}, - {field: 'deliveryAddress', title: '閫佽揣鍦板潃', sortable: true}, + {field: 'order.orderId', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, + {field: 'order.customerName', title: '瀹㈡埛鍚嶇О', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'order.project', title: '椤圭洰鍚嶇О', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'order.batch', title: '鎵规',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, + {field: 'order.otherRemarks', title: '鍘熺墖瑕佹眰', sortable: true,showOverflow:"ellipsis"}, + {field: 'order.icon', title: '鍟嗘爣閫夐」', sortable: true}, + {field: 'order.orderType', title: '璁㈠崟绫诲瀷', sortable: true}, + {field: 'order.salesman', title: '涓氬姟鍛�', sortable: true}, + {field: 'order.processingNote', title: '鍔犲伐瑕佹眰', sortable: true,showOverflow:"ellipsis"}, + {field: 'order.deliveryAddress', title: '閫佽揣鍦板潃', sortable: true}, ],//琛ㄥご鎸夐挳 toolbarConfig: { @@ -284,11 +284,13 @@ > <!-- @toolbar-button-click="toolbarButtonClickEvent"--> <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�--> - <template #content="{ row}"> + <template #content="{ row }"> <ul class="expand-wrapper"> - <li v-for="(item,key,index) in row"> - <span style="font-weight: bold">{{key+': '}}</span> - <span>{{ item }}</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> diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue index 480b918..891ff5e 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SelectProcessCard.vue @@ -17,12 +17,23 @@ const getTableRow = (row, type) => { switch (type) { case 'edit' : { - //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅') - router.push({path: '/main/workOrder/addWorkOrder', query: {id: row.id}}) + router.push({path: '/main/processCard/PrintFlowCard', query: {id: row.id}}) + break + } + case 'setType': { + alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅') break } case 'delete': { - alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅') + request.post(`/processCard/deleteFlowCard/${row.orderId}/${row.processId}`).then((res) => { + if (res.code == 200) { + ElMessage.success("鍒犻櫎鎴愬姛") + location.reload(); + } else { + ElMessage.warning(res.msg) + router.push("/login") + } + }) break } } @@ -88,7 +99,7 @@ .toISOString() .replace('T', ' ') .slice(0,10) //榛樿寮�濮嬫椂闂�7澶╁墠 - const end = new Date(new Date().getTime()) + const end = new Date(new Date().getTime()+3600 * 1000 * 24) .toISOString() .replace('T', ' ') .slice(0,10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿 @@ -184,7 +195,7 @@ 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: {}, diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue index 247e008..6994581 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/SplittingDetails.vue @@ -16,7 +16,7 @@ switch (type) { case 'edit' :{ //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅') - router.push({path: '/main/processCard/AddProcessCard', query: { id: row.id }}) + router.push({path: '/main/processCard/AddProcessCard', query: { orderId: row.orderId,productionId:row.orderGlassDetail.productionId }}) break } case 'delete':{ @@ -40,12 +40,11 @@ scrollHeight.value = row.$event.target.scrollHeight clientHeight.value = row.$event.target.clientHeight } + //绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹� let filterData = ref({ - order: { - batch: '' - }, - orderDetail: { + + orderGlassDetail: { productName: '', computeArea: '', quantity: '', @@ -53,6 +52,9 @@ perimeter: '', bendRadius: '', processingNote: '' + }, + orderDetail:{ + orderDetail:'' } }) @@ -91,7 +93,50 @@ return count.toFixed(2) } + +/*浣跨敤绛涢�夛紝鍚庣鑾峰彇鏁版嵁*/ +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] + + request.post(`/processCard/selectAddProcess/${startTime}/${endTime}`, filterData.value).then((res) => { + if (res.code == 200) { + pageTotal.value = 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 = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐� + return regex.test(value); // 杩斿洖true/false +} //瀛愮粍浠舵帴鏀跺弬鏁� + const xGrid = ref() const gridOptions = reactive({ loading: true, @@ -128,12 +173,12 @@ {title: '鎿嶄綔', width: 80, slots: { default: 'button_slot' },fixed:"left"}, { type: 'seq',fixed:"left", title: '鑷簭', width: 50 }, {field: 'orderId', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, }, - {field: 'productionId', title: '鐢熶骇璁㈠崟鍙�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: 'productId', title: '浜у搧缂栧彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, - {field: 'productName', title: '浜у搧鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, - {field: 'quantity', title: '鎬绘暟閲�', sortable: true,showOverflow:"ellipsis"}, - {field: 'computeGrossArea', title: '鎬婚潰绉�', sortable: true}, - {field: 'perimeter', title: '鍛ㄩ暱', sortable: true}, + {field: 'orderGlassDetail.productionId', title: '鐢熶骇璁㈠崟鍙�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'orderDetail.productId', title: '浜у搧缂栧彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, + {field: 'orderDetail.productName', title: '浜у搧鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}, + {field: 'orderDetail.quantity', title: '鎬绘暟閲�', sortable: true,showOverflow:"ellipsis"}, + {field: 'orderDetail.computeGrossArea', title: '鎬婚潰绉�', sortable: true}, + {field: 'orderDetail.perimeter', title: '鍛ㄩ暱', sortable: true}, ],//琛ㄥご鎸夐挳 toolbarConfig: { @@ -183,9 +228,11 @@ <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�--> <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> diff --git a/north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue b/north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue index cf516a9..4eb0dba 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/workOrder/AddWorkOrder.vue @@ -73,6 +73,7 @@ request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => { if (res.code == 200) { + console.log(res.data.data) pageTotal.value = res.data.total produceList = produceList.value.concat(deepClone(res.data.data)) xGrid.value.reloadData(produceList) @@ -82,6 +83,41 @@ } }) + +/*浣跨敤绛涢�夛紝鍚庣鑾峰彇鏁版嵁*/ +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 + } + + + request.post(`/workOrder/addWork/${id}`, filterData.value).then((res) => { + if (res.code == 200) { + pageTotal.value = res.data.total + + produceList = deepClone(res.data.data) + xGrid.value.loadData(produceList) + gridOptions.loading = false + } else { + ElMessage.warning(res.msg) + } + }) +} //琛ㄥ熬姹傚拰 const sumNum = (list, field) => { let count = 0 @@ -89,6 +125,11 @@ count += Number(item[field]) }) return count.toFixed(2) +} + +const hasDecimal = (value) => { + const regex = /\./; // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐� + return regex.test(value); // 杩斿洖true/false } //瀛愮粍浠舵帴鏀跺弬鏁� @@ -127,19 +168,12 @@ {type: 'expand', fixed: "left", slots: {content: 'content'}, width: 50}, {type: 'checkbox', fixed: "left", title: '閫夋嫨', width: 80}, {type: 'seq', fixed: "left", title: '鑷簭', width: 50}, - {field: 'orderId', title: '閿�鍞崟鍙�', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true,}, - { - field: 'productId', - title: '浜у搧缂栧彿', - sortable: true, - showOverflow: "ellipsis", - filters: [{data: ''}], - slots: {filter: 'num1_filter'} - }, - {field: 'productName', title: '浜у搧鍚嶇О', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}, - {field: 'quantity', title: '鎬绘暟閲�', sortable: true}, - {field: 'computeGrossArea', title: '鎬婚潰绉�', sortable: true}, - {field: 'perimeter', title: '鍛ㄩ暱', sortable: true, showOverflow: "ellipsis"}, + {field: 'orderId', title: '閿�鍞崟鍙�', filters: [{data: ''}], slots: {filter: 'num1_filter'},}, + {field: 'productId',title: '浜у搧缂栧彿',showOverflow: "ellipsis",filters: [{data: ''}],slots: {filter: 'num1_filter'}}, + {field: 'productName', title: '浜у搧鍚嶇О', filters: [{data: ''}], slots: {filter: 'num1_filter'}, }, + {field: 'quantity', title: '鎬绘暟閲�', }, + {field: 'computeGrossArea', title: '鎬婚潰绉�', }, + {field: 'perimeter', title: '鍛ㄩ暱', showOverflow: "ellipsis"} ],//琛ㄥご鎸夐挳 toolbarConfig: { @@ -227,7 +261,9 @@ <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> + <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> diff --git a/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue b/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue index 182b9a5..d887709 100644 --- a/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue +++ b/north-glass-erp/northglass-erp/src/views/pp/workOrder/SelectWorkOrder.vue @@ -22,8 +22,6 @@ break } case 'delete': { - //console.log(row.orderDetail.productName) - //request.post('/workOrder/deleteOrderWork/${row.orderId}', ,row.orderDetail.productName).then((res) => { request.post(`/workOrder/deleteOrderWork/${row.orderId}/${row.orderDetail.productName}`).then((res) => { if (res.code == 200) { ElMessage.success("鍒犻櫎鎴愬姛") @@ -50,7 +48,7 @@ //瀹氫箟杞崟鐘舵�� -const optionVal = ref('0') +const optionVal = ref('1') const options = [ { value: '0', @@ -112,7 +110,7 @@ .toISOString() .replace('T', ' ') .slice(0, 10) //榛樿寮�濮嬫椂闂�7澶╁墠 - const end = new Date(new Date().getTime()) + const end = new Date(new Date().getTime()+3600 * 1000 * 24) .toISOString() .replace('T', ' ') .slice(0, 10)//榛樿缁撴潫鏃堕棿褰撳墠鏃堕棿 diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java index 1d33630..8b1bd26 100644 --- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java +++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java @@ -1,9 +1,12 @@ package com.example.erp.controller.pp; +import com.example.erp.common.Constants; import com.example.erp.entity.pp.FlowCard; import com.example.erp.entity.sd.Order; import com.example.erp.common.Result; import com.example.erp.entity.sd.OrderDetail; +import com.example.erp.entity.sd.OrderGlassDetail; +import com.example.erp.exception.ServiceException; import com.example.erp.service.pp.FlowCardService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -16,32 +19,60 @@ @Autowired FlowCardService flowCardService; + //娴佺▼鍗$鐞嗘煡璇� @PostMapping ("/flowCard/{selectTime1}/{selectTime2}") public Result DateProcess( @PathVariable Date selectTime1, @PathVariable Date selectTime2, @RequestBody FlowCard flowCard){ - System.out.println(selectTime1+" "+selectTime2+" "+flowCard.toString()); return Result.seccess(flowCardService.selectProcessCard(selectTime1,selectTime2,flowCard)); } + //鍒嗘灦鏌ヨ @PostMapping ("/selectAddProcess/{selectTime1}/{selectTime2}") public Result SelectAddProcess( @PathVariable Date selectTime1, @PathVariable Date selectTime2, - @RequestBody Order order){ + @RequestBody FlowCard flowCard){ // System.out.println(selectTime1+" "+selectTime2+" "+flowCard.toString()); - return Result.seccess(flowCardService.selectAddProcess(selectTime1,selectTime2,order)); + return Result.seccess(flowCardService.selectAddProcess(selectTime1,selectTime2,flowCard)); } + //鍒嗘灦鏄庣粏鏌ヨ @PostMapping ("/detailsSelect/{orderId}") public Result DetailsSelect( @PathVariable String orderId, - @RequestBody OrderDetail orderDetail){ - return Result.seccess(flowCardService.DetailsSelectSv(orderId,orderDetail)); + @RequestBody FlowCard flowCard){ + return Result.seccess(flowCardService.DetailsSelectSv(orderId,flowCard)); + + } + + + //鍒犻櫎宸ュ崟 + @PostMapping("/deleteFlowCard/{orderId}/{processId}") + public Result deleteOrderWork( + @PathVariable String orderId, + @PathVariable String processId + ){ + if(flowCardService.DeleteFlowCardSv(orderId,processId)){ + return Result.seccess(); + }else { + throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触"); + + } + } + + //鍒嗘灦鏄庣粏鏌ヨ + @PostMapping ("/selectNoCard/{orderId}/{productionId}") + + public Result SelectNoCard( + @PathVariable String orderId, + @PathVariable String productionId, + @RequestBody FlowCard flowCard){ + return Result.seccess(flowCardService.SelectNoCardSv(orderId,productionId,flowCard)); } diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java index 33e4c4e..f646100 100644 --- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java +++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/WorkOrderController.java @@ -39,7 +39,7 @@ } - + //娣诲姞宸ュ崟 @PostMapping("/addOrderWork") public Result AddOrderWork( @RequestBody Map<String,Object> object){ System.out.println("obj:"+object); @@ -51,6 +51,7 @@ } } + //鍒犻櫎宸ュ崟 @PostMapping("/deleteOrderWork/{orderId}/{productName}") public Result deleteOrderWork( @PathVariable String orderId, diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java b/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java index 457fe82..93f5d95 100644 --- a/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java +++ b/north-glass-erp/src/main/java/com/example/erp/entity/pp/FlowCard.java @@ -5,6 +5,7 @@ import com.example.erp.entity.sd.Order; import com.example.erp.entity.sd.OrderDetail; import com.example.erp.entity.sd.OrderGlassDetail; +import com.example.erp.entity.sd.Product; import lombok.Data; import java.time.LocalDate; @@ -64,4 +65,6 @@ private OrderDetail orderDetail; //澶栭敭璁㈠崟宸ヨ壓瀹℃牳琛� private OrderGlassDetail orderGlassDetail; + + private Product product; } diff --git a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java index ef94a1c..0a4b85e 100644 --- a/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java +++ b/north-glass-erp/src/main/java/com/example/erp/entity/sd/OrderGlassDetail.java @@ -32,7 +32,7 @@ private LocalDate productionTime; private LocalDate createTime; // @TableField(select = false) -// private Order order; + private Order order; //@TableField(select = false) // @ManyToOne(fetch = FetchType.LAZY) private OrderDetail orderDetail; diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java index e0a24a1..b793093 100644 --- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java +++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/FlowCardMapper.java @@ -3,6 +3,7 @@ import com.example.erp.entity.pp.FlowCard; import com.example.erp.entity.sd.Order; import com.example.erp.entity.sd.OrderDetail; +import com.example.erp.entity.sd.OrderGlassDetail; import org.apache.ibatis.annotations.Mapper; import java.sql.Date; @@ -10,10 +11,16 @@ @Mapper public interface FlowCardMapper { + //娴佺▼鍗$鐞嗘煡璇� List<FlowCard> selectFlowCard(Date selectTime1, Date selectTime2,FlowCard flowCard); - List<Order> selectFlowCardMp(Date selectTime1, Date selectTime2, Order order); + //鍒嗘灦鏁版嵁鏌ヨ + List<FlowCard> selectFlowCardMp(Date selectTime1, Date selectTime2, FlowCard flowCard); - List<OrderDetail> DetailsSelectMp(String orderId, OrderDetail orderDetail); - // Integer getPageTotal(Integer offset, Integer pageSize, String glassTypeId, Product product); + //鍒嗘灦鏄庣粏鏌ヨ + List<FlowCard> DetailsSelectMp(String orderId, FlowCard flowCard); + + Boolean DeleteFlowCardMp(String orderId, String processId); + + List<FlowCard> SelectNoCardMp(String orderId, String productionId, FlowCard flowCard); } diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java index 61e9137..9ea6256 100644 --- a/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java +++ b/north-glass-erp/src/main/java/com/example/erp/mapper/pp/WorkOrderMapper.java @@ -11,20 +11,30 @@ @Mapper public interface WorkOrderMapper { + //宸ュ崟绠$悊鏌ヨ鏈浆宸ュ崟鏁版嵁 List<OrderGlassDetail> selectWordOrder(Date selectTime1, Date selectTime2, OrderGlassDetail orderGlassDetail); + //鏌ヨ宸茶浆宸ュ崟鏁版嵁 List<OrderGlassDetail> selectWordOrderNo(Date selectTime1, Date selectTime2, OrderGlassDetail orderGlassDetail); + + //鏌ヨ闇�瑕佽浆宸ュ崟鏄庣粏 List<OrderDetail> addWordOrder(String orderId, OrderDetail orderDetail); - + //杞伐鍗� Boolean AddOrderWorkMp(String productIdVl, @Param("orderId") String orderId, @Param("productId") Integer productId, @Param("productName") String productName, String userName); - + //鏌ヨ瀵瑰簲璁㈠崟鍙疯搴� Integer SelectOrderNumber(String productIdVl); - + //鍒犻櫎宸ュ崟,灏嗗搴斾骇鍝佺敓浜ц鍗曞彿鏀逛负null Boolean DeleteOrderWorkMp(String orderId, String productName); + + Integer SelectWorkCount(String orderId); + + Boolean UpdateWorkType(String orderId, Integer state); + + Integer SelectYesWorkCount(String orderId); } diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java index 07e9bf9..0066131 100644 --- a/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java +++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java @@ -5,6 +5,7 @@ import com.example.erp.entity.pp.FlowCard; import com.example.erp.entity.sd.Order; import com.example.erp.entity.sd.OrderDetail; +import com.example.erp.entity.sd.OrderGlassDetail; import com.example.erp.mapper.pp.FlowCardMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -21,26 +22,37 @@ public Map<String, Object> selectProcessCard(Date selectTime1, Date selectTime2, FlowCard flowCard) { Map<String, Object> map = new HashMap<>(); - System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard)); + //System.out.println(flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard)); map.put("data", flowCardMapper.selectFlowCard( selectTime1,selectTime2, flowCard)); - // map.put("total", productMapper.getPageTotal(offset, pageSize, glassTypeId, product)); return map; } - public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, Order order) { + public Map<String, Object> selectAddProcess(Date selectTime1, Date selectTime2, FlowCard flowCard) { Map<String, Object> map = new HashMap<>(); - System.out.println(flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, order)); - map.put("data", flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, order)); - // map.put("total", productMapper.getPageTotal(offset, pageSize, glassTypeId, product)); + map.put("data", flowCardMapper.selectFlowCardMp( selectTime1,selectTime2, flowCard)); return map; } - public Map<String, Object> DetailsSelectSv(String orderId, OrderDetail orderDetail) { + public Map<String, Object> DetailsSelectSv(String orderId, FlowCard flowCard) { Map<String, Object> map = new HashMap<>(); - map.put("data", flowCardMapper.DetailsSelectMp( orderId, orderDetail)); + map.put("data", flowCardMapper.DetailsSelectMp( orderId, flowCard)); + return map; + } - // map.put("total", productMapper.getPageTotal(offset, pageSize, glassTypeId, product)); + public Boolean DeleteFlowCardSv(String orderId, String processId) { + if (!orderId.isEmpty()&&!processId.isEmpty()){ + flowCardMapper.DeleteFlowCardMp(orderId, processId); + return true; + } + else { + return false; + } + } + + public Map<String, Object> SelectNoCardSv(String orderId, String productionId, FlowCard flowCard) { + Map<String, Object> map = new HashMap<>(); + map.put("data", flowCardMapper.SelectNoCardMp( orderId,productionId, flowCard)); return map; } } diff --git a/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java b/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java index a75796b..c917a79 100644 --- a/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java +++ b/north-glass-erp/src/main/java/com/example/erp/service/pp/WorkOrderService.java @@ -25,10 +25,9 @@ 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)); - if (state==1){ + if (state == 1) { map.put("data", workOrderMapper.selectWordOrder(selectTime1, selectTime2, orderGlassDetail)); - } - else { + } else { map.put("data", workOrderMapper.selectWordOrderNo(selectTime1, selectTime2, orderGlassDetail)); } @@ -62,15 +61,24 @@ letters = lettr++; productIdVl = orderID + letters; Integer workCount = workOrderMapper.SelectOrderNumber(productIdVl); - if (workCount <1) - { + if (workCount < 1) { break; } } System.out.println(productIdVl); - workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(),userName); + workOrderMapper.AddOrderWorkMp(productIdVl, orderDetail.getOrderId(), orderDetail.getProductId(), orderDetail.getProductName(), userName); + Integer State = 2; + Integer States = 1; + Integer NoWorkCount = workOrderMapper.SelectWorkCount(orderDetail.getOrderId()); + System.out.println(NoWorkCount); + if (NoWorkCount == 0) { + workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), State); + } else { + workOrderMapper.UpdateWorkType(orderDetail.getOrderId(), States); + } } + return true; } else { return false; @@ -79,11 +87,20 @@ } public Boolean DeleteOrderWorkSv(String orderId, String productName) { - if (!orderId.isEmpty()&&!productName.isEmpty()){ + 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); + System.out.println(NoWorkCount); + if (NoWorkCount ==YesWorkCount) { + workOrderMapper.UpdateWorkType(orderId, State); + } else { + workOrderMapper.UpdateWorkType(orderId, States); + } return true; - } - else { + } else { return false; } } diff --git a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml index cbfc46d..b0b3925 100644 --- a/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml +++ b/north-glass-erp/src/main/resources/mapper/pp/FolwCard.xml @@ -27,6 +27,21 @@ <result column="product_name" property="productName"/> <result column="compute_gross_area" property="computeGrossArea"/> <result column="processing_note" property="processingNote"/> + <result column="quantity" property="quantity"/> + <result column="compute_gross_area" property="computeGrossArea"/> + <result column="perimeter" property="perimeter"/> + <result column="order_number" property="orderNumber"/> + <result column="width" property="width"/> + <result column="height" property="height"/> + <result column="shape" property="shape"/> + <result column="weight" property="weight"/> + </association> + <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> + <result column="production_id" property="productionId"/> + </association> + <association property="product" javaType="com.example.erp.entity.sd.Product"> + <result column="total_thickness" property="totalThickness"/> + <result column="thickness" property="thickness"/> </association> <!--<result column="g_typeId" property="glassTypes.typeId"/> @@ -46,49 +61,7 @@ c.processing_note from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number - where a.create_time between #{selectTime1} and #{selectTime2} -<!-- <where>--> -<!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> -<!-- and a.order_id regexp #{flowCard.orderId}--> -<!-- </if>--> -<!-- <if test="flowCard.productionId != null and flowCard.productionId != ''">--> -<!-- and a.process_Id regexp #{flowCard.productionId}--> -<!-- </if>--> -<!-- <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">--> -<!-- and c.product_id regexp #{flowCard.orderDetail.productId}--> -<!-- </if>--> -<!-- <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">--> -<!-- and c.product_name regexp #{flowCard.orderDetail.productName}--> -<!-- </if>--> - -<!-- <if test="flowCard.order.project != null and flowCard.order.project!= ''">--> -<!-- and b.project regexp #{flowCard.order.project}--> -<!-- </if>--> - - -<!-- <if test="flowCard.createTime != null and flowCard.createTime != ''">--> -<!-- and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }--> -<!-- </if>--> - -<!-- </where>--> - group by a.process_Id; - </select> - - - - <select id="selectFlowCardMp"> - select o.order_id, - o.customer_name, - o.project, - o.batch, - o.other_remarks, - o.icon, - o.order_type, - o.salesman, - o.processing_note, - o.delivery_address - from sd.`order` as o - where o.create_time between #{selectTime1} and #{selectTime2} + where a.create_time between #{selectTime1} and #{selectTime2} <!-- <where>--> <!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> <!-- and a.order_id regexp #{flowCard.orderId}--> @@ -113,10 +86,47 @@ <!-- </if>--> <!-- </where>--> - ; + group by a.process_Id; </select> - - <select id="DetailsSelectMp"> + + + <select id="selectFlowCardMp" resultMap="flowCardMap"> + select o.order_id, + o.customer_name, + o.project, + o.batch, + o.other_remarks, + o.icon, + o.order_type, + o.salesman, + o.processing_note, + o.delivery_address + from sd.`order` as o + where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2} + <!-- <where>--> + <!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> + <!-- and a.order_id regexp #{flowCard.orderId}--> + <!-- </if>--> + <!-- <if test="flowCard.productionId != null and flowCard.productionId != ''">--> + <!-- and a.process_Id regexp #{flowCard.productionId}--> + <!-- </if>--> + <!-- <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">--> + <!-- and c.product_id regexp #{flowCard.orderDetail.productId}--> + <!-- </if>--> + <!-- <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">--> + <!-- and c.product_name regexp #{flowCard.orderDetail.productName}--> + <!-- </if>--> + + <!-- <if test="flowCard.order.project != null and flowCard.order.project!= ''">--> + <!-- and b.project regexp #{flowCard.order.project}--> + <!-- </if>--> + + + <!-- </where>--> + ; + </select> + + <select id="DetailsSelectMp" resultMap="flowCardMap"> select od.order_id, ogd.production_id, od.product_id, @@ -125,9 +135,55 @@ od.compute_gross_area, od.perimeter from sd.order_detail as od - left join sd.order_glass_detail as ogd - on od.order_id = ogd.order_id and od.order_number = ogd.order_number + left join sd.order_glass_detail as ogd + on od.order_id = ogd.order_id where od.order_id = #{orderId} - group by od.order_id,ogd.production_id + group by od.order_id, ogd.production_id </select> + + + <update id="DeleteFlowCardMp"> + update sd.order_detail as od left join sd.order_glass_detail as ogd + on od.order_id = ogd.order_id and od.order_number = ogd.order_number + set ogd.production_id=null, + ogd.production_time=null, + ogd.founder=null + where od.order_id = #{orderId} + and od.product_name = #{productName} + </update> + + <select id="SelectNoCardMp" resultMap="flowCardMap"> + select + od.order_number, + od.width, + od.height, + od.shape, + od.quantity, + od.compute_gross_area, + p.total_thickness, + p.thickness, + od.weight + from + sd.order_detail as od + left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id + left join sd.product as p on od.product_name=p.product_name + where od.order_id=#{orderId}and ogd.production_id=#{productionId} + <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''"> + and od.order_number regexp #{flowCard.orderDetail.orderNumber} + </if> + <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''"> + and od.width regexp #{flowCard.orderDetail.width} + </if> + <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''"> + and od.height regexp #{flowCard.orderDetail.height} + </if> + <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''"> + and od.shape regexp #{flowCard.orderDetail.shape} + + </if> + GROUP BY od.order_number; + + + </select> + </mapper> \ No newline at end of file diff --git a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml index 037e499..3eebdef 100644 --- a/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml +++ b/north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml @@ -30,39 +30,39 @@ </resultMap> <select id="selectWordOrder" resultMap="wordOrderMap"> select - a.order_id, - a.production_id, - c.batch, - b.product_name, - b.compute_area, - b.quantity, - b.compute_gross_area, - b.perimeter, - b.bend_radius, - b.processing_note - from order_glass_detail as a - LEFT JOIN order_detail as b on a.order_id=b.order_id and a.order_number=b.order_number LEFT JOIN - `order` as c on a.order_id=c.order_id - where isnull(a.production_id) + o.order_id, + ogd.production_id, + o.batch, + od.product_name, + od.compute_area, + od.quantity, + od.compute_gross_area, + od.perimeter, + od.bend_radius, + od.processing_note + + from `order` as o left join order_detail as od on o.order_id=od.order_id + left join order_glass_detail as ogd on o.order_id=ogd.order_id and ogd.order_number=od.order_number + where isnull(ogd.production_id) and o.order_review=2 and o.production_order!=2 <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''"> - and a.order_id regexp #{orderGlassDetail.orderId} + and o.order_id regexp #{orderGlassDetail.orderId} </if> <if test="orderGlassDetail.productionId != null and orderGlassDetail.productionId != ''"> - and a.production_id regexp #{orderGlassDetail.productionId} + and ogd.production_id regexp #{orderGlassDetail.productionId} </if> <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''"> - and c.batch regexp #{orderGlassDetail.order.batch} + and o.batch regexp #{orderGlassDetail.order.batch} </if> <if test="orderGlassDetail.orderDetail.productName != null and orderGlassDetail.orderDetail.productName!= ''"> - and b.product_name regexp #{orderGlassDetail.orderDetail.productName} + and od.product_name regexp #{orderGlassDetail.orderDetail.productName} </if> <if test="orderGlassDetail.createTime != ''"> - and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } + and DATE_FORMAT((ogd.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } </if> - group by a.production_id,a.order_number - order by a.id desc + group by o.order_id + order by o.id desc ; @@ -70,45 +70,45 @@ <select id="selectWordOrderNo" resultMap="wordOrderMap"> select - a.order_id, - a.production_id, - c.batch, - b.product_name, - b.compute_area, - b.quantity, - b.compute_gross_area, - b.perimeter, - b.bend_radius, - b.processing_note - from order_glass_detail as a - LEFT JOIN order_detail as b on a.order_id=b.order_id and a.order_number=b.order_number LEFT JOIN - `order` as c on a.order_id=c.order_id - where a.production_id IS NOT NULL + o.order_id, + ogd.production_id, + o.batch, + od.product_name, + od.compute_area, + od.quantity, + od.compute_gross_area, + od.perimeter, + od.bend_radius, + od.processing_note + + from `order` as o left join order_detail as od on o.order_id=od.order_id + left join order_glass_detail as ogd on o.order_id=ogd.order_id and ogd.order_number=od.order_number + where ogd.production_id IS NOT NULL <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''"> - and a.order_id regexp #{orderGlassDetail.orderId} + and ogd.order_id regexp #{orderGlassDetail.orderId} </if> <if test="orderGlassDetail.productionId != null and orderGlassDetail.productionId != ''"> - and a.production_id regexp #{orderGlassDetail.productionId} + and ogd.production_id regexp #{orderGlassDetail.productionId} </if> <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''"> - and c.batch regexp #{orderGlassDetail.order.batch} + and o.batch regexp #{orderGlassDetail.order.batch} </if> <if test="orderGlassDetail.orderDetail.productName != null and orderGlassDetail.orderDetail.productName!= ''"> - and b.product_name regexp #{orderGlassDetail.orderDetail.productName} + and od.product_name regexp #{orderGlassDetail.orderDetail.productName} </if> <if test="orderGlassDetail.createTime != ''"> - and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } + and DATE_FORMAT((ogd.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } </if> - group by a.production_id,a.order_number - order by a.id desc + group by ogd.production_id,ogd.order_number + order by ogd.id desc ; </select> - <select id="addWordOrder"> + <select id="addWordOrder" > select od.order_id, od.product_id, od.product_name, @@ -117,20 +117,28 @@ od.perimeter from order_detail as od left join sd.order_glass_detail as ogd - on od.order_id = ogd.order_id and od.order_number = ogd.order_number - where od.order_id = #{orderId} - and ISNULL(ogd.production_id) + on od.order_id = ogd.order_id + where od.order_id = #{orderId} and ISNULL(ogd.production_id) + <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> + and od.order_id regexp #{orderDetail.orderId} + </if> + <if test="orderDetail.productId != null and orderDetail.productId != ''"> + and od.product_id regexp #{orderDetail.productId} + </if> + <if test="orderDetail.productName != null and orderDetail.productName != ''"> + and od.product_name regexp #{orderDetail.productName} + </if> group by od.order_id, od.product_id, od.product_name ; </select> - <select id="SelectOrderNumber"> + <select id="SelectOrderNumber" resultMap="wordOrderMap"> select count(ogd.production_id) from sd.order_glass_detail as ogd where ogd.production_id = #{productIdVl} </select> - <update id="AddOrderWorkMp"> + <update id="AddOrderWorkMp" > update sd.order_detail as od left join sd.order_glass_detail as ogd on od.order_id = ogd.order_id and od.order_number = ogd.order_number @@ -152,4 +160,21 @@ where od.order_id = #{orderId} and od.product_name = #{productName} </update> + + <select id="SelectWorkCount"> + select COUNT(distinct order_number) + from order_glass_detail + where ISNULL(production_id) + and order_id = #{orderId} + </select> + + <select id="SelectYesWorkCount"> + select COUNT(distinct order_number) + from order_glass_detail + where order_id = #{orderId} + </select> + + <update id="UpdateWorkType"> + update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId} + </update> </mapper> \ No newline at end of file diff --git a/north-glass-erp/target/classes/mapper/pp/FolwCard.xml b/north-glass-erp/target/classes/mapper/pp/FolwCard.xml index cbfc46d..b0b3925 100644 --- a/north-glass-erp/target/classes/mapper/pp/FolwCard.xml +++ b/north-glass-erp/target/classes/mapper/pp/FolwCard.xml @@ -27,6 +27,21 @@ <result column="product_name" property="productName"/> <result column="compute_gross_area" property="computeGrossArea"/> <result column="processing_note" property="processingNote"/> + <result column="quantity" property="quantity"/> + <result column="compute_gross_area" property="computeGrossArea"/> + <result column="perimeter" property="perimeter"/> + <result column="order_number" property="orderNumber"/> + <result column="width" property="width"/> + <result column="height" property="height"/> + <result column="shape" property="shape"/> + <result column="weight" property="weight"/> + </association> + <association property="orderGlassDetail" javaType="com.example.erp.entity.sd.OrderGlassDetail"> + <result column="production_id" property="productionId"/> + </association> + <association property="product" javaType="com.example.erp.entity.sd.Product"> + <result column="total_thickness" property="totalThickness"/> + <result column="thickness" property="thickness"/> </association> <!--<result column="g_typeId" property="glassTypes.typeId"/> @@ -46,49 +61,7 @@ c.processing_note from flow_card as a left join sd.`order` as b on a.order_Id=b.order_id left join sd.order_detail as c on a.order_Id=c.order_id and a.order_Number=c.order_number - where a.create_time between #{selectTime1} and #{selectTime2} -<!-- <where>--> -<!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> -<!-- and a.order_id regexp #{flowCard.orderId}--> -<!-- </if>--> -<!-- <if test="flowCard.productionId != null and flowCard.productionId != ''">--> -<!-- and a.process_Id regexp #{flowCard.productionId}--> -<!-- </if>--> -<!-- <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">--> -<!-- and c.product_id regexp #{flowCard.orderDetail.productId}--> -<!-- </if>--> -<!-- <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">--> -<!-- and c.product_name regexp #{flowCard.orderDetail.productName}--> -<!-- </if>--> - -<!-- <if test="flowCard.order.project != null and flowCard.order.project!= ''">--> -<!-- and b.project regexp #{flowCard.order.project}--> -<!-- </if>--> - - -<!-- <if test="flowCard.createTime != null and flowCard.createTime != ''">--> -<!-- and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 }--> -<!-- </if>--> - -<!-- </where>--> - group by a.process_Id; - </select> - - - - <select id="selectFlowCardMp"> - select o.order_id, - o.customer_name, - o.project, - o.batch, - o.other_remarks, - o.icon, - o.order_type, - o.salesman, - o.processing_note, - o.delivery_address - from sd.`order` as o - where o.create_time between #{selectTime1} and #{selectTime2} + where a.create_time between #{selectTime1} and #{selectTime2} <!-- <where>--> <!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> <!-- and a.order_id regexp #{flowCard.orderId}--> @@ -113,10 +86,47 @@ <!-- </if>--> <!-- </where>--> - ; + group by a.process_Id; </select> - - <select id="DetailsSelectMp"> + + + <select id="selectFlowCardMp" resultMap="flowCardMap"> + select o.order_id, + o.customer_name, + o.project, + o.batch, + o.other_remarks, + o.icon, + o.order_type, + o.salesman, + o.processing_note, + o.delivery_address + from sd.`order` as o + where o.production_order=2 and o.create_time between #{selectTime1} and #{selectTime2} + <!-- <where>--> + <!-- <if test="flowCard.orderId != null and flowCard.orderId != ''">--> + <!-- and a.order_id regexp #{flowCard.orderId}--> + <!-- </if>--> + <!-- <if test="flowCard.productionId != null and flowCard.productionId != ''">--> + <!-- and a.process_Id regexp #{flowCard.productionId}--> + <!-- </if>--> + <!-- <if test="flowCard.orderDetail.productId != null and flowCard.orderDetail.productId != ''">--> + <!-- and c.product_id regexp #{flowCard.orderDetail.productId}--> + <!-- </if>--> + <!-- <if test="flowCard.orderDetail.productName != null and flowCard.orderDetail.productName!= ''">--> + <!-- and c.product_name regexp #{flowCard.orderDetail.productName}--> + <!-- </if>--> + + <!-- <if test="flowCard.order.project != null and flowCard.order.project!= ''">--> + <!-- and b.project regexp #{flowCard.order.project}--> + <!-- </if>--> + + + <!-- </where>--> + ; + </select> + + <select id="DetailsSelectMp" resultMap="flowCardMap"> select od.order_id, ogd.production_id, od.product_id, @@ -125,9 +135,55 @@ od.compute_gross_area, od.perimeter from sd.order_detail as od - left join sd.order_glass_detail as ogd - on od.order_id = ogd.order_id and od.order_number = ogd.order_number + left join sd.order_glass_detail as ogd + on od.order_id = ogd.order_id where od.order_id = #{orderId} - group by od.order_id,ogd.production_id + group by od.order_id, ogd.production_id </select> + + + <update id="DeleteFlowCardMp"> + update sd.order_detail as od left join sd.order_glass_detail as ogd + on od.order_id = ogd.order_id and od.order_number = ogd.order_number + set ogd.production_id=null, + ogd.production_time=null, + ogd.founder=null + where od.order_id = #{orderId} + and od.product_name = #{productName} + </update> + + <select id="SelectNoCardMp" resultMap="flowCardMap"> + select + od.order_number, + od.width, + od.height, + od.shape, + od.quantity, + od.compute_gross_area, + p.total_thickness, + p.thickness, + od.weight + from + sd.order_detail as od + left join sd.order_glass_detail as ogd on od.order_id=ogd.order_id + left join sd.product as p on od.product_name=p.product_name + where od.order_id=#{orderId}and ogd.production_id=#{productionId} + <if test="flowCard.orderDetail.orderNumber != null and flowCard.orderDetail.orderNumber != ''"> + and od.order_number regexp #{flowCard.orderDetail.orderNumber} + </if> + <if test="flowCard.orderDetail.width != null and flowCard.orderDetail.width != ''"> + and od.width regexp #{flowCard.orderDetail.width} + </if> + <if test="flowCard.orderDetail.height != null and flowCard.orderDetail.height != ''"> + and od.height regexp #{flowCard.orderDetail.height} + </if> + <if test="flowCard.orderDetail.shape != null and flowCard.orderDetail.shape != ''"> + and od.shape regexp #{flowCard.orderDetail.shape} + + </if> + GROUP BY od.order_number; + + + </select> + </mapper> \ No newline at end of file diff --git a/north-glass-erp/target/classes/mapper/pp/WordOrder.xml b/north-glass-erp/target/classes/mapper/pp/WordOrder.xml index 037e499..3eebdef 100644 --- a/north-glass-erp/target/classes/mapper/pp/WordOrder.xml +++ b/north-glass-erp/target/classes/mapper/pp/WordOrder.xml @@ -30,39 +30,39 @@ </resultMap> <select id="selectWordOrder" resultMap="wordOrderMap"> select - a.order_id, - a.production_id, - c.batch, - b.product_name, - b.compute_area, - b.quantity, - b.compute_gross_area, - b.perimeter, - b.bend_radius, - b.processing_note - from order_glass_detail as a - LEFT JOIN order_detail as b on a.order_id=b.order_id and a.order_number=b.order_number LEFT JOIN - `order` as c on a.order_id=c.order_id - where isnull(a.production_id) + o.order_id, + ogd.production_id, + o.batch, + od.product_name, + od.compute_area, + od.quantity, + od.compute_gross_area, + od.perimeter, + od.bend_radius, + od.processing_note + + from `order` as o left join order_detail as od on o.order_id=od.order_id + left join order_glass_detail as ogd on o.order_id=ogd.order_id and ogd.order_number=od.order_number + where isnull(ogd.production_id) and o.order_review=2 and o.production_order!=2 <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''"> - and a.order_id regexp #{orderGlassDetail.orderId} + and o.order_id regexp #{orderGlassDetail.orderId} </if> <if test="orderGlassDetail.productionId != null and orderGlassDetail.productionId != ''"> - and a.production_id regexp #{orderGlassDetail.productionId} + and ogd.production_id regexp #{orderGlassDetail.productionId} </if> <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''"> - and c.batch regexp #{orderGlassDetail.order.batch} + and o.batch regexp #{orderGlassDetail.order.batch} </if> <if test="orderGlassDetail.orderDetail.productName != null and orderGlassDetail.orderDetail.productName!= ''"> - and b.product_name regexp #{orderGlassDetail.orderDetail.productName} + and od.product_name regexp #{orderGlassDetail.orderDetail.productName} </if> <if test="orderGlassDetail.createTime != ''"> - and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } + and DATE_FORMAT((ogd.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } </if> - group by a.production_id,a.order_number - order by a.id desc + group by o.order_id + order by o.id desc ; @@ -70,45 +70,45 @@ <select id="selectWordOrderNo" resultMap="wordOrderMap"> select - a.order_id, - a.production_id, - c.batch, - b.product_name, - b.compute_area, - b.quantity, - b.compute_gross_area, - b.perimeter, - b.bend_radius, - b.processing_note - from order_glass_detail as a - LEFT JOIN order_detail as b on a.order_id=b.order_id and a.order_number=b.order_number LEFT JOIN - `order` as c on a.order_id=c.order_id - where a.production_id IS NOT NULL + o.order_id, + ogd.production_id, + o.batch, + od.product_name, + od.compute_area, + od.quantity, + od.compute_gross_area, + od.perimeter, + od.bend_radius, + od.processing_note + + from `order` as o left join order_detail as od on o.order_id=od.order_id + left join order_glass_detail as ogd on o.order_id=ogd.order_id and ogd.order_number=od.order_number + where ogd.production_id IS NOT NULL <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''"> - and a.order_id regexp #{orderGlassDetail.orderId} + and ogd.order_id regexp #{orderGlassDetail.orderId} </if> <if test="orderGlassDetail.productionId != null and orderGlassDetail.productionId != ''"> - and a.production_id regexp #{orderGlassDetail.productionId} + and ogd.production_id regexp #{orderGlassDetail.productionId} </if> <if test="orderGlassDetail.order.batch != null and orderGlassDetail.order.batch != ''"> - and c.batch regexp #{orderGlassDetail.order.batch} + and o.batch regexp #{orderGlassDetail.order.batch} </if> <if test="orderGlassDetail.orderDetail.productName != null and orderGlassDetail.orderDetail.productName!= ''"> - and b.product_name regexp #{orderGlassDetail.orderDetail.productName} + and od.product_name regexp #{orderGlassDetail.orderDetail.productName} </if> <if test="orderGlassDetail.createTime != ''"> - and DATE_FORMAT((a.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } + and DATE_FORMAT((ogd.create_time),'%Y-%m-%d') BETWEEN #{ selectTime1 } AND #{ selectTime2 } </if> - group by a.production_id,a.order_number - order by a.id desc + group by ogd.production_id,ogd.order_number + order by ogd.id desc ; </select> - <select id="addWordOrder"> + <select id="addWordOrder" > select od.order_id, od.product_id, od.product_name, @@ -117,20 +117,28 @@ od.perimeter from order_detail as od left join sd.order_glass_detail as ogd - on od.order_id = ogd.order_id and od.order_number = ogd.order_number - where od.order_id = #{orderId} - and ISNULL(ogd.production_id) + on od.order_id = ogd.order_id + where od.order_id = #{orderId} and ISNULL(ogd.production_id) + <if test="orderDetail.orderId != null and orderDetail.orderId != ''"> + and od.order_id regexp #{orderDetail.orderId} + </if> + <if test="orderDetail.productId != null and orderDetail.productId != ''"> + and od.product_id regexp #{orderDetail.productId} + </if> + <if test="orderDetail.productName != null and orderDetail.productName != ''"> + and od.product_name regexp #{orderDetail.productName} + </if> group by od.order_id, od.product_id, od.product_name ; </select> - <select id="SelectOrderNumber"> + <select id="SelectOrderNumber" resultMap="wordOrderMap"> select count(ogd.production_id) from sd.order_glass_detail as ogd where ogd.production_id = #{productIdVl} </select> - <update id="AddOrderWorkMp"> + <update id="AddOrderWorkMp" > update sd.order_detail as od left join sd.order_glass_detail as ogd on od.order_id = ogd.order_id and od.order_number = ogd.order_number @@ -152,4 +160,21 @@ where od.order_id = #{orderId} and od.product_name = #{productName} </update> + + <select id="SelectWorkCount"> + select COUNT(distinct order_number) + from order_glass_detail + where ISNULL(production_id) + and order_id = #{orderId} + </select> + + <select id="SelectYesWorkCount"> + select COUNT(distinct order_number) + from order_glass_detail + where order_id = #{orderId} + </select> + + <update id="UpdateWorkType"> + update sd.order as o set o.production_order=#{state} where o.order_id=#{orderId} + </update> </mapper> \ No newline at end of file -- Gitblit v1.8.0