From ff1be3b4ed56b84848ad34ea2383788c220bff64 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期一, 24 十一月 2025 13:14:17 +0800
Subject: [PATCH] 修改产品一级玻璃类别bug以及发货一行两列无金额打印
---
north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml | 2
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue | 2
north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java | 11 +
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue | 36 ++++
north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue | 14 +
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue | 2
north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet4.vue | 413 +++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 473 insertions(+), 7 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
index 92c3868..716908e 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet1.vue
@@ -177,7 +177,7 @@
<th style="text-align: left;border:none;" colspan="4">瀹㈡埛鍚嶇О锛�<span>{{itme1.delivery.customerName}}</span></th>
<th style="text-align: left;border:none;" v-if="itme1.data[0].DeliveryDetail.order.batch!==''" colspan="3">
椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}({{itme1.data[0].DeliveryDetail.order.batch}})</span></th>
- <th style="text-align: left;border:none;" colspan="3">椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}</span></th>
+ <th style="text-align: left;border:none;" v-else colspan="3">椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}</span></th>
<th style="text-align: left;border:none;" colspan="2">鑱旂郴浜猴細<span>{{itme1.delivery.contacts}}</span></th>
</tr>
<tr>
diff --git a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
index 31f4399..9657ed7 100644
--- a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
+++ b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet2.vue
@@ -123,7 +123,7 @@
<th style="text-align: left;border:none;" colspan="4">瀹㈡埛鍚嶇О锛�<span>{{itme1.delivery.customerName}}</span></th>
<th style="text-align: left;border:none;" v-if="itme1.data[0].DeliveryDetail.order.batch!==''" colspan="3">
椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}({{itme1.data[0].DeliveryDetail.order.batch}})</span></th>
- <th style="text-align: left;border:none;" colspan="3">椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}</span></th>
+ <th style="text-align: left;border:none;" v-else colspan="3">椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}</span></th>
<th style="text-align: left;border:none;" colspan="2">鑱旂郴浜猴細<span>{{itme1.delivery.contacts}}</span></th>
</tr>
<tr>
diff --git a/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet4.vue b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet4.vue
new file mode 100644
index 0000000..bc0b5ce
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/components/sd/delivery/PrintSheet4.vue
@@ -0,0 +1,413 @@
+<script setup>
+import request from "@/utils/request"
+import {computed, onMounted, ref} from "vue"
+import PrintFoot from "@/components/sd/order/PrintFoot.vue"
+import companyInfo from "@/stores/sd/companyInfo"
+import deepClone from "@/utils/deepClone";
+import {ElMessage} from "element-plus";
+import {add,multiply,multiplyAuto,divideAuto} from '@/utils/decimal';
+
+
+/*涓�琛屼袱鍒楀彂璐у崟鎵撳嵃*/
+
+const company = companyInfo()
+let produceList = ref([])
+let otherMoney = []
+let otherMoney1 = []
+let delivery = ref([])
+let money = ref("")
+let otherMoneys = 0
+let sumMoney = 0
+let takeCare =ref("娉ㄦ剰:璇峰Ε鍠勪繚绠″ソ鎴戝徃鐨勭幓鐠冩灦锛屽鏈変涪澶辨垨鎹熷潖锛屾寜1500鍏冨彧璧斿伩銆傝阿璋㈤厤鍚�!")
+let remark =ref(company.deliveryRemark)
+
+
+
+let props = defineProps({
+ deliveryId:null
+})
+const form = ref({
+})
+let produceList2 = ref([])
+
+
+
+const getData = () => {
+ if(props.deliveryId===null || props.deliveryId===undefined || props.deliveryId===''){
+ return
+ }
+ form.value.deliveryId=props.deliveryId
+ form.value.type=company.productName
+
+
+ request.post(`/delivery/getSelectDeliveryPrinting`,form.value).then((res) => {
+ if(res.code==200){
+ produceList.value = deepClone(res.data)
+ for(let i=0;i<produceList.value.length;i++){
+ let produceList1= ({
+ data:null,
+ otherMoney:null,
+ otherMoney1:null,
+ delivery:null,
+ money:null,
+ otherMoneys:0,
+ sumMoney:0
+ })
+ produceList1.data=produceList.value[i].data
+ produceList1.delivery=produceList.value[i].delivery
+ produceList1.money=produceList.value[i].money
+ produceList1.otherMoney=produceList.value[i].otherMoney
+ for(let j=0;j<produceList1.data.length;j++){
+ produceList1.sumMoney+=produceList1.data[j].DeliveryDetail.money
+ }
+ otherMoney1=[]
+ for(let i=0;i<produceList1.otherMoney.length;i++){
+ if(produceList1.otherMoney[i].DeliveryDetailOtherMoney.monery!=null){
+ produceList1.otherMoneys+=produceList1.otherMoney[i].DeliveryDetailOtherMoney.monery
+ if(otherMoney1.length===0){
+ otherMoney1.push(produceList1.otherMoney[i])
+ }
+ else{
+ for(let s=0;s<otherMoney1.length;s++){
+ if(produceList1.otherMoney[i].DeliveryDetailOtherMoney.alias===otherMoney1[s].DeliveryDetailOtherMoney.alias){
+
+ otherMoney1[s].DeliveryDetailOtherMoney.count=add(produceList1.otherMoney[i].DeliveryDetailOtherMoney.count,otherMoney1[s].DeliveryDetailOtherMoney.count)
+ otherMoney1[s].DeliveryDetailOtherMoney.monery =add(produceList1.otherMoney[i].DeliveryDetailOtherMoney.monery,otherMoney1[s].DeliveryDetailOtherMoney.monery)
+ break
+ }
+ if(s+1===otherMoney1.length){
+ otherMoney1.push(produceList1.otherMoney[i])
+ break
+ }
+ }
+
+ }
+
+ }
+
+ }
+ produceList1.otherMoney1=otherMoney1
+ produceList2.value.push(produceList1)
+ }
+ for(let j=0;j<produceList2.value.length;j++){
+
+ if(produceList2.value[j].delivery.money.toFixed(0)!==(produceList2.value[j].otherMoneys
+ +produceList2.value[j].sumMoney+produceList2.value[j].delivery.freight).toFixed(0)){
+ console.log(produceList2.value[j])
+ console.log(produceList2.value[j].delivery.money)
+ console.log((produceList2.value[j].otherMoneys
+ +produceList2.value[j].sumMoney).toFixed(0))
+ console.log(produceList2.value[j].delivery.deliveryId)
+ }
+
+ }
+
+ }else{
+ ElMessage.warning(res.msg)
+ router.push("/login")
+ }
+ })
+}
+
+onMounted(() => {
+ getData()
+})
+
+const stringToJson = (productList) => {
+ productList.forEach(item => {
+ item.otherColumns = JSON.parse(item.otherColumns)
+ })
+}
+
+const getQuantity = (productList) => {
+ let quantity = 0
+ productList.forEach(item => {
+ quantity += item.quantity
+ })
+ return parseFloat(quantity.toFixed(3))
+
+}
+
+const getArea = (productList) => {
+ let area = 0
+ productList.forEach(item => {
+ area += item.grossArea
+ })
+ return parseFloat(area.toFixed(3))
+
+}
+
+const getPerimeter = (productList) => {
+ let perimeter = 0
+ productList.forEach(item => {
+ perimeter += item.perimeter
+ })
+ return parseFloat(perimeter.toFixed(3))
+}
+
+const printSheet = () => {
+}
+
+
+const groupedData = computed(() => {
+ // 鍒嗙粍鍑芥暟锛氬皢鏁扮粍鎸夋瘡2鏉℃媶鍒�
+ const groupArray = (arr, size) => {
+ const result = [];
+ for (let i = 0; i < arr.length; i += size) {
+ result.push(arr.slice(i, i + size));
+ }
+ return result;
+ };
+
+ // 瀵规瘡涓猧tem鐨凞eliveryDetailList杩涜鍒嗙粍
+ return produceList2.value.map(produce => {
+ const groupedDetails = produce.data.map(item => ({
+ ...item,
+ // 瀵瑰綋鍓峣tem鐨勬槑缁嗚繘琛屽垎缁勶紙姣�2鏉′竴缁勶級
+ groupedDeliveryDetails: groupArray(item.DeliveryDetailList, 2)
+ }));
+ return { ...produce, data: groupedDetails };
+ });
+});
+
+
+
+defineExpose({
+ printSheet
+});
+</script>
+
+<template>
+ <div id="sheet">
+ <table class="pages" v-for="(itme1, index) in groupedData" :key="index" >
+ <thead>
+ <tr class="title-s">
+ <th colspan="11">
+ <h1>
+ {{company.companyName}}
+ </h1>
+ </th>
+ </tr>
+
+ <tr class="title-s">
+ <th colspan="2" style="width: 20%"></th>
+ <th colspan="7" style="width: 60%;">
+ <h4 v-if="!company.showDeliveryCreator" >閲戝崕甯備箰鍔ㄦ櫤鑳界鎶�鏈夐檺鍏徃</h4>
+ <h3>閿�鍞彂璐у崟</h3>
+ </th>
+ <th colspan="2" style="width: 20%;text-align: left;">鍙戣揣鍗曞彿锛�<span>{{itme1.delivery.deliveryId}}</span></th>
+ </tr>
+ <tr>
+ <th style="text-align: left;border:none;" colspan="3">瀹㈡埛鍚嶇О锛�<span>{{itme1.delivery.customerName}}</span></th>
+ <th style="text-align: left;border:none;" colspan="6">椤圭洰鍚嶇О锛�<span>{{itme1.delivery.project}}</span></th>
+ <th style="text-align: left;border:none;" colspan="2">鑱旂郴浜猴細<span>{{itme1.delivery.contacts}}</span></th>
+ </tr>
+ <tr>
+ <th style="text-align: left;border:none;" colspan="9">閫佽揣鍦板潃锛�<span>{{itme1.delivery.deliveryAddress}}</span></th>
+ <th style="text-align: left;border:none;" colspan="2">鑱旂郴鐢佃瘽锛�<span>{{itme1.delivery.contactNumber}}</span></th>
+ </tr>
+
+
+ </thead>
+ <tr style="border-style: none">
+ <td colspan="11" style="border-style: none">
+ <table style="border-style: none;width: 100%;height: 100%;">
+ <template v-for="(item, index) in itme1.data" :key="index" >
+ <thead>
+ <tr v-if="index===0">
+ <th style="width: 14%;" colspan="3">瀹絏楂�</th>
+ <th style="width: 8%;">鏁伴噺</th>
+ <th style="width: 9%;">闈㈢Н</th>
+ <th style="width: 1%;"></th>
+ <th style="width: 14%;" colspan="3">瀹絏楂�</th>
+ <th style="width: 8%;">鏁伴噺</th>
+ <th style="width: 9%;">闈㈢Н</th>
+ </tr>
+
+
+ </thead>
+ <tr>
+ <td style="font-size: 15px;text-align: left" colspan="5">浜у搧鍚嶇О:<span>{{item.DeliveryDetail.orderDetail.productName}}</span></td>
+ <td style="font-size: 15px;text-align: left" colspan="3">鎵规:<span>{{item.DeliveryDetail.order.batch}}</span></td>
+ <td style="font-size: 15px;text-align: left" colspan="3">璁㈠崟缂栧彿:<span>{{item.DeliveryDetail.orderDetail.orderId}}</span></td>
+ </tr>
+
+ <tr class="day-in" v-for="(group, groupIndex) in item.groupedDeliveryDetails" :key="groupIndex">
+ <!-- 绗竴鍒楁暟鎹紙缁勫唴绗竴鏉★級 -->
+ <td style="font-size: 15px;font-weight: bold;" colspan="3">
+ {{ group[0].parsedOtherColumns?.S02 ? `(${group[0].parsedOtherColumns.S02})` : '' }}
+ {{ group[0].width }}x{{ group[0].height }}
+ </td>
+ <td>{{ group[0].quantity }}</td>
+ <td>{{ group[0].area }}</td>
+ <td></td> <!-- 鍒嗛殧鍒� -->
+
+ <!-- 绗簩鍒楁暟鎹紙缁勫唴绗簩鏉★紝鑻ュ瓨鍦級 -->
+ <td style="font-size: 15px;font-weight: bold;" colspan="3" v-if="group[1]">
+ {{ group[1].parsedOtherColumns?.S02 ? `(${group[1].parsedOtherColumns.S02})` : '' }}
+ {{ group[1].width }}x{{ group[1].height }}
+ </td>
+ <td v-if="group[1]">{{ group[1].quantity }}</td>
+ <td v-if="group[1]">{{ group[1].area }}</td>
+
+ <!-- 鑻ョ粍鍐呭彧鏈変竴鏉℃暟鎹紝绗簩鍒楃暀绌� -->
+ <td v-else colspan="5"></td>
+ </tr>
+ <tr class="day-in" >
+ <td style="font-size: 15px;" colspan="9">灏忚:</td>
+ <td>{{item.DeliveryDetail.quantity}}</td>
+ <td>{{item.DeliveryDetail.area}}</td>
+ </tr>
+
+ </template>
+ <tr class="day-in">
+ <td style="font-size: 15px;" colspan="9">鍚堣:</td>
+ <td>{{itme1.delivery.quantity}}</td>
+ <td>{{itme1.delivery.area}}</td>
+ </tr>
+
+
+
+ <!-- <el-row :gutter="24">
+ <el-col :span="4"><div style="font-size: 12px" class="bottom">鍒跺崟鍛橈細{{data.order.creator}}<span style="font-size: 10px"></span></div></el-col>
+ <el-col :span="6"><div style="font-size: 12px" class="bottom">鍒跺崟鏃ユ湡锛歿{data.order.createTime}}<span style="font-size: 10px"></span></div></el-col>
+ <el-col :span="4"><div style="font-size: 12px" class="bottom">瀹℃牳鍛橈細{{data.order.verifier}}</div></el-col>
+ <el-col :span="6"><div style="font-size: 12px" class="bottom">瀹℃牳鏃ユ湡锛歿{data.order.updateTime}}</div></el-col>
+ <el-col :span="4"><div style="font-size: 12px" class="bottom">鎵撳嵃浜猴細{{username}}</div></el-col>
+
+ </el-row>-->
+
+ <tr class="day-in" style="border: 0;" v-if="company.showDeliveryCreator">
+ <td colspan="11" style="border: 0">
+ <div style="display:flex;text-align: left" class="bottom">
+ <div style="width: 15%">鍒跺崟鍛橈細{{ itme1.delivery.creator }}</div>
+ <div style="width: 25%">鍒跺崟鏃ユ湡锛歿{ itme1.delivery.createTime }}</div>
+ <div style="width: 10%">鍙戣揣鍛橈細</div>
+ <div style="width: 10%">鍙告満锛�</div>
+ <div style="width: 15%">瀹㈡埛绛惧瓧锛�</div>
+ <div style="width: 15%">绛炬敹鏃ユ湡锛�</div>
+ </div>
+ </td>
+ </tr>
+ <tr class="day-in" style="border: 0;" v-if="company.showDeliveryCreator">
+ <td colspan="11" style="border: 0;">
+ <div style="display:flex;" class="bottom">
+ 鏋跺瓙 鍙�
+ {{takeCare}}
+ </div>
+ </td>
+ </tr>
+ <tr class="day-in" style="border: 0;">
+ <td colspan="11" style="border: 0;">
+ <div style="display:flex;text-align: left;border: 0;margin-top: 10px " class="bottom" >
+ <el-input type="textarea" :autosize="{ minRows: 7, maxRows: 20 }" v-model="remark"/>
+ </div>
+
+ </td>
+ </tr>
+
+ <tr class="day-in" style="border: 0" v-if="!company.showDeliveryCreator">
+ <td colspan="11" style="border: 0">
+ <div style="width: 100%;height: 50px"></div>
+ </td>
+ </tr>
+ <tr class="day-in" style="border: 0" v-if="!company.showDeliveryCreator">
+ <td colspan="11" style="border: 0">
+ <div style="display:flex;text-align: left" class="bottom">
+ <div style="width: 15%">鍒跺崟鍛橈細{{ itme1.delivery.creator }}</div>
+ <div style="width: 15%">鍒跺崟鏃ユ湡锛歿{ itme1.delivery.createTime1 }}</div>
+ <div style="width: 15%">鍙戣揣鍛橈細</div>
+ <div style="width: 15%">鍙告満锛�</div>
+ <div style="width: 15%">瀹㈡埛绛惧瓧锛�</div>
+ <div style="width: 15%">绛炬敹鏃ユ湡锛�</div>
+ </div>
+ </td>
+ </tr>
+
+ </table>
+ </td>
+ </tr>
+
+ </table>
+
+
+
+ </div>
+
+
+</template>
+
+
+
+
+<style scoped>
+@media print {
+ @page {
+ margin: 12mm 10mm 20mm 10mm !important;
+ }
+ .pages {
+ page-break-after: always;
+ }
+
+ @page {
+ @top-right {
+ margin-top: 50px;
+ content: "绗� " counter(page) " 椤�"; /* 浣跨敤counter娣诲姞椤电爜 */
+ }
+ }
+}
+h1,h3{
+ left:0;
+ right:0;
+ top:0;
+ bottom:0;
+ margin:auto;
+}
+h1{
+ font-size: 1.5rem;
+}
+h3{
+ font-size: 1.2rem;
+ font-weight: bolder;
+}
+
+
+table{
+ border-collapse: collapse;
+ width: 100%;
+ text-align: center;
+}
+tr,td,th{
+ border: 1px solid black;
+}
+
+th,.no-change-row {
+ white-space: nowrap;
+}
+
+.title-1{
+ width: 76px;
+}
+.title-s,.title-s th{
+ border:0
+}
+
+.hr-border{
+ height: 2px;
+ width: 100%;
+ background-color: black;
+ color: black;
+}
+table {
+ border-collapse: collapse;
+ width: 100%;
+
+}
+td > table {
+ margin: 0;
+ padding: 0;
+}
+
+
+
+</style>
\ No newline at end of file
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 f8e71d3..e065b91 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
@@ -19,6 +19,7 @@
import { saveAs } from "file-saver"
import companyInfo from "@/stores/sd/companyInfo";
import PrintSheet3 from "@/components/sd/delivery/PrintSheet3.vue";
+import PrintSheet4 from "@/components/sd/delivery/PrintSheet4.vue";
//璇█鑾峰彇
const { t } = useI18n()
@@ -455,6 +456,39 @@
break
}
+ case 'sheet8': {
+ const selectRecords = $grid.getCheckboxRecords()
+ if (selectRecords.length === 0) {
+ if(rowClickIndex.value.deliveryState>0){
+ ElMessage.warning(t('order.printingNumber')+rowClickIndex.value.printingNumber)
+ let delivery=([])
+ delivery.push(rowClickIndex.value)
+ flowData.value.delivery=delivery
+ dialogTableVisible.value = true
+ sheetIndex.value=8
+ }else{
+ ElMessage.warning(t('order.orderNotApproved'))
+ }
+ }else{
+ let a=0
+ selectRecords.forEach((item) => {
+ if(item.deliveryState==0){
+ ElMessage.warning(t('order.orderNotApproved'))
+ a=1
+ }
+ })
+ if(a==0){
+ flowData.value.delivery=selectRecords
+ dialogTableVisible.value = true
+ sheetIndex.value=8
+ }
+
+
+ }
+
+ break
+
+ }
}
}
},
@@ -502,6 +536,7 @@
{ code: 'sheet5', name: t('delivery.print2'), prefixIcon: 'vxe-icon-file-txt', visible: false},
{ code: 'sheet6', name: t('delivery.print2')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: false},
{ code: 'sheet7', name: t('鎵撳嵃涓�琛屼咯鍒�'), prefixIcon: 'vxe-icon-file-txt', visible: true},
+ { code: 'sheet8', name: t('鎵撳嵃涓�琛屼咯鍒�')+ t('delivery.noMoney'), prefixIcon: 'vxe-icon-file-txt', visible: true},
]
]
}
@@ -715,6 +750,7 @@
<print-sheet-luoyang-details id="child" v-if="sheetIndex===5" :deliveryId="flowData.delivery" :type="3" :optionVal='optionVal'/>
<print-sheet-luoyang-details id="child" v-if="sheetIndex===6" :deliveryId="flowData.delivery" :type="4" :optionVal='optionVal'/>
<print-sheet3 id="child" v-if="sheetIndex===7" :deliveryId="flowData.delivery" />
+ <print-sheet4 id="child" v-if="sheetIndex===8" :deliveryId="flowData.delivery" />
</el-dialog>
</div>
diff --git a/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue b/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
index 065a967..903d091 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/product/CreateProduct.vue
@@ -107,7 +107,12 @@
item.separation = JSON.parse(item.separation)
})
productTotal.value = res.data.title
- productGlassTypeStore.GlassType =[res.data.title.typeId.substring(0,2),res.data.title.typeId]
+ if(res.data.title.typeId.length===2){
+ productGlassTypeStore.GlassType =[res.data.title.typeId.substring(0,2)]
+ }else{
+ productGlassTypeStore.GlassType =[res.data.title.typeId.substring(0,2),res.data.title.typeId]
+ }
+
//BasicData.value = res.data
}else{
ElMessage.warning(res.msg)
@@ -127,7 +132,12 @@
ElMessage.warning(t('product.msg.glassType'))
return
}
- productTotal.value.typeId = productGlassTypeStore.GlassType[1]
+ if(productGlassTypeStore.GlassType[1]!==undefined){
+ productTotal.value.typeId = productGlassTypeStore.GlassType[1]
+ }else{
+ productTotal.value.typeId = productGlassTypeStore.GlassType[0]
+ }
+
let productName = ""
productDetailList.value.forEach(item =>{
diff --git a/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java b/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
index a1de3f8..319c357 100644
--- a/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
+++ b/north-glass-erp/src/main/java/com/example/erp/service/sd/ProductService.java
@@ -41,8 +41,15 @@
public Map<String,Object> defaultDateProduct(Integer pageNum, Integer pageSize, List<String> glassType,Map<String,Object> config) {
Integer offset = (pageNum-1)*pageSize;
String glassTypeId = null;
- if(glassType.size()>1){
- glassTypeId = glassType.get(1);
+ if(glassType.size()==2){
+ if(!Objects.equals(glassType.get(0), "")&&!Objects.equals(glassType.get(1), "")){
+ glassTypeId = glassType.get(1);
+ }
+ }else if(glassType.size()==1){
+ if(!Objects.equals(glassType.get(0), "")&& !Objects.equals(glassType.get(0), "undefined")){
+ glassTypeId = glassType.get(0);
+ }
+
}
JSONObject orderJson = new JSONObject(config);
Product product = JSONObject.parseObject(JSONObject.toJSONString(orderJson.get("filter")), Product.class);
diff --git a/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml b/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
index 71c28d2..f618b08 100644
--- a/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
+++ b/north-glass-erp/src/main/resources/mapper/sd/ProductMapper.xml
@@ -44,7 +44,7 @@
left join basic_glass_type bgt on bgt.type_id = a.type_id
<where>
<if test="glassTypeId != null and glassTypeId != ''">
- and a.type_id like concat('%',#{glassTypeId},'%')
+ and a.type_id = #{glassTypeId}
</if>
<if test="product.id != null and product.id != ''">
and a.id like concat('%',#{product.id},'%')
--
Gitblit v1.8.0