|
@@ -347,8 +347,6 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
.setConfirmInputTime(new Date())
|
|
|
.setConfirmInputBy(StpUserUtil.getAdmin().getName());
|
|
|
this.updateById(business);
|
|
|
- TbGoods tbGoods = tbGoodsService.getById(business.getGoodsId());
|
|
|
- Integer payStep = tbGoods.getPayStep();
|
|
|
List<TbBusinessCar> cars = tbBusinessCarService.findOtherBusinessCar(business.getId());
|
|
|
String carNoStr = cars.stream().map(TbBusinessCar::getCarNo).collect(Collectors.joining("、"));
|
|
|
storeMsg(business.getCustomerId(), "业务订单【" + business.getNo() + "】已确认" + DateUtil.now() + "。");
|
|
@@ -357,11 +355,13 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
items.forEach(item -> {
|
|
|
String businessType = item.getBusinessType();
|
|
|
//合作伙伴创建+是否下单后付款
|
|
|
- if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())
|
|
|
- &&TbGoods.PayStep.BEFORE_CONFIRM.getCode().equals(payStep)) {
|
|
|
+ if (!StrUtil.equals(businessType, TbCostomer.CustomerEnum.BUSINESS_TYPE.getType())) {
|
|
|
String customerId = business.getCreateByCustomerId();
|
|
|
+ List<String> customerType=new ArrayList<>();
|
|
|
TbCostomer tbCostomer = tbCostomerService.getById(customerId);
|
|
|
- List<String> customerType = StrUtil.splitTrim(tbCostomer.getType(),",");
|
|
|
+ if (tbCostomer!=null){
|
|
|
+ customerType = StrUtil.splitTrim(tbCostomer.getType(),",");
|
|
|
+ }
|
|
|
if (customerType.contains(businessType)) {
|
|
|
StaticLog.error("订单自动确认======================="+id);
|
|
|
MsgDataBO msgDataBO = new MsgDataBO("订单号:" + item.getNo(), "系统自动确认",
|
|
@@ -378,6 +378,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
wxService.sendTemplateMsg(wxConfig.getBusinessConfirmTemplate(), openId, msgDataBO, detailUrl);
|
|
|
});
|
|
|
} else {
|
|
|
+ StaticLog.error("正常流程======================="+id);
|
|
|
String remark = "车牌:";
|
|
|
String carNo = business.getCardNo();
|
|
|
String chinaCarNo = business.getChinaCarNo();
|
|
@@ -499,7 +500,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
for (TbBusinessCar tbBusinessCar : cars) {
|
|
|
Date inTime = tbBusinessCar.getRealInTime();
|
|
|
BigDecimal partMoney = new BigDecimal("0");
|
|
|
- String carNo = tbBusinessCar.getCarNo().substring(0, 1);
|
|
|
+ String carType=tbBusinessCar.getCarType();
|
|
|
+ if (StrUtil.isEmpty(carType)){
|
|
|
+ carType=TbItem.ItemTypeEnum.EMPTY_TYPE.getType();
|
|
|
+ }
|
|
|
if (inTime != null && tbBusinessCar.getRealOutTime() == null) {
|
|
|
if (tbBusinessCar.getPay() == 1 && tbBusinessCar.getPayTime() != null) {
|
|
|
inTime = tbBusinessCar.getPayTime();
|
|
@@ -516,11 +520,11 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
}
|
|
|
|
|
|
//越南车牌,是否免费
|
|
|
- if (!CAR_LIST.contains(carNo) && vietnamCarPay == 0) {
|
|
|
+ if (TbItem.ItemTypeEnum.WEIGHT_TYPE.getType().equals(carType) && vietnamCarPay == 0) {
|
|
|
partMoney = new BigDecimal("0");
|
|
|
}
|
|
|
//中国车,是否免费
|
|
|
- if (CAR_LIST.contains(carNo) && chinaCarPay == 0) {
|
|
|
+ if (TbItem.ItemTypeEnum.EMPTY_TYPE.getType().equals(carType)&& chinaCarPay == 0) {
|
|
|
partMoney = new BigDecimal("0");
|
|
|
}
|
|
|
Map<String, Object> carMap = new HashMap<>();
|
|
@@ -713,7 +717,10 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
String carBuseinssNo = DateUtil.format(now, "yyyyMMddHHmm");
|
|
|
for (TbBusinessCar car : cars) {
|
|
|
String carNo = car.getCarNo().trim().toUpperCase();
|
|
|
- String carPrefix = StrUtil.sub(carNo, 0, 1);
|
|
|
+ String carType=car.getCarType();
|
|
|
+ if (StrUtil.isEmpty(carType)){
|
|
|
+ throw new BusinessException(carNo+"类型不能为空");
|
|
|
+ }
|
|
|
List<TbBusinessCar> notOutRecords = tbBusinessCarService.findNotOutCar(carNo);
|
|
|
if (notOutRecords.size() > 1) {
|
|
|
throw new BusinessException(carNo + "有多个未出场记录,请先处理");
|
|
@@ -729,7 +736,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
checkOtherBusiness(item.getItemTypeId(), otherBusinessBO.getOperateTime(), tbBusiness.getId(), carNo);
|
|
|
}
|
|
|
db.setPayType(TbBusinessCar.PayTypeEnum.NO_PAY_TYPE.getType());
|
|
|
- if ((CAR_LIST.contains(carPrefix) && chinaCarPay == 0) || (!CAR_LIST.contains(carPrefix) && vietnamCarPay == 0)) {
|
|
|
+ if ((TbItem.ItemTypeEnum.EMPTY_TYPE.getType().equals(carType)&& chinaCarPay == 0) || (TbItem.ItemTypeEnum.WEIGHT_TYPE.getType().equals(carType)&& vietnamCarPay == 0)) {
|
|
|
db.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
|
|
|
}
|
|
|
TbCar tbCar = tbCarService.findByCardNo(carNo);
|
|
@@ -823,7 +830,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
for (TbBusinessItem item : itemList) {
|
|
|
checkOtherBusiness(item.getItemTypeId(), otherBusinessBO.getOperateTime(), dbBusiness.getId(), carNo);
|
|
|
}
|
|
|
- String carPrefix = StrUtil.sub(carNo, 0, 1);
|
|
|
+ String carType=tbBusinessCar.getCarType();
|
|
|
if (StrUtil.isNotEmpty(businessCarId)) {
|
|
|
//原来已存在的
|
|
|
TbBusinessCar dbBusinessCar = tbBusinessCarService.getById(businessCarId);
|
|
@@ -840,7 +847,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
.setCarNo(carNo).setCarType(tbBusinessCar.getCarType()).setCarSize(tbBusinessCar.getCarSize())
|
|
|
.setNetWeight(tbBusinessCar.getNetWeight()).setCustomerId(dbBusiness.getCustomerId())
|
|
|
.setTimeUpdate(now).setIsLock(0).setCarType(tbBusinessCar.getCarType());
|
|
|
- if ((CAR_LIST.contains(carPrefix) && chinaCarPay == 0) || (!CAR_LIST.contains(carPrefix) && vietnamCarPay == 0)) {
|
|
|
+ if ((TbItem.ItemTypeEnum.EMPTY_TYPE.getType().equals(carType) && chinaCarPay == 0) || (TbItem.ItemTypeEnum.WEIGHT_TYPE.getType().equals(carType) && vietnamCarPay == 0)) {
|
|
|
otherCar.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
|
|
|
}
|
|
|
tbBusinessCarService.save(otherCar);
|
|
@@ -868,7 +875,7 @@ public class TbBusinessService extends ServiceImpl<TbBusinessMapper, TbBusiness>
|
|
|
checkCar.setCarNo(carNo).setCarType(tbBusinessCar.getCarType()).setCarSize(tbBusinessCar.getCarSize())
|
|
|
.setNetWeight(tbBusinessCar.getNetWeight()).setCustomerId(dbBusiness.getCustomerId())
|
|
|
.setTimeUpdate(now).setIsLock(0).setCarType(tbBusinessCar.getCarType());
|
|
|
- if ((CAR_LIST.contains(carPrefix) && chinaCarPay == 0) || (!CAR_LIST.contains(carPrefix) && vietnamCarPay == 0)) {
|
|
|
+ if ((TbItem.ItemTypeEnum.EMPTY_TYPE.getType().equals(carType) && chinaCarPay == 0) || (TbItem.ItemTypeEnum.WEIGHT_TYPE.getType().equals(carType) && vietnamCarPay == 0)) {
|
|
|
checkCar.setPayType(TbBusinessCar.PayTypeEnum.FEE_TYPE.getType());
|
|
|
}
|
|
|
tbBusinessCarService.saveOrUpdate(checkCar);
|