Commit cf0ca276 authored by lanbaoming's avatar lanbaoming

2024-06-13-3提交发布

parent 8d6eed28
......@@ -39,7 +39,8 @@ public class BpmCreateServiceFactoryImpl implements BpmCreateServiceFactory {
if (StrUtil.isNotBlank(businessNo)) {
processInstanceVariables.put("businessNo", businessNo);
}
String processInstanceId = processInstanceApi.createProcessInstance(userId, new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(workFlowKey).setVariables(processInstanceVariables).setBusinessKey(String.valueOf(orderFormId)).setCopyUserIds(copyUserId));
String processInstanceId = processInstanceApi.createProcessInstance(userId,
new BpmProcessInstanceCreateReqDTO().setProcessDefinitionKey(workFlowKey).setVariables(processInstanceVariables).setBusinessKey(String.valueOf(orderFormId)).setCopyUserIds(copyUserId));
return processInstanceId;
}
......
......@@ -126,7 +126,8 @@ public class BpmProcessInstanceServiceImpl implements BpmProcessInstanceService
@Override
@Transactional(rollbackFor = Exception.class)
public String createProcessInstance(Long userId, @Valid BpmProcessInstanceCreateReqVO createReqVO) {
public String createProcessInstance(Long userId,
@Valid BpmProcessInstanceCreateReqVO createReqVO) {
// 获得流程定义
ProcessDefinition definition = processDefinitionService.getProcessDefinition(createReqVO.getProcessDefinitionId());
// 发起流程
......
......@@ -2226,7 +2226,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 没有待处理的清关费未报价异常,则需要生成
//生成清关费异常 lanbm 2024-06-06 添加参数type=6,是处理价格异常
noQuoteOrAutomaticNoQuote =
this.createClearanceFeeNoQuiteException(orderDO,
this.createClearanceFeeNoQuiteException(
orderDO,
noQuoteOrAutomaticNoQuote,
orderItemDO, type);
// 这里可能因为自动处理未报价异常(包括未报价清关费异常)时,
......@@ -2607,17 +2608,22 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 查询是否有重量超限异常,如果有则不生成清关费异常
// TODO 查询是否有重量超限异常和渠道包装重量超限异常,如果有则不生成清关费异常
List<OrderExceptionDO> goodsOverweightExceptionDOList =
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKeys(orderDO.getOrderId(),
orderExceptionService.getPendingOrderExceptionByOrderIdAndOrderItemIdAndProdIdAndExceptionKeys(
orderDO.getOrderId(),
null,
orderItemDO.getProdId(),
CollectionUtil.newArrayList(OrderExceptionEnum.GOODS_OVERWEIGHT_EXCEPTION.getKey(), OrderExceptionEnum.LINE_WEIGHT_EXCEPTION.getKey()));
CollectionUtil.newArrayList(
OrderExceptionEnum.GOODS_OVERWEIGHT_EXCEPTION.getKey(),
OrderExceptionEnum.LINE_WEIGHT_EXCEPTION.getKey()));
/*
String s = "type=" + type.toString() + " TransportId=" +
orderDO.getTransportId().toString() +
" NeedOrderInquiry=" + orderItemDO.getNeedOrderInquiry().toString();
//lanbm 2024-06-06 添加的逻辑点
//空运,单询价
if (orderDO.getTransportId() == 3
&& orderItemDO.getNeedOrderInquiry() == 1) {
......@@ -2629,7 +2635,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
OrderExceptionEnum.CUSTOMS_FEE_NOT_QUOTE_EXCEPTION.getKey());
if (CollectionUtil.isNotEmpty(orderClearanceFeeNoQuoteExceptionDOList)) {
// 当其他业务补充了品名空运清关费价格后,如果还有待处理的清关费未报价异常,需要同步处理掉
// 当其他业务补充了品名空运清关费价格后,
// 如果还有待处理的清关费未报价异常,需要同步处理掉
orderExceptionService.autoProcessException(orderDO.getOrderId(),
orderItemDO.getOrderItemId(),
OrderExceptionEnum.CUSTOMS_FEE_NOT_QUOTE_EXCEPTION,
......@@ -2648,6 +2655,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
zTest z = new zTest();
z.setTestname(s);
z.setCreatedate(new Date());
zTestMapper.insert(z);
}*/
//end lanbm 2024-06-06 添加的逻辑点
......@@ -2662,6 +2670,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderItemDO.getOrderItemId(),
OrderExceptionEnum.CUSTOMS_FEE_NOT_QUOTE_EXCEPTION.getKey());
//运费加清关价才生成清关费异常 lanbm 2024-06-06 添加注释
//计费方式:0 运费/清关费 1 全包价
if (orderItemDO.getCharging() == 0 &&
(Objects.isNull(orderItemDO.getOriginalClearanceFreight()) ||
orderItemDO.getOriginalClearanceFreight().compareTo(BigDecimal.ZERO) == 0)
......@@ -2707,6 +2716,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
}
return noQuoteOrAutomaticNoQuote;
}
private void createFeeChangeException(OrderDO orderDO, Integer type, BigDecimal oldFreightAndClearanceFee, BigDecimal newFreightAndClearanceFee) {
......
......@@ -169,8 +169,6 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
private ApplicationContext applicationContext;
@Override
@Transactional(rollbackFor = Exception.class)
public Long createOrderException(OrderExceptionCreateReqVO createReqVO) {
......@@ -502,7 +500,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
@Override
public List<OrderExceptionDO> getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(Long orderId, Long orderItemId, String exceptionKey) {
return orderExceptionMapper.selectList(new LambdaQueryWrapper<OrderExceptionDO>().in(OrderExceptionDO::getOrderExceptionStatus, 0, 1).eq(Objects.nonNull(orderId), OrderExceptionDO::getOrderId, orderId).eq(Objects.nonNull(orderItemId), OrderExceptionDO::getOrderItemId, orderItemId).eq(StringUtils.isNotBlank(exceptionKey), OrderExceptionDO::getOrderExceptionType, exceptionKey));
return orderExceptionMapper.selectList(
new LambdaQueryWrapper<OrderExceptionDO>().
in(OrderExceptionDO::getOrderExceptionStatus, 0, 1).
eq(Objects.nonNull(orderId), OrderExceptionDO::getOrderId, orderId).
eq(Objects.nonNull(orderItemId), OrderExceptionDO::getOrderItemId, orderItemId).
eq(StringUtils.isNotBlank(exceptionKey), OrderExceptionDO::getOrderExceptionType, exceptionKey));
}
@Override
......@@ -1381,8 +1384,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
orderBusinessService.addOrderOperateLog(orderExceptionDO.getOrderId(), "", "处理" + orderExceptionEnum.getZhValueDesc(), applyInfoVOList);
}
// 如果是处理未设置渠道的异常,需要在处理完异常后再调用订单处理业务,否则订单会判断你渠道异常存在,不会去生成未报价与清关费未报价异常
if ((orderExceptionDO.getOrderExceptionType() + "_result").equals(OrderExceptionResult.CHANNEL_EXCEPTION_RESULT.KEY)){
if (vo.getOrderExceptionHandlerResult().equals(OrderExceptionResult.CHANNEL_EXCEPTION_RESULT.SET_SHIPMENT_CHANNEL)){
if ((orderExceptionDO.getOrderExceptionType() + "_result").equals(OrderExceptionResult.CHANNEL_EXCEPTION_RESULT.KEY)) {
if (vo.getOrderExceptionHandlerResult().equals(OrderExceptionResult.CHANNEL_EXCEPTION_RESULT.SET_SHIPMENT_CHANNEL)) {
orderBusinessService.handleOrderChannelException(orderExceptionDO.getOrderId(), vo.getChannelId());
}
}
......@@ -1614,7 +1617,7 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
String.format("更新商品价格路线重量上限为[%s]后,系统自动处理", airWeightLimitNew == null ? "空" : airWeightLimitNew), true);
}
}
});
});
}
/**
......@@ -2632,7 +2635,11 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
boolean isSystemAutoProcess) {
List<OrderExceptionDO> pendHeavyExceptionList =
this.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderId, orderItemId, orderExceptionEnum.getKey());
this.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(
orderId,
orderItemId,
orderExceptionEnum.getKey());
if (CollectionUtil.isNotEmpty(pendHeavyExceptionList)) {
for (OrderExceptionDO orderExceptionDO : pendHeavyExceptionList) {
// 自动处理 只处理待处理的。 处理中的不需要了
......@@ -2662,7 +2669,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
orderExceptionResultHandlerVo.setSystemAutoProcess(isSystemAutoProcess);
orderExceptionResultHandlerVo.setOrderExceptionHandlerResult(orderExceptionHandlerResult);
orderExceptionResultHandlerVo.setOrderExceptionHandlerRemark(StrUtil.isBlank(remark) ? "系统自动处理" : remark);
orderExceptionResultHandlerVo.setOrderExceptionHandlerRemark(
StrUtil.isBlank(remark) ? "系统自动处理" : remark);
//自动处理时设置处理人为admin
orderExceptionResultHandlerVo.setHandlerId(adminId);
//工作流处理
......
......@@ -218,7 +218,8 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
if (null != createReqVO.getNeedBackend() && createReqVO.getNeedBackend()) {
OrderDO orderDo = orderService.getById(createReqVO.getOrderId());
OrderObjectiveDO orderObjectiveDO = orderObjectiveService.getByOrderId(orderDo.getOrderId());
OrderObjectiveDO orderObjectiveDO =
orderObjectiveService.getByOrderId(orderDo.getOrderId());
/*BoxDO box = boxService.getBox(shipmentId);
......@@ -263,6 +264,9 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
OrderDO orderDO =
orderService.selectOne(OrderDO::getOrderId,
createReqVO.getOrderId());
//创建审批流
/* lanbm 2024-06-13 不创建审批流程
String bpmProcessId =
bpmCreateServiceFactory.createBmp(
SecurityFrameworkUtils.getLoginUserId(),
......@@ -270,8 +274,9 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
WorkFlowEmus.SHIPMENT_BILL_LADING.getKey(),
orderDO.getOrderNo(),
createReqVO.getCopyUserId());
makeBillOfLading.setBpmProcessId(bpmProcessId);
*/
//lanbm 2024-05-24 修改为自动审批通过
//ecw_make_bill_of_lading
/*
......
......@@ -87,6 +87,7 @@ public class MakeBillOfLadingController {
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:create')")
public CommonResult<Long> createMakeBillOfLading(@Valid @RequestBody MakeBillOfLadingCreateReqVO createReqVO) {
//lanbm 2024-05-24 修改此函数,取消审批流程
//lanbm 2024-06-13 取消流程的发起
//ecw_make_bill_of_lading 提单
String redisKey = MessageFormat.format(BOX_MAKE_LADING_KEY, createReqVO.getOrderId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
......
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