Forráskód Böngészése

其他预约代码提交

fanzherong 2 napja
szülő
commit
56b0c305d9

+ 8 - 30
snowy-admin-web/src/api/biz/bizOtherAppointmentApi.js

@@ -13,11 +13,11 @@ export default {
 	bizOtherAppointmentPage(data) {
 		return request('page', data, 'get')
 	},
-	// 其他预约
+	// 其他预约表单提交
 	bizOtherAppointmentSubmitForm(data, edit = false) {
 		return request(edit ? 'editOtherAppointment' : 'addOtherAppointment', data)
 	},
-	// 删除预约记录
+	// 删除其他预约记录
 	bizOtherAppointmentDelete(data) {
 		return request('deleteOtherAppointment', data)
 	},
@@ -26,41 +26,19 @@ export default {
 		return request('bizOtherAppointmentExit',data)
 	},
 	//授权出场
-	bizAppointmentExit(data){
-		return request('exit',data)
-	},
-	//临时预约授权出场
-	bizAppointmentExitTemp(data){
-		return request('exitTemp',data)
+	bizOtherAppointmentAuthorize(data){
+		return request('bizOtherAppointmentAuthorize',data)
 	},
+
 	// 获取预约记录详情
 	bizAppointmentRecordDetail(data) {
 		return request('detail', data, 'get')
 	},
-	//审核
-	auditRecord(data){
-		return request('auditRecord',data)
-	},
-	//审核临时预约
-	auditTemp(data){
-		return request('auditTemp',data)
-	},
+
 	//导出
-	exportRecord(data){
-		return request('exportRecord', data, 'get', {
+	bizOtherAppointmentExport(data){
+		return request('bizOtherAppointmentExport', data, 'get', {
 			responseType: 'blob'
 		})
-	},
-	//取消排队
-	cancelAppointmentRecord(data){
-		return request('cancelAppointmentRecord',data)
-	},
-	//调整订单
-	adjustOrder(data){
-		return request('adjustOrder',data)
-	},
-	//车辆执行状态分析
-	gerVehicleTotal(data){
-		return request('gerVehicleTotal',data,'get')
 	}
 }

+ 9 - 2
snowy-admin-web/src/views/biz/bizotherappoint/detail.vue

@@ -4,12 +4,19 @@
 			<a-descriptions :column="4" size="middle" bordered class="mb-2" :label-style="labelStyle" :contentStyle="contentStyle">
 				<a-descriptions-item label="车牌号" :span="2">{{ formData.licenseNumber }}</a-descriptions-item>
 <!--				<a-descriptions-item label="订单名称" :span="2">{{ formData.orderName }}</a-descriptions-item>-->
-				<a-descriptions-item label="车牌号" :span="2">{{ formData.licenseNumber }}</a-descriptions-item>
+				<a-descriptions-item label="是否过磅" :span="2">{{ $TOOL.dictTypeData('is_weigh', formData.isWeigh) }}</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.createUserName }}</a-descriptions-item>
 				<a-descriptions-item label="创建时间" :span="2">{{ formData.createTime }}</a-descriptions-item>
 
+				<a-descriptions-item label="强制结束操作人" :span="2">{{ formData.exitOperator }}</a-descriptions-item>
+				<a-descriptions-item label="强制结束操作时间" :span="2">{{ formData.exitTime }}</a-descriptions-item>
+
+				<a-descriptions-item label="授权离场操作人" :span="2">{{ formData.authorizeOperator }}</a-descriptions-item>
+				<a-descriptions-item label="授权离场操作时间" :span="2">{{ formData.authorizeTime }}</a-descriptions-item>
+
+
 				<a-descriptions-item label="预约状态" :span="4">
 					<a-tag
 						:color="
@@ -45,7 +52,7 @@
 						{{ $TOOL.dictTypeData('appointment_status', formData.status) }}
 					</a-tag>
 				</a-descriptions-item>
-				<a-descriptions-item label="审核备注" :span="4">{{ formData.remark }}</a-descriptions-item>
+				<a-descriptions-item label="备注" :span="4">{{ formData.remark }}</a-descriptions-item>
 
 			</a-descriptions>
 		</a-form>

+ 12 - 40
snowy-admin-web/src/views/biz/bizotherappoint/index.vue

@@ -9,13 +9,13 @@
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">
-					<a-form-item label="司机名称" name="customerName">
-						<a-input v-model:value="searchFormState.customerName" placeholder="司机名称" />
+					<a-form-item label="司机名称" name="driverName">
+						<a-input v-model:value="searchFormState.driverName" placeholder="司机名称" />
 					</a-form-item>
 				</a-col>
 				<a-col :span="6">
-					<a-form-item label="司机电话" name="customerName">
-						<a-input v-model:value="searchFormState.customerName" placeholder="司机电话" />
+					<a-form-item label="司机电话" name="driverMobile">
+						<a-input v-model:value="searchFormState.driverMobile" placeholder="司机电话" />
 					</a-form-item>
 				</a-col>
 				<template v-if="advanced">
@@ -121,15 +121,15 @@
 										<a @click="detailRef.onOpen(record)">详情</a>
 									</a-menu-item>
 
-									<a-menu-item v-if="hasPerm('bizOtherAppointmentEdit') && (record.status == '2' || record.status == '4')">
+									<a-menu-item v-if="hasPerm('bizOtherAppointmentEdit') && ( record.status == '4')">
 										<a style="color:blue" @click="formRef.onOpen(record)" >编辑</a>
 									</a-menu-item>
-									<a-menu-item v-if="hasPerm('bizOtherAppointmentDelete') && (record.status == '2' || record.status == '4')">
+									<a-menu-item v-if="hasPerm('bizOtherAppointmentDelete') && ( 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('bizOtherAppointmentExit') && (record.status=='5' || record.status=='6' || record.status=='7'
-									|| record.status=='8' || record.status=='9' || record.status=='16' )">
+									|| record.status=='8' || record.status=='9' || record.status=='16' || record.status=='17'  )">
 										<a style="color:green"  @click="cancel(record)" >强制结束</a>
 									</a-menu-item>
 									<a-menu-item v-if="hasPerm('bizOtherAppointmentAuthorize') && (record.status=='17' )">
@@ -319,11 +319,11 @@
 		})
 	}
 
-	//取消预约
+	//强制结束操作
 	const cancel = (record) => {
 
 		Modal.confirm({
-			title: '确定要取消吗?',
+			title: '是否确定要强制结束吗?一旦强制结束,整体流程结束',
 			icon: createVNode(ExclamationCircleOutlined),
 			content: '',
 			onOk() {
@@ -332,8 +332,6 @@
 					{
 						id: record.id
 					}
-
-
 				bizOtherAppointmentApi
 					.bizOtherAppointmentExit(params)
 					.then(() => {
@@ -350,9 +348,8 @@
 
 	//授权出场
 	const exit = (record) => {
-
 		Modal.confirm({
-			title: '确定要授权场吗?',
+			title: '确定要授权场吗?',
 			icon: createVNode(ExclamationCircleOutlined),
 			content: '',
 			onOk() {
@@ -361,10 +358,8 @@
 					{
 						id: record.id
 					}
-
-
 				bizOtherAppointmentApi
-					.bizAppointmentExit(params)
+					.bizOtherAppointmentAuthorize(params)
 					.then(() => {
 						tableRef.value.refresh(true)
 					})
@@ -425,29 +420,6 @@
 		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)
-			})
-	}
 
 
 	//导出
@@ -465,7 +437,7 @@
 				const searchFormParam = cloneDeep(searchFormState.value)
 
 				bizOtherAppointmentApi
-					.exportRecord(Object.assign(searchFormParam))
+					.bizOtherAppointmentExport(Object.assign(searchFormParam))
 					.then((res) => {
 						downloadUtil.resultDownload(res)
 					})

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

@@ -369,13 +369,13 @@ public class BizAppointmentRecordController {
         return CommonResult.ok();
     }
     /**
-     * 临时预约_删除
+     * 其他预约_删除
      *
-     * @author fanzherong
-     * @date  2025/03/24 14:47
+     * @author xumudong
+     * @date  2025/07/02 11:47
      */
-    @Operation(summary = "临时预约_删除")
-    @CommonLog("临时预约_删除")
+    @Operation(summary = "其他预约_删除")
+    @CommonLog("其他预约_删除")
     @PostMapping("/biz/bizotherappointment/deleteOtherAppointment")
     public CommonResult<String> deleteOtherAppointment(@RequestBody @Valid @NotEmpty(message = "集合不能为空")
                                                List<BizAppointmentRecordIdParam> bizAppointmentRecordIdParamList) {
@@ -385,14 +385,36 @@ public class BizAppointmentRecordController {
 
 
     /**
-     * 临时预约_强制结束
+     * 其他预约_强制结束
      */
-    @Operation(summary = "临时预约_强制结束")
-    @CommonLog("临时预约_强制结束")
+    @Operation(summary = "其他预约_强制结束")
+    @CommonLog("其他预约_强制结束")
     @PostMapping("/biz/bizotherappointment/bizOtherAppointmentExit")
     public CommonResult<String> bizOtherAppointmentExit(@RequestBody BizAppointmentRecordIdParam bizAppointmentRecordIdParam){
         bizAppointmentRecordService.bizOtherAppointmentExit(bizAppointmentRecordIdParam);
         return CommonResult.ok();
     }
 
+    /**
+     * 其他预约_授权离场
+     */
+    @Operation(summary = "其他预约_授权离场")
+    @CommonLog("其他预约_授权离场")
+    @PostMapping("/biz/bizotherappointment/bizOtherAppointmentAuthorize")
+    public CommonResult<String> bizOtherAppointmentAuthorize(@RequestBody BizAppointmentRecordIdParam bizAppointmentRecordIdParam){
+        bizAppointmentRecordService.bizOtherAppointmentAuthorize(bizAppointmentRecordIdParam);
+        return CommonResult.ok();
+    }
+
+
+
+    /**
+     * 临时预约_导出
+     */
+    @Operation(summary = "临时预约_导出")
+    @SaCheckPermission("/biz/bizotherappointment/bizOtherAppointmentExport")
+    @GetMapping(value = "/biz/bizotherappointment/bizOtherAppointmentExport", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
+    public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
+        bizAppointmentRecordService.bizOtherAppointmentExport(bizAppointmentRecordPageParam,response);
+    }
 }

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

@@ -179,6 +179,7 @@ public class BizAppointmentRecord extends CommonEntity {
     private String loadTimeId;
 
     /**是否过磅 1-是 2-否**/
+    @Trans(type = TransType.DICTIONARY, key = "is_weigh")
     private String isWeigh;
 
     /**备注**/

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

@@ -0,0 +1,70 @@
+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 io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Data
+public class BizOtherAppointmentExportResult {
+
+
+    /** 车牌号 */
+    @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 String statusName;
+
+
+    /** 是否过磅 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"其他预约报表", "是否过磅"})
+    private String isWeigh;
+
+
+    /** 备注 */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"其他预约报表", "备注"})
+    private String remark;
+
+
+    /**
+     * 其他预约_强制结束操作人
+     */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"其他预约报表", "其他预约_强制结束操作人"})
+    private String exitOperator;
+    /**
+     * 其他预约_强制结束操作时间
+     */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"其他预约报表", "其他预约_强制结束操作时间"})
+    private String exitTime;
+
+    /**
+     * 其他预约_授权离场操作人
+     */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"其他预约报表", "其他预约_授权离场操作人"})
+    private String authorizeOperator;
+    /**
+     * 其他预约_授权离场操作时间
+     */
+    @HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 120)
+    @ExcelProperty({"其他预约报表", "其他预约_授权离场操作时间"})
+    private String authorizeTime;
+
+
+}

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

