Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
14a5f2ba
Commit
14a5f2ba
authored
Nov 06, 2024
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
空运渠道有两套规则:
1、AF、AS、AN的渠道编码共用起始编号 2、其他渠道编码独立使用起始编号
parent
decae2ef
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
11 deletions
+13
-11
BoxAirNumberRecordServiceImpl.java
...ice/boxAirNumberRecord/BoxAirNumberRecordServiceImpl.java
+13
-11
No files found.
yudao-module-shipment/yudao-module-shipment-core/src/main/java/cn/iocoder/yudao/module/shipment/service/boxAirNumberRecord/BoxAirNumberRecordServiceImpl.java
View file @
14a5f2ba
...
...
@@ -42,6 +42,8 @@ public class BoxAirNumberRecordServiceImpl extends AbstractService<BoxAirNumberR
@Resource
private
ApplicationContext
applicationContext
;
static
List
<
String
>
PUBLIC_CHANNEL_CODE_LIST
=
Arrays
.
asList
(
"AF"
,
"AS"
,
"AN"
);
@Override
public
BoxAirNumberRecordDO
getBoxAirNumberRecord
(
Long
id
)
{
return
boxAirNumberRecordMapper
.
selectById
(
id
);
...
...
@@ -91,19 +93,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
(
!
PUBLIC_CHANNEL_CODE_LIST
.
contains
(
channelCode
),
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
));
...
...
@@ -149,7 +151,7 @@ public class BoxAirNumberRecordServiceImpl extends AbstractService<BoxAirNumberR
.
eq
(
BoxAirNumberRecordDO:
:
getNumber
,
number
)
.
eq
(
BoxAirNumberRecordDO:
:
getTransportType
,
transportType
)
.
eq
(
BoxAirNumberRecordDO:
:
getDestCountryCode
,
destCountryCode
)
.
eq
(
BoxAirNumberRecordDO:
:
getChannelCode
,
channelCode
)
.
eq
(
!
PUBLIC_CHANNEL_CODE_LIST
.
contains
(
channelCode
),
BoxAirNumberRecordDO:
:
getChannelCode
,
channelCode
)
.
orderByAsc
(
BoxAirNumberRecordDO:
:
getId
).
last
(
"limit 1"
));
if
(
Objects
.
nonNull
(
boxAirNumberRecordDO
))
{
// 修改自编号逻辑
...
...
@@ -178,7 +180,7 @@ public class BoxAirNumberRecordServiceImpl extends AbstractService<BoxAirNumberR
BoxAirNumberRecordDO
maxBoxAirNumberRecordDO
=
boxAirNumberRecordMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BoxAirNumberRecordDO
>()
.
eq
(
BoxAirNumberRecordDO:
:
getTransportType
,
transportType
)
.
eq
(
BoxAirNumberRecordDO:
:
getDestCountryCode
,
destCountryCode
)
.
eq
(
BoxAirNumberRecordDO:
:
getChannelCode
,
channelCode
)
.
eq
(
!
PUBLIC_CHANNEL_CODE_LIST
.
contains
(
channelCode
),
BoxAirNumberRecordDO:
:
getChannelCode
,
channelCode
)
.
orderByDesc
(
BoxAirNumberRecordDO:
:
getId
).
last
(
"limit 1"
));
// 根据最大的自编号生成最新的自编号
String
preChannelCode
=
""
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment