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

Merge branch 'master-fix' into release

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