Commit e23ba12e authored by lanbaoming's avatar lanbaoming

2024-06-18-2提交

parent b525c1de
...@@ -24,7 +24,11 @@ public class BmpShipmentBatchAddPriceListener extends BpmProcessInstanceResultEv ...@@ -24,7 +24,11 @@ public class BmpShipmentBatchAddPriceListener extends BpmProcessInstanceResultEv
@Override @Override
protected void onEvent(BpmProcessInstanceResultEvent event) { protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("---------------------批量加价审核回调-----------------------{},{}", event.getBusinessKey(), event.getResult()); log.info("---------------------批量加价审核回调-----------------------{},{}",
boxApprovalService.updateBoxApproveResult(WorkFlowEmus.SHIPMENT_BATCH_ADD_PRICE.getKey(), event.getBusinessKey(), event.getResult()); event.getBusinessKey(), event.getResult());
//lanbm 2024-06-18 改为空运和海运都有此逻辑点
boxApprovalService.updateBoxApproveResult(
WorkFlowEmus.SHIPMENT_BATCH_ADD_PRICE.getKey(),
event.getBusinessKey(), event.getResult());
} }
} }
...@@ -49,6 +49,7 @@ import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO; ...@@ -49,6 +49,7 @@ import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO;
import cn.iocoder.yudao.module.order.convert.orderLocation.OrderLocationConvert; import cn.iocoder.yudao.module.order.convert.orderLocation.OrderLocationConvert;
import cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO; import cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControl.OrderCargoControlDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControl.OrderCargoControlDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
...@@ -56,6 +57,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO; ...@@ -56,6 +57,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplit.OrderSplitDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderSplit.OrderSplitDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplitItem.OrderSplitItemDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderSplitItem.OrderSplitItemDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.dal.mysql.orderSplitItem.OrderSplitItemMapper; import cn.iocoder.yudao.module.order.dal.mysql.orderSplitItem.OrderSplitItemMapper;
import cn.iocoder.yudao.module.order.dto.ContainerNumberSummaryDto; import cn.iocoder.yudao.module.order.dto.ContainerNumberSummaryDto;
import cn.iocoder.yudao.module.order.dto.OrderRemindExceptionDto; import cn.iocoder.yudao.module.order.dto.OrderRemindExceptionDto;
...@@ -234,6 +236,9 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.DEPT_NOT_F ...@@ -234,6 +236,9 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.DEPT_NOT_F
@Slf4j @Slf4j
public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements BoxService { public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements BoxService {
@Resource
private ZTestMapper2 zTestMapper2;
@Resource @Resource
private BoxMapper boxMapper; private BoxMapper boxMapper;
...@@ -4951,10 +4956,21 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -4951,10 +4956,21 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
if (StringUtils.isEmpty(details)) { if (StringUtils.isEmpty(details)) {
throw new ServiceException(500, "加价详情不能为空"); throw new ServiceException(500, "加价详情不能为空");
} }
BoxOrderMarkUpVO boxOrderMarkUpVO = JSON.parseObject(details, BoxOrderMarkUpVO.class); BoxOrderMarkUpVO boxOrderMarkUpVO =
orderBusinessService.handleAirOrderBatchMarkup(boxOrderMarkUpVO.getOrderIds(), boxOrderMarkUpVO.getFreightFee(), JSON.parseObject(details, BoxOrderMarkUpVO.class);
boxOrderMarkUpVO.getFreightCurrencyId(), boxOrderMarkUpVO.getFreightUnitId(),
boxOrderMarkUpVO.getClearanceFee(), boxOrderMarkUpVO.getClearanceCurrencyId(), zTest z=new zTest();
z.setTestname("开始调用 handleAirOrderBatchMarkup");
z.setCreatedate(new Date());
zTestMapper2.insert(z);
orderBusinessService.handleAirOrderBatchMarkup(
boxOrderMarkUpVO.getOrderIds(),
boxOrderMarkUpVO.getFreightFee(),
boxOrderMarkUpVO.getFreightCurrencyId(),
boxOrderMarkUpVO.getFreightUnitId(),
boxOrderMarkUpVO.getClearanceFee(),
boxOrderMarkUpVO.getClearanceCurrencyId(),
boxOrderMarkUpVO.getClearanceUnitId()); boxOrderMarkUpVO.getClearanceUnitId());
} }
...@@ -4973,7 +4989,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -4973,7 +4989,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
@Override @Override
public void checkIsInClearance(Long shipmentId, Long orderId) { public void checkIsInClearance(Long shipmentId, Long orderId) {
BoxClearanceOrderDO clearanceOrderDO = boxClearanceOrderService.getOne(new LambdaQueryWrapper<BoxClearanceOrderDO>() BoxClearanceOrderDO clearanceOrderDO =
boxClearanceOrderService.getOne(new LambdaQueryWrapper<BoxClearanceOrderDO>()
.eq(BoxClearanceOrderDO::getShipmentId, shipmentId) .eq(BoxClearanceOrderDO::getShipmentId, shipmentId)
.eq(BoxClearanceOrderDO::getOrderId, orderId) .eq(BoxClearanceOrderDO::getOrderId, orderId)
); );
...@@ -5001,20 +5018,28 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements ...@@ -5001,20 +5018,28 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
@Override @Override
public void checkOrderPayStatus(Collection<Long> orderIds) { public void checkOrderPayStatus(Collection<Long> orderIds) {
if (CollectionUtil.isEmpty(orderIds)) return; if (CollectionUtil.isEmpty(orderIds)) return;
List<ReceivableDO> receivableList = receivableService.getOrderPayList(orderIds); List<ReceivableDO> receivableList =
List<OrderDO> orderList = orderQueryService.getOrderList(orderIds); receivableService.getOrderPayList(orderIds);
List<OrderDO> orderList =
orderQueryService.getOrderList(orderIds);
Map<Long, OrderDO> orderMap = orderList.stream() Map<Long, OrderDO> orderMap = orderList.stream()
.collect(Collectors.toMap(OrderDO::getOrderId, v -> v)); .collect(Collectors.toMap(OrderDO::getOrderId, v -> v));
List<String> payOrderNoList = new ArrayList<>(); List<String> payOrderNoList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(receivableList)) { if (CollectionUtil.isNotEmpty(receivableList)) {
Map<Long, List<ReceivableDO>> receivableMap = receivableList.stream() Map<Long, List<ReceivableDO>> receivableMap = receivableList.stream()
.collect(Collectors.groupingBy(ReceivableDO::getOrderId)); .collect(Collectors.groupingBy(ReceivableDO::getOrderId));
for (Map.Entry<Long, List<ReceivableDO>> entry : receivableMap.entrySet()) {
for (Map.Entry<Long,
List<ReceivableDO>> entry : receivableMap.entrySet()) {
Long orderId = entry.getKey(); Long orderId = entry.getKey();
OrderDO orderDO = orderMap.get(orderId); OrderDO orderDO = orderMap.get(orderId);
payOrderNoList.add(orderDO.getOrderNo()); payOrderNoList.add(orderDO.getOrderNo());
} }
throw new ServiceException(500, Joiner.on(",").join(payOrderNoList) + "已预付核销,不允许修改价格"); throw new ServiceException(500,
Joiner.on(",").join(payOrderNoList) + "已预付核销,不允许修改价格");
} }
} }
......
...@@ -15,8 +15,10 @@ import cn.iocoder.yudao.module.bpm.resp.TaskResp; ...@@ -15,8 +15,10 @@ import cn.iocoder.yudao.module.bpm.resp.TaskResp;
import cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService; import cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService;
import cn.iocoder.yudao.module.ecw.vo.internalMessage.InternalMessageCreateReqVO; import cn.iocoder.yudao.module.ecw.vo.internalMessage.InternalMessageCreateReqVO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplitItem.OrderSplitItemDO; import cn.iocoder.yudao.module.order.dal.dataobject.orderSplitItem.OrderSplitItemDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.enums.*; import cn.iocoder.yudao.module.order.enums.*;
import cn.iocoder.yudao.module.order.service.targetLog.TargetLogService; import cn.iocoder.yudao.module.order.service.targetLog.TargetLogService;
import cn.iocoder.yudao.module.order.vo.order.CostVO; import cn.iocoder.yudao.module.order.vo.order.CostVO;
...@@ -74,6 +76,9 @@ import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*; ...@@ -74,6 +76,9 @@ import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*;
@Validated @Validated
public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, BoxApprovalDO> implements BoxApprovalService { public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, BoxApprovalDO> implements BoxApprovalService {
@Resource
private ZTestMapper2 zTestMapper2;
@Resource @Resource
private BoxApprovalMapper boxApprovalMapper; private BoxApprovalMapper boxApprovalMapper;
@Resource @Resource
...@@ -604,10 +609,14 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -604,10 +609,14 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void updateBoxApproveResult(String flowKey, String id, int result) { public void updateBoxApproveResult(String flowKey,
String id,
int result) {
BoxApprovalDO boxApprovalDO = boxApprovalMapper.selectById(id); BoxApprovalDO boxApprovalDO = boxApprovalMapper.selectById(id);
TaskResp taskResp = bpmCreateServiceFactory.getLastTaskByProcessInstanceId(boxApprovalDO.getBpmProcessId()); TaskResp taskResp =
bpmCreateServiceFactory.getLastTaskByProcessInstanceId(boxApprovalDO.getBpmProcessId());
Long shipmentId = boxApprovalDO.getShipmentId(); Long shipmentId = boxApprovalDO.getShipmentId();
BoxDO boxDO = boxService.getBox(shipmentId); BoxDO boxDO = boxService.getBox(shipmentId);
...@@ -1145,9 +1154,27 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B ...@@ -1145,9 +1154,27 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
//======================批量加价格======================= //======================批量加价格=======================
case SHIPMENT_BATCH_ADD_PRICE: case SHIPMENT_BATCH_ADD_PRICE:
//批量加价格 //批量加价格
//lanbm 2024-06-18 添加注释 是给自编号下的订单加价
if (result == BpmProcessInstanceResultEnum.APPROVE.getResult()) { if (result == BpmProcessInstanceResultEnum.APPROVE.getResult()) {
String details = boxApprovalDO.getDetails(); String details = boxApprovalDO.getDetails();
BoxOrderMarkUpVO boxOrderMarkUpVO = JSON.parseObject(details, BoxOrderMarkUpVO.class); BoxOrderMarkUpVO boxOrderMarkUpVO =
JSON.parseObject(details, BoxOrderMarkUpVO.class);
if(boxOrderMarkUpVO.getOrderIds()!=null)
{
String s=String.valueOf(boxOrderMarkUpVO.getOrderIds());
zTest z=new zTest();
z.setTestname("订单id,"+s);
z.setCreatedate(new Date());
zTestMapper2.insert(z);
}
else
{
String s=String.valueOf(boxOrderMarkUpVO.getOrderIds());
zTest z=new zTest();
z.setTestname("批量加价申报批,订单id为空");
z.setCreatedate(new Date());
zTestMapper2.insert(z);
}
boxService.checkOrderPayStatus(boxOrderMarkUpVO.getOrderIds()); boxService.checkOrderPayStatus(boxOrderMarkUpVO.getOrderIds());
boxService.batchAddPriceSuccess(shipmentId, details); boxService.batchAddPriceSuccess(shipmentId, details);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment