|
@@ -15,6 +15,7 @@ package vip.xiaonuo.biz.modular.bizappointmentrecord.service.impl;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollStreamUtil;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.PhoneUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
@@ -58,6 +59,7 @@ import vip.xiaonuo.biz.modular.bizappointmentrecord.service.BizAppointmentRecord
|
|
|
import java.io.IOException;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.concurrent.locks.ReentrantLock;
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
@@ -69,6 +71,7 @@ import java.util.regex.Pattern;
|
|
|
@Service
|
|
|
public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentRecordMapper, BizAppointmentRecord> implements BizAppointmentRecordService {
|
|
|
|
|
|
+ private final ReentrantLock lock = new ReentrantLock();
|
|
|
@Resource
|
|
|
private BizConfigService bizConfigService;
|
|
|
@Resource
|
|
@@ -103,7 +106,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
queryWrapper.like("bo.order_number",bizAppointmentRecordPageParam.getOrderNumber());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getCustomerName())){
|
|
|
- queryWrapper.like("bc.customer_name",bizAppointmentRecordPageParam.getCustomerName());
|
|
|
+ queryWrapper.like("bc.name",bizAppointmentRecordPageParam.getCustomerName());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getDriverName())){
|
|
|
queryWrapper.like("bar.driver_name",bizAppointmentRecordPageParam.getDriverName());
|
|
@@ -112,7 +115,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
queryWrapper.like("bar.driver_mobile",bizAppointmentRecordPageParam.getDriverMobile());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getGoodsName())){
|
|
|
- queryWrapper.like("bg.NAME",bizAppointmentRecordPageParam.getGoodsName());
|
|
|
+ queryWrapper.like("bg.GOODS_NAME",bizAppointmentRecordPageParam.getGoodsName());
|
|
|
}
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getLicenseNumber())){
|
|
|
queryWrapper.like("bar.license_number",bizAppointmentRecordPageParam.getLicenseNumber());
|
|
@@ -151,7 +154,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
bizAppointmentRecord.setStatus("3");
|
|
|
}
|
|
|
}
|
|
|
- this.save(bizAppointmentRecord);
|
|
|
+ //this.save(bizAppointmentRecord);
|
|
|
+ saveRecord(bizAppointmentRecord);
|
|
|
|
|
|
BizOrder bizOrder = bizOrderService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
|
bizOrder.setOrderStatus("4");
|
|
@@ -167,6 +171,22 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void saveRecord(BizAppointmentRecord bizAppointmentRecord){
|
|
|
+ //排队中
|
|
|
+ lock.lock();
|
|
|
+ try {
|
|
|
+ //查询当天预约记录条数
|
|
|
+ String format = DateUtil.format(DateUtil.date(), "yyyy-MM-dd");
|
|
|
+ long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
+ between(BizAppointmentRecord::getCreateTime, format + " 00:00:00", format + " 23:59:59"));
|
|
|
+ bizAppointmentRecord.setQueueNumber((int) (count+1));
|
|
|
+ this.save(bizAppointmentRecord);
|
|
|
+ } finally {
|
|
|
+ lock.unlock(); // 释放锁
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
public void checkParam(BizAppointmentRecordAddParam bizAppointmentRecordAddParam){
|
|
|
//校验车牌号
|
|
|
if(ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getLicenseNumber())){
|
|
@@ -375,7 +395,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
BizAppointmentExportResult bizAppointmentExportResult = new BizAppointmentExportResult();
|
|
|
BeanUtil.copyProperties(bizAppointmentRecord, bizAppointmentExportResult);
|
|
|
bizAppointmentExportResult.setStatusName((String) bizAppointmentRecord.getTransMap().get("statusName"));
|
|
|
- bizAppointmentExportResult.setTimeInfo(bizAppointmentRecord.getBeginTime()+"~"+bizAppointmentRecord.getEndTime());
|
|
|
+ bizAppointmentExportResult.setAxleNumber(bizAppointmentRecord.getAxleNumber()+"轴");
|
|
|
list.add(bizAppointmentExportResult);
|
|
|
}
|
|
|
CommonExportUtil.export(fileName, BizAppointmentExportResult.class,list,response,"预约报表");
|