fanzherong_v 2 giorni fa
parent
commit
8a2f8bd683
27 ha cambiato i file con 733 aggiunte e 21 eliminazioni
  1. 16 0
      snowy-admin-web/src/api/biz/bizAppointmentRecordApi.js
  2. 4 0
      snowy-admin-web/src/api/biz/bizChargeStationReservationApi.js
  3. 4 0
      snowy-admin-web/src/api/biz/bizOrderSupplierApi.js
  4. 4 0
      snowy-admin-web/src/api/biz/bizOtherAppointmentApi.js
  5. 3 3
      snowy-admin-web/src/views/biz/bizappointload/index.vue
  6. 27 3
      snowy-admin-web/src/views/biz/bizappointmentrecord/form.vue
  7. 6 0
      snowy-admin-web/src/views/biz/bizappointmentrecord/index.vue
  8. 204 0
      snowy-admin-web/src/views/biz/bizappointmentrecord/replace.vue
  9. 34 5
      snowy-admin-web/src/views/biz/bizchargestationreservation/index.vue
  10. 27 1
      snowy-admin-web/src/views/biz/bizloadappoint/detail.vue
  11. 1 1
      snowy-admin-web/src/views/biz/bizloadappoint/reject.vue
  12. 29 0
      snowy-admin-web/src/views/biz/bizotherappoint/index.vue
  13. 57 0
      snowy-admin-web/src/views/biz/bizpipeappoint/index.vue
  14. 79 3
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/controller/BizAppointmentRecordController.java
  15. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizAppointmentRecordAddParam.java
  16. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/param/BizAppointmentRecordEditParam.java
  17. 26 1
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/BizAppointmentRecordService.java
  18. 138 2
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizappointmentrecord/service/impl/BizAppointmentRecordServiceImpl.java
  19. 4 1
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadappoint/mapper/mapping/BizLoadAppointMapper.xml
  20. 1 1
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadarrive/service/impl/BizLoadArriveServiceImpl.java
  21. 12 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/controller/BizOrderSupplierController.java
  22. 6 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/entity/BizOrderSupplier.java
  23. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/mapper/BizOrderSupplierMapper.java
  24. 9 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/mapper/mapping/BizOrderSupplierMapper.xml
  25. 3 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/param/BizOrderSupplierPageParam.java
  26. 5 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/service/BizOrderSupplierService.java
  27. 25 0
      snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/service/impl/BizOrderSupplierServiceImpl.java

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

@@ -102,5 +102,21 @@ export default {
 	//司机取消
 	cloudCancel(data){
 		return request('cloudCancel',data)
+	},
+	//管桩预约完成装货
+	completePipeAppoint(data){
+		return request('completePipeAppoint',data)
+	},
+	//管桩预约强制结束
+	endPipeAppoint(data){
+		return request('endPipeAppoint',data)
+	},
+	//起卸预约强制结束
+	endLoadAppoint(data){
+		return request('endLoadAppoint',data)
+	},
+	//司机调度订单
+	replaceAppoint(data){
+		return request('replaceAppoint',data)
 	}
 }

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

@@ -36,5 +36,9 @@ export default {
 		return request('bizChargeStationReservationExport', data, 'get', {
 			responseType: 'blob'
 		})
+	},
+	//强制结束
+	bizChargeStationEnd(data){
+		return request('bizChargeStationEnd',data)
 	}
 }

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

@@ -28,5 +28,9 @@ export default {
 	// 获取订单供应商列表
 	getSupplierList(data){
 		return request('getSupplierList',data,'get')
+	},
+	//获取供应商在执行的订单
+	getListBySupplier(data){
+		return request('getListBySupplier',data,'get')
 	}
 }

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

@@ -40,5 +40,9 @@ export default {
 		return request('bizOtherAppointmentExport', data, 'get', {
 			responseType: 'blob'
 		})
+	},
+	//完成装货
+	bizOtherAppointmentComplete(data){
+		return request('bizOtherAppointmentComplete',data)
 	}
 }

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

@@ -187,7 +187,7 @@
 										<a style="color:green"  @click="cancel(record)" >取消</a>
 									</a-menu-item>
 									<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 style="color:orange"  @click="exit(record)" >强制结束</a>
 									</a-menu-item>
 
 
