Jelajahi Sumber

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

shasha 1 Minggu lalu
induk
melakukan
a3228af922
24 mengubah file dengan 1629 tambahan dan 64 penghapusan
  1. 24 0
      snowy-admin-web/src/api/biz/bizAppointmentRecordApi.js
  2. 9 9
      snowy-admin-web/src/views/biz/bizappointload/index.vue
  3. 1 1
      snowy-admin-web/src/views/biz/bizappointmentrecord/index.vue
  4. 19 6
      snowy-admin-web/src/views/biz/bizloadappoint/dispatch.vue
  5. 282 0
      snowy-admin-web/src/views/biz/bizloadappoint/dispatchadd.vue
  6. 20 21
      snowy-admin-web/src/views/biz/bizloadappoint/dispatchload.vue
  7. 316 0
      snowy-admin-web/src/views/biz/bizloadappoint/dispatchloadadd.vue
  8. 2 2
      snowy-admin-web/src/views/biz/bizloadarrive/index.vue
  9. 1 1
      snowy-admin-web/src/views/biz/bizorder/form.vue
  10. 124 0
      snowy-admin-web/src/views/biz/bizpipeappoint/detail.vue
  11. 9 8
      snowy-admin-web/src/views/biz/bizpipeappoint/form.vue
  12. 220 6
      snowy-admin-web/src/views/biz/bizpipeappoint/index.vue
  13. 101 6
      snowy-admin-web/src/views/biz/bizpipeplan/index.vue
  14. 76 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/controller/BizAppointmentRecordController.java
  15. 11 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/entity/BizAppointmentRecord.java
  16. 6 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/mapper/BizAppointmentRecordMapper.java
  17. 37 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/mapper/mapping/BizAppointmentRecordMapper.xml
  18. 4 4
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizAppointmentExportResult.java
  19. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizAppointmentRecordPageParam.java
  20. 54 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizLoadAppointmentExportResult.java
  21. 46 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizPipeAppointmentExportResult.java
  22. 17 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/BizAppointmentRecordService.java
  23. 236 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/impl/BizAppointmentRecordServiceImpl.java
  24. 11 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloaddispatch/service/impl/BizLoadDispatchServiceImpl.java

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

