Parcourir la source

Merge branch 'master' of http://218.2.6.10:3001/fanzherong/hunanzeyunew

shasha il y a 1 mois
Parent
commit
aead5a9a37
22 fichiers modifiés avec 642 ajouts et 67 suppressions
  1. 4 0
      snowy-admin-web/src/api/biz/bizAppointmentRecordApi.js
  2. 1 1
      snowy-admin-web/src/api/biz/bizAppointmentTimeApi.js
  3. 11 1
      snowy-admin-web/src/api/biz/bizOrderApi.js
  4. 30 23
      snowy-admin-web/src/views/biz/count/goodsindex.vue
  5. 171 0
      snowy-admin-web/src/views/biz/count/orderplan.vue
  6. 27 25
      snowy-admin-web/src/views/biz/count/recordindex.vue
  7. 172 0
      snowy-admin-web/src/views/biz/count/vehicle.vue
  8. 11 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/controller/BizAppointmentRecordController.java
  9. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/mapper/BizAppointmentRecordMapper.java
  10. 33 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/mapper/mapping/BizAppointmentRecordMapper.xml
  11. 4 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizAppointmentRecordPageParam.java
  12. 4 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/BizAppointmentRecordService.java
  13. 23 2
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/impl/BizAppointmentRecordServiceImpl.java
  14. 18 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/controller/BizOrderController.java
  15. 4 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/entity/BizOrder.java
  16. 4 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/mapper/BizOrderMapper.java
  17. 25 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/mapper/mapping/BizOrderMapper.xml
  18. 42 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/param/BizOrderExportTotal.java
  19. 6 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/service/BizOrderService.java
  20. 38 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/service/impl/BizOrderServiceImpl.java
  21. 5 3
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizvehicle/service/impl/BizVehicleServiceImpl.java
  22. 6 12
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/record/result/GoodsResult.java

+ 4 - 0
snowy-admin-web/src/api/biz/bizAppointmentRecordApi.js

@@ -42,5 +42,9 @@ export default {
 	//调整订单
 	adjustOrder(data){
 		return request('adjustOrder',data)
+	},
+	//车辆执行状态分析
+	gerVehicleTotal(data){
+		return request('gerVehicleTotal',data,'get')
 	}
 }

+ 1 - 1
snowy-admin-web/src/api/biz/bizAppointmentTimeApi.js

@@ -28,5 +28,5 @@ export default {
 	//获取预约时段下拉列表
 	getDownList(data){
 		return request('getDownList',data,'get')
-	}
+	},
 }

+ 11 - 1
snowy-admin-web/src/api/biz/bizOrderApi.js

@@ -62,5 +62,15 @@ export default {
 	//提交
 	submit(data){
 		return request('submit',data)
-	}
+	},
+	//订单计划分析
+	getOrderTotal(data){
+		return request('getOrderTotal',data,'get')
+	},
+	//导出
+	exportRecordTotal(data){
+		return request('exportRecordTotal', data, 'get', {
+			responseType: 'blob'
+		})
+	},
 }

+ 30 - 23
snowy-admin-web/src/views/biz/count/goodsindex.vue

@@ -7,29 +7,29 @@
 						<a-range-picker v-model:value="searchFormState.times" value-format="YYYY-MM-DD" />
 					</a-form-item>
 				</a-col>
-				<a-col :span="6">
+<!--				<a-col :span="6">
 					<a-form-item label="单位名称" name="companyName">
 						<a-input v-model:value="searchFormState.companyName" placeholder="请输入单位名称" />
 					</a-form-item>
-				</a-col>
+				</a-col>-->
 				<a-col :span="6">
 					<a-form-item label="货品" name="goodsName">
 						<a-input v-model:value="searchFormState.goodsName" placeholder="请输入货品" />
 					</a-form-item>
 				</a-col>
-				<a-col :span="6" v-if="advanced">
+<!--				<a-col :span="6" v-if="advanced">
 					<a-form-item label="车牌号" name="licensePlate">
 						<a-input v-model:value="searchFormState.licensePlate" placeholder="请输入车牌号" />
 					</a-form-item>
-				</a-col>
+				</a-col>-->
 				<a-col :span="6">
 					<a-button type="primary" @click="query()">查询</a-button>
 					<a-button style="margin: 0 8px" @click="reset">重置</a-button>
 					<a-button type="dashed" class="snowy-buttom-left" @click="exportData()"><export-outlined />导出</a-button>
-					<a @click="toggleAdvanced" style="margin-left: 8px">
+<!--					<a @click="toggleAdvanced" style="margin-left: 8px">
 						{{ advanced ? '收起' : '展开' }}
 						<component :is="advanced ? 'up-outlined' : 'down-outlined'" />
-					</a>
+					</a>-->
 				</a-col>
 			</a-row>
 		</a-form>
@@ -48,13 +48,13 @@
 					{{ index + 1 }}
 				</template>
 				<template v-if="column.dataIndex === 'totalNetWeight'">
-					{{ record.totalNetWeight + ' t' }}
+					{{ record.totalNetWeight}}
 				</template>
 				<template v-if="column.dataIndex === 'totalGrossWeight'">