@@ -431,7 +431,7 @@
 	const exit = (record) => {
 
 		Modal.confirm({
-			title: '确定要授权出场吗?',
+			title: '确定要强制结束吗?',
 			icon: createVNode(ExclamationCircleOutlined),
 			content: '',
 			onOk() {
@@ -443,7 +443,7 @@
 
 
 				bizAppointmentRecordApi
-					.bizAppointmentExit(params)
+					.endLoadAppoint(params)
 					.then(() => {
 						tableRef.value.refresh(true)
 					})

+ 27 - 3
snowy-admin-web/src/views/biz/bizappointmentrecord/form.vue

@@ -35,11 +35,20 @@
 						  :options="overIdList"
 				> </a-select>
 			</a-form-item>
-			<a-form-item label="司机姓名:" name="driverName">
+<!--			<a-form-item label="司机姓名:" name="driverName">
 				<a-input v-model:value="formData.driverName" placeholder="请输入司机姓名" allow-clear />
 			</a-form-item>
 			<a-form-item label="司机电话:" name="driverMobile">
 				<a-input v-model:value="formData.driverMobile" placeholder="请输入司机电话" allow-clear />
+			</a-form-item>-->
+			<a-form-item label="司机:" name="driverId">
+				<xn-user-selector
+					:org-tree-api="selectorApiFunction.orgTreeApi"
+					:user-page-api="selectorApiFunction.userPageApi"
+					:radio-model="true"
+					placeholder="请选择司机"
+					v-model:value="formData.driverId"
+				/>
 			</a-form-item>
 		</a-form>
 		<template #footer>
@@ -57,6 +66,7 @@
 	import bizOrderApi from '@/api/biz/bizOrderApi'
 	import bizExcessConfigApi from "@/api/biz/bizExcessConfigApi";
 	import bizOrderLoadApi from "@/api/biz/bizOrderLoadApi";
+	import userApi from '@/api/biz/bizUserApi'
 
 	// 抽屉状态
 	const open = ref(false)
@@ -179,10 +189,9 @@
 		licenseNumber: [required('请输入车牌号')],
 		//timeId: [required('请选择预约时段')],
 		overId: [required('请选择车辆轴数')],
-		driverName:[required('请输入司机姓名')],
-		driverMobile:[required('请输入司机电话')],
 		loadPointId:[required('请选择装卸点位')],
 		loadTimeId:[required('请选择装卸时间')],
+		driverId:[required('请选择司机')],
 	}
 	// 验证并提交数据
 	const onSubmit = () => {
@@ -203,6 +212,21 @@
 			})
 			.catch(() => {})
 	}
+
+	// 传递设计器需要的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)
+			})
+		}
+	}
 	// 抛出函数
 	defineExpose({
 		onOpen

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

@@ -197,6 +197,9 @@
 									<a-menu-item v-if="record.status=='8' && hasPerm('bizAppointmentDriverCancel') ">
 										<a style="color:green"  @click="driverCancel(record)" >司机取消</a>
 									</a-menu-item>
+									<a-menu-item v-if="hasPerm('bizAppointmentDispatch') && (record.status == '5' || record.status == '6')">
+										<a style="color:blue" @click="replaceRef.onOpen(record)" >调度</a>
+									</a-menu-item>
 
 
 								</a-menu>
@@ -211,6 +214,7 @@
 	<Review ref="reviewRef" @successful="tableRef.refresh(true)" />
 	<Detail ref="detailRef" @successful="tableRef.refresh()" />
 	<Sign ref="signRef" @successful="tableRef.refresh(true)" />
+	<Replace ref="replaceRef" @successful="tableRef.refresh(true)" />
 
 	<XnSignName ref="XnSignNameRef" :image="searchFormState.driverSign" @successful="signSuccess" />
 	<a-modal v-model:visible="open" title="二维码" width="600px" style="height: 700px">
@@ -254,6 +258,7 @@
 	import bizRecordApi from '@/api/biz/bizRecordApi'
 	import Sign from './sign.vue'
 	import bizOrderApi from "@/api/biz/bizOrderApi";
+	import Replace from './replace.vue'
 
 	const submitLoading = ref(false)
 	const tableRef = ref()
@@ -261,6 +266,7 @@
 	const formRef = ref()
 	const reviewRef = ref()
 	const detailRef = ref()
+	const replaceRef = ref()
 	const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
 
 	const nowRecord = ref()

+ 204 - 0
snowy-admin-web/src/views/biz/bizappointmentrecord/replace.vue

@@ -0,0 +1,204 @@
+<template>
+	<xn-form-container
+		:title="formData.id ? '调度' : '调度'"
+		:width="700"
+		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="orderId">
+				<a-select v-model:value="formData.orderId" placeholder="请选择订单信息"
+						  :options="orderIdList" @change="onChangeOrder"
+				> </a-select>
+			</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"
+				> </a-select>
+			</a-form-item>
+			<a-form-item label="车牌号:" name="licenseNumber">
+				<a-input v-model:value="formData.licenseNumber" placeholder="请输入车牌号" allow-clear />
+			</a-form-item>
+			<a-form-item label="车辆轴数:" name="overId">
+				<a-select v-model:value="formData.overId" placeholder="请选择车辆轴数"
+						  :options="overIdList"
+				> </a-select>
+			</a-form-item>
+		</a-form>
+		<template #footer>
+			<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
+			<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
+		</template>
+	</xn-form-container>
+</template>
+
+<script setup name="bizAppointmentRecordForm">
+	import { cloneDeep } from 'lodash-es'
+	import { required } from '@/utils/formRules'
+	import bizAppointmentRecordApi from '@/api/biz/bizAppointmentRecordApi'
+	import bizAppointmentTimeApi from "@/api/biz/bizAppointmentTimeApi";
+	import bizOrderApi from '@/api/biz/bizOrderApi'
+	import bizExcessConfigApi from "@/api/biz/bizExcessConfigApi";
+	import bizOrderLoadApi from "@/api/biz/bizOrderLoadApi";
+	import userApi from '@/api/biz/bizUserApi'
+	import bizOrderSupplierApi from "@/api/biz/bizOrderSupplierApi";
+
+	// 抽屉状态
+	const open = ref(false)
+	const emit = defineEmits({ successful: null })
+	const formRef = ref()
+	// 表单数据
+	const formData = ref({})
+	const submitLoading = ref(false)
+	const orderIdList = ref()
+	const timeIdList = ref()
+	const overIdList = ref()
+	const loadPointIdList = ref()
+	const loadTimeIdList = ref()
+
+	//设置表单样式
+	const labelCol = ref({ span: 5})
+	const wrapperCol = ref({ span: 16})
+
+	// 打开抽屉
+	const onOpen = (record) => {
+		open.value = true
+		if (record) {
+			let recordData = cloneDeep(record)
+			formData.value = Object.assign({}, recordData)
+		}
+		//查询订单信息
+		bizOrderSupplierApi.getListBySupplier({licenseNumber:formData.value.licenseNumber}).then((res)=>{
+			orderIdList.value = res.map((item)=>{
+				return{
+					value:item.orderId,
+					label:item.orderNumber
+				}
+			})
+		})
+
+		//查询车辆轴数
+		bizExcessConfigApi.getList().then((res)=>{
+			overIdList.value = res.map((item)=>{
+				return{
+					value:item.id,
+					label:item.vehicleAxleNumber+'轴'
+				}
+			})
+		})
+
+		//查询装卸点位信息
+		if(formData.value.orderId){
+			bizOrderLoadApi.getPointList({orderId:formData.value.orderId}).then((res)=>{
+				loadPointIdList.value=res.map((item)=>{
+					return{
+						value:item.loadPointId,
+						label:item.loadPoint
+					}
+				})
+			})
+		}
+
+		//查询装卸时间信息
+		if(formData.value.orderId && formData.value.loadPointId){
+			bizOrderLoadApi.getLoadTimeList({orderId:formData.value.orderId,loadPointId:formData.value.loadPointId}).then((res)=>{
+				loadTimeIdList.value = res.map((item)=>{
+					return{
+						value:item.loadTimeId,
+						label:item.beginTime+'~'+item.endTime
+					}
+				})
+			})
+		}
+	}
+
+
+	//订单点击事件
+	const onChangeOrder = (value) =>{
+		formData.value.loadTimeId = ''
+		formData.value.loadPointId = ''
+		loadTimeIdList.value = ''
+		console.log("value:"+JSON.stringify(value))
+		bizOrderLoadApi.getPointList({orderId:value}).then((res)=>{
+			loadPointIdList.value=res.map((item)=>{
+				return{
+					value:item.loadPointId,
+					label:item.loadPoint
+				}
+			})
+			if(res){
+				formData.value.loadPointId = res[0].loadPointId
+				bizOrderLoadApi.getLoadTimeList({orderId:formData.value.orderId,loadPointId:formData.value.loadPointId}).then((res)=>{
+					loadTimeIdList.value = res.map((item)=>{
+						return{
+							value:item.loadTimeId,
+							label:item.beginTime+'~'+item.endTime
+						}
+					})
+					if(res){
+						formData.value.loadTimeId = res[0].loadTimeId
+					}
+				})
+			}
+			console.log("loadPointIdList:"+JSON.stringify(res))
+		})
+	}
+
+	//装卸点位点击事件
+	const onChangePoint = (value) =>{
+		formData.value.loadTimeId = ''
+		bizOrderLoadApi.getLoadTimeList({orderId:formData.value.orderId,loadPointId:value}).then((res)=>{
+			loadTimeIdList.value = res.map((item)=>{
+				return{
+					value:item.loadTimeId,
+					label:item.beginTime+'~'+item.endTime
+				}
+			})
+		})
+	}
+
+	// 关闭抽屉
+	const onClose = () => {
+		formRef.value.resetFields()
+		formData.value = {}
+		open.value = false
+	}
+	// 默认要校验的
+	const formRules = {
+		orderId: [required('请选择订单信息')],
+		licenseNumber: [required('请输入车牌号')],
+		overId: [required('请选择车辆轴数')],
+		loadPointId:[required('请选择装卸点位')],
+		loadTimeId:[required('请选择装卸时间')],
+	}
+	// 验证并提交数据
+	const onSubmit = () => {
+		formRef.value
+			.validate()
+			.then(() => {
+				submitLoading.value = true
+				const formDataParam = cloneDeep(formData.value)
+				bizAppointmentRecordApi
+					.replaceAppoint(formDataParam)
+					.then(() => {
+						onClose()
+						emit('successful')
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			})
+			.catch(() => {})
+	}
+
+	// 抛出函数
+	defineExpose({
+		onOpen
+	})
+</script>

+ 34 - 5
snowy-admin-web/src/views/biz/bizchargestationreservation/index.vue

@@ -133,9 +133,12 @@
 										<a style="color:red" type="link" danger size="small" @click="deleteConfig(record)">删除</a>
 									</a-menu-item>
 
-									<a-menu-item v-if="hasPerm('bizChargeStationReservationExit') && (record.status=='4' || record.status=='5' || record.status=='6' || record.status=='7'
-									|| record.status=='8' || record.status=='9' || record.status=='16' || record.status=='18'  )">
-										<a style="color:green"  @click="cancel(record)" >强制结束</a>
+									<a-menu-item v-if="hasPerm('bizChargeStationReservationExit') && (record.status=='5' )">
+										<a style="color:green"  @click="charge(record)" >充电结束</a>
+									</a-menu-item>
+
+									<a-menu-item v-if="hasPerm('bizChargeStationEnd') && (record.status=='4' || record.status=='5' || record.status=='18')">
+										<a style="color:red"  @click="cancel(record)" >强制结束</a>
 									</a-menu-item>
 
 
@@ -300,7 +303,33 @@
 		})
 	}
 
