From 5314634fbbe6fd099d9b134614dba450cba2b5b9 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 19 四月 2024 13:52:23 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
---
north-glass-erp/northglass-erp/src/router/index.js | 10
north-glass-erp/target/classes/mapper/sd/Delivery.xml | 14
north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue | 2
north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java | 6
north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java | 6
north-glass-erp/src/main/resources/mapper/sd/Customer.xml | 156 +++++
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue | 59 ++
north-glass-erp/target/classes/mapper/sd/Customer.xml | 156 +++++
north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue | 4
north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml | 53 +
north-glass-erp/src/main/resources/mapper/sd/Delivery.xml | 14
north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java | 5
north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java | 2
north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue | 8
north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java | 267 +++++++++
north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue | 414 +++++++++++++++
north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomerOrder.vue | 345 ++++++++++++
north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java | 24
north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java | 8
north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml | 53 +
20 files changed, 1,600 insertions(+), 6 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/router/index.js b/north-glass-erp/northglass-erp/src/router/index.js
index 2c3fd7a..95ded16 100644
--- a/north-glass-erp/northglass-erp/src/router/index.js
+++ b/north-glass-erp/northglass-erp/src/router/index.js
@@ -132,6 +132,11 @@
name: 'createDelivery',
component: () => import('../views/sd/delivery/CreateDelivery.vue'),
},
+ {
+ path: 'deliveryPrinting',
+ name: 'deliveryPrinting',
+ component: () => import('../views/sd/delivery/DeliveryPrinting.vue'),
+ },
{
@@ -192,6 +197,11 @@
path: 'createCustomer',
name: 'createCustomer',
component: () => import('../views/sd/customer/CreateCustomer.vue'),
+ },
+ {
+ path: 'selectCustomerOrder',
+ name: 'selectCustomerOrder',
+ component: () => import('../views/sd/customer/SelectCustomerOrder.vue'),
}
]
},
diff --git a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
index c868542..ea405e3 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/mainIngredientStock/SelectIngredientsStock.vue
@@ -734,9 +734,9 @@
</el-select>
</el-row>
</div>
- <div class="main-div-customers">
+ <div class="main-div-customers" style="height: 350px">
<vxe-grid
- height="400px"
+ height="100%"
class="mytable-scrollbar"
ref="xGrids"
v-bind="gridOption"
diff --git a/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue b/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
index bebd527..888d6d8 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
@@ -151,7 +151,7 @@
// }],
// import: false,
// export: true,
- // print: true,
+ print: true,
zoom: true,
custom: true
},
diff --git a/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue b/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
index f7935c8..fcd265c 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomer.vue
@@ -24,6 +24,11 @@
router.push({path: '/main/customer/CreateCustomer', query: { id: row.id }})
break
}
+ case 'customerOrder' :{
+ //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+ router.push({path: '/main/customer/selectCustomerOrder', query: { id: row.id }})
+ break
+ }
case 'delete':{
let ruleForm = ref({
id:0,
@@ -189,7 +194,7 @@
columns:[
{type:'expand',fixed:"left",slots: { content:'content' },width: 60},
{type: 'seq',fixed:"left", title: t('basicData.Number'), width: 80 },
- {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left"},
+ {title: t('basicData.operate'), width: 180, slots: { default: 'button_slot' },fixed:"left"},
{field: 'id', title: t('customer.customerNumber'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
{field: 'customerName', title: t('customer.customerName'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
{field: 'grade', title: t('customer.customerGrade'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
@@ -250,6 +255,7 @@
<!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
<template #button_slot="{ row }">
<el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
+ <el-button @click="getTableRow(row,'customerOrder')" link type="primary" size="small">瀹㈡埛璁㈠崟</el-button>
<el-popconfirm @confirm="getTableRow(row,'delete')" title="纭畾鍒犻櫎?">
<template #reference>
<el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
diff --git a/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomerOrder.vue b/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomerOrder.vue
new file mode 100644
index 0000000..e69429c
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/sd/customer/SelectCustomerOrder.vue
@@ -0,0 +1,345 @@
+<script setup>
+import {Search} from "@element-plus/icons-vue"
+import {useRoute, useRouter} from "vue-router"
+import {onMounted, reactive, ref} from "vue";
+import request from "@/utils/request"
+import deepClone from "@/utils/deepClone"
+import VXETable from "vxe-table";
+import useUserInfoStore from "@/stores/userInfo";
+import {ElMessage} from "element-plus";
+import { useI18n } from 'vue-i18n'
+
+//璇█鑾峰彇
+const { t } = useI18n()
+const router = useRouter()
+const route = useRoute()
+const userStore = useUserInfoStore()
+const username = userStore.user.userName
+const userid = userStore.user.userId
+let produceList = ref([])
+
+const getTableRow = (row,type) =>{
+ switch (type) {
+
+ }
+}
+
+
+const hasDecimal=(value)=>{
+ const regex=/\./ // 瀹氫箟姝e垯琛ㄨ揪寮忥紝鏌ユ壘灏忔暟鐐�
+ return regex.test(value) //杩斿洖true/false
+}
+
+const hasDecimalhtml=(item,row)=>{
+ let aa=item.split('.').length
+ if (aa===2){
+ return row[item.split('.')[0]][item.split('.')[1]]
+ }else if(aa===3){
+ return row[item.split('.')[0]][item.split('.')[1]][item.split('.')[2]]
+ }
+
+
+}
+
+//绛涢�夋潯浠讹紝鏈夊閿渶瑕佸厛瀹氫箟鏄庣粏閲岄潰鐨勬暟鎹�
+let filterData = ref({
+ order:{
+ customerId:''
+ }
+
+
+})
+let selectDate = ref(["",""])
+
+let pageNum=ref(1)
+let total = reactive({
+ pageTotal : 0,
+ dataTotal : 0,
+ pageSize : 100
+})
+
+
+onMounted(()=>{
+
+ //鑾峰彇浼犺繃鏉ョ殑鏁版嵁杩涜鍒ゆ柇
+ const str = route.query.id
+ if (typeof str != 'undefined' && str != null && str !== '' && str !== '\n' && str !== '\r'){
+ filterData.value.order.customerId = Number(str)
+
+ request.post(`/customer/getSelectCustomerOderDate/1/${total.pageSize}/${selectDate.value}`,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
+ selectDate.value = res.data.selectDate
+ pageNum.value=1
+ produceList = deepClone(res.data.data)
+ xGrid.value.loadData(produceList)
+ gridOptions.loading=false
+
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+ }
+
+
+})
+
+
+
+
+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(`/customer/getSelectCustomerOderDate/1/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
+
+ if(res.code==200){
+ total.dataTotal = res.data.total.total*1
+ total.pageTotal= res.data.total.pageTotal
+ selectDate.value = res.data.selectDate
+ pageNum.value=1
+ produceList = deepClone(res.data.data)
+ xGrid.value.loadData(produceList)
+ gridOptions.loading=false
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+}
+
+const selectOrderList = ()=>{
+ request.post(`/customer/getSelectCustomerOderDate/${pageNum.value}/${total.pageSize}/${selectDate.value}`,filterData.value).then((res) => {
+
+ if(res.code==200){
+ if (res.data.total!=null){
+ total.dataTotal = res.data.total.total*1
+ total.pageTotal= res.data.total.pageTotal
+ }
+ produceList = deepClone(res.data.data)
+ xGrid.value.loadData(produceList)
+ gridOptions.loading=false
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+}
+
+const changeDate = ()=>{
+ pageNum.value=1
+ selectOrderList()
+}
+
+//椤佃剼璺宠浆
+const handlePageChange = ({ currentPage, pageSize }) => {
+ total.pageTotal = pageSize
+ pageNum.value=currentPage
+
+ selectOrderList()
+}
+
+
+const xGrid = ref()
+const gridOptions = reactive({
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe:true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'OrderList',
+ showFooter: true,//鏄剧ず鑴�
+ printConfig: {},
+ importConfig: {},
+ exportConfig: {},
+ scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+ showOverflow:true,
+ columnConfig: {
+ resizable: true,
+ useKey: true
+ },
+ filterConfig: { //绛涢�夐厤缃」
+ remote: true
+ },
+ customConfig: {
+ storage: true
+ },
+ editConfig: {
+ trigger: 'click',
+ mode: 'row',
+ showStatus: true
+ },//琛ㄥご鍙傛暟
+ columns:[
+
+ {type:'expand',slots: { content:'content' },width: 60,fixed:"left"},
+ {type: 'seq', title: t('basicData.Number'), width: 80 ,fixed:"left"},
+
+ {field: 'orderId',width:120, title: t('order.orderId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'order.customerId',width:120, title: t('customer.customerNumber')},
+ {field: 'order.customerName',width:120, title: t('customer.customerName')},
+ {field: 'quantity',width:120, title: t('order.quantity')},
+ {field: 'productId',width:120, title: "浜у搧缂栧彿",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'productName',width:120, title: "浜у搧鍚嶇О",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'shape',width:120, title: "褰㈢姸",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'width',width:120, title: "瀹藉害",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'height',width:120, title: "楂樺害",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'order.project',width:120, title: t('order.project'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'order.batch',width:120, title: t('order.batch'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'order.money',width:120, title: "璁㈠崟閲戦",filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'area',width:120, title: t('productStock.totalArea')},
+ {field: 'order.orderType',width:120, title: t('order.orderType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'order.salesman',width:120, title:t('order.salesman'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'order.createTime',width:120, title:"鍒涘缓鏃堕棿"},
+
+
+ ],//琛ㄥご鎸夐挳
+ toolbarConfig: {
+ buttons: [
+ ],
+ /*import: false,
+ export: true,
+ print: true,*/
+ zoom: true,
+ custom: true
+ },
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ let footList = ['quantity','area']
+ return[
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return t('basicData.total')
+ }
+ if (footList.includes(column.field)) {
+ return sumNum(data, column.field)
+ }
+ return ''
+ })
+ ]
+ }
+
+})
+
+
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+ let count = 0
+ list.forEach(item => {
+ count += Number(item[field])
+ })
+ return count.toFixed(2)
+}
+
+const gridEvents = {
+ toolbarButtonClick ({ code }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (code) {
+
+ }
+ }
+ }
+}
+
+//鏁扮粍鏁版嵁楠岄噸
+function isAllEqual(array){
+ if(array.length>0){
+ return !array.some(function(value,index){
+ return value !== array[0];
+ });
+ }else{
+ return true;
+ }
+}
+
+
+
+
+</script>
+
+<template>
+ <div style="width: 100%;height: 100%">
+ <el-date-picker
+ v-model="selectDate"
+ type="daterange"
+ start-placeholder="寮�濮嬫椂闂�"
+ end-placeholder="缁撴潫鏃堕棿"
+ format="YYYY-MM-DD"
+ value-format="YYYY-MM-DD"
+
+ />
+ <el-button @click="changeDate" style="margin-top: -5px" id="searchButton" type="primary" :icon="Search">{{$t('basicData.search')}}</el-button>
+ <vxe-grid
+ max-height="97%"
+ class="mytable-scrollbar"
+ @filter-change="filterChanged"
+ ref="xGrid"
+ v-bind="gridOptions"
+ v-on="gridEvents"
+
+ >
+ <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+ <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>
+ </ul>
+ </template>
+
+ <template #state="{ row,column}">
+ <el-checkbox @click.native.prevent :indeterminate="row[column.field]===1" :checked="row[column.field]===2"/>
+ </template>
+
+ <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+ <template #button_slot="{ row }">
+ <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
+ <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">{{$t('basicData.delete')}}</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>
+
+ <template #pager>
+ <!--浣跨敤 pager 鎻掓Ы-->
+ <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>
+</template>
+
+<style scoped>
+
+</style>
\ No newline at end of file
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue
new file mode 100644
index 0000000..09b4144
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/DeliveryPrinting.vue
@@ -0,0 +1,414 @@
+<script setup>
+
+
+import request from "@/utils/request"
+import {ElDatePicker, ElMessage} from "element-plus"
+import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
+import {Search} from "@element-plus/icons-vue"
+import {useRoute, useRouter} from "vue-router"
+import {changeFilterEvent, filterChanged} from "@/hook"
+
+import { useI18n } from 'vue-i18n'
+import deepClone from "@/utils/deepClone";
+//璇█鑾峰彇
+const { t } = useI18n()
+let router=useRouter()
+const route = useRoute()
+let produceList = ref([])
+let delivery = ref([])
+let money = ref("")
+let takeCare = "娉ㄦ剰:璇峰Ε鍠勪繚绠″ソ鎴戝徃鐨勭幓鐠冩灦锛屽鏈変涪澶辨垨鎹熷潖锛屾寜1500鍏冨彧璧斿伩銆傝阿璋㈤厤鍚�!"
+let remark = "澶囨敞:鏈壒鐜荤拑涓轰紭绛夊悎鏍煎搧锛岃鍦ㄥ嵏璐ф椂,褰撻潰娑堢偣楠屾敹銆佸鏈夎川閲忛棶棰樺湪涓�鍛ㄥ唴涓庢湰鍏徃鑱旂郴,鍚﹀垯姒備笉璐熻矗锛�"
+
+let props = defineProps({
+ deliveryId:null
+})
+
+const form = ref({
+})
+
+
+
+
+const Printing = ()=>{
+
+ // 闇�瑕佹墦鍗扮殑灞�閮ㄥ尯鍩熻祴浜�"print-wrap"鐨刬d
+ let el = document.getElementById("pis");
+ let doc = document;
+ let body = doc.body || doc.getElementsByTagName("body")[0];
+ let printId = "print-" + Date.now();
+
+ // 鍒涘缓鏃犲壇浣滅敤鐨勬墦鍗板鍣�(鍥犱笉纭畾椤甸潰鐨勬墦鍗板厓绱犳湁鏃犲叾瀹冩牱寮�)
+ let content = doc.createElement("div");
+ content.id = printId;
+
+ // 鏍峰紡鎺у埗涓庢墦鍗版棤鍏崇殑鍏冪礌闅愯棌
+ let style = doc.createElement("style");
+ style.innerHTML =
+ "body>#" +
+ printId +
+ "{display:none}@media print{body>:not(#" +
+ printId +
+ "){display:none !important}body>#" +
+ printId +
+ "{display:block;padding-top:1px}}";
+
+ content.innerHTML = el.outerHTML;
+ // console.log("el.outerHTML", el.outerHTML);
+ body.appendChild(style);
+
+ // 涓巗tyle鍏冪礌璁剧疆鐨勬牱寮忕浉閰嶅悎
+ // 鎶婃墦鍗板唴瀹圭殑鍏冪礌娣诲姞鍒癰ody(浣滀负body鐨勫瓙鍏冪礌锛屽彲鐢╞ody鐨勫瓙閫夋嫨鍣� '>' 鎺у埗鎵撳嵃鏍峰紡)
+ body.appendChild(content);
+ setTimeout(() => {
+ window.print();
+ body.removeChild(content);
+ body.removeChild(style);
+ }, 20);
+}
+
+
+onMounted(()=>{
+ console.log(props.deliveryId)
+ /*if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){
+ return
+ }
+ form.value.deliveryId = props.deliveryId*/
+ if(route.query.deliveryID===null || route.query.deliveryID===undefined || route.query.deliveryID===''){
+ return
+ }
+ form.value.deliveryId=route.query.deliveryID
+
+
+ request.post(`/Delivery/getSelectDeliveryPrinting`,form.value).then((res) => {
+ if(res.code==200){
+ produceList.value = deepClone(res.data.data)
+ delivery.value=deepClone(res.data.delivery)
+ money.value=deepClone(res.data.money)
+
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+
+})
+
+setTimeout(function(){
+ Printing()
+}, 1000);
+
+
+
+
+</script>
+
+<template>
+
+ <div>
+ <el-button @click="Printing" style="margin-top: -5px" id="searchButton" type="primary" >鎵撳嵃</el-button>
+ <div id="pis" style="width: 100%;height: 100%">
+ <div style="font-size: 30px;text-align: center;font-weight: bold;">甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�</div>
+ <el-row :gutter="20">
+ <el-col :span="7"><div></div></el-col>
+ <el-col :span="10"><div style="font-size: 25px;text-align: center;font-weight: bold;">閿�鍞彂璐у崟</div></el-col>
+ <el-col :span="7">
+ <div style="display: flex;margin-top: 10px">
+ <div style="font-weight: bold;font-size: 15px">鍙戣揣鍗曞彿锛�</div>
+ <div style="font-weight: bold;font-size: 15px">{{delivery.deliveryId}}</div>
+ </div>
+ </el-col>
+ </el-row>
+ <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <tr>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">瀹㈡埛鍚嶇О锛�<span>{{delivery.customerName}}</span></th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">椤圭洰鍚嶇О锛�<span>{{delivery.project}}</span></th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">鑱旂郴浜猴細<span>{{delivery.contacts}}</span></th>
+
+ </tr>
+ <tr>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="6">閫佽揣鍦板潃锛�<span>{{delivery.deliveryAddress}}</span></th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">鑱旂郴鐢佃瘽锛�<span>{{delivery.contactNumber}}</span></th>
+
+ </tr>
+ <tr>
+ <th style="width: 6%;font-size: 15px;font-weight: bold;">搴忓彿</th>
+ <th style="width: 20%;font-size: 15px;font-weight: bold;">妤煎眰缂栧彿</th>
+ <th style="width: 20%;font-size: 15px;font-weight: bold;">瀹�(寮у害)*楂�</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">鏁伴噺</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">闈㈢Н</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">鍗曚环</th>
+ <th style="width: 12%;font-size: 15px;font-weight: bold;">閲戦</th>
+ <th style="width: 12%;font-size: 15px;font-weight: bold;">鍔犲伐瑕佹眰</th>
+ </tr>
+
+ <template v-for="(item, index) in produceList" :key="index" >
+ <tr>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">浜у搧鍚嶇О:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">瀵规柟鍗曞彿:</td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="2">璁㈠崟缂栧彿:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
+ </tr>
+
+ <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
+ <td>{{items.order_number}}</td>
+ <td>{{items.buildingNumber}}</td>
+ <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
+ <td>{{items.quantity}}</td>
+ <td>{{items.area}}</td>
+ <td>{{items.price}}</td>
+ <td>{{items.money}}</td>
+ <td>{{items.processingNote}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">灏忚:</td>
+ <td>{{item.DeliveryDetail.quantity}}</td>
+ <td>{{item.DeliveryDetail.area}}</td>
+ <td></td>
+ <td>{{item.DeliveryDetail.money}}</td>
+ <td></td>
+ </tr>
+
+ </template>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">鍚堣:</td>
+ <td>{{delivery.quantity}}</td>
+ <td>{{delivery.area}}</td>
+ <td></td>
+ <td>{{delivery.money}}</td>
+ <td></td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
+ <div style="display: flex;font-size: 10px;">
+ <div>鍔犲伐璐圭敤</div>
+ <div style="margin-left: 20%">鍗曚环</div>
+ <div style="margin-left: 20%">鏁伴噺</div>
+ <div style="margin-left: 20%">閲戦</div>
+ </div>
+
+ </td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">鎬婚噾棰�: {{delivery.money}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">澶у啓閲戦: {{money}}</td>
+ </tr>
+ </table>
+ </div>
+ <el-row :gutter="20">
+ <el-col :span="3"><div class="bottom">鍒跺崟鍛橈細<span style="font-size: 10px">{{delivery.creator}}</span></div></el-col>
+ <el-col :span="5"><div class="bottom">鍒跺崟鏃ユ湡锛�<span style="font-size: 10px">{{delivery.createTime}}</span></div></el-col>
+ <el-col :span="4"><div class="bottom">鍙戣揣鍛橈細</div></el-col>
+ <el-col :span="4"><div class="bottom">鍙告満锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">瀹㈡埛绛惧瓧锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">绛炬敹鏃ユ湡锛�</div></el-col>
+
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="3"><div class="bottom">鏋跺瓙 鍙�</div></el-col>
+ <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
+ </el-row>
+
+
+
+ </div>
+ </div>
+</template>
+
+<style>
+@media print{
+ @page {
+ mso-header:none;
+ margin: 10mm 16mm;
+ margin-bottom: 8mm;
+ margin-top:8mm;
+
+ }
+}
+#table1 tr{
+ height: 30px;
+}
+#table1 th{
+ height: 30px;
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+}
+.day-in td{
+text-align: center;
+}
+#table1 td{
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+}
+#deliveryPrinting .el-dialog__header{
+ visibility:hidden
+}
+
+.el-overlay-dialog{
+ overflow-y: scroll;
+}
+::-webkit-scrollbar {
+ display: none;
+}
+.bottom{
+ font-size: 10px;
+ font-weight: bold;
+
+}
+
+</style>
+
+
+<!--
+<template>
+
+ <div>
+ <div id="pis" style="width: 100%;height: 100%">
+ <div style="font-size: 35px;text-align: center;font-weight: bold;">甯稿窞甯傚悏鍒╃幓鐠冩湁闄愬叕鍙�</div>
+ <el-row :gutter="20">
+ <el-col :span="6"><div></div></el-col>
+ <el-col :span="12"><div style="font-size: 30px;text-align: center;font-weight: bold;">閿�鍞彂璐у崟</div></el-col>
+ <el-col :span="6">
+ <div style="font-size: 20px;display: flex;margin-top: 10px">
+ <div style="font-weight: bold;">鍙戣揣鍗曞彿锛�</div>
+ <div style="font-weight: bold;">{{delivery.deliveryId}}</div>
+ </div>
+ </el-col>
+ </el-row>
+ <div style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <table id="table1" style="border: 1px solid #d3dce6;border-collapse: collapse;width: 100%;height: 100%;">
+ <tr>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">瀹㈡埛鍚嶇О锛歿{delivery.customerName}}</th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="3">椤圭洰鍚嶇О锛歿{delivery.project}}</th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">鑱旂郴浜猴細{{delivery.contacts}}</th>
+
+ </tr>
+ <tr>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="6">閫佽揣鍦板潃锛歿{delivery.deliveryAddress}}</th>
+ <th style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="2">鑱旂郴鐢佃瘽锛歿{delivery.contactNumber}}</th>
+
+ </tr>
+ <tr>
+ <th style="width: 6%;font-size: 15px;font-weight: bold;">搴忓彿</th>
+ <th style="width: 20%;font-size: 15px;font-weight: bold;">妤煎眰缂栧彿</th>
+ <th style="width: 20%;font-size: 15px;font-weight: bold;">瀹�(寮у害)*楂�</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">鏁伴噺</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">闈㈢Н</th>
+ <th style="width: 10%;font-size: 15px;font-weight: bold;">鍗曚环</th>
+ <th style="width: 12%;font-size: 15px;font-weight: bold;">閲戦</th>
+ <th style="width: 12%;font-size: 15px;font-weight: bold;">鍔犲伐瑕佹眰</th>
+ </tr>
+
+ <template v-for="(item, index) in produceList" :key="index" >
+ <tr>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">浜у搧鍚嶇О:{{item.DeliveryDetail.orderDetail.productName}}</td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">瀵规柟鍗曞彿:</td>
+ <td style="font-size: 15px;font-weight: bold;" colspan="2">璁㈠崟缂栧彿:{{item.DeliveryDetail.orderDetail.orderId}}</td>
+ </tr>
+
+ <tr class="day-in" v-for="(items, index1) in item.DeliveryDetailList" :key="index1">
+ <td>{{items.order_number}}</td>
+ <td>{{items.buildingNumber}}</td>
+ <td style="font-size: 15px;font-weight: bold;">{{items.width}}x{{items.height}}</td>
+ <td>{{items.quantity}}</td>
+ <td>{{items.area}}</td>
+ <td>{{items.price}}</td>
+ <td>{{items.money}}</td>
+ <td>{{items.processingNote}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">灏忚:</td>
+ <td>{{item.DeliveryDetail.quantity}}</td>
+ <td>{{item.DeliveryDetail.area}}</td>
+ <td></td>
+ <td>{{item.DeliveryDetail.money}}</td>
+ <td></td>
+ </tr>
+
+ </template>
+ <tr class="day-in">
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">鍚堣:</td>
+ <td>{{delivery.quantity}}</td>
+ <td>{{delivery.area}}</td>
+ <td></td>
+ <td>{{delivery.money}}</td>
+ <td></td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6" colspan="3">
+ <div style="display: flex">
+ <div>鍔犲伐璐圭敤</div>
+ <div style="margin-left: 20%">鍗曚环</div>
+ <div style="margin-left: 20%">鏁伴噺</div>
+ <div style="margin-left: 20%">閲戦</div>
+ </div>
+
+ </td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">鎬婚噾棰�: {{delivery.money}}</td>
+ </tr>
+ <tr class="day-in">
+ <td style="text-align: left;border-width: 0 1px 0 0; border-style: solid; border-color: #d3dce6;" colspan="3"></td>
+ <td style="text-align: left;border:none;font-size: 15px;font-weight: bold;" colspan="5">澶у啓閲戦: {{money}}</td>
+ </tr>
+ </table>
+ </div>
+ <el-row :gutter="20">
+ <el-col :span="3"><div class="bottom">鍒跺崟鍛橈細<span style="font-size: 15px">{{delivery.creator}}</span></div></el-col>
+ <el-col :span="5"><div class="bottom">鍒跺崟鏃ユ湡锛�<span style="font-size: 15px">{{delivery.createTime}}</span></div></el-col>
+ <el-col :span="4"><div class="bottom">鍙戣揣鍛橈細</div></el-col>
+ <el-col :span="4"><div class="bottom">鍙告満锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">瀹㈡埛绛惧瓧锛�</div></el-col>
+ <el-col :span="4"><div class="bottom">绛炬敹鏃ユ湡锛�</div></el-col>
+
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="3"><div class="bottom">鏋跺瓙 鍙�</div></el-col>
+ <el-col :span="21"><div class="bottom">{{takeCare}}</div></el-col>
+ </el-row>
+ <el-row :gutter="20" style="margin-top: 20px;">
+ <el-col :span="24"><div class="bottom">{{remark}}</div></el-col>
+ </el-row>
+
+
+
+ </div>
+ </div>
+</template>
+
+<style >
+#table1 tr{
+ height: 30px;
+}
+#table1 th{
+ height: 30px;
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+}
+.day-in td{
+ text-align: center;
+}
+#table1 td{
+ border: 1px solid #d3dce6;
+ border-collapse: collapse;
+}
+#deliveryPrinting .el-dialog__header{
+ visibility:hidden
+}
+
+.el-overlay-dialog{
+ overflow-y: scroll;
+}
+::-webkit-scrollbar {
+ display: none;
+}
+.bottom{
+ font-size: 20px;
+ font-weight: bold;
+
+}
+
+</style>-->
diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
index 847874e..fe180ed 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
@@ -8,6 +8,7 @@
import useUserInfoStore from "@/stores/userInfo";
import {ElMessage} from "element-plus";
import { useI18n } from 'vue-i18n'
+import DeliveryPrinting from "@/views/sd/delivery/DeliveryPrinting.vue";
//璇█鑾峰彇
const { t } = useI18n()
@@ -15,11 +16,20 @@
const userStore = useUserInfoStore()
const username = userStore.user.userName
const userid = userStore.user.userId
+const dialogTableVisible = ref(false)
+let rowClickIndex = ref(null)
let produceList = ref([])
const getTableRow = (row,type) =>{
switch (type) {
case 'edit' :{
router.push({path: '/main/delivery/createDelivery', query: { deliveryID: row.deliveryId }})
+ break
+ }
+ case 'printing' :{
+ /*const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
+ window.open(url.href, '_blank')
+ break*/
+ router.push({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
break
}
case 'delete':{
@@ -162,6 +172,29 @@
selectOrderList()
}
+const gridEvents = {
+
+ menuClick ({ menu, row, column }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (menu.code) {
+ case 'getProcessList': {
+ if(rowClickIndex.value===null){
+ ElMessage.warning(t('searchOrder.msgList.checkOrder'))
+ return
+ }
+ dialogTableVisible.value = true
+ break
+ }
+
+ }
+ }
+ },
+ cellClick({ row }){
+ rowClickIndex.value = row
+ }
+}
+
const gridOptions = reactive({
border: "full",//琛ㄦ牸鍔犺竟妗�
keepSource: true,//淇濇寔婧愭暟鎹�
@@ -189,10 +222,20 @@
trigger: 'click',
mode: 'row',
showStatus: true
- },//琛ㄥご鍙傛暟
+ },
+ menuConfig: {
+ body: {
+ options: [
+ [
+ { code: 'getProcessList', name: "鎵撳嵃", prefixIcon: 'vxe-icon-file-txt', visible: true}
+ ]
+ ]
+ }
+ },
+ //琛ㄥご鍙傛暟
columns:[
{type:'expand',slots: { content:'content' },width: 60},
- {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' }},
+ {title: t('basicData.operate'), width: 150, slots: { default: 'button_slot' }},
{type: 'seq', title: t('basicData.Number'), width: 80 },
{field: 'deliveryState',title: t('basicData.review'), width: 40, slots: { default: 'state' }},
@@ -258,6 +301,7 @@
class="mytable-scrollbar"
ref="xGrid"
v-bind="gridOptions"
+ v-on="gridEvents"
>
<!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
@@ -280,6 +324,7 @@
<!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
<template #button_slot="{ row }">
<el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
+ <el-button @click="getTableRow(row,'printing')" :disabled="row.deliveryState!==2" link type="primary" size="small">鎵撳嵃</el-button>
<el-popconfirm @confirm="getTableRow(row,'delete')" title="纭畾鍒犻櫎?">
<template #reference>
<el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
@@ -308,6 +353,16 @@
</vxe-pager>
</template>
</vxe-grid>
+
+ <el-dialog
+ v-model="dialogTableVisible"
+ destroy-on-close
+ id="deliveryPrinting"
+ style="width: 100%;height:100%;margin-top: 0; ">
+ <DeliveryPrinting
+ :deliveryId="rowClickIndex.deliveryId"
+ style="width: 100%;height: 100%;" />
+ </el-dialog>
</div>
</template>
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java
index dd6c85d..8c49ace 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/CustomerController.java
@@ -59,6 +59,12 @@
}
}
+ @ApiOperation("瀹㈡埛璁㈠崟鏌ヨ鎺ュ彛")
+ @PostMapping("/getSelectCustomerOderDate/{pageNum}/{pageSize}/{selectDate}")
+ public Result getSelectCustomerOderDate(@PathVariable Integer pageNum, @PathVariable Integer pageSize,@PathVariable List<String> selectDate, @RequestBody OrderDetail orderDetail){
+ return Result.seccess(customerService.getSelectCustomerOderDate(pageNum,pageSize,selectDate,orderDetail));
+ }
+
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java b/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
index 4f1645d..a653efd 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/sd/DeliveryController.java
@@ -95,6 +95,12 @@
}
}
+ @ApiOperation("鍙戣揣璁㈠崟鏌ヨ鎺ュ彛")
+ @PostMapping("/getSelectDeliveryPrinting")
+ public Result getSelectDeliveryPrinting( @RequestBody DeliveryDetail deliveryDetail){
+ return Result.seccess(deliveryService.getSelectDeliveryPrinting(deliveryDetail));
+ }
+
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java
index d286f2c..86622ca 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/CustomerMapper.java
@@ -2,6 +2,8 @@
import com.example.erp.entity.sd.Customer;
import com.example.erp.entity.sd.Delivery;
+import com.example.erp.entity.sd.DeliveryDetail;
+import com.example.erp.entity.sd.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.repository.CrudRepository;
@@ -25,4 +27,10 @@
Boolean updateCustomer(@Param("customer") Customer customer);
Boolean deleteCustomer(@Param("customer") Customer customer);
+
+ List<OrderDetail> getSelectCustomerOderDate(@Param("offset") Integer offset,
+ @Param("pageSize") Integer pageSize, String startDate, String endDate,
+ @Param("orderDetail") OrderDetail orderDetail);
+
+ Map<String,Integer> getSelectCustomerOderDatePageTotal(Integer offset, Integer pageSize,String startDate, String endDate, OrderDetail orderDetail);
}
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java
index bae21c0..d66aa05 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryDetailMapper.java
@@ -22,6 +22,11 @@
Integer getSelectShippingOrderDetailPageTotal(Integer offset, Integer pageSize,OrderDetail orderDetail);
+ List<DeliveryDetail> getSelectDeliveryPrinting(@Param("deliveryDetail") DeliveryDetail deliveryDetail);
+
+ List <Map<String, Object>> getSelectDeliveryDetailPrinting(@Param("deliveryId") String deliveryId,
+ @Param("productId") Integer productId,@Param("orderId") String orderId);
+
List<DeliveryDetail> getSelectDeliveryDetailReport(@Param("offset") Integer offset,
@Param("pageSize") Integer pageSize,String startDate, String endDate,
@Param("deliveryDetail") DeliveryDetail deliveryDetail);
diff --git a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java
index 7c30f76..a79c0fb 100644
--- a/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java
+++ b/north-glass-erp/src/main/java/com/example/erp/mapper/sd/DeliveryMapper.java
@@ -23,6 +23,8 @@
@Param("pageSize") Integer pageSize,
@Param("orderDetail") OrderDetail orderDetail);
+ Delivery getSelectShippingOrderDetailDeliveryPrinting(@Param("deliveryDetail") DeliveryDetail deliveryDetail);
+
Order getSelectShippingOrderDetailDeliverys(@Param("offset") Integer offset,
@Param("pageSize") Integer pageSize,
@Param("orderDetail") OrderDetail orderDetail);
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
index c141ddb..d14e3dc 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/CustomerService.java
@@ -97,5 +97,29 @@
}
+ public Map<String, Object> getSelectCustomerOderDate(Integer pageNum, Integer pageSize,List<String> selectDate, OrderDetail orderDetail) {
+ Integer offset = (pageNum - 1) * pageSize;
+ String endDate = LocalDate.now().toString();
+ String startDate = LocalDate.now().minusDays(15).toString();
+ if(selectDate !=null && selectDate.size()==2){
+ if(!selectDate.get(0).isEmpty()){
+ startDate = selectDate.get(0);
+ }
+ if(!selectDate.get(1).isEmpty()){
+ endDate = selectDate.get(1);
+ }
+ }
+ System.out.println(orderDetail);
+ System.out.println(orderDetail.getOrder());
+ Map<String, Object> map = new HashMap<>();
+ map.put("data", customerMapper.getSelectCustomerOderDate(offset, pageSize,startDate,endDate, orderDetail));
+ map.put("total", customerMapper.getSelectCustomerOderDatePageTotal(offset, pageSize,startDate,endDate, orderDetail));
+ List<String> list = new ArrayList<>();
+ list.add(startDate);
+ list.add(endDate);
+ map.put("selectDate",list);
+ return map;
+ }
+
}
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
index 4dc53cb..c14a556 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/DeliveryService.java
@@ -1,5 +1,6 @@
package com.example.erp.service.sd;
+import com.alibaba.excel.util.StringUtils;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
@@ -22,6 +23,7 @@
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
+import java.math.BigDecimal;
@Service
@DS("sd")
@@ -265,6 +267,271 @@
}
+ public Map<String, Object> getSelectDeliveryPrinting( DeliveryDetail deliveryDetail) {
+ Map<String, Object> map = new HashMap<>();
+ List <Map<String, Object>> list=new ArrayList<Map<String, Object>>();//鏈�缁堢粨鏋�
+ List<DeliveryDetail> deliveryDetailList=deliveryDetailMapper.getSelectDeliveryPrinting(deliveryDetail);
+ for (DeliveryDetail detail : deliveryDetailList) {
+
+ Map<String, Object> itemmap = new HashMap<>();
+ List<Map<String, Object>> deliveryDetailList2 = deliveryDetailMapper.getSelectDeliveryDetailPrinting(detail.getDeliveryId(),
+ detail.getOrderDetail().getProductId(), detail.getOrderDetail().getOrderId());
+ itemmap.put("DeliveryDetail", detail);
+ itemmap.put("DeliveryDetailList", deliveryDetailList2);
+ list.add(itemmap);
+
+
+ }
+ Delivery delivery=deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail);
+ map.put("data", list);
+ map.put("delivery", deliveryMapper.getSelectShippingOrderDetailDeliveryPrinting(deliveryDetail));
+ map.put("money", toChinese(delivery.getMoney().toString(), false));
+ return map;
+
+ }
+
+ private static final String[] NUMBERS = {"闆�", "澹�", "璐�", "鍙�", "鑲�", "浼�", "闄�", "鏌�", "鎹�", "鐜�"};
+
+ private static final String[] IUNIT = {"鍏�", "鎷�", "浣�", "浠�", "涓�", "鎷�", "浣�", "浠�", "浜�", "鎷�", "浣�", "浠�"};
+
+ private static final String[] DUNIT = {"瑙�", "鍒�"};
+
+ private static final String[] CN_NUMBERS = {"闆�", "涓�", "浜�", "涓�", "鍥�", "浜�", "鍏�", "涓�", "鍏�", "涔�"};
+
+ private static final String[] CN_IUNIT = {"", "鍗�", "鐧�", "鍗�", "涓�", "鍗�", "鐧�", "鍗�", "浜�", "鍗�", "鐧�", "鍗�"};
+
+
+
+ /**
+ * 杞崲涓哄ぇ鍐欑殑涓枃閲戦,鏀寔璐熸暟
+ * @param amount 閲戦
+ * @param isSimplified 鏄惁绠�浣撲腑鏂囷細true:绠�浣擄紝false锛氱箒浣�
+ * @return
+ */
+ public static String toChinese(String amount, boolean isSimplified) {
+ // 鍒ゆ柇杈撳叆鐨勯噾棰濆瓧绗︿覆鏄惁绗﹀悎瑕佹眰
+ if (StringUtils.isBlank(amount) || !amount.matches("(-)?[\\d]*(.)?[\\d]*")) {
+ throw new RuntimeException("璇疯緭鍏ユ暟瀛�");
+ }
+
+ if ("0".equals(amount) || "0.00".equals(amount) || "0.0".equals(amount)) {
+ return isSimplified ? "闆�" : "闆跺厓";
+ }
+
+ // 鍒ゆ柇閲戦鏁板瓧涓槸鍚﹀瓨鍦ㄨ礋鍙�"-"
+ boolean flag = false;
+ if (amount.startsWith("-")) {
+ // 鏍囧織浣嶏紝鏍囧織姝ら噾棰濇暟瀛椾负璐熸暟
+ flag = true;
+ amount = amount.replaceAll("-", "");
+ }
+ // 鍘绘帀閲戦鏁板瓧涓殑閫楀彿","
+ amount = amount.replaceAll(",", "");
+ // 鍒濆鍖栵細鍒嗙鏁存暟閮ㄥ垎鍜屽皬鏁伴儴鍒�
+ String[] separateNum = separateNum(amount);
+ // 鏁存暟閮ㄥ垎鏁板瓧
+ String integerStr = separateNum[0];
+ // 灏忔暟閮ㄥ垎鏁板瓧
+ String decimalStr = separateNum[1];
+ // beyond瓒呭嚭璁$畻鑳藉姏锛岀洿鎺ヨ繑鍥�
+ if (integerStr.length() > IUNIT.length) {
+ throw new RuntimeException("杈撳叆鏁板瓧瓒呴檺");
+ }
+ // 鏁存暟閮ㄥ垎鏁板瓧
+ int[] integers = toIntArray(integerStr);
+ // 鍒ゆ柇鏁存暟閮ㄥ垎鏄惁瀛樺湪杈撳叆012鐨勬儏鍐�
+ if (integers.length > 1 && integers[0] == 0) {
+ throw new RuntimeException("杈撳叆鏁板瓧涓嶇鍚堣姹�");
+ }
+ // 璁剧疆涓囧崟浣�
+ boolean isWan = isWan5(integerStr);
+ // 灏忔暟閮ㄥ垎鏁板瓧
+ int[] decimals = toIntArray(decimalStr);
+ // 杩斿洖鏈�缁堢殑澶у啓閲戦
+ String result = "";
+ String chineseInteger = getChineseInteger(integers, isWan, isSimplified);
+ String chineseDecimal = getChineseDecimal(decimals, isSimplified);
+ if (decimals.length > 0 && isSimplified) {
+ result = chineseInteger;
+ if (!chineseDecimal.equals("闆堕浂")) {
+ result = result + "鐐�" + chineseDecimal;
+ }
+ } else {
+ result = chineseInteger + chineseDecimal;
+
+ }
+ if (flag) {
+ // 濡傛灉鏄礋鏁帮紝鍔犱笂"璐�"
+ return "璐�" + result;
+ } else {
+ return result;
+ }
+ }
+
+ /**
+ * 鍒嗙鏁存暟閮ㄥ垎鍜屽皬鏁伴儴鍒�
+ * @param str
+ * @return
+ */
+ private static String[] separateNum(String str) {
+ String integerStr;// 鏁存暟閮ㄥ垎鏁板瓧
+ String decimalStr;// 灏忔暟閮ㄥ垎鏁板瓧
+ if (str.indexOf('.') >= 1) {
+ integerStr = str.substring(0, str.indexOf('.'));
+ decimalStr = str.substring(str.indexOf('.') + 1);
+ if (decimalStr.length() > 2) {
+ decimalStr = decimalStr.substring(0, 2);
+ }
+ } else if (str.indexOf('.') == 0) {
+ integerStr = "";
+ decimalStr = str.substring(1);
+ } else {
+ integerStr = str;
+ decimalStr = "";
+ }
+ return new String[] {integerStr, decimalStr};
+ }
+
+ /**
+ * 灏嗗瓧绗︿覆杞负int鏁扮粍
+ * @param number 鏁板瓧
+ * @return
+ */
+ private static int[] toIntArray(String number) {
+ int[] array = new int[number.length()];
+ for (int i = 0; i < number.length(); i++) {
+ array[i] = Integer.parseInt(number.substring(i, i + 1));
+ }
+ return array;
+ }
+
+ /**
+ * 灏嗘暣鏁伴儴鍒嗚浆涓哄ぇ鍐欑殑閲戦
+ * @param integers 鏁存暟閮ㄥ垎鏁板瓧
+ * @param isWan 鏁存暟閮ㄥ垎鏄惁宸茬粡鏄揪鍒般�愪竾銆�
+ * @return
+ */
+ private static String getChineseInteger(int[] integers, boolean isWan, boolean isSimplified) {
+
+ int length = integers.length;
+ if (!isSimplified && length == 1 && integers[0] == 0) {
+ return "";
+ }
+ if (!isSimplified) {
+ return traditionalChineseInteger(integers, isWan);
+ } else {
+ return simplifiedChineseInteger(integers, isWan);
+ }
+ }
+
+ /**
+ * 绻佷綋涓枃鏁存暟
+ * @param integers
+ * @param isWan
+ * @return
+ */
+ private static String traditionalChineseInteger(int[] integers, boolean isWan) {
+ StringBuilder chineseInteger = new StringBuilder("");
+ int length = integers.length;
+ for (int i = 0; i < length; i++) {
+ String key = "";
+ if (integers[i] == 0) {
+ if ((length - i) == 13)// 涓囷紙浜匡級
+ key = IUNIT[4];
+ else if ((length - i) == 9) {// 浜�
+ key = IUNIT[8];
+ } else if ((length - i) == 5 && isWan) {// 涓�
+ key = IUNIT[4];
+ } else if ((length - i) == 1) {// 鍏�
+ key = IUNIT[0];
+ }
+ if ((length - i) > 1 && integers[i + 1] != 0) {
+ key += NUMBERS[0];
+ }
+ }
+ chineseInteger.append(integers[i] == 0 ? key : (NUMBERS[integers[i]] + IUNIT[length - i - 1]));
+ }
+ return chineseInteger.toString();
+ }
+
+ /**
+ * 绠�浣撲腑鏂囨暣鏁�
+ * @param integers
+ * @param isWan
+ * @return
+ */
+ private static String simplifiedChineseInteger(int[] integers, boolean isWan) {
+ StringBuilder chineseInteger = new StringBuilder("");
+ int length = integers.length;
+ for (int i = 0; i < length; i++) {
+ String key = "";
+ if (integers[i] == 0) {
+ if ((length - i) == 13) {// 涓囷紙浜匡級
+ key = CN_IUNIT[4];
+ } else if ((length - i) == 9) {// 浜�
+ key = CN_IUNIT[8];
+ } else if ((length - i) == 5 && isWan) {// 涓�
+ key = CN_IUNIT[4];
+ } else if ((length - i) == 1) {// 鍏�
+ key = CN_IUNIT[0];
+ }
+ if ((length - i) > 1 && integers[i + 1] != 0) {
+ key += CN_NUMBERS[0];
+ }
+ if (length == 1 && integers[i] == 0) {
+ key += CN_NUMBERS[0];
+ }
+ }
+ chineseInteger.append(integers[i] == 0 ? key : (CN_NUMBERS[integers[i]] + CN_IUNIT[length - i - 1]));
+ }
+ return chineseInteger.toString();
+ }
+
+ /**
+ * 灏嗗皬鏁伴儴鍒嗚浆涓哄ぇ鍐欑殑閲戦
+ * @param decimals 灏忔暟閮ㄥ垎鐨勬暟瀛�
+ * @return
+ */
+ private static String getChineseDecimal(int[] decimals, boolean isSimplified) {
+ StringBuilder chineseDecimal = new StringBuilder("");
+ if (!isSimplified) {
+ for (int i = 0; i < decimals.length; i++) {
+ String key = "";
+
+ if ((decimals.length - i) > 1 && decimals[i + 1] != 0) {
+ key += NUMBERS[0];
+ }
+
+ chineseDecimal.append(decimals[i] == 0 ? key : (NUMBERS[decimals[i]] + DUNIT[i]));
+ }
+ } else {
+ for (int i = 0; i < decimals.length; i++) {
+ chineseDecimal.append(CN_NUMBERS[decimals[i]]);
+ }
+
+ }
+ return chineseDecimal.toString();
+ }
+
+ /**
+ * 鍒ゆ柇褰撳墠鏁存暟閮ㄥ垎鏄惁宸茬粡鏄揪鍒般�愪竾銆�
+ * @param integerStr 鏁存暟閮ㄥ垎鏁板瓧
+ * @return
+ */
+ private static boolean isWan5(String integerStr) {
+ int length = integerStr.length();
+ if (length > 4) {
+ String subInteger = "";
+ if (length > 8) {
+ subInteger = integerStr.substring(length - 8, length - 4);
+ } else {
+ subInteger = integerStr.substring(0, length - 4);
+ }
+ return Integer.parseInt(subInteger) > 0;
+ } else {
+ return false;
+ }
+ }
public String orderNumberSetting(String type) {
//鏍规嵁绫诲瀷鑷姩鐢熸垚涓嶅悓鐨勬搷浣滃崟鍙�
diff --git a/north-glass-erp/src/main/resources/mapper/sd/Customer.xml b/north-glass-erp/src/main/resources/mapper/sd/Customer.xml
index 9092f50..aa4a38d 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/Customer.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/Customer.xml
@@ -3,6 +3,162 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
+ <resultMap id="selectCustomerOrderDetail" type="com.example.erp.entity.sd.OrderDetail">
+
+ <result column="order_id" property="orderId"/>
+ <result column="order_number" property="orderNumber"/>
+ <result column="quantity" property="quantity"/>
+ <result column="building_number" property="buildingNumber"/>
+ <result column="product_name" property="productName"/>
+ <result column="product_id" property="productId"/>
+ <result column="price" property="price"/>
+ <result column="width" property="width"/>
+ <result column="height" property="height"/>
+ <result column="area" property="area"/>
+ <result column="shape" property="shape"/>
+ <result column="gross_area" property="grossArea"/>
+ <result column="compute_area" property="computeArea"/>
+ <result column="compute_gross_area" property="computeGrossArea"/>
+ <result column="processing_note" property="processingNote"/>
+ <result column="edging_type" property="edgingType"/>
+ <result column="perimeter" property="perimeter"/>
+
+
+ <result column="batch" property="order.batch"/>
+ <result column="project" property="order.project"/>
+ <result column="customer_id" property="order.customerId"/>
+ <result column="customer_name" property="order.customerName"/>
+ <result column="money" property="order.money"/>
+ <result column="order_type" property="order.orderType"/>
+ <result column="salesman" property="order.salesman"/>
+ <result column="create_time" property="order.createTime"/>
+
+
+
+
+
+ </resultMap>
+
+
+ <select id="getSelectCustomerOderDate" resultMap="selectCustomerOrderDetail">
+ select od.order_id,
+ od.order_number,
+ o.project,
+ od.product_id,
+ od.product_name,
+ o.customer_id,
+ o.customer_name,
+ sum(od.quantity) as quantity,
+ sum(od.area) as area,
+ od.shape,
+ od.width,
+ od.height,
+ o.batch,
+ o.money,
+ o.order_type,
+ o.salesman,
+ o.create_time
+ from order_detail od
+ left join `order` o on o.order_id = od.order_id
+ <where>
+ and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
+ <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
+ and o.customer_id = #{orderDetail.order.customerId}
+ </if>
+ <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
+ and o.project regexp #{orderDetail.order.project}
+ </if>
+ <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
+ and o.batch regexp #{orderDetail.order.batch}
+ </if>
+ <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
+ and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
+ </if>
+ <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
+ and o.order_type regexp #{orderDetail.order.orderType}
+ </if>
+ <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
+ and o.salesman regexp #{orderDetail.order.salesman}
+ </if>
+ <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
+ and od.order_id regexp #{orderDetail.orderId}
+ </if>
+ <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
+ and od.order_number regexp #{orderDetail.orderNumber}
+ </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>
+ <if test="orderDetail.shape != null and orderDetail.shape != ''">
+ and od.shape regexp #{orderDetail.shape}
+ </if>
+ <if test="orderDetail.width != null and orderDetail.width != ''">
+ and od.width regexp REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
+ </if>
+ <if test="orderDetail.height != null and orderDetail.height != ''">
+ and od.height regexp REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
+ </if>
+
+ </where>
+ group by od.product_id, od.width, od.height
+ limit #{offset},#{pageSize};
+ </select>
+
+ <select id="getSelectCustomerOderDatePageTotal" >
+ select
+ CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
+ count(zu.id) as 'total' from (select od.product_id,od.id
+ from order_detail od
+ left join `order` o on o.order_id = od.order_id
+ <where>
+ and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
+ <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
+ and o.customer_id = #{orderDetail.order.customerId}
+ </if>
+ <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
+ and o.project regexp #{orderDetail.order.project}
+ </if>
+ <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
+ and o.batch regexp #{orderDetail.order.batch}
+ </if>
+ <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
+ and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
+ </if>
+ <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
+ and o.order_type regexp #{orderDetail.order.orderType}
+ </if>
+ <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
+ and o.salesman regexp #{orderDetail.order.salesman}
+ </if>
+ <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
+ and od.order_id regexp #{orderDetail.orderId}
+ </if>
+ <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
+ and od.order_number regexp #{orderDetail.orderNumber}
+ </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>
+ <if test="orderDetail.shape != null and orderDetail.shape != ''">
+ and od.shape regexp #{orderDetail.shape}
+ </if>
+ <if test="orderDetail.width != null and orderDetail.width != ''">
+ and od.width regexp REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
+ </if>
+ <if test="orderDetail.height != null and orderDetail.height != ''">
+ and od.height regexp REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
+ </if>
+
+ </where>
+ group by od.product_id, od.width, od.height) as zu
+ </select>
+
<select id="getCustomerList">
select
*
diff --git a/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml b/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
index bdeccd8..9ab2ac2 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/Delivery.xml
@@ -202,6 +202,20 @@
limit 0,1
</select>
+ <select id="getSelectShippingOrderDetailDeliveryPrinting" >
+ select
+ d.delivery_id,d.quantity,d.money,d.area,d.project,
+ d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
+ d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
+ from sd.delivery d
+ <where>
+ <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
+ and d.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
+ </if>
+
+ </where>
+ </select>
+
<select id="getSelectShippingOrderDetailDeliverys" >
select customer_id,customer_name,project,salesman,salesman_id,contacts,contact_number,delivery_address from sd.`order`
diff --git a/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml b/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml
index 2e92abc..f83bba4 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/DeliveryDetail.xml
@@ -87,6 +87,28 @@
</resultMap>
+ <resultMap id="selectDeliveryDetailOrderDetail" type="com.example.erp.entity.sd.DeliveryDetail">
+
+ <result column="order_number" property="orderNumber"/>
+ <result column="o_quantity" property="quantity"/>
+ <result column="delivery_id" property="deliveryId"/>
+ <result column="delivery_number" property="deliveryNumber"/>
+ <result column="quantity" property="quantity"/>
+ <result column="area" property="area"/>
+ <result column="money" property="money"/>
+ <result column="delivery_detail_remakes" property="deliveryDetailRemakes"/>
+ <result column="delivery_detail_state" property="deliveryDetailState"/>
+ <result column="create_time" property="createTime"/>
+
+ <result column="product_id" property="orderDetail.productId"/>
+ <result column="product_name" property="orderDetail.productName"/>
+ <result column="order_id" property="orderDetail.orderId"/>
+
+
+
+
+ </resultMap>
+
<delete id="deleteDeliveryDetail">
delete from sd.delivery_detail where delivery_id=#{deliveryId}
</delete>
@@ -645,4 +667,35 @@
</where>
order by dd.delivery_id,dd.delivery_number
</select>
+
+ <select id="getSelectDeliveryPrinting" resultMap="selectDeliveryDetailOrderDetail" >
+ select dd.delivery_id,od.order_id,od.product_id,od.product_name,sum(dd.area) as area,sum(dd.money) as money,sum(dd.quantity) as quantity from
+ delivery_detail dd left join order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number
+
+ <where>
+ <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
+ and dd.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
+ </if>
+ </where>
+ group by od.order_id,od.product_name,od.product_id
+ </select>
+
+ <select id="getSelectDeliveryDetailPrinting" >
+ select od.order_id,
+ od.order_number,
+ od.product_name,
+ od.width,
+ od.height,
+ dd.quantity,
+ dd.money,
+ dd.area,
+ ifnull(od.processing_note,"") as processingNote,
+ ifnull(od.building_number,"") as buildingNumber,
+ od.price
+ from delivery_detail dd
+ left join order_detail od on dd.order_id = od.order_id and dd.order_number = od.order_number
+ where delivery_id = #{deliveryId}
+ and od.order_id = #{orderId}
+ and od.product_id = #{productId}
+ </select>
</mapper>
\ No newline at end of file
diff --git a/north-glass-erp/target/classes/mapper/sd/Customer.xml b/north-glass-erp/target/classes/mapper/sd/Customer.xml
index 9092f50..aa4a38d 100644
--- a/north-glass-erp/target/classes/mapper/sd/Customer.xml
+++ b/north-glass-erp/target/classes/mapper/sd/Customer.xml
@@ -3,6 +3,162 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.example.erp.mapper.sd.CustomerMapper">
+ <resultMap id="selectCustomerOrderDetail" type="com.example.erp.entity.sd.OrderDetail">
+
+ <result column="order_id" property="orderId"/>
+ <result column="order_number" property="orderNumber"/>
+ <result column="quantity" property="quantity"/>
+ <result column="building_number" property="buildingNumber"/>
+ <result column="product_name" property="productName"/>
+ <result column="product_id" property="productId"/>
+ <result column="price" property="price"/>
+ <result column="width" property="width"/>
+ <result column="height" property="height"/>
+ <result column="area" property="area"/>
+ <result column="shape" property="shape"/>
+ <result column="gross_area" property="grossArea"/>
+ <result column="compute_area" property="computeArea"/>
+ <result column="compute_gross_area" property="computeGrossArea"/>
+ <result column="processing_note" property="processingNote"/>
+ <result column="edging_type" property="edgingType"/>
+ <result column="perimeter" property="perimeter"/>
+
+
+ <result column="batch" property="order.batch"/>
+ <result column="project" property="order.project"/>
+ <result column="customer_id" property="order.customerId"/>
+ <result column="customer_name" property="order.customerName"/>
+ <result column="money" property="order.money"/>
+ <result column="order_type" property="order.orderType"/>
+ <result column="salesman" property="order.salesman"/>
+ <result column="create_time" property="order.createTime"/>
+
+
+
+
+
+ </resultMap>
+
+
+ <select id="getSelectCustomerOderDate" resultMap="selectCustomerOrderDetail">
+ select od.order_id,
+ od.order_number,
+ o.project,
+ od.product_id,
+ od.product_name,
+ o.customer_id,
+ o.customer_name,
+ sum(od.quantity) as quantity,
+ sum(od.area) as area,
+ od.shape,
+ od.width,
+ od.height,
+ o.batch,
+ o.money,
+ o.order_type,
+ o.salesman,
+ o.create_time
+ from order_detail od
+ left join `order` o on o.order_id = od.order_id
+ <where>
+ and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
+ <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
+ and o.customer_id = #{orderDetail.order.customerId}
+ </if>
+ <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
+ and o.project regexp #{orderDetail.order.project}
+ </if>
+ <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
+ and o.batch regexp #{orderDetail.order.batch}
+ </if>
+ <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
+ and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
+ </if>
+ <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
+ and o.order_type regexp #{orderDetail.order.orderType}
+ </if>
+ <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
+ and o.salesman regexp #{orderDetail.order.salesman}
+ </if>
+ <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
+ and od.order_id regexp #{orderDetail.orderId}
+ </if>
+ <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
+ and od.order_number regexp #{orderDetail.orderNumber}
+ </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>
+ <if test="orderDetail.shape != null and orderDetail.shape != ''">
+ and od.shape regexp #{orderDetail.shape}
+ </if>
+ <if test="orderDetail.width != null and orderDetail.width != ''">
+ and od.width regexp REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
+ </if>
+ <if test="orderDetail.height != null and orderDetail.height != ''">
+ and od.height regexp REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
+ </if>
+
+ </where>
+ group by od.product_id, od.width, od.height
+ limit #{offset},#{pageSize};
+ </select>
+
+ <select id="getSelectCustomerOderDatePageTotal" >
+ select
+ CEILING(count(zu.id)/#{pageSize}) as 'pageTotal',
+ count(zu.id) as 'total' from (select od.product_id,od.id
+ from order_detail od
+ left join `order` o on o.order_id = od.order_id
+ <where>
+ and date(o.create_time)>=#{startDate} and date(o.create_time) <= #{endDate}
+ <if test="orderDetail.order.customerId != null and orderDetail.order.customerId != ''">
+ and o.customer_id = #{orderDetail.order.customerId}
+ </if>
+ <if test="orderDetail.order.project != null and orderDetail.order.project != ''">
+ and o.project regexp #{orderDetail.order.project}
+ </if>
+ <if test="orderDetail.order.batch != null and orderDetail.order.batch != ''">
+ and o.batch regexp #{orderDetail.order.batch}
+ </if>
+ <if test="orderDetail.order.money != null and orderDetail.order.money != ''">
+ and o.money regexp REGEXP_REPLACE(#{orderDetail.order.money},'\\.0+$','')
+ </if>
+ <if test="orderDetail.order.orderType != null and orderDetail.order.orderType != ''">
+ and o.order_type regexp #{orderDetail.order.orderType}
+ </if>
+ <if test="orderDetail.order.salesman != null and orderDetail.order.salesman != ''">
+ and o.salesman regexp #{orderDetail.order.salesman}
+ </if>
+ <if test="orderDetail.orderId != null and orderDetail.orderId != ''">
+ and od.order_id regexp #{orderDetail.orderId}
+ </if>
+ <if test="orderDetail.orderNumber != null and orderDetail.orderNumber != ''">
+ and od.order_number regexp #{orderDetail.orderNumber}
+ </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>
+ <if test="orderDetail.shape != null and orderDetail.shape != ''">
+ and od.shape regexp #{orderDetail.shape}
+ </if>
+ <if test="orderDetail.width != null and orderDetail.width != ''">
+ and od.width regexp REGEXP_REPLACE(#{orderDetail.width},'\\.0+$','')
+ </if>
+ <if test="orderDetail.height != null and orderDetail.height != ''">
+ and od.height regexp REGEXP_REPLACE(#{orderDetail.height},'\\.0+$','')
+ </if>
+
+ </where>
+ group by od.product_id, od.width, od.height) as zu
+ </select>
+
<select id="getCustomerList">
select
*
diff --git a/north-glass-erp/target/classes/mapper/sd/Delivery.xml b/north-glass-erp/target/classes/mapper/sd/Delivery.xml
index bdeccd8..9ab2ac2 100644
--- a/north-glass-erp/target/classes/mapper/sd/Delivery.xml
+++ b/north-glass-erp/target/classes/mapper/sd/Delivery.xml
@@ -202,6 +202,20 @@
limit 0,1
</select>
+ <select id="getSelectShippingOrderDetailDeliveryPrinting" >
+ select
+ d.delivery_id,d.quantity,d.money,d.area,d.project,
+ d.customer_id,d.customer_name,d.project,d.pay_method,d.pay_date,d.contacts,d.contact_number,
+ d.delivery_address,d.remarks,d.create_time,d.delivery_date,d.creator,d.salesman,d.salesman_id
+ from sd.delivery d
+ <where>
+ <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
+ and d.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
+ </if>
+
+ </where>
+ </select>
+
<select id="getSelectShippingOrderDetailDeliverys" >
select customer_id,customer_name,project,salesman,salesman_id,contacts,contact_number,delivery_address from sd.`order`
diff --git a/north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml b/north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml
index 2e92abc..f83bba4 100644
--- a/north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml
+++ b/north-glass-erp/target/classes/mapper/sd/DeliveryDetail.xml
@@ -87,6 +87,28 @@
</resultMap>
+ <resultMap id="selectDeliveryDetailOrderDetail" type="com.example.erp.entity.sd.DeliveryDetail">
+
+ <result column="order_number" property="orderNumber"/>
+ <result column="o_quantity" property="quantity"/>
+ <result column="delivery_id" property="deliveryId"/>
+ <result column="delivery_number" property="deliveryNumber"/>
+ <result column="quantity" property="quantity"/>
+ <result column="area" property="area"/>
+ <result column="money" property="money"/>
+ <result column="delivery_detail_remakes" property="deliveryDetailRemakes"/>
+ <result column="delivery_detail_state" property="deliveryDetailState"/>
+ <result column="create_time" property="createTime"/>
+
+ <result column="product_id" property="orderDetail.productId"/>
+ <result column="product_name" property="orderDetail.productName"/>
+ <result column="order_id" property="orderDetail.orderId"/>
+
+
+
+
+ </resultMap>
+
<delete id="deleteDeliveryDetail">
delete from sd.delivery_detail where delivery_id=#{deliveryId}
</delete>
@@ -645,4 +667,35 @@
</where>
order by dd.delivery_id,dd.delivery_number
</select>
+
+ <select id="getSelectDeliveryPrinting" resultMap="selectDeliveryDetailOrderDetail" >
+ select dd.delivery_id,od.order_id,od.product_id,od.product_name,sum(dd.area) as area,sum(dd.money) as money,sum(dd.quantity) as quantity from
+ delivery_detail dd left join order_detail od on dd.order_id=od.order_id and dd.order_number=od.order_number
+
+ <where>
+ <if test="deliveryDetail.deliveryId != null and deliveryDetail.deliveryId != ''">
+ and dd.delivery_id like concat('%',#{deliveryDetail.deliveryId},'%')
+ </if>
+ </where>
+ group by od.order_id,od.product_name,od.product_id
+ </select>
+
+ <select id="getSelectDeliveryDetailPrinting" >
+ select od.order_id,
+ od.order_number,
+ od.product_name,
+ od.width,
+ od.height,
+ dd.quantity,
+ dd.money,
+ dd.area,
+ ifnull(od.processing_note,"") as processingNote,
+ ifnull(od.building_number,"") as buildingNumber,
+ od.price
+ from delivery_detail dd
+ left join order_detail od on dd.order_id = od.order_id and dd.order_number = od.order_number
+ where delivery_id = #{deliveryId}
+ and od.order_id = #{orderId}
+ and od.product_id = #{productId}
+ </select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0