@@ -151,5 +151,19 @@ public interface BizAppointmentRecordService extends IService<BizAppointmentReco
      * @param bizAppointmentRecordIdParam
      */
     void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam);
+    /**
+     * 其他预约_授权离场
+     * @param bizAppointmentRecordIdParam
+     */
+    void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam);
+
+
+    /**
+     * 其他预约_导出
+     * @param bizAppointmentRecordPageParam
+     * @param response
+     * @throws IOException
+     */
+    void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException;
 
 }

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

@@ -34,6 +34,7 @@ import org.apache.commons.compress.utils.Lists;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+import vip.xiaonuo.auth.core.pojo.SaBaseLoginUser;
 import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
 import vip.xiaonuo.biz.modular.api.param.WxUserMsgParam;
 import vip.xiaonuo.biz.modular.api.service.ApiService;
@@ -84,6 +85,8 @@ import vip.xiaonuo.common.prop.CommonProperties;
 
 import java.io.IOException;
 import java.text.SimpleDateFormat;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -1323,6 +1326,11 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
             checkOtherParam(bizOtherAppointmentEditParam.getLicenseNumber());
         }
         BizAppointmentRecord bizAppointmentRecordUp = BeanUtil.toBean(bizOtherAppointmentEditParam, BizAppointmentRecord.class);