-	//强制结束操作
+	//充电结束
+	const charge = (record) => {
+
+		Modal.confirm({
+			title: '是否确定充电结束吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params =
+					{
+						id: record.id
+					}
+				bizChargeStationReservationApi
+					.bizChargeStationReservationExit(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
+	//强制结束
 	const cancel = (record) => {
 
 		Modal.confirm({
@@ -314,7 +343,7 @@
 						id: record.id
 					}
 				bizChargeStationReservationApi
-					.bizChargeStationReservationExit(params)
+					.bizChargeStationEnd(params)
 					.then(() => {
 						tableRef.value.refresh(true)
 					})

+ 27 - 1
snowy-admin-web/src/views/biz/bizloadappoint/detail.vue

@@ -26,7 +26,7 @@
 				<a-descriptions-item label="订单重量" :span="2">{{ formData.orderWeight +'吨'}}</a-descriptions-item>
 				<a-descriptions-item label="单价" :span="2">{{ formData.orderPrice +'元/吨'}}</a-descriptions-item>
 				<a-descriptions-item label="订单总额" :span="2">{{ formData.orderAmount +'元'}}</a-descriptions-item>
-				<a-descriptions-item label="运费单价" :span="2">{{ formData.freightPrice +'元/吨'}}</a-descriptions-item>
+				<a-descriptions-item label="船运运费单价" :span="2">{{ formData.freightPrice +'元/吨'}}</a-descriptions-item>
 				<a-descriptions-item label="订单状态" :span="2">
 					<a-tag
 						:color="
@@ -51,6 +51,32 @@
 					</a-tag>
 				</a-descriptions-item>
 				<a-descriptions-item label="船运供应商" :span="2">{{ formData.supplierName}}</a-descriptions-item>
+				<a-descriptions-item label="支付方式" :span="2">
+					<a-tag
+						:color="
+							formData.payType === '1'
+								? 'blue'
+								: formData.payType === '2'
+								  ? 'warning'
+								  : 'warning'
+						"
+					>
+						{{ $TOOL.dictTypeData('pay_type', formData.payType) }}
+					</a-tag>
+				</a-descriptions-item>
+				<a-descriptions-item label="场地类型" :span="2">
+					<a-tag
+						:color="
+							formData.loadType === '1'
+								? 'blue'
+								: formData.loadType === '2'
+								  ? 'warning'
+								  : 'warning'
+						"
+					>
+						{{ $TOOL.dictTypeData('load_type', formData.loadType) }}
+					</a-tag>
+				</a-descriptions-item>
 				<a-descriptions-item label="创建时间" :span="2">{{ formData.createTime}}</a-descriptions-item>
 				<a-descriptions-item label="创建人" :span="2">{{ formData.createUserName}}</a-descriptions-item>
 

+ 1 - 1
snowy-admin-web/src/views/biz/bizloadappoint/reject.vue

@@ -15,7 +15,7 @@
         </a-form>
         <template #footer>
             <a-spin :spinning="submitLoading">
-                <a-button type="primary" @click="onsubmit(true)">结束</a-button>
+                <a-button type="primary" @click="onsubmit(true)">驳回</a-button>
             </a-spin>
         </template>
     </a-modal>

+ 29 - 0
snowy-admin-web/src/views/biz/bizotherappoint/index.vue

@@ -141,6 +141,10 @@
 										<a style="color:orange"  @click="exit(record)" >授权离场</a>
 									</a-menu-item>
 
+									<a-menu-item v-if="hasPerm('bizOtherComplete') && (record.status=='6' )">
+										<a style="color:orange"  @click="completeOther(record)" >完成装货</a>
+									</a-menu-item>
+
 
 								</a-menu>
 							</template>
@@ -330,6 +334,31 @@
 		})
 	}
 
+	//完成装货
+	const completeOther = (record) => {
+		Modal.confirm({
+			title: '确定要完成装货吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params =
+					{
+						id: record.id
+					}
+				bizOtherAppointmentApi
+					.bizOtherAppointmentComplete(params)
+					.then(() => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
 	//强制结束操作
 	const cancel = (record) => {
 

+ 57 - 0
snowy-admin-web/src/views/biz/bizpipeappoint/index.vue

@@ -93,6 +93,12 @@
 									<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="hasPerm('bizPipeComplete') && record.status == '5'">
+										<a style="color:orange" type="link" danger size="small" @click="completePipe(record)">完成装货</a>
+									</a-menu-item>
+									<a-menu-item v-if="hasPerm('bizPipeEnd') && (record.status == '5' || record.status == '9')">
+										<a style="color:orange" type="link" danger size="small" @click="endPipe(record)">强制结束</a>
+									</a-menu-item>
 									<a-menu-item v-if="record.status=='4'">
 										<a style="color:green"  @click="cancel(record)" >取消</a>
 									</a-menu-item>
@@ -263,6 +269,57 @@
 			onCancel() {}
 		})
 	}
+
+	//完成装货
+	const completePipe = (record) => {
+		Modal.confirm({
+			title: '确定要完成装货吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params =
+					{
+						id: record.id
+					}
+				bizAppointmentRecordApi
+					.completePipeAppoint(params)
+					.then((res) => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
+	//强制结束
+	const endPipe = (record) => {
+		Modal.confirm({
+			title: '确定要强制结束吗?',
+			icon: createVNode(ExclamationCircleOutlined),
+			content: '',
+			onOk() {
+				submitLoading.value = true
+				let params =
+					{
+						id: record.id
+					}
+				bizAppointmentRecordApi
+					.endPipeAppoint(params)
+					.then((res) => {
+						tableRef.value.refresh(true)
+					})
+					.finally(() => {
+						submitLoading.value = false
+					})
+			},
+			onCancel() {}
+		})
+	}
+
 	// 重置
 	const reset = () => {
 		searchFormRef.value.resetFields()

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

@@ -141,6 +141,20 @@ public class BizAppointmentRecordController {
         return CommonResult.ok();
     }
 
+    /**
+     * 司机调度订单
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "司机调度订单")
+    @CommonLog("司机调度订单")
+    @PostMapping("/biz/bizappointmentrecord/replaceAppoint")
+    public CommonResult<String> replaceAppoint(@RequestBody @Valid BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        bizAppointmentRecordService.replaceAppoint(bizAppointmentRecordEditParam);
+        return CommonResult.ok();
+    }
+
     /**
      * 获取预约记录详情
      *
@@ -326,6 +340,18 @@ public class BizAppointmentRecordController {
         return CommonResult.data(bizAppointmentRecordService.getLoadPage(bizAppointmentRecordPageParam));
     }
 
+    /**
+     * 起卸预约_强制结束
+     */
+    @Operation(summary = "起卸预约_强制结束")
+    @CommonLog("起卸预约_强制结束")
+    @PostMapping("/biz/bizappointmentrecord/endLoadAppoint")
+    public CommonResult<String> endLoadAppoint(@RequestBody @Valid BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        bizAppointmentRecordService.endLoadAppoint(bizAppointmentRecordEditParam);
+        return CommonResult.ok();
+    }
+
+
     /**
      * 导出起卸预约报表
      */
@@ -375,6 +401,20 @@ public class BizAppointmentRecordController {
         return CommonResult.ok();
     }
 
+    /**
+     * 管桩预约完成装货
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "管桩预约完成装货")
+    @CommonLog("管桩预约完成装货")
+    @PostMapping("/biz/bizappointmentrecord/completePipeAppoint")
+    public CommonResult<String> completePipeAppoint(@RequestBody @Valid BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        bizAppointmentRecordService.completePipeAppoint(bizAppointmentRecordEditParam);
+        return CommonResult.ok();
+    }
+
     /**
      * 获取管桩预约列表
      *
@@ -402,6 +442,20 @@ public class BizAppointmentRecordController {
         return CommonResult.ok();
     }
 
+    /**
+     * 管桩预约_强制结束
+     *
+     * @author fanzherong
+     * @date  2025/03/24 14:47
+     */
+    @Operation(summary = "管桩预约_强制结束")
+    @CommonLog("管桩预约_强制结束")
+    @PostMapping("/biz/bizappointmentrecord/endPipeAppoint")
+    public CommonResult<String> endPipeAppoint(@RequestBody @Valid BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        bizAppointmentRecordService.endPipeAppoint(bizAppointmentRecordEditParam);
+        return CommonResult.ok();
+    }
+
     /**
      * 其他预约_记录分页
      *
@@ -471,6 +525,17 @@ public class BizAppointmentRecordController {
         return CommonResult.ok();
     }
 
+    /**
+     * 其他预约_完成装货
+     */
+    @Operation(summary = "其他预约_完成装货")
+    @CommonLog("其他预约_完成装货")
+    @PostMapping("/biz/bizotherappointment/bizOtherAppointmentComplete")
+    public CommonResult<String> bizOtherAppointmentComplete(@RequestBody BizAppointmentRecordIdParam bizAppointmentRecordIdParam){
+        bizAppointmentRecordService.bizOtherAppointmentComplete(bizAppointmentRecordIdParam);
+        return CommonResult.ok();
+    }
+
     /**
      * 其他预约_授权离场
      */
@@ -557,16 +622,27 @@ public class BizAppointmentRecordController {
 
 
     /**
-     * 充电预约_强制结束
+     * 充电预约_充电结束
      */
-    @Operation(summary = "充电预约_强制结束")
-    @CommonLog("充电预约_强制结束")
+    @Operation(summary = "充电预约_充电结束")
+    @CommonLog("充电预约_充电结束")
     @PostMapping("/biz/bizchargestationreservation/bizChargeStationReservationExit")
     public CommonResult<String> bizChargeStationReservationExit(@RequestBody BizAppointmentRecordIdParam bizAppointmentRecordIdParam){
         bizAppointmentRecordService.bizChargeStationReservationExit(bizAppointmentRecordIdParam);
         return CommonResult.ok();
     }
 
+    /**
+     * 充电预约_强制结束
+     */
+    @Operation(summary = "充电预约_强制结束")
+    @CommonLog("充电预约_强制结束")
+    @PostMapping("/biz/bizchargestationreservation/bizChargeStationEnd")
+    public CommonResult<String> bizChargeStationEnd(@RequestBody BizAppointmentRecordIdParam bizAppointmentRecordIdParam){
+        bizAppointmentRecordService.bizChargeStationEnd(bizAppointmentRecordIdParam);
+        return CommonResult.ok();
+    }
+
 
     /**
      * 地磅端司机确认

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

@@ -71,4 +71,7 @@ public class BizAppointmentRecordAddParam {
     /**装卸时间ID**/
     private String loadTimeId;
 
+    /**司机id*/
+    private String driverId;
+
 }

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

@@ -80,4 +80,7 @@ public class BizAppointmentRecordEditParam {
     /**装卸时间ID**/
     private String loadTimeId;
 
+    /**司机id*/
+    private String driverId;
+
 }

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

@@ -75,6 +75,12 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
      */
     void delete(List<BizAppointmentRecordIdParam> bizAppointmentRecordIdParamList);
 
+    /**
+     * 订单调度
+     * @param bizAppointmentRecordEditParam
+     */
+    void replaceAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
+
     /**
      * 获取预约记录详情
      *
@@ -132,6 +138,9 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
     /**起卸预约编辑*/
     void editLoad(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
 
+    /**起卸预约_强制结束*/
+    void endLoadAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
+
     /**导出起卸报表*/
     void exportLoadRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException;
 
@@ -147,6 +156,12 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
     /**取消管桩预约*/
     void replacePipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
 
+    /**管桩预约完成装货*/
+    void completePipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
+
+    /**管桩预约_强制结束*/
+    void endPipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam);
+
     /**导出管桩预约报表*/
     void exportPipeRecord(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException;
 
@@ -174,6 +189,11 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
      */
     void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam);
 
+    /**
+     * 其他预约_完成装货
+     */
+    void bizOtherAppointmentComplete(BizAppointmentRecordIdParam bizAppointmentRecordIdParam);
+
 
     /**
      * 其他预约_导出
@@ -204,11 +224,16 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
      */
     void deleteChargeStationReservation(List<BizAppointmentRecordIdParam> bizAppointmentRecordIdParamList);
     /**
-     * 充电预约_强制结束
+     * 充电预约_充电完成
      * @param bizAppointmentRecordIdParam
      */
     void bizChargeStationReservationExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam);
 
+    /**
+     * 充电预约_强制结束
+     */
+    void bizChargeStationEnd(BizAppointmentRecordIdParam bizAppointmentRecordIdParam);
+
     /**
      * 地磅端确认
      */

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

@@ -206,7 +206,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         // 校验数据范围
         List<String> loginUserDataScope = StpLoginUserUtil.getLoginUserDataScope();
         if (ObjectUtil.isEmpty(loginUserDataScope)) {
-            queryWrapper.eq("bar.create_user", StpUtil.getLoginIdAsString());
+            queryWrapper.eq("bar.driver_id", StpUtil.getLoginIdAsString());
         }
         if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getLoadNumber())) {
             queryWrapper.like("bla.load_number", bizAppointmentRecordPageParam.getLoadNumber());
@@ -245,6 +245,17 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
                 bizAppointmentRecord.setStatus("4");
             }
         }
+        if(ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getDriverId())){
+            BizUser bizUser = bizUserService.getById(bizAppointmentRecordAddParam.getDriverId());
+            if(ObjectUtil.isNotNull(bizUser)){
+                if(ObjectUtil.isEmpty(bizAppointmentRecordAddParam.getDriverName())){
+                    bizAppointmentRecord.setDriverName(bizUser.getName());
+                }
+                if(ObjectUtil.isEmpty(bizAppointmentRecordAddParam.getDriverMobile())){
+                    bizAppointmentRecord.setDriverMobile(bizUser.getPhone());
+                }
+            }
+        }
         //this.save(bizAppointmentRecord);
         saveRecord(bizAppointmentRecord);
 
@@ -621,6 +632,17 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
             //如果当前状态是审核不通过的状态,修改后重新提交审核
             bizAppointmentRecord.setStatus("1");
         }
+        if(ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getDriverId())){
+            BizUser bizUser = bizUserService.getById(bizAppointmentRecordEditParam.getDriverId());
+            if(ObjectUtil.isNotNull(bizUser)){
+                if(ObjectUtil.isEmpty(bizAppointmentRecordEditParam.getDriverName())){
+                    bizAppointmentRecord.setDriverName(bizUser.getName());
+                }
+                if(ObjectUtil.isEmpty(bizAppointmentRecordEditParam.getDriverMobile())){
+                    bizAppointmentRecord.setDriverMobile(bizUser.getPhone());
+                }
+            }
+        }
         this.updateById(bizAppointmentRecord);
     }
 
@@ -666,6 +688,68 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         this.removeByIds(CollStreamUtil.toList(bizAppointmentRecordIdParamList, BizAppointmentRecordIdParam::getId));
     }
 
+    @Transactional
+    @Override
+    public void replaceAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
+        if(!StringUtils.equals(bizAppointmentRecord.getOrderId(),bizAppointmentRecordEditParam.getOrderId())){
+            //查询旧订单预约配置
+            BizOrderConfig oldOrderConfig = bizOrderConfigService.getOne(new QueryWrapper<BizOrderConfig>().lambda().
+                    eq(BizOrderConfig::getOrderId, bizAppointmentRecord.getOrderId()).
+                    last("limit 1"));
+            if(ObjectUtil.isNotNull(oldOrderConfig)){
+                //释放旧订单预约次数
+                oldOrderConfig.setApplyNumberAlready(oldOrderConfig.getApplyNumberAlready()-1);
+                bizOrderConfigService.updateById(oldOrderConfig);
+            }
+
+            //查询新订单预约配置
+            BizOrderConfig newOrderConfig = bizOrderConfigService.getOne(new QueryWrapper<BizOrderConfig>().lambda().
+                    eq(BizOrderConfig::getOrderId, bizAppointmentRecordEditParam.getOrderId()).
+                    last("limit 1"));
+            if(ObjectUtil.isNotNull(newOrderConfig)){
+                newOrderConfig.setApplyNumberAlready(newOrderConfig.getApplyNumberAlready()+1);
+                bizOrderConfigService.updateById(newOrderConfig);
+            }
+        }
+        //判断装卸时间是否一致
+        if(!StringUtils.equals(bizAppointmentRecord.getLoadTimeId(),bizAppointmentRecordEditParam.getLoadTimeId())){
+            //装卸时间段修改
+            //查询旧时间段预约次数
+            BizLoadTime oldTime = bizLoadTimeService.getById(bizAppointmentRecord.getLoadTimeId());
+            if(ObjectUtil.isNotNull(oldTime)){
+                //释放旧时段预约次数
+                oldTime.setAlreadyNumber(oldTime.getAlreadyNumber()-1);
+                bizLoadTimeService.updateById(oldTime);
+            }
+
+            //查询新时段的预约次数
+            BizLoadTime newTime = bizLoadTimeService.getById(bizAppointmentRecordEditParam.getLoadTimeId());
+            if(ObjectUtil.isNotNull(newTime)){
+                //添加新时段预约次数
+                newTime.setAlreadyNumber(newTime.getAlreadyNumber()+1);
+                bizLoadTimeService.updateById(newTime);
+            }
+        }
+        if(!StringUtils.equals(bizAppointmentRecord.getOrderId(),bizAppointmentRecordEditParam.getOrderId())){
+            //订单修改
+            bizAppointmentRecord.setOrderId(bizAppointmentRecordEditParam.getOrderId());
+            //装卸点位
+            bizAppointmentRecord.setLoadPointId(bizAppointmentRecordEditParam.getLoadPointId());
+            //装卸时间
+            bizAppointmentRecord.setLoadTimeId(bizAppointmentRecordEditParam.getLoadTimeId());
+        }
+        //车牌号
+        if(!StringUtils.equals(bizAppointmentRecord.getLicenseNumber(),bizAppointmentRecordEditParam.getLicenseNumber())){
+            bizAppointmentRecord.setLicenseNumber(bizAppointmentRecordEditParam.getLicenseNumber());
+        }
+        //车辆轴数
+        if(!StringUtils.equals(bizAppointmentRecord.getOverId(),bizAppointmentRecordEditParam.getOverId())){
+            bizAppointmentRecord.setOverId(bizAppointmentRecordEditParam.getOverId());
+        }
+        this.updateById(bizAppointmentRecord);
+    }
+
     @Override
     public BizAppointmentRecord detail(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
         return this.queryEntity(bizAppointmentRecordIdParam.getId());
@@ -1272,6 +1356,13 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         this.updateById(bizAppointmentRecord);
     }
 