-					{{ record.totalGrossWeight + ' t' }}
+					{{ record.totalGrossWeight}}
 				</template>
 				<template v-if="column.dataIndex === 'totalTareWeight'">
-					{{ record.totalTareWeight + ' t' }}
+					{{ record.totalTareWeight}}
 				</template>
 			</template>
 		</a-table>
@@ -93,32 +93,39 @@
 		{
 			title: '序号',
 			width: 80,
-			dataIndex: 'serial'
+			dataIndex: 'serial',
+			align:'center'
 		},
 		{
-			title: '单位名称',
-			dataIndex: 'goodsName'
+			title: '货品名称',
+			dataIndex: 'goodsName',
+			align:'center'
 		},
 		{
-			title: '规格型号',
-			dataIndex: 'goodsModel'
+			title: '货品规格',
+			dataIndex: 'goodsModel',
+			align:'center'
 		},
 		{
 			title: '总车次',
-			dataIndex: 'totalCarNum'
+			dataIndex: 'totalCarNum',
+			align:'center'
 		},
 		{
-			title: '总净重',
-			dataIndex: 'totalNetWeight'
+			title: '总毛重(吨)',
+			dataIndex: 'totalGrossWeight',
+			align:'center'
 		},
 		{
-			title: '总毛重',
-			dataIndex: 'totalGrossWeight'
+			title: '总皮重(吨)',
+			dataIndex: 'totalTareWeight',
+			align:'center'
 		},
 		{
-			title: '总皮重',
-			dataIndex: 'totalTareWeight'
-		}
+			title: '总净重(吨)',
+			dataIndex: 'totalNetWeight',
+			align:'center'
+		},
 	]
 	const companyData = ref([])
 	const loadData = () => {
@@ -141,7 +148,7 @@
 		const searchFormParam = cloneDeep(searchFormState.value)
 		Modal.confirm({
 			title: '提示',
-			content: '确定要导出运输单位统计记录吗?',
+			content: '确定要导出货品统计记录吗?',
 			maskClosable: true,
 			onOk: () => {
 				bizRecordApi.goodsCountExport(searchFormParam).then((res) => {

+ 171 - 0
snowy-admin-web/src/views/biz/count/orderplan.vue

@@ -0,0 +1,171 @@
+<template>
+	<a-card>
+		<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
+			<a-row :gutter="24">
+				<a-col :span="6">
+					<a-form-item label="订单名称" name="orderName">
+						<a-input v-model:value="searchFormState.orderName" placeholder="订单名称查询" />
+					</a-form-item>
+				</a-col>
+				<a-col :span="6">
+					<a-form-item label="订单编号" name="orderNumber">
+						<a-input v-model:value="searchFormState.orderNumber" placeholder="订单编号查询" />
+					</a-form-item>
+				</a-col>
+				<a-col :span="6">
+					<a-form-item label="客户名称" name="customerName">
+						<a-input v-model:value="searchFormState.customerName" placeholder="客户名称查询" />
+					</a-form-item>
+				</a-col>
+				<a-col :span="6">
+					<a-button type="primary" @click="query()">查询</a-button>
+					<a-button style="margin: 0 8px" @click="reset">重置</a-button>
+					<a-button type="dashed" class="snowy-buttom-left" @click="exportData()"><export-outlined />导出</a-button>
+<!--					<a @click="toggleAdvanced" style="margin-left: 8px">
+						{{ advanced ? '收起' : '展开' }}
+						<component :is="advanced ? 'up-outlined' : 'down-outlined'" />
+					</a>-->
+				</a-col>
+			</a-row>
+		</a-form>
+	</a-card>
+	<a-card style="margin-top: 5px">
+		<a-table
+			ref="tableRef"
+			:columns="columns"
+			:data-source="companyData"
+			bordered
+			:row-key="(record) => record.id"
+			:rowClassName="rowClassName"
+		>
+			<!--	:pagination="false"		-->
+			<template #bodyCell="{ column, record, index }">
+				<template v-if="column.dataIndex === 'serial'">
+					{{ index + 1 }}
+				</template>
+<!--				<template v-if="column.dataIndex === 'actualWeight'">
+					<span v-if="record.actualWeight>record.netWeight" style="color:red">{{ record.actualWeight}}</span>
+					<span v-else>{{ record.actualWeight}}</span>
+				</template>-->
+			</template>
+		</a-table>
+	</a-card>
+</template>
+
+<script setup name="receiptcount">
+	import { Modal } from 'ant-design-vue'
+	import { ref, onMounted } from 'vue'
+	import { cloneDeep } from 'lodash-es'
+	import bizRecordApi from '@/api/biz/bizRecordApi'
+	import downloadUtil from '@/utils/downloadUtil'
+	import bizOrderApi from "@/api/biz/bizOrderApi";
+
+
+	const searchFormRef = ref()
+	const searchFormState = ref({
+		times: [],
+		licensePlate: '',
+		goodsName: '',
+		receiptCompany: ''
+	})
+
+	onMounted(() => {
+		loadData()
+	})
+
+	// 查询区域显示更多控制
+	const advanced = ref(false)
+	const toggleAdvanced = () => {
+		advanced.value = !advanced.value
+	}
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+	}
+	//表格相关
+	const columns = [
+		{
+			title: '序号',
+			width: 80,
+			dataIndex: 'serial',
+			align:'center'
+		},
+		{
+			title: '订单名称',
+			dataIndex: 'orderName',
+			align:'center'
+		},
+		{
+			title: '订单编号',
+			dataIndex: 'orderNumber',
+			align:'center'
+		},
+		{
+			title: '客户名称',
+			dataIndex: 'customerName',
+			align:'center'
+		},
+		{
+			title: '订单重量(吨)',
+			dataIndex: 'orderWeight',
+			align:'center'
+		},
+		{
+			title: '过磅重量(吨)',
+			dataIndex: 'netWeight',
+			align:'center'
+		},
+		{
+			title: '实际托运重量(吨)',
+			dataIndex: 'actualWeight',
+			align:'center'
+		},
+	]
+	const companyData = ref([])
+	const loadData = () => {
+		const searchFormParam = cloneDeep(searchFormState.value)
+		bizOrderApi.getOrderTotal(searchFormParam).then((data) => {
+			companyData.value = data.records
+		})
+	}
+
+	// 根据条件设置行的类名
+	const rowClassName = (record, index) => {
+		// 如果 status 为 'inactive',则标红
+		console.log("record:"+JSON.stringify(record))
+		return record.actualWeight > record.netWeight ? 'highlight' : '';
+	};
+
+	const query = () => {
+		loadData()
+	}
+	// 导出
+	const exportData = () => {
+		const searchFormParam = cloneDeep(searchFormState.value)
+		Modal.confirm({
+			title: '提示',
+			content: '确定要导出订单计划统计记录吗?',
+			maskClosable: true,
+			onOk: () => {
+				bizOrderApi.exportRecordTotal(searchFormParam).then((res) => {
+					downloadUtil.resultDownload(res)
+				})
+			}
+		})
+	}
+</script>
+
+<style>
+/*.highlight {
+	animation: blink 2s infinite;
+}
+@keyframes blink {
+	0%, 100% { background-color: transparent; }
+	50% { background-color: red; }
+}*/
+
+.highlight {
+	background-color: red; /* 设置背景色为红色 */
+	/*color: white;*/ /* 可选:设置文字颜色为白色,以便更好地显示 */
+}
+</style>

+ 27 - 25
snowy-admin-web/src/views/biz/count/recordindex.vue

@@ -24,12 +24,12 @@
 						<a-input v-model:value="searchFormState.goodsName" placeholder="请输入货品" />
 					</a-form-item>
 				</a-col>
-				<a-col :span="6" v-show="advanced">
-					<a-form-item label="收货单位" name="receiptCompany">
-						<a-input v-model:value="searchFormState.receiptCompany" placeholder="请输入收货单位" />
+<!--				<a-col :span="6" v-show="advanced">
+					<a-form-item label="客户名称" name="receiptCompany">
+						<a-input v-model:value="searchFormState.receiptCompany" placeholder="请输入客户名称" />
 					</a-form-item>
-				</a-col>
-				<a-col :span="6" v-show="advanced">
+				</a-col>-->
+<!--				<a-col :span="6" v-show="advanced">
 					<a-form-item label="发货单位" name="shippingCompany">
 						<a-input v-model:value="searchFormState.shippingCompany" placeholder="请输入发货单位" />
 					</a-form-item>
@@ -38,14 +38,14 @@
 					<a-form-item label="运输单位" name="transportCompany">
 						<a-input v-model:value="searchFormState.transportCompany" placeholder="请输入运输单位" />
 					</a-form-item>
-				</a-col>
+				</a-col>-->
 				<a-col :span="6">
 					<a-button type="primary" @click="query()">查询</a-button>
 					<a-button style="margin: 0 8px" @click="reset">重置</a-button>
-					<a @click="toggleAdvanced" style="margin-left: 8px">
+<!--					<a @click="toggleAdvanced" style="margin-left: 8px">
 						{{ advanced ? '收起' : '展开' }}
 						<component :is="advanced ? 'up-outlined' : 'down-outlined'" />
-					</a>
+					</a>-->
 				</a-col>
 			</a-row>
 		</a-form>
@@ -59,27 +59,27 @@
 			</a-col>
 			<a-col :span="6">
 				<a-card>
-					<a-statistic title="总净重" :value="totalNetWeight">
+					<a-statistic title="总毛重" :value="totalGrossWeight">
 						<template #suffix>
-							<span>t</span>
+							<span></span>
 						</template>
 					</a-statistic>
 				</a-card>
 			</a-col>
 			<a-col :span="6">
 				<a-card>
-					<a-statistic title="总毛重" :value="totalGrossWeight">
+					<a-statistic title="总皮重" :value="totalTareWeight">
 						<template #suffix>
-							<span>t</span>
+							<span></span>
 						</template>
 					</a-statistic>
 				</a-card>
 			</a-col>
 			<a-col :span="6">
 				<a-card>
-					<a-statistic title="总皮重" :value="totalTareWeight">
+					<a-statistic title="总净重" :value="totalNetWeight">
 						<template #suffix>
-							<span>t</span>
+							<span></span>
 						</template>
 					</a-statistic>
 				</a-card>
@@ -98,6 +98,7 @@
 	import { onMounted } from 'vue'
 	import { Column } from '@antv/g2plot'
 	import bizRecordApi from '@/api/biz/bizRecordApi'
+	import {cloneDeep} from "lodash-es";
 	const searchFormState = ref({
 		times: [],
 		licensePlate: '',
@@ -161,20 +162,21 @@
 		searchFormState.value.endDay = null
 	}
 	const query = () => {
-		if (Array.isArray(searchFormState.value.times) && searchFormState.value.times.length > 0) {
-			searchFormState.value.times = searchFormState.value.times.map((item) => item.format('YYYY-MM-DD'))
-			searchFormState.value.startDay = searchFormState.value.times[0]
-			searchFormState.value.endDay = searchFormState.value.times[1]
-			delete searchFormState.value.times
+		const searchFormParam = cloneDeep(searchFormState.value)
+		if (Array.isArray(searchFormParam.times) && searchFormParam.times.length > 0) {
+			searchFormParam.times = searchFormParam.times.map((item) => item.format('YYYY-MM-DD'))
+			searchFormParam.startDay = searchFormParam.times[0]
+			searchFormParam.endDay = searchFormParam.times[1]
+			delete searchFormParam.times
 		}
-		countData()
+		countData(searchFormParam)
 		return bizRecordApi
-			.bizRecordSevenDaysList(searchFormState.value)
+			.bizRecordSevenDaysList(Object.assign(searchFormParam))
 			.then((res) => {
 				sevenData.value = res || []
 				renderChart() // 查询成功后重新渲染图表
-				searchFormState.value.startDay = null
-				searchFormState.value.endDay = null
+				//searchFormState.value.startDay = null
+				//searchFormState.value.endDay = null
 			})
 			.catch((err) => {
 				console.error('查询失败:', err)
@@ -207,8 +209,8 @@
 		stackedColumnPlot.render()
 	}
 	// 统计
-	const countData = () => {
-		bizRecordApi.bizRecordCountWeight(searchFormState.value).then((res) => {
+	const countData = (param) => {
+		bizRecordApi.bizRecordCountWeight(param).then((res) => {
 			if (res) {
 				totalCar.value = res.totalCar
 				totalGrossWeight.value = res.totalGrossWeight

+ 172 - 0
snowy-admin-web/src/views/biz/count/vehicle.vue

@@ -0,0 +1,172 @@
+<template>
+	<a-card>
+		<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
+			<a-row :gutter="24">
+				<a-col :span="6">
+					<a-form-item label="日期" name="times">
+						<a-range-picker
+							v-model:value="searchFormState.times"
+							:disabled-date="disabledDate"
+							format="YYYY-MM-DD"
+							@change="onChange"
+							@openChange="onOpenChange"
+							@calendarChange="onCalendarChange"
+						/>
+					</a-form-item>
+				</a-col>
+<!--				<a-col :span="6">
+					<a-form-item label="车牌号" name="licensePlate">
+						<a-input v-model:value="searchFormState.licensePlate" placeholder="请输入车牌号" />
+					</a-form-item>
+				</a-col>-->
+				<a-col :span="6">
+					<a-button type="primary" @click="query()">查询</a-button>
+					<a-button style="margin: 0 8px" @click="reset">重置</a-button>
+<!--					<a @click="toggleAdvanced" style="margin-left: 8px">
+						{{ advanced ? '收起' : '展开' }}
+						<component :is="advanced ? 'up-outlined' : 'down-outlined'" />
+					</a>-->
+				</a-col>
+			</a-row>
+		</a-form>
+	</a-card>
+	<div style="margin-top: 5px">
+		<a-card title="车辆执行状态分析" :bordered="false">
+			<div id="SevenDays"></div>
+		</a-card>
+	</div>
+</template>
+
+<script setup name="recordcount">
+	import { ref } from 'vue'
+	import { onMounted } from 'vue'
+	import { Column } from '@antv/g2plot'
+	import bizRecordApi from '@/api/biz/bizRecordApi'
+	import bizAppointmentRecordApi from "@/api/biz/bizAppointmentRecordApi";
+	import {cloneDeep} from "lodash-es";
+	const searchFormState = ref({
+		times: [],
+		licensePlate: '',
+		goodsName: '',
+		receiptCompany: '',
+		shippingCompany: '',
+		transportCompany: ''
+	})
+	const totalCar = ref(0)
+	const totalGrossWeight = ref(0)
+	const totalNetWeight = ref(0)
+	const totalTareWeight = ref(0)
+	const searchFormRef = ref()
+
+	// 查询区域显示更多控制
+	const advanced = ref(false)
+	const toggleAdvanced = () => {
+		advanced.value = !advanced.value
+	}
+	// 统计
+	const sevenData = ref([])
+	const loading = ref(true)
+	let stackedColumnPlot = null // 声明图表实例
+
+	onMounted(() => {
+		loadData()
+	})
+
+	//日期选择
+	const dates = ref()
+	const value = ref()
+	const hackValue = ref()
+	const disabledDate = (current) => {
+		if (!dates.value || dates.value.length === 0) {
+			return false
+		}
+		const tooLate = dates.value[0] && current.diff(dates.value[0], 'days') > 7
+		const tooEarly = dates.value[1] && dates.value[1].diff(current, 'days') > 7
+		return tooEarly || tooLate
+	}
+	const onOpenChange = (open) => {
+		if (open) {
+			dates.value = []
+			hackValue.value = []
+		} else {
+			hackValue.value = undefined
+		}
+	}
+	const onChange = (val) => {
+		console.log(val)
+		value.value = val
+	}
+	const onCalendarChange = (val) => {
+		dates.value = val
+	}
+
+	// 重置
+	const reset = () => {
+		searchFormRef.value.resetFields()
+		searchFormState.value.startDay = null
+		searchFormState.value.endDay = null
+	}
+	const query = () => {
+		const searchFormParam = cloneDeep(searchFormState.value)
+		if (Array.isArray(searchFormParam.times) && searchFormParam.times.length > 0) {
+			searchFormParam.times = searchFormParam.times.map((item) => item.format('YYYY-MM-DD'))
+			searchFormParam.beginTime = searchFormParam.times[0]
+			searchFormParam.endTime = searchFormParam.times[1]
+			delete searchFormParam.times
+		}
+		return bizAppointmentRecordApi
+			.gerVehicleTotal(Object.assign(searchFormParam))
+			.then((res) => {
+				sevenData.value = res || []
+				renderChart() // 查询成功后重新渲染图表
+				searchFormState.value.startDay = null
+				searchFormState.value.endDay = null
+			})
+			.catch((err) => {
+				console.error('查询失败:', err)
+				sevenData.value = [] // 如果请求失败,清空数据
+			})
+	}
+
+	const loadData = () => {
+		query().finally(() => {
+			loading.value = false
+			renderChart()
+		})
+	}
+
+	const renderChart = () => {
+		if (stackedColumnPlot) {
+			stackedColumnPlot.destroy() // 销毁旧的图表实例
+		}
+		stackedColumnPlot = new Column('SevenDays', {
+			data: sevenData.value, // 使用 sevenData.value
+			xField: 'status',
+			yField: 'count',
+			label: {
+				position: 'middle',
+				layout: [{ type: 'interval-adjust-position' }, { type: 'interval-hide-overlap' }, { type: 'adjust-color' }]
+			},
+			meta: {
+				status: {
+					alias: '状态'
+				},
+				count: {
+					alias: '车辆数'
+				}
+			}
+		})
+		stackedColumnPlot.render()
+	}
+	// 统计
+	const countData = () => {
+		bizRecordApi.bizRecordCountWeight(searchFormState.value).then((res) => {
+			if (res) {
+				totalCar.value = res.totalCar
+				totalGrossWeight.value = res.totalGrossWeight
+				totalNetWeight.value = res.totalNetWeight
+				totalTareWeight.value = res.totalTareWeight
+			}
+		})
+	}
+</script>

+ 11 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/controller/BizAppointmentRecordController.java

@@ -41,6 +41,7 @@ import jakarta.validation.constraints.NotEmpty;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 预约记录控制器
@@ -197,4 +198,14 @@ public class BizAppointmentRecordController {
         bizAppointmentRecordService.adjustOrder(bizAppointmentRecordEditParam);
         return CommonResult.ok();
     }
+
+    /**
+     * 车辆执行状态分析
+     */
+    @Operation(summary = "车辆执行状态分析")
+    @CommonLog("车辆执行状态分析")
+    @GetMapping("/biz/bizappointmentrecord/gerVehicleTotal")
+    public CommonResult<List<Map<String,Object>>> gerVehicleTotal(BizAppointmentRecordPageParam bizAppointmentRecordPageParam){
+        return CommonResult.data(bizAppointmentRecordService.gerVehicleTotal(bizAppointmentRecordPageParam));
+    }
 }

+ 3 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/mapper/BizAppointmentRecordMapper.java

@@ -19,6 +19,7 @@ import org.apache.ibatis.annotations.Param;
 import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 预约记录Mapper接口
@@ -32,4 +33,6 @@ public interface BizAppointmentRecordMapper extends BaseMapper<BizAppointmentRec
     List<BizAppointmentRecord> getPage(@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
 
     List<BizAppointmentRecord> getRecord(@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
+
+    List<Map<String,Object>> gerVehicleTotal(@Param("beginTime") String beginTime,@Param("endTime") String endTime);
 }

+ 33 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/mapper/mapping/BizAppointmentRecordMapper.xml

@@ -56,4 +56,37 @@
         LEFT JOIN biz_goods_conf bgc ON bgc.id = bar.time_id
             ${ew.customSqlSegment}
     </select>
+
+    <select id="gerVehicleTotal" resultType="java.util.Map">
+        SELECT
+            case
+                when a.DICT_VALUE ='1' then '待审核'
+                when a.DICT_VALUE ='2' then '审核不通过'
+                when a.DICT_VALUE ='3' then '排队中'
+                when a.DICT_VALUE ='4' then '可入场'
+                when a.DICT_VALUE ='5' then '已入场'
+                when a.DICT_VALUE ='6' then '一次过磅'
+                when a.DICT_VALUE ='7' then '完成装货'
+                when a.DICT_VALUE ='8' then '二次过磅'
+                when a.DICT_VALUE ='9' then '待出场'
+                when a.DICT_VALUE ='10' then '已出场'
+                when a.DICT_VALUE ='11' then '已签收'
+                when a.DICT_VALUE ='12' then '销售待审核'
+                when a.DICT_VALUE ='13' then '销售已审核'
+                when a.DICT_VALUE ='14' then '已取消'
+                else '超期作废'
+            end as status,
+            ifnull( b.count, 0 ) count
+        FROM
+            ( SELECT DICT_VALUE FROM dev_dict WHERE PARENT_ID = ( SELECT id FROM dev_dict WHERE DICT_VALUE = 'appointment_status' ) ) a
+            LEFT JOIN (
+                SELECT STATUS, count( * ) count
+                FROM biz_appointment_record bar
+                where delete_flag = 'NOT_DELETE'
+                <if test="beginTime!=null and endTime!=null">
+                    and create_time between #{beginTime} and #{endTime}
+                </if>
+                GROUP BY bar.STATUS
+            ) b ON a.DICT_VALUE = b.STATUS
+    </select>
 </mapper>

+ 4 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizAppointmentRecordPageParam.java

@@ -77,4 +77,8 @@ public class BizAppointmentRecordPageParam {
 
     private String dateNow;
 
+    private String beginTime;
+
+    private String endTime;
+
 }

+ 4 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/BizAppointmentRecordService.java

@@ -24,6 +24,7 @@ import vip.xiaonuo.biz.modular.bizorder.param.BizOrderPageParam;
 
 import java.io.IOException;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 预约记录Service接口
@@ -98,4 +99,7 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
 
     /**获取当前时间的预约*/
     BizAppointmentRecord getAppointmentRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam);
+
+    /**车辆执行状态分析*/
+    List<Map<String,Object>> gerVehicleTotal(BizAppointmentRecordPageParam bizAppointmentRecordPageParam);
 }

+ 23 - 2
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/impl/BizAppointmentRecordServiceImpl.java

@@ -23,8 +23,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fhs.trans.service.impl.TransService;
+import com.google.common.collect.Maps;
 import jakarta.annotation.Resource;
 import jakarta.servlet.http.HttpServletResponse;
+import org.apache.commons.collections4.MapUtils;
 import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
@@ -59,6 +61,7 @@ import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecord
 import java.io.IOException;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.concurrent.locks.ReentrantLock;
 import java.util.regex.Pattern;
 
@@ -201,7 +204,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
             //校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核  、 14:已取消
             long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
                     eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordAddParam.getLicenseNumber()).
-                    notIn(BizAppointmentRecord::getStatus, "11", "13", "14","15"));
+                    notIn(BizAppointmentRecord::getStatus, "10","11", "13", "14","15"));
             if(count>0){
                 throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordAddParam.getLicenseNumber());
             }
@@ -259,7 +262,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
                 //校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核  、 14:已取消
                 long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
                         eq(BizAppointmentRecord::getLicenseNumber,bizAppointmentRecordEditParam.getLicenseNumber()).
-                        notIn(BizAppointmentRecord::getStatus, "11", "13", "14","15"));
+                        notIn(BizAppointmentRecord::getStatus, "10","11", "13", "14","15"));
                 if(count>0){
                     throw new CommonException("车牌号:{}已经添加过预约!",bizAppointmentRecordEditParam.getLicenseNumber());
                 }
@@ -551,6 +554,24 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         return null;
     }
 
+    @Override
+    public List<Map<String, Object>> gerVehicleTotal(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
+        String beginTime = null;
+        String endTime = null;
+        if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getBeginTime())){
+            beginTime = bizAppointmentRecordPageParam.getBeginTime()+" 00:00:00";
+        }else{
+            //beginTime = DateUtil.format(DateUtil.date(),"yyyy-MM-dd");
+        }
+        if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getEndTime())){
+            endTime = bizAppointmentRecordPageParam.getEndTime()+" 23:59:59";
+        }else{
+            //endTime = DateUtil.format(DateUtil.date(),"yyyy-MM-dd");
+        }
+        List<Map<String, Object>> list = this.getBaseMapper().gerVehicleTotal(beginTime, endTime);
+        return list;
+    }
+
     public BizAppointmentRecord setBizAppointmentRecord(BizAppointmentRecord bizAppointmentRecord){
         bizAppointmentRecord.setIsFlag("1");
         if(ObjectUtil.isNotEmpty(bizAppointmentRecord.getOrderId())){

+ 18 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/controller/BizOrderController.java

@@ -258,4 +258,22 @@ public class BizOrderController {
         bizOrderService.submit(bizOrderEditParam);
         return CommonResult.ok();
     }
+
+    @Operation(summary = "订单计划分析")
+    @CommonLog("订单计划分析")
+    @GetMapping("/biz/bizorder/getOrderTotal")
+    public CommonResult<Page<BizOrder>> getOrderTotal(BizOrderPageParam bizOrderPageParam) {
+        return CommonResult.data(bizOrderService.getOrderTotal(bizOrderPageParam));
+    }
+
+
+    /**
+     * 导出订单统计
+     */
+    @Operation(summary = "导出订单统计")
+    @SaCheckPermission("/biz/bizorder/exportRecordTotal")
+    @GetMapping(value = "/biz/bizorder/exportRecordTotal", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
+    public void exportRecordTotal(BizOrderPageParam bizOrderPageParam, HttpServletResponse response) throws IOException {
+        bizOrderService.exportRecordTotal(bizOrderPageParam,response);
+    }
 }

+ 4 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/entity/BizOrder.java

@@ -131,4 +131,8 @@ public class BizOrder extends CommonEntity{
     /**结束备注**/
     private String endReason;
 
+    /**实际托运重量*/
+    @TableField(exist = false)
+    private BigDecimal actualWeight;
+
 }

+ 4 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/mapper/BizOrderMapper.java

@@ -30,4 +30,8 @@ public interface BizOrderMapper extends BaseMapper<BizOrder> {
     Page<BizOrder> getPage(@Param("page")Page<BizOrder> page, @Param("ew") QueryWrapper<BizOrder> ew);
 
     List<BizOrder> getPage(@Param("ew") QueryWrapper<BizOrder> ew);
+
+    Page<BizOrder> getOrderTotal(@Param("page") Page<BizOrder> page,@Param("ew") QueryWrapper<BizOrder> ew);
+
+    List<BizOrder> getOrderTotal(@Param("ew") QueryWrapper<BizOrder> ew);
 }

+ 25 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/mapper/mapping/BizOrderMapper.xml

@@ -33,4 +33,29 @@
         left join biz_goods_conf bgc on bgc.id = bo.delivery_time_id
         ${ew.customSqlSegment}
     </select>
+
+    <select id="getOrderTotal" resultType="vip.xiaonuo.biz.modular.bizorder.entity.BizOrder">
+        select
+            a.*
+        from(
+            select
+                bo.id,
+                bo.order_number,
+                bo.order_name,
+                bc.name customerName,
+                bo.order_weight/1000 order_weight,
+                bo.net_weight/1000 net_weight,
+                IFNULL(br.actualWeight/1000,0) actualWeight,
+                case
+                    when IFNULL(br.actualWeight,0)>bo.net_weight then '1'
+                    else '0'
+                end as 	orderFlag
+            from biz_order bo
+            left join biz_customer bc on bo.customer_id = bc.id
+            left join (select order_id,IFNULL(sum(net_weight),0) actualWeight from biz_record  where delete_flag = 'NOT_DELETE' group by order_id) br
+            on br.order_id = bo.id
+            ${ew.customSqlSegment}
+        ) a
+        order by a.orderFlag desc
+    </select>
 </mapper>

+ 42 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/param/BizOrderExportTotal.java

@@ -0,0 +1,42 @@
+package vip.xiaonuo.biz.modular.bizorder.param;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.HeadStyle;
+import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+public class BizOrderExportTotal {
+    /** 订单名称 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"订单计划统计", "订单名称"})
+    private String orderName;
+
+    /** 订单编号 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"订单计划统计", "订单编号"})
+    private String orderNumber;
+
+    /** 客户名称 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"订单计划统计", "客户名称"})
+    private String customerName;
+
+    /** 订单重量 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"订单计划统计", "订单重量(吨)"})
+    private BigDecimal orderWeight;
+
+    /** 过磅重量 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"订单计划统计", "过磅重量(吨)"})
+    private BigDecimal netWeight;
+
+    /** 过磅重量 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"订单计划统计", "实际托运重量(吨)"})
+    private BigDecimal actualWeight;
+}

+ 6 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/service/BizOrderService.java

@@ -15,6 +15,7 @@ package vip.xiaonuo.biz.modular.bizorder.service;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
 import jakarta.servlet.http.HttpServletResponse;
+import vip.xiaonuo.biz.modular.bizappointmentrecord.param.BizAppointmentRecordPageParam;
 import vip.xiaonuo.biz.modular.customer.entity.BizCustomer;
 import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
 import vip.xiaonuo.biz.modular.bizorder.param.BizOrderAddParam;
@@ -111,4 +112,9 @@ public interface BizOrderService extends IService<BizOrder> {
 
     /**提交*/
     void submit(BizOrderEditParam bizOrderEditParam);
+
+    Page<BizOrder> getOrderTotal(BizOrderPageParam bizOrderPageParam);
+
+    /**导出报表*/
+    void exportRecordTotal(BizOrderPageParam bizOrderPageParam, HttpServletResponse response) throws IOException;
 }

+ 38 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizorder/service/impl/BizOrderServiceImpl.java

@@ -31,6 +31,8 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import vip.xiaonuo.auth.api.SaBaseLoginUserApi;
 import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
+import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
+import vip.xiaonuo.biz.modular.bizappointmentrecord.param.BizAppointmentExportResult;
 import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
 import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
 import vip.xiaonuo.biz.modular.bizorderconfig.entity.BizOrderConfig;
@@ -403,6 +405,42 @@ public class BizOrderServiceImpl extends ServiceImpl<BizOrderMapper, BizOrder> i
         this.updateById(bizOrder);
     }
 
+    @Override
+    public Page<BizOrder> getOrderTotal(BizOrderPageParam bizOrderPageParam) {
+        QueryWrapper<BizOrder> queryWrapper = getTotalQueryWrapper(bizOrderPageParam);
+        Page<BizOrder> orderTotal = this.getBaseMapper().getOrderTotal(CommonPageRequest.defaultPage(), queryWrapper);
+        return orderTotal;
+    }
+
+    @Override
+    public void exportRecordTotal(BizOrderPageParam bizOrderPageParam, HttpServletResponse response) throws IOException {
+        QueryWrapper<BizOrder> queryWrapper = getTotalQueryWrapper(bizOrderPageParam);
+        List<BizOrder> orderList = this.getBaseMapper().getOrderTotal(queryWrapper);
+        String fileName = "订单计划统计.xlsx";
+        List<BizOrderExportTotal> list = Lists.newArrayList();
+        for(BizOrder bizOrder : orderList){
+            BizOrderExportTotal bizOrderExportTotal = new BizOrderExportTotal();
+            BeanUtil.copyProperties(bizOrder, bizOrderExportTotal);
+            list.add(bizOrderExportTotal);
+        }
+        CommonExportUtil.export(fileName, BizOrderExportTotal.class,list,response,"订单计划统计");
+    }
+
+    public QueryWrapper<BizOrder> getTotalQueryWrapper(BizOrderPageParam bizOrderPageParam){
+        QueryWrapper<BizOrder> queryWrapper = new QueryWrapper<>();
+        if(ObjectUtil.isNotEmpty(bizOrderPageParam.getOrderName())){
+            queryWrapper.like("bo.order_name",bizOrderPageParam.getOrderName());
+        }
+        if(ObjectUtil.isNotEmpty(bizOrderPageParam.getOrderNumber())){
+            queryWrapper.like("bo.order_number",bizOrderPageParam.getOrderNumber());
+        }
+        if(ObjectUtil.isNotEmpty(bizOrderPageParam.getCustomerName())){
+            queryWrapper.like("bc.name",bizOrderPageParam.getCustomerName());
+        }
+        queryWrapper.eq("bo.delete_flag","NOT_DELETE");
+        return queryWrapper;
+    }
+
     public static void main(String[] args) {
         String result = "";
         try {

+ 5 - 3
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizvehicle/service/impl/BizVehicleServiceImpl.java

@@ -211,9 +211,11 @@ public class BizVehicleServiceImpl extends ServiceImpl<BizVehicleMapper, BizVehi
                 eq(BizVehicle::getStatus, "1").
                 eq(BizVehicle::getCreateUser, StpLoginUserUtil.getLoginUser().getId()).
                 last("limit 1"));
-        BizExcessConfig excessConfig = bizExcessConfigService.getById(bizVehicle.getVehicleAxles());
-        if(ObjectUtil.isNotNull(excessConfig)){
-            bizVehicle.setVehicleAxleNumber(excessConfig.getVehicleAxleNumber().toString());
+        if(ObjectUtil.isNotNull(bizVehicle)){
+            BizExcessConfig excessConfig = bizExcessConfigService.getById(bizVehicle.getVehicleAxles());
+            if(ObjectUtil.isNotNull(excessConfig)){
+                bizVehicle.setVehicleAxleNumber(excessConfig.getVehicleAxleNumber().toString());
+            }
         }
         return bizVehicle;
     }

+ 6 - 12
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/record/result/GoodsResult.java

@@ -20,40 +20,34 @@ import java.math.BigDecimal;
 @Getter
 public class GoodsResult {
 
-    @Schema(description = "货品名称")
     @ColumnWidth(20)
     @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
     @ExcelProperty({"统计分析", "货品名称"})
     private String goodsName;
 
-    @Schema(description = "规格型号")
     @ColumnWidth(20)
     @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
-    @ExcelProperty({"统计分析", "规格型号"})
+    @ExcelProperty({"统计分析", "货品规格"})
     private String goodsModel;
 
-    @Schema(description = "总车次")
     @ColumnWidth(20)
     @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
     @ExcelProperty({"统计分析", "总车次"})
     private Integer totalCarNum;
 
-    @Schema(description = "总净重")
-    @ColumnWidth(20)
-    @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
-    @ExcelProperty({"统计分析", "总净重(吨)"})
-    private BigDecimal totalNetWeight;
-
-    @Schema(description = "总毛重")
     @ColumnWidth(20)
     @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
     @ExcelProperty({"统计分析", "总毛重(吨)"})
     private BigDecimal totalGrossWeight;
 
-    @Schema(description = "总皮重")
     @ColumnWidth(20)
     @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
     @ExcelProperty({"统计分析", "总皮重(吨)"})
     private BigDecimal totalTareWeight;
 
+    @ColumnWidth(20)
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.NO_FILL)
+    @ExcelProperty({"统计分析", "总净重(吨)"})
+    private BigDecimal totalNetWeight;
+
 }