+        BizUser bizUser = bizUserService.getById(bizOtherAppointmentEditParam.getDriverId());
+        if (bizUser != null) {
+            bizAppointmentRecordUp.setDriverName(bizUser.getName());
+            bizAppointmentRecordUp.setDriverMobile(bizUser.getPhone());
+        }
         this.updateById(bizAppointmentRecordUp);
     }
 
@@ -1346,10 +1354,49 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
     @Override
     public void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
         BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
+        if("10".equals(bizAppointmentRecord.getStatus())){
+            throw new CommonException("当前流程已经强制结束,不可重复操作!");
+        }
         //强制结束,将状态改成已出场,同时记录操作人以及操作时间
+        SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
+        bizAppointmentRecord.setExitOperator(loginUser.getName());
+        bizAppointmentRecord.setExitTime(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
+                .format(LocalDateTime.now()));
         bizAppointmentRecord.setStatus("10");
         this.updateById(bizAppointmentRecord);
     }
+    @Override
+    public void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
+        BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
+        if("9".equals(bizAppointmentRecord.getStatus())){
+            throw new CommonException("当前流程已经授权离场,不可重复操作!");
+        }
+        //强制结束,将状态改成已出场,同时记录操作人以及操作时间
+        SaBaseLoginUser loginUser = StpLoginUserUtil.getLoginUser();
+        bizAppointmentRecord.setAuthorizeOperator(loginUser.getName());
+        bizAppointmentRecord.setAuthorizeTime(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")
+                .format(LocalDateTime.now()));
+        bizAppointmentRecord.setStatus("9");
+        this.updateById(bizAppointmentRecord);
+    }
 
 
+
+    @Override
+    public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
+        QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
+        List<BizAppointmentRecord> recordList = this.getBaseMapper().getPage(queryWrapper);
+        String fileName = "其他预约报表.xlsx";
+        List<BizOtherAppointmentExportResult> list = Lists.newArrayList();
+        transService.transBatch(recordList);
+        for (BizAppointmentRecord bizAppointmentRecord : recordList) {
+            BizOtherAppointmentExportResult bizOtherAppointmentExportResult = new BizOtherAppointmentExportResult();
+            BeanUtil.copyProperties(bizAppointmentRecord, bizOtherAppointmentExportResult);
+            bizOtherAppointmentExportResult.setStatusName((String) bizAppointmentRecord.getTransMap().get("statusName"));
+            bizOtherAppointmentExportResult.setIsWeigh((String) bizAppointmentRecord.getTransMap().get("isWeightName"));
+            list.add(bizOtherAppointmentExportResult);
+        }
+        CommonExportUtil.export(fileName, BizOtherAppointmentExportResult.class, list, response, "其他预约报表");
+    }
+
 }