+    @Override
+    public void endLoadAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
+        bizAppointmentRecord.setStatus("10");
+        this.updateById(bizAppointmentRecord);
+    }
+
     public void checkLoadParam(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
         //校验车牌号
         if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getLicenseNumber())) {
@@ -1577,6 +1668,20 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
 
     }
 
+    @Override
+    public void completePipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
+        bizAppointmentRecord.setStatus("9");
+        this.updateById(bizAppointmentRecord);
+    }
+
+    @Override
+    public void endPipeAppoint(BizAppointmentRecordEditParam bizAppointmentRecordEditParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordEditParam.getId());
+        bizAppointmentRecord.setStatus("10");
+        this.updateById(bizAppointmentRecord);
+    }
+
 
     @Override
     public void addOtherAppointment(BizOtherAppointmentAddParam bizOtherAppointmentAddParam) {
@@ -1676,6 +1781,13 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         this.updateById(bizAppointmentRecord);
     }
 
+    @Override
+    public void bizOtherAppointmentComplete(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
+        bizAppointmentRecord.setStatus("7");
+        this.updateById(bizAppointmentRecord);
+    }
+
 
     @Override
     public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
@@ -1795,6 +1907,31 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void bizChargeStationReservationExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
+        lock.lock();
+        try {
+            //充电结束
+            BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
+            bizAppointmentRecord.setStatus("18");
+            if(this.updateById(bizAppointmentRecord)){
+                //释放充电数量
+                //查询充电桩配置信息
+                BizChargeStation bizChargeStation = bizChargeStationService.getOne(new QueryWrapper<BizChargeStation>()
+                        .lambda().eq(BizChargeStation::getDeleteFlag, 0).last("limit 1"));
+                if (ObjectUtil.isNotNull(bizChargeStation)) {
+                    bizChargeStation.setChargeStationUsedNumber(bizChargeStation.getChargeStationUsedNumber() - 1);
+                    bizChargeStationService.updateById(bizChargeStation);
+                }
+            }
+
+        } finally {
+            lock.unlock();
+        }
+
+    }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public void bizChargeStationEnd(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
         lock.lock();
         try {
             BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
@@ -1821,7 +1958,6 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
         } finally {
             lock.unlock();
         }
-
     }
 
     @Override

