|
@@ -18,7 +18,6 @@ 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;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
@@ -29,7 +28,6 @@ import com.google.common.collect.Maps;
|
|
|
import jakarta.annotation.Resource;
|
|
|
import jakarta.servlet.http.HttpServletResponse;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.collections4.MapUtils;
|
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -39,8 +37,9 @@ import vip.xiaonuo.auth.core.util.StpLoginUserUtil;
|
|
|
import vip.xiaonuo.biz.modular.api.param.WxUserMsgParam;
|
|
|
import vip.xiaonuo.biz.modular.api.service.ApiService;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.param.*;
|
|
|
-import vip.xiaonuo.biz.modular.bizappointmenttime.entity.BizAppointmentTime;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmenttime.service.BizAppointmentTimeService;
|
|
|
+import vip.xiaonuo.biz.modular.bizchargestation.entity.BizChargeStation;
|
|
|
+import vip.xiaonuo.biz.modular.bizchargestation.service.BizChargeStationService;
|
|
|
import vip.xiaonuo.biz.modular.bizconfig.entity.BizConfig;
|
|
|
import vip.xiaonuo.biz.modular.bizconfig.service.BizConfigService;
|
|
|
import vip.xiaonuo.biz.modular.bizexcessconfig.entity.BizExcessConfig;
|
|
@@ -52,7 +51,6 @@ import vip.xiaonuo.biz.modular.bizloadappointsupplier.service.BizLoadAppointSupp
|
|
|
import vip.xiaonuo.biz.modular.bizloadtime.entity.BizLoadTime;
|
|
|
import vip.xiaonuo.biz.modular.bizloadtime.service.BizLoadTimeService;
|
|
|
import vip.xiaonuo.biz.modular.bizorder.entity.BizOrder;
|
|
|
-import vip.xiaonuo.biz.modular.bizorder.param.BizOrderExportResult;
|
|
|
import vip.xiaonuo.biz.modular.bizorder.service.BizOrderService;
|
|
|
import vip.xiaonuo.biz.modular.bizorderconfig.entity.BizOrderConfig;
|
|
|
import vip.xiaonuo.biz.modular.bizorderconfig.service.BizOrderConfigService;
|
|
@@ -77,7 +75,6 @@ import vip.xiaonuo.biz.modular.record.service.BizRecordService;
|
|
|
import vip.xiaonuo.biz.modular.user.entity.BizUser;
|
|
|
import vip.xiaonuo.biz.modular.user.service.BizUserService;
|
|
|
import vip.xiaonuo.biz.modular.utils.CommonExportUtil;
|
|
|
-import vip.xiaonuo.common.enums.CommonSortOrderEnum;
|
|
|
import vip.xiaonuo.common.exception.CommonException;
|
|
|
import vip.xiaonuo.common.page.CommonPageRequest;
|
|
|
import vip.xiaonuo.biz.modular.bizappointmentrecord.entity.BizAppointmentRecord;
|
|
@@ -156,6 +153,10 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
@Resource
|
|
|
private BizPipePlanService bizPipePlanService;
|
|
|
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private BizChargeStationService bizChargeStationService;
|
|
|
+
|
|
|
@Override
|
|
|
public Page<BizAppointmentRecord> page(BizAppointmentRecordPageParam bizAppointmentRecordPageParam) {
|
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
@@ -173,6 +174,9 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderName())) {
|
|
|
queryWrapper.like("bo.order_name", bizAppointmentRecordPageParam.getOrderName());
|
|
|
}
|
|
|
+ if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOtherNumber())) {
|
|
|
+ queryWrapper.like("bar.other_number", bizAppointmentRecordPageParam.getOtherNumber());
|
|
|
+ }
|
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getOrderNumber())) {
|
|
|
queryWrapper.like("bo.order_number", bizAppointmentRecordPageParam.getOrderNumber());
|
|
|
}
|
|
@@ -207,8 +211,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
queryWrapper.like("bla.load_number", bizAppointmentRecordPageParam.getLoadNumber());
|
|
|
}
|
|
|
//管桩计划单号
|
|
|
- if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getPlanNumber())){
|
|
|
- queryWrapper.like("bpp.plan_number",bizAppointmentRecordPageParam.getPlanNumber());
|
|
|
+ if (ObjectUtil.isNotEmpty(bizAppointmentRecordPageParam.getPlanNumber())) {
|
|
|
+ queryWrapper.like("bpp.plan_number", bizAppointmentRecordPageParam.getPlanNumber());
|
|
|
}
|
|
|
queryWrapper.eq("bar.delete_flag", "NOT_DELETE");
|
|
|
queryWrapper.orderByDesc("bar.create_time");
|
|
@@ -1291,7 +1295,6 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
public void getLoadTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
|
|
|
lock.lock();
|
|
|
try {
|
|
@@ -1353,7 +1356,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
//修改管桩计划状态
|
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
|
pipePlan.setStatus("2");
|
|
|
pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() + 1);
|
|
|
bizPipePlanService.updateById(pipePlan);
|
|
@@ -1398,8 +1401,8 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
//判断管桩计划次数是否满足
|
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordAddParam.getOrderId())) {
|
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordAddParam.getOrderId());
|
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
- if(pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0){
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
|
+ if (pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0) {
|
|
|
throw new CommonException("当前管桩计划单预约次数已满");
|
|
|
}
|
|
|
}
|
|
@@ -1477,15 +1480,15 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void getPipeTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam,BizAppointmentRecord bizAppointmentRecord) {
|
|
|
+ public void getPipeTimeCount(BizAppointmentRecordEditParam bizAppointmentRecordEditParam, BizAppointmentRecord bizAppointmentRecord) {
|
|
|
lock.lock();
|
|
|
try {
|
|
|
//判断管桩计划次数是否满足
|
|
|
if (ObjectUtil.isNotEmpty(bizAppointmentRecordEditParam.getOrderId())) {
|
|
|
- if(!StringUtils.equals(bizAppointmentRecordEditParam.getOrderId(),bizAppointmentRecord.getOrderId())){
|
|
|
+ if (!StringUtils.equals(bizAppointmentRecordEditParam.getOrderId(), bizAppointmentRecord.getOrderId())) {
|
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecordEditParam.getOrderId());
|
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
- if(pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0){
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
|
+ if (pipePlan.getPlanCount() - pipePlan.getPlanAlreadyCount() <= 0) {
|
|
|
throw new CommonException("当前管桩计划单预约次数已满");
|
|
|
}
|
|
|
}
|
|
@@ -1514,7 +1517,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
//修改管桩计划单已约数量
|
|
|
BizPipePlan pipePlan = bizPipePlanService.getById(bizAppointmentRecord.getOrderId());
|
|
|
- if(ObjectUtil.isNotNull(pipePlan)){
|
|
|
+ if (ObjectUtil.isNotNull(pipePlan)) {
|
|
|
pipePlan.setPlanAlreadyCount(pipePlan.getPlanAlreadyCount() - 1);
|
|
|
bizPipePlanService.updateById(pipePlan);
|
|
|
}
|
|
@@ -1524,7 +1527,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
|
|
|
@Override
|
|
|
public void addOtherAppointment(BizOtherAppointmentAddParam bizOtherAppointmentAddParam) {
|
|
|
- checkOtherParam(bizOtherAppointmentAddParam.getLicenseNumber());
|
|
|
+ checkParam(bizOtherAppointmentAddParam.getLicenseNumber());
|
|
|
//获取流程配置判断预约是否需要审核
|
|
|
BizAppointmentRecord bizAppointmentRecord = BeanUtil.toBean(bizOtherAppointmentAddParam, BizAppointmentRecord.class);
|
|
|
BizUser bizUser = bizUserService.getById(bizOtherAppointmentAddParam.getDriverId());
|
|
@@ -1532,6 +1535,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
bizAppointmentRecord.setDriverName(bizUser.getName());
|
|
|
bizAppointmentRecord.setDriverMobile(bizUser.getPhone());
|
|
|
}
|
|
|
+ bizAppointmentRecord.setOtherNumber(getNumber("QT", "6"));
|
|
|
//默认赋值待入场状态
|
|
|
bizAppointmentRecord.setStatus("4");
|
|
|
bizAppointmentRecord.setAppointmentType("6");
|
|
@@ -1542,7 +1546,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
public void editOtherAppointment(BizOtherAppointmentEditParam bizOtherAppointmentEditParam) {
|
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizOtherAppointmentEditParam.getId());
|
|
|
if (!bizAppointmentRecord.getLicenseNumber().equals(bizOtherAppointmentEditParam.getLicenseNumber())) {
|
|
|
- checkOtherParam(bizOtherAppointmentEditParam.getLicenseNumber());
|
|
|
+ checkParam(bizOtherAppointmentEditParam.getLicenseNumber());
|
|
|
}
|
|
|
BizAppointmentRecord bizAppointmentRecordUp = BeanUtil.toBean(bizOtherAppointmentEditParam, BizAppointmentRecord.class);
|
|
|
BizUser bizUser = bizUserService.getById(bizOtherAppointmentEditParam.getDriverId());
|
|
@@ -1554,17 +1558,19 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
|
|
|
|
|
|
- //其他预约校验
|
|
|
- public void checkOtherParam(String licenseNumber) {
|
|
|
+ //预约校验
|
|
|
+ public void checkParam(String licenseNumber) {
|
|
|
//校验车牌号
|
|
|
if (ObjectUtil.isNotEmpty(licenseNumber)) {
|
|
|
licenseNumber = licenseNumber.toUpperCase().trim();
|
|
|
//校验车牌号是否添加过预约,排除11:已签收、 13:销售已审核 、 14:已取消
|
|
|
- long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.getOne(new QueryWrapper<BizAppointmentRecord>().lambda().
|
|
|
eq(BizAppointmentRecord::getLicenseNumber, licenseNumber).
|
|
|
- notIn(BizAppointmentRecord::getStatus, "10", "11", "12", "13", "14", "15"));
|
|
|
- if (count > 0) {
|
|
|
- throw new CommonException("车牌号:{}已经添加过预约!", licenseNumber);
|
|
|
+ notIn(BizAppointmentRecord::getStatus, "10", "11", "12", "13", "14", "15", "19")
|
|
|
+ .last("limit 1"));
|
|
|
+ if (bizAppointmentRecord != null) {
|
|
|
+ transService.transOne(bizAppointmentRecord);
|
|
|
+ throw new CommonException("车牌号:{}已经存在【" + (String) bizAppointmentRecord.getTransMap().get("appointmentTypeName") + "】类型的有效预约记录!", licenseNumber);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1590,7 +1596,7 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
@Override
|
|
|
public void bizOtherAppointmentExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
|
- if("10".equals(bizAppointmentRecord.getStatus())){
|
|
|
+ if ("10".equals(bizAppointmentRecord.getStatus())) {
|
|
|
throw new CommonException("当前流程已经强制结束,不可重复操作!");
|
|
|
}
|
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
@@ -1601,10 +1607,11 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
bizAppointmentRecord.setStatus("10");
|
|
|
this.updateById(bizAppointmentRecord);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public void bizOtherAppointmentAuthorize(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
|
BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizAppointmentRecordIdParam.getId());
|
|
|
- if("9".equals(bizAppointmentRecord.getStatus())){
|
|
|
+ if ("9".equals(bizAppointmentRecord.getStatus())) {
|
|
|
throw new CommonException("当前流程已经授权离场,不可重复操作!");
|
|
|
}
|
|
|
//强制结束,将状态改成已出场,同时记录操作人以及操作时间
|
|
@@ -1617,7 +1624,6 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public void bizOtherAppointmentExport(BizAppointmentRecordPageParam bizAppointmentRecordPageParam, HttpServletResponse response) throws IOException {
|
|
|
QueryWrapper<BizAppointmentRecord> queryWrapper = getQueryWrapper(bizAppointmentRecordPageParam);
|
|
@@ -1635,4 +1641,141 @@ public class BizAppointmentRecordServiceImpl extends ServiceImpl<BizAppointmentR
|
|
|
CommonExportUtil.export(fileName, BizOtherAppointmentExportResult.class, list, response, "其他预约报表");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public String getNumber(String startPrefix, String appointmentType) {
|
|
|
+ lock.lock();
|
|
|
+ try {
|
|
|
+ String format = new SimpleDateFormat("yyyyMMdd").format(new Date());
|
|
|
+ String time = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
|
|
|
+ long count = this.count(new QueryWrapper<BizAppointmentRecord>().lambda()
|
|
|
+ .eq(BizAppointmentRecord::getAppointmentType, appointmentType)
|
|
|
+ .between(BizAppointmentRecord::getCreateTime,
|
|
|
+ time + " 00:00:00", time + " 23:59:59"));
|
|
|
+ String settleNo = startPrefix + format + generateCode((int) count);
|
|
|
+ return settleNo;
|
|
|
+ } finally {
|
|
|
+ lock.unlock(); // 释放锁
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String generateCode(Integer counter) {
|
|
|
+ counter++;
|
|
|
+ return String.format("%03d", counter);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void addChargeStationReservation(BizChargeStationReservationAddParam bizChargeStationReservationAddParam) {
|
|
|
+ //校验是否存在有效得预约信息
|
|
|
+ checkParam(bizChargeStationReservationAddParam.getLicenseNumber());
|
|
|
+ lock.lock();
|
|
|
+ try {
|
|
|
+ //校验一下充电桩剩余数量是否够扣减
|
|
|
+ //查询充电桩配置信息
|
|
|
+ BizChargeStation bizChargeStation = bizChargeStationService.getOne(new QueryWrapper<BizChargeStation>()
|
|
|
+ .lambda().eq(BizChargeStation::getDeleteFlag, 0).last("limit 1"));
|
|
|
+ if (bizChargeStation != null && (bizChargeStation.getChargeStationTotalNumber() - bizChargeStation.getChargeStationUsedNumber()) < 1) {
|
|
|
+ throw new CommonException("充电桩已无剩余充电桩数量");
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取流程配置判断预约是否需要审核
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = BeanUtil.toBean(bizChargeStationReservationAddParam, BizAppointmentRecord.class);
|
|
|
+ BizUser bizUser = bizUserService.getById(bizChargeStationReservationAddParam.getDriverId());
|
|
|
+ if (bizUser != null) {
|
|
|
+ bizAppointmentRecord.setDriverName(bizUser.getName());
|
|
|
+ bizAppointmentRecord.setDriverMobile(bizUser.getPhone());
|
|
|
+ }
|
|
|
+ bizAppointmentRecord.setOtherNumber(getNumber("CD", "4"));
|
|
|
+ //默认赋值待入场状态
|
|
|
+ bizAppointmentRecord.setStatus("4");
|
|
|
+ bizAppointmentRecord.setAppointmentType("4");
|
|
|
+ //新增成功,并将充电桩已使用数量进行扣减
|
|
|
+ if (this.save(bizAppointmentRecord)) {
|
|
|
+ bizChargeStation.setChargeStationUsedNumber(bizChargeStation.getChargeStationUsedNumber() + 1);
|
|
|
+ bizChargeStationService.updateById(bizChargeStation);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ } finally {
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void editChargeStationReservation(BizChargeStationReservationEditParam bizChargeStationReservationEditParam) {
|
|
|
+ BizAppointmentRecord bizAppointmentRecord = this.queryEntity(bizChargeStationReservationEditParam.getId());
|
|
|
+ if (!bizAppointmentRecord.getLicenseNumber().equals(bizChargeStationReservationEditParam.getLicenseNumber())) {
|
|
|
+ //校验是否存在有效得预约信息
|
|
|
+ checkParam(bizChargeStationReservationEditParam.getLicenseNumber());
|
|
|
+ }
|
|
|
+ BizAppointmentRecord bizAppointmentRecordUp = BeanUtil.toBean(bizChargeStationReservationEditParam, BizAppointmentRecord.class);
|
|
|
+ BizUser bizUser = bizUserService.getById(bizChargeStationReservationEditParam.getDriverId());
|
|
|
+ if (bizUser != null) {
|
|
|
+ bizAppointmentRecordUp.setDriverName(bizUser.getName());
|
|
|
+ bizAppointmentRecordUp.setDriverMobile(bizUser.getPhone());
|
|
|
+ }
|
|
|
+ this.updateById(bizAppointmentRecordUp);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void deleteChargeStationReservation(List<BizAppointmentRecordIdParam> bizAppointmentRecordIdParamList) {
|
|
|
+ lock.lock();
|
|
|
+ try {
|
|
|
+ //释放充电数量
|
|
|
+ //查询充电桩配置信息
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ // 执行删除
|
|
|
+ this.removeByIds(CollStreamUtil.toList(bizAppointmentRecordIdParamList, BizAppointmentRecordIdParam::getId));
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ } finally {
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @Override
|
|
|
+ public void bizChargeStationReservationExit(BizAppointmentRecordIdParam bizAppointmentRecordIdParam) {
|
|
|
+ lock.lock();
|
|
|
+ try {
|
|
|
+ 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");
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ } finally {
|
|
|
+ lock.unlock();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|