@@ -17,6 +17,10 @@ export default {
 	bizAppointmentLoadRecordPage(data) {
 		return request('getLoadPage', data, 'get')
 	},
+	//获取管桩预约列表
+	bizAppointmentPipeRecordPage(data) {
+		return request('getPipePage', data, 'get')
+	},
 	// 提交预约记录表单 edit为true时为编辑,默认为新增
 	bizAppointmentRecordSubmitForm(data, edit = false) {
 		return request(edit ? 'edit' : 'add', data)
@@ -29,6 +33,10 @@ export default {
 	bizAppointmentLoadSubmitForm(data, edit = false) {
 		return request(edit ? 'editLoad' : 'addLoad', data)
 	},
+	//管桩预约
+	bizAppointmentPipeSubmitForm(data,edit = false){
+		return request(edit ? 'editPipeAppoint' : 'addPipeAppoint', data)
+	},
 	// 删除预约记录
 	bizAppointmentRecordDelete(data) {
 		return request('delete', data)
@@ -63,10 +71,26 @@ export default {
 			responseType: 'blob'
 		})
 	},
+	//导出起卸预约
+	exportLoadRecord(data){
+		return request('exportLoadRecord', data, 'get', {
+			responseType: 'blob'
+		})
+	},
+	//导出管桩预约
+	exportPipeRecord(data){
+		return request('exportPipeRecord', data, 'get', {
+			responseType: 'blob'
+		})
+	},
 	//取消排队
 	cancelAppointmentRecord(data){
 		return request('cancelAppointmentRecord',data)
 	},
+	//取消管桩预约
+	replacePipeAppoint(data){
+		return request('replacePipeAppoint',data)
+	},
 	//调整订单
 	adjustOrder(data){
 		return request('adjustOrder',data)

+ 9 - 9
snowy-admin-web/src/views/biz/bizappointload/index.vue

@@ -64,11 +64,11 @@
 		>
 			<template #operator class="table-operator">
 				<a-space>
-					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizAppointmentRecordAdd')">
+					<a-button type="primary" @click="formRef.onOpen()" v-if="hasPerm('bizAppointLoadAdd')">
 						<template #icon><plus-outlined /></template>
 						新增
 					</a-button>
-					<a-button @click="exportTotal" v-if="hasPerm('bizAppointmentExport')">
+					<a-button @click="exportTotal" v-if="hasPerm('bizAppointLoadExport')">
 						<template #icon>
 							<export-outlined/>
 						</template>
@@ -171,22 +171,22 @@
 									<a-menu-item v-if="hasPerm('bizAppointmentAudit') && (record.status == '1')">
 										<a style="color: #ffaa00" @click="reviewRef.showModal(record.id)">审核</a>
 									</a-menu-item>
-									<a-menu-item v-if="hasPerm('bizAppointmentRecordEdit') && (record.status == '2' || record.status == '4')">
+									<a-menu-item v-if="hasPerm('bizAppointLoadEdit') && (record.status == '2' || record.status == '4')">
 										<a style="color:blue" @click="formRef.onOpen(record)" >编辑</a>
 									</a-menu-item>
-									<a-menu-item v-if="hasPerm('bizAppointmentRecordDelete') && (record.status == '2' || record.status == '4')">
+									<a-menu-item v-if="hasPerm('bizAppointLoadDelete') && (record.status == '2' || record.status == '4')">
 										<a style="color:red" type="link" danger size="small" @click="deleteConfig(record)">删除</a>
 									</a-menu-item>
-									<a-menu-item v-if="hasPerm('bizAppointmentDriverConfim') && record.status == '8'">
+									<a-menu-item v-if="hasPerm('bizAppointLoadconfirm') && record.status == '8'">
 										<a @click="XnSignNameRef.show(record.recordId)" >确认</a>
 									</a-menu-item>
-									<a-menu-item v-if="hasPerm('bizAppointmentDriverSign') && record.status=='10' && record.orderType=='1'">
+									<a-menu-item v-if="hasPerm('bizAppointLoadDriverSign') && record.status=='10' && record.orderType=='1'">
 										<a  @click="signRef.onOpen(record)" >回签</a>
 									</a-menu-item>
 									<a-menu-item v-if="record.status=='4'">
 										<a style="color:green"  @click="cancel(record)" >取消</a>
 									</a-menu-item>
-									<a-menu-item v-if="hasPerm('bizAppointmentDriverExit') && (record.status=='5' || record.status=='6' || record.status=='7' || record.status=='8')">
+									<a-menu-item v-if="hasPerm('bizAppointLoadExit') && (record.status=='5' || record.status=='6' || record.status=='7' || record.status=='8')">
 										<a style="color:orange"  @click="exit(record)" >授权出场</a>
 									</a-menu-item>
 
@@ -542,9 +542,9 @@
 			onOk() {
 				submitLoading.value = true
 				const searchFormParam = cloneDeep(searchFormState.value)
-
+				searchFormParam.type = '3'
 				bizAppointmentRecordApi
-					.exportRecord(Object.assign(searchFormParam))
+					.exportLoadRecord(Object.assign(searchFormParam))
 					.then((res) => {
 						downloadUtil.resultDownload(res)
 					})

+ 1 - 1
snowy-admin-web/src/views/biz/bizappointmentrecord/index.vue

@@ -553,7 +553,7 @@
 			onOk() {
 				submitLoading.value = true
 				const searchFormParam = cloneDeep(searchFormState.value)
-
+				searchFormParam.type = '1'
 				bizAppointmentRecordApi
 					.exportRecord(Object.assign(searchFormParam))
 					.then((res) => {

+ 19 - 6
snowy-admin-web/src/views/biz/bizloadappoint/dispatch.vue

@@ -1,12 +1,12 @@
 <template>
 	<xn-form-container
-		:title="formData.id ? '装载车调度' : '装载车调度'"
+		:title="formData.id ? '装载车调度详情' : '装载车调度详情'"
 		:width="900"
 		v-model:open="open"
 		:destroy-on-close="true"
 		@close="onClose"
 	>
-		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+<!--		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
 			<a-form-item label="预约单号:" name="loadNumber">
 				<a-input v-model:value="formData.loadNumber" placeholder="请输入预约单号" allow-clear disabled/>
 			</a-form-item>
@@ -26,7 +26,7 @@
 			<a-form-item label="已约次数:" name="alreadyNumber" v-show="numberFlag">
 				<a-input v-model:value="formData.alreadyNumber" placeholder="请输入已约次数" allow-clear disabled/>
 			</a-form-item>
-		</a-form>
+		</a-form>-->
 
 		<s-table
 			ref="tableRef"
@@ -35,6 +35,14 @@
 			bordered
 			:row-key="(record) => record.id"
 		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="dispatchAddRef.onOpen(appointId)">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+				</a-space>
+			</template>
 			<template #bodyCell="{ column, record }">
 				<template v-if="column.dataIndex === 'action'">
 					<a-space>
@@ -47,12 +55,13 @@
 			</template>
 		</s-table>
 
-		<template #footer>
+<!--		<template #footer>
 			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
 			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
-		</template>
+		</template>-->
 
 		<Replace ref="replaceRef" @successful="tableRef.refresh(true)" />
+		<DispatchAdd ref="dispatchAddRef" @successful="tableRef.refresh(true)" />
 	</xn-form-container>
 </template>
 
@@ -70,6 +79,7 @@
 	import {createVNode} from 'vue';
 	import Replace from './replace.vue'
 	import bizLoadDispatchApi from "@/api/biz/bizLoadDispatchApi";
+	import DispatchAdd from './dispatchadd.vue'
 
 
 	// 抽屉状态
@@ -78,6 +88,7 @@
 	const formRef = ref()
 	const tableRef = ref()
 	const replaceRef = ref()
+	const dispatchAddRef = ref()
 
 	const numberFlag = ref(false)
 	// 表单数据
@@ -98,12 +109,14 @@
 	const loadPointIdList = ref()
 	const loadTimeIdList = ref()
 
+	const appointId = ref()
 	// 打开抽屉
 	const onOpen = (record) => {
 		open.value = true
 		if (record) {
 			let recordData = cloneDeep(record)
 			formData.value = Object.assign({}, recordData)
+			appointId.value = formData.value.id
 		}
 
 		//装货点位查询
@@ -158,7 +171,7 @@
 	}
 
 	const loadData = (parameter) => {
-		return bizLoadDispatchApi.getPageList({appointId:formData.value.id,loadType:'2'}).then((data) => {
+		return bizLoadDispatchApi.getPageList({appointId:formData.value.id,appointType:'2'}).then((data) => {
 			return data
 		})
 	}

+ 282 - 0
snowy-admin-web/src/views/biz/bizloadappoint/dispatchadd.vue

@@ -0,0 +1,282 @@
+<template>
+	<xn-form-container
+		:title="formData.id ? '装载车调度更换' : '装载车调度新增'"
+		:width="900"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+			<a-form-item label="预约单号:" name="loadNumber">
+				<a-input v-model:value="formData.loadNumber" placeholder="请输入预约单号" allow-clear disabled/>
+			</a-form-item>
+			<a-form-item label="装卸点位:" name="loadPointId">
+				<a-select v-model:value="formData.loadPointId" placeholder="请选择装卸点位"
+						  :options="loadPointIdList" @change="onChangePoint"
+				> </a-select>
+			</a-form-item>
+			<a-form-item label="装卸时间:" name="loadTimeId" >
+				<a-select v-model:value="formData.loadTimeId" placeholder="请选择装卸时间"
+						  :options="loadTimeIdList" @change="onChangeLoadTime"
+				> </a-select>
+			</a-form-item>
+			<a-form-item label="可约次数:" name="availableNumber" v-show="numberFlag">
+				<a-input v-model:value="formData.availableNumber" placeholder="请输入可约次数" allow-clear disabled/>
+			</a-form-item>
+			<a-form-item label="已约次数:" name="alreadyNumber" v-show="numberFlag">
+				<a-input v-model:value="formData.alreadyNumber" placeholder="请输入已约次数" allow-clear disabled/>
+			</a-form-item>
+		</a-form>
+
+<!--		<s-table
+			ref="tableRef"
+			:columns="columns"
+			:data="loadData"
+			bordered
+			:row-key="(record) => record.id"
+		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="formRef.onOpen()">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+				</a-space>
+			</template>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a-button type="link" size="small" v-if="hasPerm('bizDispatchReplace')" @click="replaceRef.onOpen(record)">更换</a-button>
+					</a-space>
+					<a-space>
+						<a-button type="link" danger size="small" v-if="hasPerm('bizOrderDispatchDelete')" @click="deleteConfig(record)">删除</a-button>
+					</a-space>
+				</template>
+			</template>
+		</s-table>-->
+
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+
+		<Replace ref="replaceRef" @successful="tableRef.refresh(true)" />
+	</xn-form-container>
+</template>
+
+<script setup name="bizOrderForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import tool from '@/utils/tool'
+	import goodsConfApi from '@/api/biz/goodsConfApi'
+	import bizSaleOrderApi from "@/api/biz/bizSaleOrderApi";
+	import bizLoadPointApi from "@/api/biz/bizLoadPointApi";
+	import bizLoadTimeApi from "@/api/biz/bizLoadTimeApi"
+	import bizOrderLoadApi from "@/api/biz/bizOrderLoadApi";
+	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
+	import {Modal} from 'ant-design-vue';
+	import {createVNode} from 'vue';
+	import Replace from './replace.vue'
+	import bizLoadDispatchApi from "@/api/biz/bizLoadDispatchApi";
+
+
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	const tableRef = ref()
+	const replaceRef = ref()
+
+	const numberFlag = ref(false)
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	//设置表单样式
+	const labelCol = ref({ span: 5})
+	const wrapperCol = ref({ span: 16})
+
+	//订单类型
+	const orderTypeList = tool.dictList('order_type')
+	const goodIdList = ref()
+	const customerIdList = ref()
+	const saleOrderInfoList = ref()
+	const deliveryTimeIdList = ref()
+	const supplierIdList = ref()
+	const loadPointIdList = ref()
+	const loadTimeIdList = ref()
+
+	// 打开抽屉
+	const onOpen = (record) => {
+		open.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value.appointId = record
+		}
+
+		//装货点位查询
+		bizLoadPointApi.getList({appointType:'2'}).then((res)=>{
+			loadPointIdList.value = res.map((item)=>{
+				return{
+					value:item.id,
+					label:item.loadPoint
+				}
+			})
+		})
+
+
+	}
+
+	//卸货点位点击事件
+	const onChangePoint =(value)=>{
+		formData.value.loadTimeId = ''
+		loadTimeIdList.value = ''
+		formData.value.availableNumber = ''
+		formData.value.alreadyNumber = ''
+		bizLoadTimeApi.searchNow({pointId:formData.value.loadPointId}).then((res)=>{
+			loadTimeIdList.value = res.map((item)=>{
+				return{
+					value:item.id,
+					label:item.beginTime+'~'+item.endTime
+				}
+			})
+		})
+	}
+
+	const onChangeLoadTime = (value) => {
+		bizLoadTimeApi.bizLoadTimeDetail({id:value}).then((res)=>{
+			formData.value.availableNumber = res.availableNumber
+			formData.value.alreadyNumber = res.alreadyNumber
+			numberFlag.value = true
+		})
+	}
+
+	const loadData = (parameter) => {
+		return bizLoadDispatchApi.getPageList({appointId:formData.value.id,appointType:'2'}).then((data) => {
+			return data
+		})
+	}
+
+	const columns = [
+		{
+			title: '装卸点位',
+			dataIndex: 'loadPoint',
+			align:'center'
+		},
+		{
+			title: '开始时间',
+			dataIndex: 'beginTime',
+			align:'center'
+		},
+		{
+			title: '结束时间',
+			dataIndex: 'endTime',
+			align:'center'
+		},
+		{
+			title: '可约次数',
+			dataIndex: 'availableNumber',
+			align:'center'
+		},
+		{
+			title: '已约次数',
+			dataIndex: 'alreadyNumber',
+			align:'center'
+		},
+	]
+	// 操作栏通过权限判断是否显示
+	columns.push({
+		title: '操作',
+		dataIndex: 'action',
+		align: 'center',
+		width: 150
+	})
+
+
+
+
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+		loadTimeIdList.value = ''
+		numberFlag.value = false
+		emit('successful')
+
+	}
+	// 默认要校验的
+	const formRules = {
+		//orderNumber: [required('请输入订单编号')],
+		//orderName: [required('请输入订单名称')],
+		//customerId:[required('请选择客户信息')],
+		loadPointId:[required('请选择装卸点位')],
+		loadTimeId: [required('请选择装卸时间')],
+	}
+
+
+	// 删除
+	const deleteConfig = (record) => {
+
+		Modal.confirm({
+			title: '确定删除该数据吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params = [
+					{
+						id: record.id
+					}
+				]
+
+				bizLoadDispatchApi
+					.deleteDispatch(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				bizLoadDispatchApi
+					.bizLoadDispatchSubmitDispatch(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>
+
+<style>
+/* 修改禁用状态下的颜色 */
+.ant-radio-button-wrapper-disabled {
+	color: black !important; /* 设置文字颜色 */
+	background-color: #f0f0f0 !important; /* 设置背景颜色 */
+}
+
+/* 修改禁用状态下选中项的颜色 */
+.ant-radio-button-wrapper-checked.ant-radio-button-wrapper-disabled {
+	color: white !important; /* 设置文字颜色 */
+	background-color: blue !important; /* 设置选中项的背景颜色 */
+}
+</style>

+ 20 - 21
snowy-admin-web/src/views/biz/bizloadappoint/dispatchload.vue

@@ -1,12 +1,12 @@
 <template>
 	<xn-form-container
-		:title="formData.id ? '起卸调度' : '起卸调度'"
+		:title="formData.id ? '起卸调度详情' : '起卸调度详情'"
 		:width="900"
 		v-model:open="open"
 		:destroy-on-close="true"
 		@close="onClose"
 	>
-		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+<!--		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
 			<a-form-item label="预约单号:" name="loadNumber">
 				<a-input v-model:value="formData.loadNumber" placeholder="请输入预约单号" allow-clear disabled/>
 			</a-form-item>
@@ -29,7 +29,7 @@
 					v-model:value="formData.userId"
 				/>
 			</a-form-item>
-		</a-form>
+		</a-form>-->
 
 		<s-table
 			ref="tableRef"
@@ -38,6 +38,14 @@
 			bordered
 			:row-key="(record) => record.id"
 		>
+			<template #operator class="table-operator">
+				<a-space>
+					<a-button type="primary" @click="dispatchLoadAddRef.onOpen(appointId)">
+						<template #icon><plus-outlined /></template>
+						新增
+					</a-button>
+				</a-space>
+			</template>
 			<template #bodyCell="{ column, record }">
 				<template v-if="column.dataIndex === 'action'">
 					<a-space>
@@ -50,12 +58,13 @@
 			</template>
 		</s-table>
 
-		<template #footer>
+<!--		<template #footer>
 			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
 			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
-		</template>
+		</template>-->
 
 		<Replace ref="replaceRef" @successful="tableRef.refresh(true)" />
+		<DispatchLoadAdd ref="dispatchLoadAddRef" @successful="tableRef.refresh(true)" />
 	</xn-form-container>
 </template>
 
@@ -74,6 +83,7 @@
 	import Replace from './replaceload.vue'
 	import bizLoadDispatchApi from "@/api/biz/bizLoadDispatchApi";
 	import userApi from '@/api/biz/bizUserApi'
+	import DispatchLoadAdd from './dispatchloadadd.vue'
 
 
 	// 抽屉状态
@@ -82,6 +92,7 @@
 	const formRef = ref()
 	const tableRef = ref()
 	const replaceRef = ref()
+	const dispatchLoadAddRef = ref()
 
 	const numberFlag = ref(false)
 	// 表单数据
@@ -102,16 +113,18 @@
 	const loadPointIdList = ref()
 	const loadTimeIdList = ref()
 
+	const appointId = ref()
 	// 打开抽屉
 	const onOpen = (record) => {
 		open.value = true
 		if (record) {
 			let recordData = cloneDeep(record)
 			formData.value = Object.assign({}, recordData)
+			appointId.value = formData.value.id
 		}
 
 		//装货点位查询
-		bizLoadPointApi.getList({loadType:'1'}).then((res)=>{
+		bizLoadPointApi.getList({appointType:'1'}).then((res)=>{
 			loadPointIdList.value = res.map((item)=>{
 				return{
 					value:item.id,
@@ -120,20 +133,6 @@
 			})
 		})
 
-		if(formData.value.saleOrderInfo){
-			bizSaleOrderApi.detailById({id:formData.value.saleOrderInfo}).then((res)=>{
-				//根据货品名称和重量查询提货时间段
-				goodsConfApi.getList({goodsName:res.saleGoodsName,goodsCode:res.goodsCode,needWeight:res.saleOrderWeight}).then((res)=>{
-					deliveryTimeIdList.value = res.map((item)=>{
-						return{
-							value:item.id,
-							label:item.confStartTime+'~'+item.confEndTime
-						}
-					})
-				})
-			})
-		}
-
 
 	}
 
@@ -177,7 +176,7 @@
 	}
 
 	const loadData = (parameter) => {
-		return bizLoadDispatchApi.getPageList({appointId:formData.value.id,loadType:'1'}).then((data) => {
+		return bizLoadDispatchApi.getPageList({appointId:formData.value.id,appointType:'1'}).then((data) => {
 			return data
 		})
 	}

+ 316 - 0
snowy-admin-web/src/views/biz/bizloadappoint/dispatchloadadd.vue

@@ -0,0 +1,316 @@
+<template>
+	<xn-form-container
+		:title="formData.id ? '起卸调度更换' : '起卸调度新增'"
+		:width="900"
+		v-model:open="open"
+		:destroy-on-close="true"
+		@close="onClose"
+	>
+		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
+			<a-form-item label="预约单号:" name="loadNumber">
+				<a-input v-model:value="formData.loadNumber" placeholder="请输入预约单号" allow-clear disabled/>
+			</a-form-item>
+			<a-form-item label="起卸点位:" name="loadPointId">
+				<a-select v-model:value="formData.loadPointId" placeholder="请选择装卸点位"
+						  :options="loadPointIdList" @change="onChangePoint"
+				> </a-select>
+			</a-form-item>
+			<a-form-item label="起卸时间:" name="loadTimeId" >
+				<a-select v-model:value="formData.loadTimeId" placeholder="请选择装卸时间"
+						  :options="loadTimeIdList" @change="onChangeLoadTime"
+				> </a-select>
+			</a-form-item>
+			<a-form-item label="执行人员:" name="userId">
+				<xn-user-selector
+					:org-tree-api="selectorApiFunction.orgTreeApi"
+					:user-page-api="selectorApiFunction.userPageApi"
+					:radio-model="true"
+					placeholder="请选择执行人员"
+					v-model:value="formData.userId"
+				/>
+			</a-form-item>
+		</a-form>
+
+<!--		<s-table
+			ref="tableRef"
+			:columns="columns"
+			:data="loadData"
+			bordered
+			:row-key="(record) => record.id"
+		>
+			<template #bodyCell="{ column, record }">
+				<template v-if="column.dataIndex === 'action'">
+					<a-space>
+						<a-button type="link" size="small" v-if="hasPerm('bizLoadReplace')" @click="replaceRef.onOpen(record)">更换</a-button>
+					</a-space>
+					<a-space>
+						<a-button type="link" danger size="small" v-if="hasPerm('bizOrderDispatchDelete')" @click="deleteConfig(record)">删除</a-button>
+					</a-space>
+				</template>
+			</template>
+		</s-table>-->
+
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+
+		<Replace ref="replaceRef" @successful="tableRef.refresh(true)" />
+	</xn-form-container>
+</template>
+
+<script setup name="bizOrderForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import tool from '@/utils/tool'
+	import goodsConfApi from '@/api/biz/goodsConfApi'
+	import bizSaleOrderApi from "@/api/biz/bizSaleOrderApi";
+	import bizLoadPointApi from "@/api/biz/bizLoadPointApi";
+	import bizLoadTimeApi from "@/api/biz/bizLoadTimeApi"
+	import bizOrderLoadApi from "@/api/biz/bizOrderLoadApi";
+	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
+	import {Modal} from 'ant-design-vue';
+	import {createVNode} from 'vue';
+	import Replace from './replaceload.vue'
+	import bizLoadDispatchApi from "@/api/biz/bizLoadDispatchApi";
+	import userApi from '@/api/biz/bizUserApi'
+
+
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	const tableRef = ref()
+	const replaceRef = ref()
+
+	const numberFlag = ref(false)
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+
+	//设置表单样式
+	const labelCol = ref({ span: 5})
+	const wrapperCol = ref({ span: 16})
+
+	//订单类型
+	const orderTypeList = tool.dictList('order_type')
+	const goodIdList = ref()
+	const customerIdList = ref()
+	const saleOrderInfoList = ref()
+	const deliveryTimeIdList = ref()
+	const supplierIdList = ref()
+	const loadPointIdList = ref()
+	const loadTimeIdList = ref()
+
+	// 打开抽屉
+	const onOpen = (record) => {
+		console.log("record:"+JSON.stringify(record))
+		open.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value.appointId = record
+			console.log("formData:"+JSON.stringify(formData.value))
+		}
+
+		//装货点位查询
+		bizLoadPointApi.getList({appointType:'1'}).then((res)=>{
+			loadPointIdList.value = res.map((item)=>{
+				return{
+					value:item.id,
+					label:item.loadPoint
+				}
+			})
+		})
+
+		if(formData.value.saleOrderInfo){
+			bizSaleOrderApi.detailById({id:formData.value.saleOrderInfo}).then((res)=>{
+				//根据货品名称和重量查询提货时间段
+				goodsConfApi.getList({goodsName:res.saleGoodsName,goodsCode:res.goodsCode,needWeight:res.saleOrderWeight}).then((res)=>{
+					deliveryTimeIdList.value = res.map((item)=>{
+						return{
+							value:item.id,
+							label:item.confStartTime+'~'+item.confEndTime
+						}
+					})
+				})
+			})
+		}
+
+
+	}
+
+	// 传递设计器需要的API
+	const selectorApiFunction = {
+		orgTreeApi: (param) => {
+			return userApi.userOrgTreeSelector(param).then((data) => {
+				return Promise.resolve(data)
+			})
+		},
+		userPageApi: (param) => {
+			param.roleName = '起卸员'
+			return userApi.userSelectorByRole(param).then((data) => {
+				return Promise.resolve(data)
+			})
+		}
+	}
+
+	//卸货点位点击事件
+	const onChangePoint =(value)=>{
+		formData.value.loadTimeId = ''
+		loadTimeIdList.value = ''
+		formData.value.availableNumber = ''
+		formData.value.alreadyNumber = ''
+		bizLoadTimeApi.searchNow({pointId:formData.value.loadPointId}).then((res)=>{
+			loadTimeIdList.value = res.map((item)=>{
+				return{
+					value:item.id,
+					label:item.beginTime+'~'+item.endTime
+				}
+			})
+		})
+	}
+
+	const onChangeLoadTime = (value) => {
+		bizLoadTimeApi.bizLoadTimeDetail({id:value}).then((res)=>{
+			formData.value.availableNumber = res.availableNumber
+			formData.value.alreadyNumber = res.alreadyNumber
+			//numberFlag.value = true
+		})
+	}
+
+	const loadData = (parameter) => {
+		return bizLoadDispatchApi.getPageList({appointId:formData.value.id,loadType:'1'}).then((data) => {
+			return data
+		})
+	}
+
+	const columns = [
+		{
+			title: '起卸点位',
+			dataIndex: 'loadPoint',
+			align:'center'
+		},
+		{
+			title: '执行人员',
+			dataIndex: 'userName',
+			align:'center'
+		},
+		{
+			title: '开始时间',
+			dataIndex: 'beginTime',
+			align:'center'
+		},
+		{
+			title: '结束时间',
+			dataIndex: 'endTime',
+			align:'center'
+		},
+		/*{
+			title: '可约次数',
+			dataIndex: 'availableNumber',
+			align:'center'
+		},
+		{
+			title: '已约次数',
+			dataIndex: 'alreadyNumber',
+			align:'center'
+		},*/
+	]
+	// 操作栏通过权限判断是否显示
+	columns.push({
+		title: '操作',
+		dataIndex: 'action',
+		align: 'center',
+		width: 150
+	})
+
+
+
+
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+		loadTimeIdList.value = ''
+		numberFlag.value = false
+		emit('successful')
+
+	}
+	// 默认要校验的
+	const formRules = {
+		//orderNumber: [required('请输入订单编号')],
+		//orderName: [required('请输入订单名称')],
+		//customerId:[required('请选择客户信息')],
+		loadPointId:[required('请选择装卸点位')],
+		loadTimeId: [required('请选择装卸时间')],
+		userId: [required('请选择执行人员')],
+	}
+
+
+	// 删除
+	const deleteConfig = (record) => {
+
+		Modal.confirm({
+			title: '确定删除该数据吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params = [
+					{
+						id: record.id
+					}
+				]
+
+				bizLoadDispatchApi
+					.bizLoadDispatchDelete(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				console.log("formDataParam:"+JSON.stringify(formDataParam))
+				bizLoadDispatchApi
+					.bizLoadDispatchSubmitLoad(formDataParam, formDataParam.id)
+					.then(() => {
+						onClose()
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>
+
+<style>
+/* 修改禁用状态下的颜色 */
+.ant-radio-button-wrapper-disabled {
+	color: black !important; /* 设置文字颜色 */
+	background-color: #f0f0f0 !important; /* 设置背景颜色 */
+}
+
+/* 修改禁用状态下选中项的颜色 */
+.ant-radio-button-wrapper-checked.ant-radio-button-wrapper-disabled {
+	color: white !important; /* 设置文字颜色 */
+	background-color: blue !important; /* 设置选中项的背景颜色 */
+}
+</style>

+ 2 - 2
snowy-admin-web/src/views/biz/bizloadarrive/index.vue

@@ -207,11 +207,11 @@
 			dataIndex: 'arriveTime',
 			align:'center'
 		},
-		{
+		/*{
 			title: '起卸数量(吨)',
 			dataIndex: 'fillWeight',
 			align:'center'
-		},
+		},*/
 		{
 			title: '状态',
 			dataIndex: 'status',

+ 1 - 1
snowy-admin-web/src/views/biz/bizorder/form.vue

@@ -230,7 +230,7 @@
 		customerId:[required('请选择客户信息')],
 		saleOrderInfo:[required('请选择订单信息')],
 		deliveryTimeId: [required('请选择提货时间')],
-		orderWeight: [required('请输入订单重量')],
+		//orderWeight: [required('请输入订单重量')],
 		orderType: [required('请选择订单类型')],
 		supplierIdList: [required('请选择供货商信息')],
 		freightPrice: [required('请输入运费单价')],

+ 124 - 0
snowy-admin-web/src/views/biz/bizpipeappoint/detail.vue

@@ -0,0 +1,124 @@
+<template>
+	<xn-form-container title="详情" :width="900" :visible="visible" :destroy-on-close="true" @close="onClose">
+		<a-form ref="formRef" :model="formData" :label-col="labelCol4" :wrapper-col="wrapperCol20">
+			<a-descriptions :column="4" size="middle" bordered class="mb-2" :label-style="labelStyle" :contentStyle="contentStyle">
+				<a-descriptions-item label="管桩计划单号" :span="2">{{ formData.planNumber }}</a-descriptions-item>
+				<a-descriptions-item label="车牌号" :span="2">{{ formData.licenseNumber }}</a-descriptions-item>
+				<a-descriptions-item label="司机姓名" :span="2">{{ formData.driverName }}</a-descriptions-item>
+				<a-descriptions-item label="司机电话" :span="2">{{ formData.driverMobile }}</a-descriptions-item>
+				<a-descriptions-item label="入场时间" :span="2">{{ formData.enterTime }}</a-descriptions-item>
+				<a-descriptions-item label="出场时间" :span="2">{{ formData.leaveTime }}</a-descriptions-item>
+				<a-descriptions-item label="创建人" :span="2">{{ formData.createUserName }}</a-descriptions-item>
+				<a-descriptions-item label="创建时间" :span="2">{{ formData.createTime }}</a-descriptions-item>
+
+				<a-descriptions-item label="预约状态" :span="2">
+					<a-tag
+						:color="
+							formData.status === '1'
+								? 'volcano'
+								: formData.status === '2'
+								  ? 'red'
+								  : formData.status === '3'
+								  ? 'processing'
+								  : formData.status === '4'
+								  ? 'warning'
+								  : formData.status === '5'
+								  ? 'magenta'
+								  : formData.status === '6'
+								  ? 'orange'
+								  : formData.status === '7'
+								  ? 'gold'
+								   : formData.status === '8'
+								  ? 'lime'
+								   : formData.status === '9'
+								  ? 'green'
+								  : formData.status === '10'
+								  ? 'cyan'
+								  : formData.status === '11'
+								  ? 'success'
+								  : formData.status === '12'
+								  ? 'blue'
+								  : formData.status === '13'
+								  ? 'geekblue'
+								  : 'error'
+						"
+					>
+						{{ $TOOL.dictTypeData('appointment_status', formData.status) }}
+					</a-tag>
+				</a-descriptions-item>
+			</a-descriptions>
+		</a-form>
+	</xn-form-container>
+</template>
+
+<script setup name="recordDoubleForm">
+	import { cloneDeep } from 'lodash-es'
+	import sysConfig from "@/config";
+	// 默认是关闭状态
+	const visible = ref(false)
+	const formData = ref({})
+	const table = ref()
+	const resultJson = ref()
+
+	const labelStyle = {
+		width: '20%'
+	}
+	const contentStyle = {
+		width: '30%'
+	}
+
+	const labelCol4 = ref({span: 4, style: 'width: 26%; line-height: 20px; white-space: normal',})
+	const labelCol8 = ref({span: 8, style: 'width: 26%; line-height: 20px; white-space: normal',})
+	const wrapperCol20 = ref({span: 20})
+
+	const fileList = ref([])
+	// 打开抽屉
+	const onOpen = (record) => {
+		visible.value = true
+		//getRecordDoubleDetail(record)
+		if(record){
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+			fileList.value = []
+			if(formData.value.unloadImg!=null){
+				for (var i=0;i<formData.value.unloadImg.split(',').length;i++){
+					fileList.value.push({
+						name: formData.value.unloadName.split(',')[i],
+						url:sysConfig.PREVIEW_PATH + formData.value.unloadImg.split(',')[i]
+					})
+				}
+			}
+		}
+
+	}
+	const getRecordDoubleDetail = (record) => {
+		const param = {
+			id: record.id
+		}
+		tbRecordDoubleApi.recordDoubleDetailPic(param).then((data) => {
+			Object.assign(record, data)
+			formData.value = record
+		})
+	}
+	// 关闭抽屉
+	const onClose = () => {
+		resultJson.value = ''
+		visible.value = false
+	}
+
+	// 调用这个函数将子组件的一些数据和方法暴露出去
+	defineExpose({
+		onOpen
+	})
+</script>
+
+<style scoped>
+	.imgDiv ::v-deep .ant-image {
+		margin-left: 20px;
+		margin-top: 10px;
+	}
+	.imgDiv ::v-deep .ant-image-mask-info {
+		margin-left: 20px;
+		margin-top: 10px;
+	}
+</style>

+ 9 - 8
snowy-admin-web/src/views/biz/bizpipeappoint/form.vue

@@ -7,13 +7,13 @@
 		@close="onClose"
 	>
 		<a-form ref="formRef" :model="formData" :rules="formRules" :wrapper-col="wrapperCol" :label-col="labelCol">
-			<a-form-item label="管桩计划:" name="planId">
-				<a-select v-model:value="formData.planId" placeholder="请选择管桩计划"
+			<a-form-item label="管桩计划:" name="orderId">
+				<a-select v-model:value="formData.orderId" placeholder="请选择管桩计划"
 						  :options="planIdList"
 				> </a-select>
 			</a-form-item>
-			<a-form-item label="车牌号:" name="licensePlate">
-				<a-input v-model:value="formData.licensePlate" placeholder="请输入车牌号" allow-clear />
+			<a-form-item label="车牌号:" name="licenseNumber">
+				<a-input v-model:value="formData.licenseNumber" placeholder="请输入车牌号" allow-clear />
 			</a-form-item>
 			<a-form-item label="司机姓名:" name="driverName">
 				<a-input v-model:value="formData.driverName" placeholder="请输入司机姓名" allow-clear />
@@ -34,6 +34,7 @@
 	import { required } from '@/utils/formRules'
 	import bizPipeAppointApi from '@/api/biz/bizPipeAppointApi'
 	import bizPipePlanApi from "@/api/biz/bizPipePlanApi";
+	import bizAppointmentRecordApi from "@/api/biz/bizAppointmentRecordApi";
 
 	// 抽屉状态
 	const open = ref(false)
@@ -72,8 +73,8 @@
 	}
 	// 默认要校验的
 	const formRules = {
-		planId:[required('请选择管桩计划')],
-		licensePlate:[required('请输入车牌号')],
+		orderId:[required('请选择管桩计划')],
+		licenseNumber:[required('请输入车牌号')],
 		driverName:[required('请输入司机姓名')],
 		driverMobile:[required('请输入司机电话')],
 	}
@@ -84,8 +85,8 @@
 			.then(() => {
 				submitLoading.value = true
 				const formDataParam = cloneDeep(formData.value)
-				bizPipeAppointApi
-					.bizPipeAppointSubmitForm(formDataParam, formDataParam.id)
+				bizAppointmentRecordApi
+					.bizAppointmentPipeSubmitForm(formDataParam, formDataParam.id)
 					.then(() => {
 						onClose()
 						emit('successful')

+ 220 - 6
snowy-admin-web/src/views/biz/bizpipeappoint/index.vue

@@ -1,4 +1,48 @@
 <template>
+	<a-card :bordered="false" style="margin-bottom: 10px" class="mb-2">
+		<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="planNumber">
+						<a-input v-model:value="searchFormState.planNumber" placeholder="管桩计划单号查询" />
+					</a-form-item>
+				</a-col>
+				<a-col :span="6">
+					<a-form-item label="车牌号" name="licenseNumber">
+						<a-input v-model:value="searchFormState.licenseNumber" placeholder="车牌号码查询" />
+					</a-form-item>
+				</a-col>
+				<a-col :span="6">
+					<a-form-item label="司机名称" name="driverName">
+						<a-input v-model:value="searchFormState.driverName" placeholder="司机名称查询" />
+					</a-form-item>
+				</a-col>
+				<template v-if="advanced">
+					<a-col :span="6">
+						<a-form-item label="司机电话" name="driverMobile">
+							<a-input v-model:value="searchFormState.driverMobile" placeholder="司机电话查询" />
+						</a-form-item>
+					</a-col>
+
+					<a-col :span="6">
+						<a-form-item label="预约状态" name="status">
+							<a-select v-model:value="searchFormState.status" placeholder="预约状态查询"
+									  :options="statusList"
+							> </a-select>
+						</a-form-item>
+					</a-col>
+				</template>
+				<a-col :span="6">
+					<a-button type="primary" @click="tableRef.refresh()">查询</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>
 	<a-card :bordered="false">
 		<s-table
 			ref="tableRef"
@@ -13,40 +57,129 @@
 						<template #icon><plus-outlined /></template>
 						新增
 					</a-button>
+					<a-button @click="exportTotal" v-if="hasPerm('bizPipeAppointExport')">
+						<template #icon>
+							<export-outlined/>
+						</template>
+						导出
+					</a-button>
 				</a-space>
 			</template>
 			<template #bodyCell="{ column, record }">
 				<template v-if="column.dataIndex === 'action'">
-					<a-space>
+<!--					<a-space>
 						<a @click="formRef.onOpen(record)" v-if="hasPerm('bizPipeAppointEdit')">编辑</a>
 						<a-divider type="vertical" v-if="hasPerm(['bizPipeAppointEdit', 'bizPipeAppointDelete'], 'and')" />
 						<a-popconfirm title="确定要删除吗?" @confirm="deleteBizPipeAppoint(record)">
 							<a-button type="link" danger size="small" v-if="hasPerm('bizPipeAppointDelete')">删除</a-button>
 						</a-popconfirm>
+					</a-space>-->
+
+					<a-space>
+						<a-dropdown>
+							<a class="ant-dropdown-link">
+								更多
+								<DownOutlined />
+							</a>
+
+							<template #overlay>
+								<a-menu>
+									<a-menu-item>
+										<a @click="detailRef.onOpen(record)">详情</a>
+									</a-menu-item>
+									<a-menu-item v-if="hasPerm('bizAppointmentRecordEdit') && (record.status == '2' || record.status == '4')">
+										<a @click="formRef.onOpen(record)" >编辑</a>
+									</a-menu-item>
+									<a-menu-item v-if="hasPerm('bizAppointmentRecordDelete') && (record.status == '2' || record.status == '4')">
+										<a style="color:red" type="link" danger size="small" @click="deleteConfig(record)">删除</a>
+									</a-menu-item>
+									<a-menu-item v-if="record.status=='4'">
+										<a style="color:green"  @click="cancel(record)" >取消</a>
+									</a-menu-item>
+								</a-menu>
+							</template>
+						</a-dropdown>
 					</a-space>
 				</template>
+				<template v-if="column.dataIndex === 'status'">
+					<a-tag
+						:color="
+							record.status === '1'
+								? 'volcano'
+								: record.status === '2'
+								  ? 'red'
+								  : record.status === '3'
+								  ? 'processing'
+								  : record.status === '4'
+								  ? 'warning'
+								  : record.status === '5'
+								  ? 'magenta'
+								  : record.status === '6'
+								  ? 'orange'
+								  : record.status === '7'
+								  ? 'gold'
+								   : record.status === '8'
+								  ? 'lime'
+								   : record.status === '9'
+								  ? 'green'
+								  : record.status === '10'
+								  ? 'cyan'
+								  : record.status === '11'
+								  ? 'success'
+								  : record.status === '12'
+								  ? 'blue'
+								  : record.status === '13'
+								  ? 'geekblue'
+								  : 'error'
+						"
+					>
+						{{ $TOOL.dictTypeData('appointment_status', record.status) }}
+					</a-tag>
+				</template>
 			</template>
 		</s-table>
 	</a-card>
 	<Form ref="formRef" @successful="tableRef.refresh()" />
+	<Detail ref="detailRef" @successful="tableRef.refresh()" />
 </template>
 
 <script setup name="bizpipeappoint">
 	import { cloneDeep } from 'lodash-es'
 	import Form from './form.vue'
 	import bizPipeAppointApi from '@/api/biz/bizPipeAppointApi'
+	import bizAppointmentRecordApi from "@/api/biz/bizAppointmentRecordApi"
+	import tool from '@/utils/tool'
+	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
+	import {Modal} from 'ant-design-vue';
+	import {createVNode} from 'vue';
+	import Detail from "./detail.vue";
+	import downloadUtil from '@/utils/downloadUtil'
+
+	//查询数据
+	const searchFormState = ref({})
+	const searchFormRef = ref()
+	const statusList = tool.dictList('appointment_status')
+
+	// 查询区域显示更多控制
+	const advanced = ref(false)
+	const toggleAdvanced = () => {
+		advanced.value = !advanced.value
+	}
+
+	const submitLoading = ref(false)
 	const tableRef = ref()
 	const formRef = ref()
+	const detailRef = ref()
 	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
 	const columns = [
 		{
 			title: '管桩计划单号',
-			dataIndex: 'planId',
+			dataIndex: 'planNumber',
 			align:'center'
 		},
 		{
 			title: '车牌号',
-			dataIndex: 'licensePlate',
+			dataIndex: 'licenseNumber',
 			align:'center'
 		},
 		{
@@ -61,12 +194,12 @@
 		},
 		{
 			title: '入场时间',
-			dataIndex: 'beginTime',
+			dataIndex: 'enterTime',
 			align:'center'
 		},
 		{
 			title: '出场时间',
-			dataIndex: 'endTime',
+			dataIndex: 'leaveTime',
 			align:'center'
 		},
 		{
@@ -101,10 +234,35 @@
 		}
 	}
 	const loadData = (parameter) => {
-		return bizPipeAppointApi.bizPipeAppointPage(parameter).then((data) => {
+		const searchFormParam = cloneDeep(searchFormState.value)
+		searchFormParam.type = '5'
+		return bizAppointmentRecordApi.bizAppointmentPipeRecordPage(Object.assign(parameter, searchFormParam)).then((data) => {
 			return data
 		})
 	}
+
+	//导出
+	const exportTotal = () => {
+		Modal.confirm({
+			title: '确定要导出记录吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				const searchFormParam = cloneDeep(searchFormState.value)
+				searchFormParam.type = '5'
+				bizAppointmentRecordApi
+					.exportPipeRecord(Object.assign(searchFormParam))
+					.then((res) => {
+						downloadUtil.resultDownload(res)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
 	// 重置
 	const reset = () => {
 		searchFormRef.value.resetFields()
@@ -121,6 +279,62 @@
 			tableRef.value.refresh(true)
 		})
 	}
+
+	//取消预约
+	const cancel = (record) => {
+
+		Modal.confirm({
+			title: '确定要取消吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params =
+					{
+						id: record.id
+					}
+
+
+				bizAppointmentRecordApi
+					.replacePipeAppoint(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
+	// 删除
+	const deleteConfig = (record) => {
+
+		Modal.confirm({
+			title: '确定删除该数据吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params = [
+					{
+						id: record.id
+					}
+				]
+
+				bizAppointmentRecordApi
+					.bizAppointmentRecordDelete(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
 	// 批量删除
 	const deleteBatchBizPipeAppoint = (params) => {
 		bizPipeAppointApi.bizPipeAppointDelete(params).then(() => {

+ 101 - 6
snowy-admin-web/src/views/biz/bizpipeplan/index.vue

@@ -40,11 +40,11 @@
 			</template>
 			<template #bodyCell="{ column, record }">
 				<template v-if="column.dataIndex === 'action'">
-<!--					<a-space>
-						<a @click="formRef.onOpen(record)" v-if="hasPerm('bizPipePlanEdit')">编辑</a>
-						<a-divider type="vertical" v-if="hasPerm(['bizPipePlanEdit', 'bizPipePlanDelete'], 'and')" />
-						<a style="color:red" size="small"  v-if="hasPerm('bizPipePlanDelete')" type="link" @click="deleteConfig(record)">删除</a>
-					</a-space>-->
+
+					<a @click="showModal(record)" v-if="(record.status == '1' || record.status == '2')">二维码</a>
+
+					<a-divider type="vertical" v-if="(record.status == '1' || record.status == '2') "/>
+
 					<a-dropdown>
 						<a class="ant-dropdown-link">
 							更多
@@ -97,6 +97,30 @@
 		</s-table>
 	</a-card>
 	<Form ref="formRef" @successful="tableRef.refresh()" />
+
+	<a-modal v-model:visible="open" title="二维码" width="600px" style="height: 700px">
+		<div id="qrcode" style="text-align: center; margin:  15px 5px 15px 5px">
+			<a-row>
+				<a-col :span="13" id="colFlag">
+					<div style="margin-top:10px;font-size:16px;">
+						<p id="projectCodeFlag">计划编码:{{ nowRecord.planNumber }}</p>
+						<p id="projectCodeFlag">计划名称:{{ nowRecord.planName }}</p>
+<!--						<p id="projectCodeFlag">预约次数:{{ nowRecord.planCount }}</p>
+						<p id="projectCodeFlag">已约次数:{{ nowRecord.planAlreadyCount }}</p>-->
+						<p id="projectCodeFlag">开始时间:{{ nowRecord.beginTime }}</p>
+						<p id="projectCodeFlag">结束时间:{{ nowRecord.endTime }}</p>
+					</div>
+				</a-col>
+				<a-col :span="11">
+					<a-image width="250"  height="100%" :src="qrCodeUrl.codeUrl"></a-image>
+				</a-col>
+			</a-row>
+		</div>
+		<template #footer>
+			<a-button @click="closeQrCode">关闭</a-button>
+			<a-button type="primary" @click="downloadFile">下载</a-button>
+		</template>
+	</a-modal>
 </template>
 
 <script setup name="bizpipeplan">
@@ -106,6 +130,8 @@
 	import {ExclamationCircleOutlined} from '@ant-design/icons-vue';
 	import {Modal} from 'ant-design-vue';
 	import {createVNode} from 'vue';
+	import QRCode from 'qrcode'
+	import html2canvas from 'html2canvas'
 
 
 	//查询数据
@@ -133,7 +159,7 @@
 			align:'center'
 		},
 		{
-			title: '已约次数',
+			title: '已约次数',
 			dataIndex: 'planAlreadyCount',
 			align:'center'
 		},
@@ -264,4 +290,73 @@
 			tableRef.value.clearRefreshSelected()
 		})
 	}
+
+
+	//二维码
+	const open = ref(false);
+	const qrCodeUrl = ref({})
+	const nowRecord = ref()
+	const showModal = (record) => {
+		nowRecord.value = record
+		open.value = true;
+		getQrCode(record)
+
+	};
+
+	const getQrCode = (record) => {
+		//QRCode.toDataURL("id:"+record.id+"saleCode:"+record.saleCode, {
+		let param = {
+			id:record.id,
+			loadNumber:record.planNumber,
+			type:'5'
+		}
+		QRCode.toDataURL(JSON.stringify(param), {
+			errorCorrectionLevel: 'H',
+			margin: 1,
+			height: 206,
+			width: 206,
+			type: '10',
+			scal: 177,
+			color: {
+				dark: '#000' // 二维码背景颜色
+			},
+			rendererOpts: {
+				quality: 0.9
+			}
+		})
+			.then((url) => {
+				qrCodeUrl.value.codeUrl = url
+			})
+			.catch((err) => {
+				console.error(err)
+			})
+	}
+
+	const closeQrCode = () => {
+		open.value = false;
+	}
+
+	// 下载二维码
+	const downloadFile = () => {
+		const qrcodeDiv = document.getElementById('qrcode');
+		html2canvas(qrcodeDiv, {
+			logging: false,
+			allowTaint: true,
+			scale: window.devicePixelRatio,
+			scrollY: 0,
+			scrollX: 0,
+			useCORS: true,
+			backgroundColor: '#ffffff'
+		})
+			.then(function (canvas) {
+				const a = window.document.createElement('a')
+				a.href = canvas.toDataURL('image/png')
+				a.download = '二维码'
+				a.click()
+				this.$message.success('正在进行下载保存')
+			})
+			.catch((err) => {
+				console.log(err)
+			})
+	}
 </script>

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

@@ -326,6 +326,82 @@ public class BizAppointmentRecordController {
         return CommonResult.data(bizAppointmentRecordService.getLoadPage(bizAppointmentRecordPageParam));
     }
 
+    /**
+     * 导出起卸预约报表
+     */
+    @Operation(summary = "导出起卸预约报表")
+    @SaCheckPermission("/biz/bizappointmentrecord/exportLoadRecord")
+    @GetMapping(value = "/biz/bizappointmentrecord/exportLoadRecord", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
+    public void exportLoadRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
+        bizAppointmentRecordService.exportLoadRecord(bizAppointmentRecordPageParam,response);
+    }
+
+    /**
+     * 导出管桩预约报表
+     */
+    @Operation(summary = "导出管桩预约报表")
+    @SaCheckPermission("/biz/bizappointmentrecord/exportPipeRecord")
+    @GetMapping(value = "/biz/bizappointmentrecord/exportPipeRecord", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
+    public void exportPipeRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
+        bizAppointmentRecordService.exportPipeRecord(bizAppointmentRecordPageParam,response);
+    }
+
+    /**
+     * 添加管桩预约
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "添加管桩预约")
+    @CommonLog("添加管桩预约")
+    @CommonNoRepeat
+    @PostMapping("/biz/bizappointmentrecord/addPipeAppoint")
+    public CommonResult<String> addPipeAppoint(@RequestBody @Valid BizAppointmentRecordAddParam bizAppointmentRecordAddParam) {
+        bizAppointmentRecordService.addPipeAppoint(bizAppointmentRecordAddParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 编辑管桩预约记录
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "编辑管桩预约记录")
+    @CommonLog("编辑管桩预约记录")
+    @PostMapping("/biz/bizappointmentrecord/editPipeAppoint")
+    public CommonResult<String> editPipeAppoint(@RequestBody @Valid BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        bizAppointmentRecordService.editPipeAppoint(bizAppointmentRecordEditParam);
+        return CommonResult.ok();
+    }
+
+    /**
+     * 获取管桩预约列表
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "获取管桩预约列表")
+    @SaCheckPermission("/biz/bizappointmentrecord/getPipePage")
+    @GetMapping("/biz/bizappointmentrecord/getPipePage")
+    public CommonResult<Page<BizAppointmentRecord>> getPipePage(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
+        return CommonResult.data(bizAppointmentRecordService.getPipePage(bizAppointmentRecordPageParam));
+    }
+
+    /**
+     * 取消管桩预约记录
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "取消管桩预约记录")
+    @CommonLog("取消管桩预约记录")
+    @PostMapping("/biz/bizappointmentrecord/replacePipeAppoint")
+    public CommonResult<String> replacePipeAppoint(@RequestBody @Valid BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        bizAppointmentRecordService.replacePipeAppoint(bizAppointmentRecordEditParam);
+        return CommonResult.ok();
+    }
+
     /**
      * 其他预约_记录分页
      *

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

@@ -240,4 +240,15 @@ public class BizAppointmentRecord extends CommonEntity {
     @Schema(description = "操作时间")
     private String authorizeTime;
 
+    /**管桩计划单号*/
+    @TableField(exist = false)
+    private String planNumber;
+
+
+    /**入场时间*/
+    private Date enterTime;
+
+    /**出场时间*/
+    private Date leaveTime;
+
 }

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

@@ -39,4 +39,10 @@ public interface BizAppointmentRecordMapper extends BaseMapper<BizAppointmentRec
     List<BizAppointmentRecord> getRecordList(@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
 
     Page<BizAppointmentRecord> getLoadPage(@Param("page") Page<BizAppointmentRecord> page,@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
+
+    List<BizAppointmentRecord> getLoadPage(@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
+
+    Page<BizAppointmentRecord> getPipePage(@Param("page") Page<BizAppointmentRecord> page,@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
+
+    List<BizAppointmentRecord> getPipePage(@Param("ew") QueryWrapper<BizAppointmentRecord> ew);
 }

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

@@ -184,4 +184,41 @@
                 LEFT JOIN biz_load_time blt ON blt.id = bar.load_time_id
             ${ew.customSqlSegment}
     </select>
+
+    <select id="getPipePage"
+            resultType="vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord">
+        SELECT
+            bar.id,
+            bar.order_id,
+            bar.license_number,
+            bar.driver_name,
+            bar.driver_mobile,
+            bar.STATUS,
+            bar.appointment_reason,
+            bar.over_id,
+            br.id recordId,
+            bar.queue_number,
+            br.driver_sign,
+            br.unload_weight / 1000 unload_weight,
+            br.unload_img,
+            br.unload_name,
+            br.audit_sign,
+            bar.appointment_type,
+            bar.appointment_classify,
+            bar.create_time,
+            bar.create_user,
+            bar.load_point_id,
+            bar.load_time_id,
+            br.complete_send_time,
+            bpp.plan_number,
+            bpp.plan_name,
+            bar.enter_time,
+            bar.leave_time
+        FROM
+            biz_appointment_record bar
+                LEFT JOIN biz_record br ON bar.id = br.appointment_id
+                LEFT JOIN biz_pipe_plan bpp ON bar.order_id = bpp.id
+                LEFT JOIN biz_excess_config bec ON bec.id = bar.over_id
+            ${ew.customSqlSegment}
+    </select>
 </mapper>

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

@@ -15,9 +15,9 @@ public class BizAppointmentExportResult {
     private String orderNumber;
 
     /** 订单名称 */
-    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    /*@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
     @ExcelProperty({"预约报表", "订单名称"})
-    private String orderName;
+    private String orderName;*/
 
     /** 车牌号 */
     @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
@@ -45,8 +45,8 @@ public class BizAppointmentExportResult {
 
     /** 货品规格*/
     @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
-    @ExcelProperty({"预约报表", "货品规格"})
-    private String goodsModel;
+    @ExcelProperty({"预约报表", "货品编码"})
+    private String goodsCode;
 
     /** 司机姓名 */
     @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)

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

@@ -88,4 +88,7 @@ public class BizAppointmentRecordPageParam {
     /**起卸单号*/
     private String loadNumber;
 
+    /**管桩计划单号*/
+    private String planNumber;
+
 }

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

@@ -0,0 +1,54 @@
+package vip.xiaonuo.biz.modular.bizappointmentrecord.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;
+
+@Data
+public class BizLoadAppointmentExportResult {
+    /** 订单编号 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "起卸单号"})
+    private String loadNumber;
+
+    /** 车牌号 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "车牌号"})
+    private String licenseNumber;
+
+    /** 客户名称 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "客户名称"})
+    private String customerName;
+
+    /** 货品名称*/
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "货品名称"})
+    private String goodsName;
+
+    /** 货品规格*/
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "货品编码"})
+    private String goodsCode;
+
+    /** 司机姓名 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "司机姓名"})
+    private String driverName;
+
+    /** 司机电话 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "司机电话"})
+    private String driverMobile;
+
+    /** 司机电话 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "车辆轴数"})
+    private String axleNumber;
+
+    /** 预约状态*/
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"起卸预约报表", "预约状态"})
+    private String statusName;
+}

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

@@ -0,0 +1,46 @@
+package vip.xiaonuo.biz.modular.bizappointmentrecord.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.util.Date;
+
+@Data
+public class BizPipeAppointmentExportResult {
+    /** 订单编号 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "管桩计划单号"})
+    private String planNumber;
+
+    /** 车牌号 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "车牌号"})
+    private String licenseNumber;
+
+    /** 司机姓名 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "司机姓名"})
+    private String driverName;
+
+    /** 司机电话 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "司机电话"})
+    private String driverMobile;
+
+    /** 入场时间 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "入场时间"})
+    private Date enterTime;
+
+    /** 出场时间 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "出场时间"})
+    private Date leaveTime;
+
+    /** 预约状态*/
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"管桩预约报表", "预约状态"})
+    private String statusName;
+}

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

@@ -132,6 +132,23 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
     /**起卸预约编辑*/
     void editLoad(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
 
+    /**导出起卸报表*/
+    void exportLoadRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException;
+
+    /**管桩预约新增*/
+    void addPipeAppoint(BizAppointmentRecordAddParam bizAppointmentRecordAddParam);
+
+    /**管桩预约编辑*/
+    void editPipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
+
+    /**管桩预约列表**/
+    Page<BizAppointmentRecord> getPipePage(BizAppointmentRecordPageParam bizAppointmentRecordPageParam);
+
+    /**取消管桩预约*/
+    void replacePipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
+
+    /**导出管桩预约报表*/
+    void exportPipeRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException;
 
 
     /**

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

@@ -58,6 +58,8 @@ import vip.xiaonuo.biz.modular.bizorderconfig.entity.BizOrderConfig;
 import vip.xiaonuo.biz.modular.bizorderconfig.service.BizOrderConfigService;
 import vip.xiaonuo.biz.modular.bizordersupplier.entity.BizOrderSupplier;
 import vip.xiaonuo.biz.modular.bizordersupplier.service.BizOrderSupplierService;
+import vip.xiaonuo.biz.modular.bizpipeplan.entity.BizPipePlan;
+import vip.xiaonuo.biz.modular.bizpipeplan.service.BizPipePlanService;
 import vip.xiaonuo.biz.modular.bizsupplier.entity.BizSupplierTransport;
 import vip.xiaonuo.biz.modular.bizsupplier.service.BizSupplierTransportService;
 import vip.xiaonuo.biz.modular.customer.entity.BizCustomer;
@@ -151,6 +153,9 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
     @Resource
     private BizLoadAppointSupplierService bizLoadAppointSupplierService;
 
+    @Resource
+    private BizPipePlanService bizPipePlanService;
+
     @Override
     public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
         QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
@@ -201,6 +206,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getLoadNumber())) {
             queryWrapper.like("bla.load_number", bizAppointmentRecordPageParam.getLoadNumber());
         }
+        //管桩计划单号
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getPlanNumber())){
+            queryWrapper.like("bpp.plan_number",bizAppointmentRecordPageParam.getPlanNumber());
+        }
         queryWrapper.eq("bar.delete_flag", "NOT_DELETE");
         queryWrapper.orderByDesc("bar.create_time");
         return queryWrapper;
@@ -1281,6 +1290,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         }
     }
 
+
+
     public void getLoadTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
         lock.lock();
         try {
@@ -1303,6 +1314,214 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
 
     }
 
+
+    @Override
+    public void exportLoadRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
+        QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
+        List<BizAppointmentRecord> recordList = this.getBaseMapper().getLoadPage(queryWrapper);
+        String fileName = "起卸预约报表.xlsx";
+        List<BizLoadAppointmentExportResult> list = Lists.newArrayList();
+        transService.transBatch(recordList);
+        for (BizAppointmentRecord bizAppointmentRecord : recordList) {
+            BizLoadAppointmentExportResult bizAppointmentExportResult = new BizLoadAppointmentExportResult();
+            BeanUtil.copyProperties(bizAppointmentRecord, bizAppointmentExportResult);
+            bizAppointmentExportResult.setStatusName((String) bizAppointmentRecord.getTransMap().get("statusName"));
+            bizAppointmentExportResult.setAxleNumber(bizAppointmentRecord.getAxleNumber() + "轴");
+            list.add(bizAppointmentExportResult);
+        }
+        CommonExportUtil.export(fileName, BizLoadAppointmentExportResult.class, list, response, "起卸预约报表");
+    }
+
+    @Transactional
+    @Override
+    public void addPipeAppoint(BizAppointmentRecordAddParam bizAppointmentRecordAddParam) {
+        checkPipeParam(bizAppointmentRecordAddParam);
+        //获取流程配置判断预约是否需要审核
+        BizConfig bizConfig = bizConfigService.getOne(new QueryWrapper<BizConfig>().lambda().last("limit 1"));
+        BizAppointmentRecord bizAppointmentRecord = BeanUtil.toBean(bizAppointmentRecordAddParam, BizAppointmentRecord.class);
+        if (ObjectUtil.isNotNull(bizConfig)) {
+            if (StringUtils.equals(bizConfig.getTemporaryAuditSwitch(), "1")) {
+                //开启审核,设置待审核状态
+                bizAppointmentRecord.setStatus("1");
+            } else {
+                //未开启审核,设置待入场状态
+                bizAppointmentRecord.setStatus("4");
+            }
+        }
+        bizAppointmentRecord.setAppointmentType("5");
+        this.save(bizAppointmentRecord);
+
+        //修改管桩计划状态
+        BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
+        if(ObjectUtil.isNotNull(pipePlan)){
+            pipePlan.setStatus("2");
+            pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() + 1);
+            bizPipePlanService.updateById(pipePlan);
+        }
+    }
+
+    public void checkPipeParam(BizAppointmentRecordAddParam bizAppointmentRecordAddParam) {
+        //校验车牌号
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getLicenseNumber())) {
+            bizAppointmentRecordAddParam.setLicenseNumber(bizAppointmentRecordAddParam.getLicenseNumber().toUpperCase().trim());
+            //校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核  、 14:已取消
+            long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
+                    eq(BizAppointmentRecord::getLicenseNumber, bizAppointmentRecordAddParam.getLicenseNumber()).
+                    notIn(BizAppointmentRecord::getStatus, "10", "11", "12", "13", "14", "15"));
+            if (count > 0) {
+                throw new CommonException("车牌号:{}已经添加过预约!", bizAppointmentRecordAddParam.getLicenseNumber());
+            }
+        }
+        //校验手机号
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getDriverMobile())) {
+            if (!PhoneUtil.isMobile(bizAppointmentRecordAddParam.getDriverMobile())) {
+                throw new CommonException("手机号码:{}格式错误", bizAppointmentRecordAddParam.getDriverMobile());
+            }
+        }
+        //校验订单
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getOrderId())) {
+            BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
+            if (ObjectUtil.isNotNull(pipePlan)) {
+                if (!StringUtils.equals(pipePlan.getStatus(), "1") && !StringUtils.equals(pipePlan.getStatus(), "2")) {
+                    throw new CommonException("当前订单不可预约!");
+                }
+            }
+        }
+
+        //查询预约时间段内可预约次数
+        getPipeTimeCount(bizAppointmentRecordAddParam);
+    }
+
+    public void getPipeTimeCount(BizAppointmentRecordAddParam bizAppointmentRecordAddParam) {
+        lock.lock();
+        try {
+            //判断管桩计划次数是否满足
+            if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getOrderId())) {
+                BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
+                if(ObjectUtil.isNotNull(pipePlan)){
+                    if(pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0){
+                        throw new CommonException("当前管桩计划单预约次数已满");
+                    }
+                }
+            }
+        } finally {
+            lock.unlock(); // 释放锁
+        }
+
+    }
+
+    @Transactional
+    @Override
+    public void editPipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
+        checkPipeParam(bizAppointmentRecordEditParam, bizAppointmentRecord);
+        if (!StringUtils.equals(bizAppointmentRecord.getLoadTimeId(), bizAppointmentRecordEditParam.getLoadTimeId())) {
+            //调整了装卸时段,释放之前的已约次数,更新新的时段已约次数
+            if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getLoadTimeId())) {
+                BizLoadTime bizLoadTime = bizLoadTimeService.getById(bizAppointmentRecordEditParam.getLoadTimeId());
+                if (ObjectUtil.isNotNull(bizLoadTime)) {
+                    bizLoadTime.setAlreadyNumber(bizLoadTime.getAlreadyNumber() + 1);
+                    bizLoadTimeService.updateById(bizLoadTime);
+                }
+            }
+
+            if (ObjectUtil.isNotEmpty(bizAppointmentRecord.getLoadTimeId())) {
+                BizLoadTime bizLoadTime = bizLoadTimeService.getById(bizAppointmentRecord.getLoadTimeId());
+                if (ObjectUtil.isNotNull(bizLoadTime)) {
+                    bizLoadTime.setAlreadyNumber(bizLoadTime.getAlreadyNumber() - 1);
+                    bizLoadTimeService.updateById(bizLoadTime);
+                }
+            }
+        }
+        BeanUtil.copyProperties(bizAppointmentRecordEditParam, bizAppointmentRecord);
+        if (StringUtils.equals(bizAppointmentRecord.getStatus(), "2")) {
+            //如果当前状态是审核不通过的状态,修改后重新提交审核
+            bizAppointmentRecord.setStatus("1");
+        }
+        this.updateById(bizAppointmentRecord);
+    }
+
+    public void checkPipeParam(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
+        //校验车牌号
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getLicenseNumber())) {
+            bizAppointmentRecordEditParam.setLicenseNumber(bizAppointmentRecordEditParam.getLicenseNumber().toUpperCase().trim());
+            if (!StringUtils.equals(bizAppointmentRecord.getLicenseNumber(), bizAppointmentRecordEditParam.getLicenseNumber())) {
+                //校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核  、 14:已取消
+                long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
+                        eq(BizAppointmentRecord::getLicenseNumber, bizAppointmentRecordEditParam.getLicenseNumber()).
+                        notIn(BizAppointmentRecord::getStatus, "10", "11", "12", "13", "14", "15"));
+                if (count > 0) {
+                    throw new CommonException("车牌号:{}已经添加过预约!", bizAppointmentRecordEditParam.getLicenseNumber());
+                }
+            }
+        }
+        //校验手机号
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getDriverMobile())) {
+            if (!PhoneUtil.isMobile(bizAppointmentRecordEditParam.getDriverMobile())) {
+                throw new CommonException("手机号码:{}格式错误", bizAppointmentRecordEditParam.getDriverMobile());
+            }
+        }
+        //校验订单
+        if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getOrderId())) {
+            BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordEditParam.getOrderId());
+            if (ObjectUtil.isNotNull(pipePlan)) {
+                if (!StringUtils.equals(pipePlan.getStatus(), "1") && !StringUtils.equals(pipePlan.getStatus(), "2")) {
+                    throw new CommonException("当前订单不可预约!");
+                }
+            }
+
+        }
+
+        //查询预约时间段内可预约次数
+        getPipeTimeCount(bizAppointmentRecordEditParam, bizAppointmentRecord);
+
+    }
+
+    public void getPipeTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam,BizAppointmentRecord bizAppointmentRecord) {
+        lock.lock();
+        try {
+            //判断管桩计划次数是否满足
+            if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getOrderId())) {
+                if(!StringUtils.equals(bizAppointmentRecordEditParam.getOrderId(),bizAppointmentRecord.getOrderId())){
+                    BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordEditParam.getOrderId());
+                    if(ObjectUtil.isNotNull(pipePlan)){
+                        if(pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0){
+                            throw new CommonException("当前管桩计划单预约次数已满");
+                        }
+                    }
+                }
+            }
+        } finally {
+            lock.unlock(); // 释放锁
+        }
+
+    }
+
+
+    @Override
+    public Page<BizAppointmentRecord> getPipePage(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
+        QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
+        Page<BizAppointmentRecord> loadPage = this.getBaseMapper().getPipePage(CommonPageRequest.defaultPage(), queryWrapper);
+        return loadPage;
+    }
+
+    @Override
+    public void replacePipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        //修改预约已取消状态
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
+        bizAppointmentRecord.setStatus("14");
+        this.updateById(bizAppointmentRecord);
+
+        //修改管桩计划单已约数量
+        BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecord.getOrderId());
+        if(ObjectUtil.isNotNull(pipePlan)){
+            pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() - 1);
+            bizPipePlanService.updateById(pipePlan);
+        }
+
+    }
+
+
     @Override
     public void addOtherAppointment(BizOtherAppointmentAddParam bizOtherAppointmentAddParam) {
         checkOtherParam(bizOtherAppointmentAddParam.getLicenseNumber());
@@ -1351,6 +1570,23 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
 
     }
 
+    @Override
+    public void exportPipeRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
+        QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
+        List<BizAppointmentRecord> recordList = this.getBaseMapper().getPipePage(queryWrapper);
+        String fileName = "管桩预约报表.xlsx";
+        List<BizPipeAppointmentExportResult> list = Lists.newArrayList();
+        transService.transBatch(recordList);
+        for (BizAppointmentRecord bizAppointmentRecord : recordList) {
+            BizPipeAppointmentExportResult bizAppointmentExportResult = new BizPipeAppointmentExportResult();
+            BeanUtil.copyProperties(bizAppointmentRecord, bizAppointmentExportResult);
+            bizAppointmentExportResult.setStatusName((String) bizAppointmentRecord.getTransMap().get("statusName"));
+            list.add(bizAppointmentExportResult);
+        }
+        CommonExportUtil.export(fileName, BizPipeAppointmentExportResult.class, list, response, "管桩预约报表");
+    }
+
+
     @Override
     public void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
         BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());

+ 11 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloaddispatch/service/impl/BizLoadDispatchServiceImpl.java

@@ -122,6 +122,17 @@ public class BizLoadDispatchServiceImpl extends ServiceImpl<BizLoadDispatchMappe
 
         }
 
+        long count1 = this.count(new QueryWrapper<BizLoadDispatch>().lambda().
+                eq(BizLoadDispatch::getAppointId, bizLoadDispatchAddParam.getAppointId()).
+                eq(BizLoadDispatch::getLoadType, type));
+        if(count1>0){
+            if(StringUtils.equals(type,"1")){
+                throw new CommonException("已添加过起卸调度!");
+            }else{
+                throw new CommonException("已添加过装卸调度!");
+            }
+        }
+
         //判断是否添加过多个执行人员
         long userCount = this.count(new QueryWrapper<BizLoadDispatch>().lambda().
                 eq(BizLoadDispatch::getAppointId, bizLoadDispatchAddParam.getAppointId()).