+ 4 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadappoint/mapper/mapping/BizLoadAppointMapper.xml

@@ -31,7 +31,10 @@
             bla.load_price,
             bla.land_freight_price,
             bla.appoint_number,
-            bla.already_appoint_number
+            bla.already_appoint_number,
+            bla.load_type,
+            bla.end_sign,
+            bla.end_sign_time
         from biz_load_appoint bla
          left join biz_service_customer bsc on bla.customer_id = bsc.id
          left join biz_goods bg on bg.id = bla.goods_id

+ 1 - 1
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizloadarrive/service/impl/BizLoadArriveServiceImpl.java

@@ -449,7 +449,7 @@ public class BizLoadArriveServiceImpl extends ServiceImpl<BizLoadArriveMapper, B
                 flow.setOperateAmountAfter(customerAccount.getAccountAmount());
                 flow.setDataStatus("0");
                 flow.setDataId(bizLoadAppoint.getId());
-                bizServiceCustomerFlowService.updateById(flow);
+                bizServiceCustomerFlowService.save(flow);
                 bizServiceCustomerAccountService.updateById(customerAccount);
             }
         }

+ 12 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/controller/BizOrderSupplierController.java

@@ -128,4 +128,16 @@ public class BizOrderSupplierController {
     public CommonResult<List<BizOrderSupplier>> getSupplierList(BizOrderSupplierPageParam bizOrderSupplierPageParam) {
         return CommonResult.data(bizOrderSupplierService.getSupplierList(bizOrderSupplierPageParam));
     }
+
+    /**
+     * 获取供应商在执行订单
+     *
+     * @author fanzherong
+     * @date  2025/06/20 11:43
+     */
+    @Operation(summary = "获取供应商在执行订单")
+    @GetMapping("/biz/bizordersupplier/getListBySupplier")
+    public CommonResult<List<BizOrderSupplier>> getListBySupplier(BizOrderSupplierPageParam bizOrderSupplierPageParam) {
+        return CommonResult.data(bizOrderSupplierService.getListBySupplier(bizOrderSupplierPageParam));
+    }
 }

