Commit decae2ef authored by 332784038@qq.com's avatar 332784038@qq.com

空运自编号bug修复

parent 673062bb
......@@ -645,19 +645,19 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
// 更新
BoxDO updateObj = BoxConvert.INSTANCE.convert(updateReqVO);
if (StringUtils.equals(TransportTypeEnum.AIR.getType(), transportType)) {
if (!Objects.equals(channelId, boxDO.getShippingChannelId()) || !Objects.equals(oldDestId, newDestId)) {
if (!Objects.equals(channelId, oldChannelId) || !Objects.equals(oldDestId, newDestId)) {
// 当箱子的渠道或者目的变更时,都需要重新生成自编号
// 先将原有的自编号记录做使用状态变更处理
String selfNo = "";
if (!Objects.equals(oldDestId, newDestId)) {
// String selfNo = "";
// if (!Objects.equals(oldDestId, newDestId) || !Objects.equals(oldDestId, newDestId) ) {
// 目的国变更,需要切换自编号
boxAirNumberRecordService.updateBoxAirNumberRecordUsedStatus(boxDO.getSelfNo());
// 再重新获取自编号
selfNo = getAirOrderNo(channelId, newDestId, transportType);
} else {
// 不是目的国变更,那么只是渠道变更,渠道变更只需要更新自编号规则,将原有记录更新
selfNo = chargeChannelAirOrderNo(boxDO.getSelfNo(), channelId, newDestId, transportType);
}
String selfNo = getAirOrderNo(channelId, newDestId, transportType);
// } else {
// // 不是目的国变更,那么只是渠道变更,渠道变更只需要更新自编号规则,将原有记录更新
// selfNo = chargeChannelAirOrderNo(boxDO.getSelfNo(), channelId, newDestId, transportType);
// }
updateObj.setSelfNo(selfNo);
}
} else {
......
......@@ -91,18 +91,19 @@ public class BoxAirNumberRecordServiceImpl extends AbstractService<BoxAirNumberR
BoxAirNumberRecordDO boxAirNumberRecordDO = boxAirNumberRecordMapper.selectOne(new LambdaQueryWrapper<BoxAirNumberRecordDO>()
.eq(BoxAirNumberRecordDO::getTransportType, transportType)
.eq(BoxAirNumberRecordDO::getDestCountryCode, destCountryCode)
.eq(BoxAirNumberRecordDO::getChannelCode, channelCode)
.eq(BoxAirNumberRecordDO::getUsed, 0)
.orderByAsc(BoxAirNumberRecordDO::getId).last("limit 1"));
if (Objects.nonNull(boxAirNumberRecordDO)) {
// 修改自编号逻辑
if (!StringUtils.equals(channelCode, boxAirNumberRecordDO.getChannelCode())) {
String newNumber = CodeUtils.chargeChannelAirSelfNumbers(destCountryCode, channelCode, boxAirNumberRecordDO.getChannelCode(), boxAirNumberRecordDO.getNumber());
boxAirNumberRecordDO.setDestId(destId);
boxAirNumberRecordDO.setDestCountryCode(destCountryCode);
boxAirNumberRecordDO.setNumber(newNumber);
boxAirNumberRecordDO.setChannelCode(channelCode);
boxAirNumberRecordDO.setChannelId(channelId);
}
// if (!StringUtils.equals(channelCode, boxAirNumberRecordDO.getChannelCode())) {
// String newNumber = CodeUtils.chargeChannelAirSelfNumbers(destCountryCode, channelCode, boxAirNumberRecordDO.getChannelCode(), boxAirNumberRecordDO.getNumber());
// boxAirNumberRecordDO.setDestId(destId);
// boxAirNumberRecordDO.setDestCountryCode(destCountryCode);
// boxAirNumberRecordDO.setNumber(newNumber);
// boxAirNumberRecordDO.setChannelCode(channelCode);
// boxAirNumberRecordDO.setChannelId(channelId);
// }
// 如果有未使用的编号记录,则直接更新为使用状态后返回
boxAirNumberRecordDO.setUsed(Boolean.TRUE);
boxAirNumberRecordDO.setUpdater(String.valueOf(userId));
......@@ -148,6 +149,7 @@ public class BoxAirNumberRecordServiceImpl extends AbstractService<BoxAirNumberR
.eq(BoxAirNumberRecordDO::getNumber, number)
.eq(BoxAirNumberRecordDO::getTransportType, transportType)
.eq(BoxAirNumberRecordDO::getDestCountryCode, destCountryCode)
.eq(BoxAirNumberRecordDO::getChannelCode, channelCode)
.orderByAsc(BoxAirNumberRecordDO::getId).last("limit 1"));
if (Objects.nonNull(boxAirNumberRecordDO)) {
// 修改自编号逻辑
......
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