localizer
parent
e3769b129b
commit
7cfcdc3b36
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.njzscloud.common.mp.support.PageParam;
|
||||
import com.njzscloud.common.mp.support.PageResult;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -65,8 +66,8 @@ public class IncSnService extends ServiceImpl<IncSnMapper, IncSnEntity> implemen
|
|||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<IncSnEntity>query(incSnEntity)));
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long inc(String code) {
|
||||
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
|
||||
public synchronized Long inc(String code) {
|
||||
IncSnEntity incCodeEntity = this.getOne(Wrappers.<IncSnEntity>lambdaQuery()
|
||||
.eq(IncSnEntity::getCode, code));
|
||||
Long val = incCodeEntity.getVal();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.njzscloud.common.sn.support;
|
||||
|
||||
import com.njzscloud.common.core.ex.Exceptions;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -21,6 +23,6 @@ public class Sn {
|
|||
return sections.stream()
|
||||
.map(ISnSection::next)
|
||||
.reduce((a, b) -> a + b)
|
||||
.orElseThrow(() -> new RuntimeException("No section found"));
|
||||
.orElseThrow(() -> Exceptions.exception("编码配置配置错误"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public final class SnUtil {
|
|||
return next("Default");
|
||||
}
|
||||
|
||||
public static String next(String sncode) {
|
||||
public static synchronized String next(String sncode) {
|
||||
Assert.notBlank(sncode);
|
||||
return SN_CONFIG_SERVICE.getSn(sncode).next();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.njzscloud.supervisory.device.mapper.DeviceInfoMapper;
|
|||
import com.njzscloud.supervisory.device.pojo.entity.DeviceInfoEntity;
|
||||
import com.njzscloud.supervisory.order.contant.CheckStatus;
|
||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||
import com.njzscloud.supervisory.order.contant.PaymentStatus;
|
||||
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckComingOrderParam;
|
||||
import com.njzscloud.supervisory.order.pojo.param.TruckLeavingOrderParam;
|
||||
|
|
@ -203,7 +204,15 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
}
|
||||
DeviceCode deviceCode = deviceInfoEntity.getDeviceCode();
|
||||
OrderStatus orderStatus = orderPagingResult.getOrderStatus();
|
||||
CheckStatus checkStatus = orderPagingResult.getCheckStatus();
|
||||
|
||||
if (deviceCode == DeviceCode.JinQianZhi && orderStatus == OrderStatus.QingYunZhong) {
|
||||
PaymentStatus paymentStatus = orderPagingResult.getPaymentStatus();
|
||||
if (paymentStatus == PaymentStatus.WeiZhiFu) {
|
||||
// 播语音
|
||||
playVoice(sn, cid, "{}请先支付", licensePlate);
|
||||
}
|
||||
|
||||
// 开门
|
||||
open(sn, cid);
|
||||
return resBuilder
|
||||
|
|
@ -218,7 +227,24 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
.build())
|
||||
.build();
|
||||
}
|
||||
CheckStatus checkStatus = orderPagingResult.getCheckStatus();
|
||||
|
||||
if (deviceCode == DeviceCode.JinQianZhi && orderStatus == OrderStatus.YiJinChang) {
|
||||
if (checkStatus == CheckStatus.WeiKanLiao) {
|
||||
// 播语音
|
||||
playVoice(sn, cid, "{}未看料", licensePlate);
|
||||
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
|
||||
// 开门
|
||||
open(sn, cid);
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 0).build())
|
||||
.build();
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.ChuQianZhi && checkStatus == CheckStatus.WeiKanLiao) {
|
||||
// 播语音
|
||||
playVoice(sn, cid, "{}未看料", licensePlate);
|
||||
|
|
@ -236,6 +262,14 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
|
|||
.build();
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.Jin && orderStatus == OrderStatus.YiJinChang) {
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 2)
|
||||
.put("order_no", orderPagingResult.getId() + "")
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
if (deviceCode == DeviceCode.Chu && orderStatus == OrderStatus.YiJinChang) {
|
||||
return resBuilder
|
||||
.put("data", dataBuilder.put("type", 2)
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ import lombok.RequiredArgsConstructor;
|
|||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
public enum CheckStatus implements DictStr {
|
||||
YiKanLiao("YiKanLiao", "已看料"),
|
||||
WeiKanLiao("WeiKanLiao", "未看料"),
|
||||
YiKanLiao("YiKanLiao", "已勘料"),
|
||||
WeiKanLiao("WeiKanLiao", "未勘料"),
|
||||
;
|
||||
private final String val;
|
||||
private final String txt;
|
||||
|
|
|
|||
|
|
@ -836,10 +836,12 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
|||
Assert.isTrue(orderStatus == OrderStatus.YiJinChang, () -> Exceptions.clierr("当前订单状态,无法出场"));
|
||||
baseMapper.busyDriver(orderInfoEntity.getDriverId(), Boolean.FALSE);
|
||||
baseMapper.busyTruck(orderInfoEntity.getTruckId(), Boolean.FALSE);
|
||||
PaymentStatus paymentStatus = orderInfoEntity.getPaymentStatus();
|
||||
|
||||
this.updateById(new OrderInfoEntity()
|
||||
.setAutoOrder(3 ^ (i << 1))
|
||||
.setId(orderInfoEntity.getId())
|
||||
.setOrderStatus(OrderStatus.YiChuChang)
|
||||
.setOrderStatus(paymentStatus == PaymentStatus.WeiZhiFu ? OrderStatus.YiChuChang : OrderStatus.YiWanCheng)
|
||||
);
|
||||
OrderCategory orderCategory = orderInfoEntity.getOrderCategory();
|
||||
// 计算本单净重(或结算重量),作为结算时的数量依据
|
||||
|
|
|
|||
Loading…
Reference in New Issue