+ 6 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/entity/BizOrderSupplier.java

@@ -61,4 +61,10 @@ public class BizOrderSupplier extends CommonEntity {
      * 状态 0:待结算  1:已结算
      */
     private String status;
+
+    /**
+     * 订单编号
+     */
+    @TableField(exist = false)
+    private String orderNumber;
 }

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

@@ -15,6 +15,7 @@ package vip.xiaonuo.biz.modular.bizordersupplier.mapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
+import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
 import vip.xiaonuo.biz.modular.bizordersupplier.entity.BizOrderSupplier;
 
 import java.util.List;
@@ -28,4 +29,6 @@ import java.util.List;
 public interface BizOrderSupplierMapper extends BaseMapper<BizOrderSupplier> {
 
     List<BizOrderSupplier> getSupplierList(@Param("ew") QueryWrapper<BizOrderSupplier> ew);
+
+    List<BizOrderSupplier> getOrderList(@Param("ew") QueryWrapper<BizOrderSupplier> ew);
 }

+ 9 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/mapper/mapping/BizOrderSupplierMapper.xml

@@ -12,4 +12,13 @@
         LEFT JOIN biz_supplier bs ON bs.id = bos.supplier_id
         ${ew.customSqlSegment}
     </select>
+
+    <select id="getOrderList" resultType="vip.xiaonuo.biz.modular.bizordersupplier.entity.BizOrderSupplier">
+        select distinct
+            bo.id orderId,
+            bo.order_number
+        from biz_order_supplier bos
+                 left join biz_order bo on bo.id = bos.order_id
+            ${ew.customSqlSegment}
+    </select>
 </mapper>

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

