Commit 96e27c3b authored by lanbaoming's avatar lanbaoming

2024-06-04

parent c03e4afa
......@@ -112,6 +112,9 @@ public class CustomerUpdateReqVO extends CustomerBaseVO {
private String remarks;
/*
lanbm 2024-06-03 处理开启到仓确认,就报发货人异常的BUG
*/
@ApiModelProperty(value = "到仓确认")
private Integer arrivalConfirm;
......
......@@ -204,9 +204,13 @@ public class CustomerController {
@ApiOperation("更新客户")
@PreAuthorize("@ss.hasAnyPermissions('ecw:customer:update', 'ecw:customer:dep-update', 'ecw:customer:my-update', 'ecw:customer:distribution-update')")
@Idempotent(timeout = 5)
public CommonResult<Boolean> updateCustomer(@Valid @RequestBody CustomerUpdateReqVO updateReqVO) {
public CommonResult<Boolean> updateCustomer(
@Valid @RequestBody CustomerUpdateReqVO updateReqVO) {
List<CustomerContactsUpdateReqVO> customerContacts = updateReqVO.getCustomerContacts();
//SELECT arrival_confirm from ecw_customer 到仓确认
List<CustomerContactsUpdateReqVO> customerContacts =
updateReqVO.getCustomerContacts();
if (!CollectionUtils.isEmpty(customerContacts)) {
long count = customerContacts.stream().filter(t -> CustomerContactsDefaultEnum.IS_DEFAULT.getValue().equals(t.getIsDefault())).count();
if (count <= 0) {
......
......@@ -64,6 +64,8 @@ public class EcwVzController {
private final String HYPG = "海运拼柜";
private final String ZXKY = "专线空运";
/**
* 新增数据
*
......
......@@ -166,4 +166,16 @@ public class WarehouseDO extends BaseDO implements Serializable {
@TableField(exist = false)
private String tempTitleZh;
/*
仓库免租期,单位为天数
*/
private int rentFreeDays;
/*
锁定收货人天数
*/
private int lockRecipientDays;
}
......@@ -81,4 +81,17 @@ public class WarehouseBaseVO {
@ApiModelProperty(value = "会员控货下单要求")
private String kycStatus;
/*
仓库免租期,单位为天数
*/
@ApiModelProperty(value = "仓库免租期")
private int rentFreeDays;
/*
锁定收货人天数
*/
@ApiModelProperty(value = "锁定收货人天数")
private int lockRecipientDays;
}
......@@ -2,12 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.depository.dal.mysql.warehouse.WarehouseLineMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<resultMap id="warehouseLineEntity" type="cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseLineDO">
<!-- <result property="id" column="id" />-->
......
......@@ -2,6 +2,10 @@ package cn.iocoder.yudao.module.order.enums;
import lombok.Getter;
/*
订单异常枚举类型
lanbm 2024-06-03 添加注释
*/
@Getter
public enum OrderExceptionEnum {
ORDER_NO_QUOTE_EXCEPTION("order_no_quote_exception", "未报价异常", "no quote"),
......@@ -34,6 +38,7 @@ public enum OrderExceptionEnum {
GOODS_OVERWEIGHT_EXCEPTION("overweight_exception", "商品重量超限异常", "overweight exception"),
CHANNEL_PACKAGING_OVERWEIGHT_EXCEPTION("channel_packaging_overweight_exception", "渠道包装重量超限异常", "channel packaging overweight exception"),
//不可出渠道异常,lanbm 2024-06-03 处理异常添加注释
NOT_SHIPPING_CHANNEL_EXCEPTION("not_shipping_channel_exception", "不可出渠道异常", "not shipping channel exception"),
GOODS_WEIGHT_EXCEPTION("goods_weight_exception", "货物重量异常", "goods weight exception"),
......
......@@ -217,7 +217,8 @@ public class OrderAirServiceImpl extends AbstractService<OrderMapper, OrderDO> i
@Override
public void inspectWarehouseInOrderChannelNoCan(QueryChannelInfoEvent event) {
// 获取已入仓的渠道相关空运订单
List<OrderDO> orderDOList = orderService.selectList(new LambdaQueryWrapper<OrderDO>()
List<OrderDO> orderDOList = orderService.selectList(
new LambdaQueryWrapper<OrderDO>()
.eq(OrderDO::getStatus, OrderStatusEnum.IN_WAREHOUSE.getValue())
.eq(OrderDO::getTransportId, TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())
.eq(OrderDO::getChannelId, event.getChannelId()));
......@@ -226,7 +227,10 @@ public class OrderAirServiceImpl extends AbstractService<OrderMapper, OrderDO> i
// 检查订单的不可出特性渠道异常情况,如果有则判断是否自动处理,如果没有则判断是否生成
// 更新完订单所有计价信息后,对未报价的订单项去生成未报价异常(待确认商品不予生成未报价异常)
// 只对非拆单子订单进行校验
if (Objects.isNull(orderDO.getParentOrderId()) || orderDO.getParentOrderId() == 0 || orderDO.getSplitSeparateOrder()) {
if (Objects.isNull(orderDO.getParentOrderId()) ||
orderDO.getParentOrderId() == 0 ||
orderDO.getSplitSeparateOrder()) {
orderBusinessService.addOrderOperateLog(orderDO.getOrderId(), "订单操作", "渠道特性修改自动检查订单不可出渠道特性", "");
List<OrderItemDO> orderItemDOList = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>().eq(OrderItemDO::getOrderId, orderDO.getOrderId()));
// 查询待处理的不可出渠道异常
......
......@@ -170,7 +170,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
@Override
@Transactional(rollbackFor = Exception.class)
public Long createOrderException(OrderExceptionCreateReqVO createReqVO) {
OrderAbnormalStateEnum abnormal = OrderAbnormalStateEnum.keyOf(createReqVO.getOrderExceptionType());
OrderAbnormalStateEnum abnormal =
OrderAbnormalStateEnum.keyOf(createReqVO.getOrderExceptionType());
if (null == abnormal) {
throw exception(ORDER_EXCEPTION_NOT_EXISTS);
}
......@@ -230,7 +231,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
}
if (mustToInsert) {
OrderExceptionDO orderException = OrderExceptionConvert.INSTANCE.convert(createReqVO);
OrderExceptionDO orderException =
OrderExceptionConvert.INSTANCE.convert(createReqVO);
orderException.setOrderExceptionRemark(JSONObject.toJSONString(createReqVO.getOrderExceptionDescVO()));
orderExceptionMapper.insert(orderException);
resultId = orderException.getId();
......@@ -553,7 +555,8 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
@Transactional(rollbackFor = Exception.class)
public void handlerExceptionByExceptionId(OrderExceptionResultHandlerVo vo) {
OrderExceptionDO orderExceptionDO = this.getById(vo.getOrderExceptionId());
OrderExceptionDO orderExceptionDO =
this.getById(vo.getOrderExceptionId());
if (null == orderExceptionDO) {
throw exception(ORDER_EXCEPTION_RESULT_NOT_EXISTS);
}
......@@ -600,6 +603,7 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
List<ApplyInfoVO> applyInfoVOList = new ArrayList<>();
orderExceptionResultService.save(orderExceptionResult);
if ((orderExceptionDO.getOrderExceptionType() + "_result").equals(OrderExceptionResult.ORDER_COD_EXCEPTION_RESULT.KEY)) {
//代收货款
if (vo.getOrderExceptionHandlerResult().equals(OrderExceptionResult.ORDER_COD_EXCEPTION_RESULT.COD)) {
......@@ -2616,26 +2620,39 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
@Override
public void autoProcessException(Long orderId, Long orderItemId, OrderExceptionEnum orderExceptionEnum, String remark, String orderExceptionHandlerResult, boolean isSystemAutoProcess) {
List<OrderExceptionDO> pendHeavyExceptionList = this.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderId, orderItemId, orderExceptionEnum.getKey());
public void autoProcessException(Long orderId,
Long orderItemId,
OrderExceptionEnum orderExceptionEnum,
String remark,
String orderExceptionHandlerResult,
boolean isSystemAutoProcess) {
List<OrderExceptionDO> pendHeavyExceptionList =
this.getPendingOrderExceptionByOrderIdAndOrderItemIdAndExceptionKey(orderId, orderItemId, orderExceptionEnum.getKey());
if (CollectionUtil.isNotEmpty(pendHeavyExceptionList)) {
for (OrderExceptionDO orderExceptionDO : pendHeavyExceptionList) {
// 自动处理 只处理待处理的。 处理中的不需要了
if (orderExceptionDO.getOrderExceptionStatus() == 0) {
autoProcessExceptionDo(orderExceptionDO, orderExceptionHandlerResult, remark, isSystemAutoProcess);
autoProcessExceptionDo(orderExceptionDO,
orderExceptionHandlerResult,
remark, isSystemAutoProcess);
}
}
}
}
private void autoProcessExceptionDo(OrderExceptionDO orderExceptionDO, String orderExceptionHandlerResult, String remark, boolean isSystemAutoProcess) {
private void autoProcessExceptionDo(OrderExceptionDO orderExceptionDO,
String orderExceptionHandlerResult,
String remark,
boolean isSystemAutoProcess) {
//默认admin
Long adminId = 1l;
if (!isSystemAutoProcess) {
adminId = SecurityFrameworkUtils.getLoginUserId();
}
OrderExceptionResultHandlerVo orderExceptionResultHandlerVo = new OrderExceptionResultHandlerVo();
OrderExceptionResultHandlerVo orderExceptionResultHandlerVo =
new OrderExceptionResultHandlerVo();
orderExceptionResultHandlerVo.setSource("pc");
orderExceptionResultHandlerVo.setOrderExceptionId(orderExceptionDO.getId());
orderExceptionResultHandlerVo.setSystemAutoProcess(isSystemAutoProcess);
......
......@@ -70,6 +70,9 @@ public class OrderExceptionChannelPriceController {
return success(OrderExceptionChannelPriceConvert.INSTANCE.convert(exceptionChannelPrice));
}
/*
getOrderExceptionChannelPriceList
*/
@PostMapping("/getOrderExceptionChannelPriceList")
@ApiOperation("根据订单ID,异常ID获取价格")
public CommonResult<List<OrderExceptionChannelPriceBackVO>> getOrderExceptionChannelPriceList(@Valid @RequestBody OrderExceptionChannelPriceQueryVO queryVO) {
......@@ -77,7 +80,8 @@ public class OrderExceptionChannelPriceController {
queryWrapper.eq(OrderExceptionChannelPriceDO::getOrderId, queryVO.getOrderId());
queryWrapper.eq(OrderExceptionChannelPriceDO::getExceptionId, queryVO.getExceptionId());
queryWrapper.eq(OrderExceptionChannelPriceDO::getExceptionResultId, queryVO.getExceptionResultId());
List<OrderExceptionChannelPriceDO> exceptionChannelPrice = exceptionChannelPriceService.list(queryWrapper);
List<OrderExceptionChannelPriceDO> exceptionChannelPrice =
exceptionChannelPriceService.list(queryWrapper);
return success(OrderExceptionChannelPriceConvert.INSTANCE.convertList(exceptionChannelPrice));
}
......
......@@ -102,7 +102,9 @@ public class OrderExceptionController {
return success(orderExceptionService.statisticsOrder(query));
}
/*
根据订单ID获取订单异常处理记录 lanbm 2024-06-04 添加注释
*/
@GetMapping("/getExceptionListByOrderId")
@ApiOperation("根据订单ID获取所有的订单异常列表")
@ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataTypeClass = Long.class)
......
......@@ -75,6 +75,9 @@ public class OrderWarehouseInController {
/*
创建入仓,保存入仓记录 lanbm 2024-05-28 添加注释
渠道,关联可出商品属性
SELECT * from ecw_channel
SELECT * from ecw_product_attr
*/
@PostMapping("/create")
@ApiOperation("入仓/追加")
......@@ -130,7 +133,9 @@ public class OrderWarehouseInController {
@PostMapping("/finish")
@ApiOperation("入仓完成/转异")
@Idempotent(timeout = 5)
public CommonResult<Boolean> finishWarehouseIn(@Valid @RequestBody OrderWarehouseInFinishReqVO finishReqVO) {
public CommonResult<Boolean> finishWarehouseIn(
@Valid @RequestBody OrderWarehouseInFinishReqVO finishReqVO) {
//lanbm 2024-05-26 在此处添加注释
String redisKey = MessageFormat.format(ORDER_FINISH_WAREHOUSE_IN_KEY,
finishReqVO.getOrderId().toString());
......@@ -140,6 +145,7 @@ public class OrderWarehouseInController {
}
boolean hasException = false;
try {
//完成入仓
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
hasException = orderWarehouseInService.finishWarehouseIn(finishReqVO);
......
......@@ -126,7 +126,7 @@ public class MyOrderController {
@PostMapping("/create")
@DynamicRateLimiter(base = "#Headers['Authorization']", permits = 1)
@ApiOperation(value = "创建订单", notes = "发货人只取当前用户信息,收货人取当前用户的客户信息")
@Idempotent(timeout = 5)
@Idempotent(timeout = 15)
@PreAuthenticated
public CommonResult<Long> createOrder(@Valid @RequestBody OrderCreateReqVO createReqVO) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
......
......@@ -41,19 +41,39 @@ public class ProdLinePriceController {
*/
@PostMapping("/calculation")
@ApiOperation("计算单种运输方式的商品费用(单个商品也做数组传参)")
public CommonResult<CalculationCostResultDto> calculationProdCost(@RequestBody ConditionParam param) {
if (CollectionUtil.isEmpty(param.getProdConditionParamList())){
public CommonResult<CalculationCostResultDto> calculationProdCost(
@RequestBody ConditionParam param) {
if (CollectionUtil.isEmpty(param.getProdConditionParamList())) {
return error(ORDER_ITEM_PROD_NOT_EXISTS);
}
// 前端实时计价时需要将订单的固定价格参数进行格式化,转为未定价,否则不会去查询当前实时价格
param.setProdConditionParamList(param.getProdConditionParamList().stream().peek(it->it.setIsPriced(false)).collect(Collectors.toList()));
List<ProdConditionParam> prodConditionParams = prodCostCalculation.obtainProdLineOnePrice(param.getProdConditionParamList(), "",
Objects.nonNull(param.getCustomsType()) ? param.getCustomsType() : 1, param.getCustomerId(),
param.getTransportId(), param.getLineId(), param.getChannelId(), false);
CalculationCostResultDto dto = prodCostCalculation.calculationProdCost(prodConditionParams, "",
param.getOrderType(), Objects.nonNull(param.getCustomsType()) ? param.getCustomsType() : 1, Objects.nonNull(param.getIsCargoControl()) && param.getIsCargoControl() ? 1 : 0,
param.getUserId(), param.getCustomerId(), param.getConsignorCustomerId(), param.getConsigneeCustomerId(),
param.getConsignorCustomerContactsId(), param.getConsigneeCustomerContactsId(), param.getTransportId(), param.getLineId(), param.getChannelId());
param.setProdConditionParamList(param.getProdConditionParamList().stream().peek(it -> it.setIsPriced(false)).collect(Collectors.toList()));
List<ProdConditionParam> prodConditionParams =
prodCostCalculation.obtainProdLineOnePrice(
param.getProdConditionParamList(),
"",
Objects.nonNull(param.getCustomsType()) ? param.getCustomsType() : 1,
param.getCustomerId(),
param.getTransportId(),
param.getLineId(),
param.getChannelId(),
false);
CalculationCostResultDto dto =
prodCostCalculation.calculationProdCost(prodConditionParams,
"",
param.getOrderType(),
Objects.nonNull(param.getCustomsType()) ? param.getCustomsType() : 1,
Objects.nonNull(param.getIsCargoControl()) && param.getIsCargoControl() ? 1 : 0,
param.getUserId(),
param.getCustomerId(),
param.getConsignorCustomerId(),
param.getConsigneeCustomerId(),
param.getConsignorCustomerContactsId(),
param.getConsigneeCustomerContactsId(),
param.getTransportId(),
param.getLineId(),
param.getChannelId());
return success(dto);
}
......
package cn.iocoder.yudao.module.shipment.dal.dataobject;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
/**
* 费用登记 DO
*
......@@ -56,6 +59,7 @@ public class BoxCostDO extends BaseDO {
/*
费用产生时间 lanbm 2024-05-17 add
*/
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date freecsdate;
}
......@@ -46,4 +46,6 @@ public interface MakeBillOfLadingMapper extends AbstractMapper<MakeBillOfLadingD
}
MakeBillOfLadingListBackVO getLadingBillOrderInfo(Long orderId);
String getBpmStatus(String process_instance_id);
}
......@@ -15,6 +15,11 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
*/
public interface MakeBillOfLadingService extends IService<MakeBillOfLadingDO> {
/*
获取提单审批状态 lanbm 2024-06-04 add
*/
String getBpmStatus(String process_instance_id);
/**
* 创建制作提货单
* @param createReqVO 创建信息
......
......@@ -173,6 +173,13 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
@Resource
private CurrencyApi currencyApi;
/*
获取提单审批状态 lanbm 2024-06-04 add
*/
public String getBpmStatus(String process_instance_id) {
return makeBillOfLadingMapper.getBpmStatus(process_instance_id);
}
@SneakyThrows
@Override
@Transactional(rollbackFor = Exception.class)
......
......@@ -92,4 +92,17 @@ public class BoxCostBackVO {
private String updater;
/*
应付款,关联的付款单 lanbm 2024-06-03 add
*/
private String paymentId;
/*
费用产生时间 lanbm 2024-05-17 add
*/
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
private Date freecsdate;
}
......@@ -38,6 +38,11 @@ public class MakeBillOfLadingBackVO {
@ApiModelProperty(value = "流程实例ID")
private String bpmProcessId;
/*
审批状态 lanbm 2024-05-04 add
*/
private String bpmStatus;
@ApiModelProperty(value = "提货单pdfURL")
private String imgUrl;
......
......@@ -2,12 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.shipment.dal.mysql.makeBillOfLading.MakeBillOfLadingMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="getBpmStatus" resultType="java.lang.String">
SELECT status from bpm_process_instance_ext
where deleted=0 and process_instance_id=#{process_instance_id}
</select>
<select id="getLadingBillOrderInfo" parameterType="java.lang.Long" resultType="cn.iocoder.yudao.module.shipment.vo.makeBillOfLading.MakeBillOfLadingListBackVO">
SELECT distinct
......
......@@ -71,7 +71,7 @@ public class BoxCostController {
//@PreAuthorize("@ss.hasPermission('ecw:box-cost:create')")
public CommonResult<Long> createBoxCost(@Valid @RequestBody BoxCostCreateReqVO createReqVO) {
//lanbm 2024-05-17 添加费用产生日期字段
String s="";
String s = "";
return success(boxCostService.createBoxCost(createReqVO));
}
......@@ -80,7 +80,7 @@ public class BoxCostController {
// @PreAuthorize("@ss.hasPermission('ecw:box-cost:update')")
public CommonResult<Boolean> updateBoxCost(@Valid @RequestBody BoxCostUpdateReqVO updateReqVO) {
//lanbm 2024-05-17 添加费用产生日期字段
String s="";
String s = "";
boxCostService.updateBoxCost(updateReqVO);
return success(true);
}
......@@ -111,19 +111,25 @@ public class BoxCostController {
public CommonResult<Long> getPaymentId(@RequestParam("id") Long id) {
PayableDO payableDO = payableService.getPayable(id);
if (payableDO == null) {
return error(new ErrorCode(1,"费用记录不存在"));
return error(new ErrorCode(1, "费用记录不存在"));
}
if (payableDO.getPaymentId()==null||payableDO.getPaymentId() == 0) {
return error(new ErrorCode(2,"付款单信息还未生成。"));
//ecw_payable 付款单信息
if (payableDO.getPaymentId() == null || payableDO.getPaymentId() == 0) {
return error(new ErrorCode(2, "付款单信息还未生成。"));
}
return success(payableDO.getPaymentId());
}
/*
-- 先登记费用信息,生成 ecw_payable 付款单,付款单付款付款后生成
-- 应付款 ecw_payment
*/
@GetMapping("/list")
@ApiOperation("获得费用登记列表, use this")
//@PreAuthorize("@ss.hasPermission('ecw:box-cost:query')")
public CommonResult<List<BoxCostBackVO>> getBoxCostList(@Valid BoxCostQueryVO query) {
//ecw_box_cost 费用登记
List<BoxCostDO> list = boxCostService.getBoxCostList(query);
List<BoxCostBackVO> costList = BoxCostConvert.INSTANCE.convertList(list);
......@@ -149,7 +155,9 @@ public class BoxCostController {
if (CollectionUtil.isNotEmpty(payableList)) {
Map<Long, PayableDO> payableMap = payableList.stream()
.collect(Collectors.toMap(PayableDO::getShippingFeeId, t -> t));
for (BoxCostBackVO boxCostBackVO : costList) {
//获取应付款信息
PayableDO payableDO = payableMap.get(boxCostBackVO.getId());
if (payableDO != null) {
//lanbm 2024-05-16 添加实付金额币种
......@@ -161,6 +169,13 @@ public class BoxCostController {
//lanbm 2024-05-16 添加付款单单号
boxCostBackVO.setPayableNo(payableDO.getPayableNo());
boxCostBackVO.setPayableId(payableDO.getId());
//判断是否生成付款单 lanbm 2024-06-03
if (payableDO.getPaymentId() == null || payableDO.getPaymentId() == 0) {
boxCostBackVO.setPaymentId("-1");
} else {
boxCostBackVO.setPaymentId(payableDO.getPaymentId().toString());
}
}
}
}
......
package cn.iocoder.yudao.module.shipment.controller.admin;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
......@@ -89,7 +90,7 @@ public class MakeBillOfLadingController {
//ecw_make_bill_of_lading 提单
String redisKey = MessageFormat.format(BOX_MAKE_LADING_KEY, createReqVO.getOrderId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1){
if (count > 1) {
return error(BOX_MAKE_LADING_REPEAT_COMMIT);
}
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
......@@ -181,13 +182,27 @@ public class MakeBillOfLadingController {
public CommonResult<MakeBillOfLadingBackVO> downloadByOrderId(@RequestParam("orderId") Long orderId, HttpServletResponse response) {
MakeBillOfLadingDO lading = makeBillOfLadingService.selectOne(MakeBillOfLadingDO::getOrderId, orderId);
if (lading == null) {
return error(new ErrorCode(1109010018, "该提单未制作或未审批通过!"));
return error(new ErrorCode(1109010018,
"该提单未制作或未审批通过!"));
}
OrderDO orderDOCheck = orderService.getById(orderId);
if (orderDOCheck.getStatus() < OrderStatusEnum.INSTALLED_CABINET.getValue()) {
return error(new ErrorCode(1109010019, "装柜前无法下载提货单"));
}
return success(MakeBillOfLadingConvert.INSTANCE.convert(lading));
MakeBillOfLadingBackVO vResult =
MakeBillOfLadingConvert.INSTANCE.convert(lading);
if (lading.getBpmProcessId() == null ||
lading.getBpmProcessId().length() == 0) {
vResult.setBpmStatus("-1");
} else {
String sStatus =
makeBillOfLadingService.getBpmStatus(lading.getBpmProcessId());
if (sStatus == null) sStatus = "-1";
vResult.setBpmStatus(sStatus);
}
return success(vResult);
}
@GetMapping("/download")
......
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