@@ -50,4 +50,7 @@ public class BizOrderSupplierPageParam {
 
     private String orderId;
 
+    /**车牌号*/
+    private String licenseNumber;
+
 }

+ 5 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/service/BizOrderSupplierService.java

@@ -82,4 +82,9 @@ public interface BizOrderSupplierService extends IService<BizOrderSupplier> {
      * 获取订单供应商列表
      */
     List<BizOrderSupplier> getSupplierList(BizOrderSupplierPageParam bizOrderSupplierPageParam);
+
+    /**
+     * 查询供应商正在执行的物流订单
+     */
+    List<BizOrderSupplier> getListBySupplier(BizOrderSupplierPageParam bizOrderSupplierPageParam);
 }

+ 25 - 0
snowy-plugin/snowy-plugin-biz/src/main/java/vip/xiaonuo/biz/modular/bizordersupplier/service/impl/BizOrderSupplierServiceImpl.java

@@ -19,8 +19,11 @@ import cn.hutool.core.util.StrUtil;
 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 jakarta.annotation.Resource;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.biz.modular.bizsupplier.entity.BizSupplierTransport;
+import vip.xiaonuo.biz.modular.bizsupplier.service.BizSupplierTransportService;
 import vip.xiaonuo.common.enums.CommonSortOrderEnum;
 import vip.xiaonuo.common.exception.CommonException;
 import vip.xiaonuo.common.page.CommonPageRequest;
@@ -43,6 +46,9 @@ import java.util.List;
 @Service
 public class BizOrderSupplierServiceImpl extends ServiceImpl<BizOrderSupplierMapper, BizOrderSupplier> implements BizOrderSupplierService {
 
+    @Resource
+    private BizSupplierTransportService bizSupplierTransportService;
+
     @Override
     public Page<BizOrderSupplier> page(BizOrderSupplierPageParam bizOrderSupplierPageParam) {
         QueryWrapper<BizOrderSupplier> queryWrapper = new QueryWrapper<BizOrderSupplier>().checkSqlInjection();
@@ -102,4 +108,23 @@ public class BizOrderSupplierServiceImpl extends ServiceImpl<BizOrderSupplierMap
         List<BizOrderSupplier> list = this.getBaseMapper().getSupplierList(queryWrapper);
         return list;
     }
+
+    @Override
+    public List<BizOrderSupplier> getListBySupplier(BizOrderSupplierPageParam bizOrderSupplierPageParam) {
+        //根据车牌号查询所属供应商
+        BizSupplierTransport transport = bizSupplierTransportService.getOne(new QueryWrapper<BizSupplierTransport>().lambda().
+                eq(BizSupplierTransport::getTransportNo, bizOrderSupplierPageParam.getLicenseNumber()).
+                last("limit 1"));
+        if(ObjectUtil.isNotNull(transport)){
+            //根据供应商查询正在执行中的订单
+            QueryWrapper<BizOrderSupplier> queryWrapper = new QueryWrapper<>();
+            queryWrapper.eq("bos.supplier_id",transport.getSupplierId()).
+                    eq("bo.delete_flag","NOT_DELETE").
+                    eq("bos.delete_flag","NOT_DELETE").
+                    in("bo.order_status","3","4");
+            List<BizOrderSupplier> orderList = this.getBaseMapper().getOrderList(queryWrapper);
+            return orderList;
+        }
+        return null;
+    }
 }