Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
iClear-Connect-Pre-Clearance
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tao.mo
2024-11-07 10:10:46 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
17ae1450464fcbfa4e2b3901346d495f9762726d
17ae1450
1 parent
f39b6f6c
biz-customer | 修改 | 附件、运单查询跟操作分开
mt 2024年11月7日10:10:37
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
138 additions
and
92 deletions
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/base/BaseController.java
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/impl/AttachmentQueryController.java
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/impl/ConsignmentQueryController.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IAttachmentQueryService.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IAttachmentService.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IConsignmentQueryService.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IConsignmentService.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/AttachmentQueryServiceImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/AttachmentServiceImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/ConsignmentQueryServiceImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/ConsignmentServiceImpl.java
server/biz-customer/src/main/java/com/fedex/connect/customer/validate/controller/biz/ConsignmentInfoValidate.java
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/base/BaseController.java
View file @
17ae145
...
...
@@ -2,15 +2,14 @@ package com.fedex.connect.customer.controller.base;
import
com.fedex.connect.common.dependencies.common.BasicController
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.common.dependencies.enums.ResponseCode
;
import
com.fedex.connect.common.dependencies.exception.OpErrorException
;
import
com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil
;
import
com.fedex.connect.common.dependencies.util.CurrentUserInfo
;
import
com.fedex.connect.common.model.sys.User
;
import
com.fedex.connect.customer.service.biz.IAttachmentQueryService
;
import
com.fedex.connect.customer.service.biz.IAttachmentService
;
import
com.fedex.connect.customer.service.biz.IConsignmentQueryService
;
import
com.fedex.connect.customer.service.biz.IConsignmentService
;
import
com.fedex.connect.customer.validate.controller.biz.AttachmentValidate
;
import
com.fedex.connect.customer.validate.controller.biz.ConsignmentInfoValidate
;
import
com.fedex.connect.customer.validate.controller.biz.ConsignmentValidate
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -30,14 +29,23 @@ public class BaseController extends BasicController {
protected
IConsignmentService
consignmentService
;
@Autowired
protected
IConsignmentQueryService
consignmentQueryService
;
@Autowired
protected
IAttachmentService
attachmentService
;
@Autowired
protected
IAttachmentQueryService
attachmentQueryService
;
@Autowired
protected
AttachmentValidate
attachmentValidate
;
@Autowired
protected
ConsignmentValidate
consignmentValidate
;
@Autowired
protected
ConsignmentInfoValidate
consignmentInfoValidate
;
public
User
getCurrentUserInfo
(){
User
user
=
this
.
getUserInfo
(
localeMessageUtil
);
return
user
;
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/impl/AttachmentQueryController.java
View file @
17ae145
...
...
@@ -5,7 +5,6 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import
com.fedex.connect.common.dependencies.enums.ResponseCode
;
import
com.fedex.connect.common.dependencies.util.CurrentUserInfo
;
import
com.fedex.connect.customer.controller.base.BaseController
;
import
com.fedex.connect.customer.controller.biz.IAttachmentController
;
import
com.fedex.connect.customer.controller.biz.IAttachmentQueryController
;
import
com.fedex.connect.customer.data.bo.LongBo
;
import
io.swagger.annotations.Api
;
...
...
@@ -43,7 +42,7 @@ public class AttachmentQueryController extends BaseController implements IAttach
log
.
error
(
LogShowModel
.
showException
(
"Exception"
,
e
));
return
ResponseVo
.
fail
(
localeMessageUtil
.
getMessage
(
ResponseCode
.
TOKEN_FORMAT_ERROR
.
getMsg
()));
}
return
attachmentService
.
findHistory
(
userId
,
bo
.
getId
());
return
attachment
Query
Service
.
findHistory
(
userId
,
bo
.
getId
());
}
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/controller/biz/impl/ConsignmentQueryController.java
View file @
17ae145
...
...
@@ -37,7 +37,7 @@ public class ConsignmentQueryController extends BaseController implements IConsi
ConsignmentQuery
query
=
ConsignmentQuery
.
dataProcessing
(
consignmentQuery
);
query
.
setUserId
(
user
.
getId
());
query
.
setUuid
(
user
.
getUserUuid
());
return
consignmentService
.
findConsignments
(
query
);
return
consignment
Query
Service
.
findConsignments
(
query
);
}
@PostMapping
(
"/info/{id}"
)
...
...
@@ -49,11 +49,13 @@ public class ConsignmentQueryController extends BaseController implements IConsi
*/
User
user
=
this
.
getCurrentUserInfo
();
consignmentInfoValidate
.
validateConsignmentId
(
id
);
ConsignmentInfoQuery
detailQuery
=
new
ConsignmentInfoQuery
();
detailQuery
.
setUserId
(
user
.
getId
());
detailQuery
.
setUuid
(
user
.
getUserUuid
());
detailQuery
.
setConsignmentId
(
id
);
// return consignmentService.findConsignmentInfo(detailQuery);
// return consignment
Query
Service.findConsignmentInfo(detailQuery);
return
null
;
}
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IAttachmentQueryService.java
0 → 100644
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
public
interface
IAttachmentQueryService
{
ResponseVo
findHistory
(
Long
userId
,
Long
bizId
);
}
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IAttachmentService.java
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
public
interface
IAttachmentService
{
ResponseVo
findHistory
(
Long
userId
,
Long
bizId
);
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IConsignmentQueryService.java
0 → 100644
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.customer.data.query.ConsignmentQuery
;
public
interface
IConsignmentQueryService
{
/**
* @Author Szl
* @Description 功能说明 运单查询
* @Date 2024/11/5
* @param query
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
ResponseVo
findConsignments
(
ConsignmentQuery
query
);
}
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/IConsignmentService.java
View file @
17ae145
...
...
@@ -3,17 +3,8 @@ package com.fedex.connect.customer.service.biz;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.common.model.sys.User
;
import
com.fedex.connect.customer.data.bo.AddBo
;
import
com.fedex.connect.customer.data.query.ConsignmentQuery
;
public
interface
IConsignmentService
{
/**
* @Author Szl
* @Description 功能说明 运单查询
* @Date 2024/11/5
* @param query
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
ResponseVo
findConsignments
(
ConsignmentQuery
query
);
/**
* @Author Szl
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/AttachmentQueryServiceImpl.java
0 → 100644
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
.
impl
;
import
com.fedex.connect.common.dependencies.contants.DigitConstants
;
import
com.fedex.connect.common.dependencies.date.vo.PageResult
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.customer.data.dto.AttachmentHistoryDto
;
import
com.fedex.connect.customer.service.base.BaseService
;
import
com.fedex.connect.customer.service.biz.IAttachmentQueryService
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @Author Szl
* @Description 类说明 附件查询相关service
* @Date 2024/11/4
*/
@Service
public
class
AttachmentQueryServiceImpl
extends
BaseService
implements
IAttachmentQueryService
{
/**
* @Author Szl
* @Description 功能说明 查询该运单历史数据
* @Date 2024/11/5
* @param userId
* @param bizId
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public
ResponseVo
findHistory
(
Long
userId
,
Long
bizId
)
{
List
<
AttachmentHistoryDto
>
history
=
attachmentRepository
.
findHistory
(
bizId
);
if
(
history
!=
null
)
{
history
.
forEach
(
attachmentHistoryDto
->
attachmentHistoryDto
.
setCreatorFlag
(
(
attachmentHistoryDto
.
getUploadUserId
()
!=
null
&&
attachmentHistoryDto
.
getUploadUserId
().
equals
(
userId
))
?
DigitConstants
.
DIGIT_ONE
:
DigitConstants
.
DIGIT_ZERO
)
);
}
PageResult
pageResult
=
new
PageResult
();
pageResult
.
setList
(
history
!=
null
?
history
:
Collections
.
emptyList
());
return
ResponseVo
.
succ
(
pageResult
);
}
}
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/AttachmentServiceImpl.java
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
.
impl
;
import
com.fedex.connect.common.dependencies.contants.DigitConstants
;
import
com.fedex.connect.common.dependencies.date.vo.PageResult
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.customer.data.dto.AttachmentHistoryDto
;
import
com.fedex.connect.customer.service.base.BaseService
;
import
com.fedex.connect.customer.service.biz.IAttachmentService
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @Author Szl
* @Description 类说明 附件相关service
* @Description 类说明 附件
操作
相关service
* @Date 2024/11/4
*/
@Service
public
class
AttachmentServiceImpl
extends
BaseService
implements
IAttachmentService
{
/**
* @Author Szl
* @Description 功能说明 查询该运单历史数据
* @Date 2024/11/5
* @param userId
* @param bizId
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public
ResponseVo
findHistory
(
Long
userId
,
Long
bizId
)
{
List
<
AttachmentHistoryDto
>
history
=
attachmentRepository
.
findHistory
(
bizId
);
if
(
history
!=
null
)
{
history
.
forEach
(
attachmentHistoryDto
->
attachmentHistoryDto
.
setCreatorFlag
(
(
attachmentHistoryDto
.
getUploadUserId
()
!=
null
&&
attachmentHistoryDto
.
getUploadUserId
().
equals
(
userId
))
?
DigitConstants
.
DIGIT_ONE
:
DigitConstants
.
DIGIT_ZERO
)
);
}
PageResult
pageResult
=
new
PageResult
();
pageResult
.
setList
(
history
!=
null
?
history
:
Collections
.
emptyList
());
return
ResponseVo
.
succ
(
pageResult
);
}
}
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/ConsignmentQueryServiceImpl.java
0 → 100644
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
.
impl
;
import
com.fedex.connect.common.dependencies.contants.GlobalConstantFedex
;
import
com.fedex.connect.common.dependencies.date.vo.PageResult
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.common.dependencies.util.Utils
;
import
com.fedex.connect.customer.data.dto.FindConsignmentsDto
;
import
com.fedex.connect.customer.data.query.ConsignmentQuery
;
import
com.fedex.connect.customer.service.base.BaseService
;
import
com.fedex.connect.customer.service.biz.IConsignmentQueryService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Author Szl
* @Description 类说明 运单查询相关service
* @Date 2024/10/31
*/
@Service
public
class
ConsignmentQueryServiceImpl
extends
BaseService
implements
IConsignmentQueryService
{
/**
* @Author Szl
* @Description 功能说明 运单查询
* @Date 2024/11/5
* @param query
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public
ResponseVo
findConsignments
(
ConsignmentQuery
query
)
{
List
<
String
>
consignmentCodeList
=
query
.
getConsignmentCodeList
();
if
(
Utils
.
isNotEmpty
(
consignmentCodeList
)
&&
consignmentCodeList
.
size
()
>
GlobalConstantFedex
.
DECLARE_COUNT
)
{
return
ResponseVo
.
fail
(
localeMessageUtil
.
getMessage
(
"conl_cus_declare_count_max"
));
}
//查询数量
Long
total
=
consignmentExtRepository
.
findAllCount
(
query
);
PageResult
pageResult
=
new
PageResult
();
pageResult
.
setTotal
(
total
);
pageResult
.
setPage
(
query
.
getPage
());
pageResult
.
setSize
(
query
.
getSize
());
if
(
total
!=
null
&&
total
>
0
)
{
List
<
FindConsignmentsDto
>
consignments
=
consignmentExtRepository
.
findConsignments
(
query
);
pageResult
.
setList
(
consignments
);
}
return
ResponseVo
.
succ
(
pageResult
);
}
}
server/biz-customer/src/main/java/com/fedex/connect/customer/service/biz/impl/ConsignmentServiceImpl.java
View file @
17ae145
package
com
.
fedex
.
connect
.
customer
.
service
.
biz
.
impl
;
import
com.fedex.connect.common.dependencies.contants.GlobalConstantFedex
;
import
com.fedex.connect.common.dependencies.date.vo.PageResult
;
import
com.fedex.connect.common.dependencies.date.vo.ResponseVo
;
import
com.fedex.connect.common.dependencies.util.Utils
;
import
com.fedex.connect.common.model.biz.Consignment
;
import
com.fedex.connect.common.model.sys.User
;
import
com.fedex.connect.customer.data.bo.AddBo
;
import
com.fedex.connect.customer.data.dto.FindConsignmentsDto
;
import
com.fedex.connect.customer.data.query.ConsignmentQuery
;
import
com.fedex.connect.customer.service.base.BaseService
;
import
com.fedex.connect.customer.service.biz.IConsignmentService
;
import
com.fedex.connect.customer.util.service.biz.ConsignmentUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* @Author Szl
* @Description 类说明 运单相关service
* @Description 类说明 运单
操作
相关service
* @Date 2024/10/31
*/
@Service
...
...
@@ -30,34 +23,6 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
/**
* @Author Szl
* @Description 功能说明 运单查询
* @Date 2024/11/5
* @param query
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public
ResponseVo
findConsignments
(
ConsignmentQuery
query
)
{
List
<
String
>
consignmentCodeList
=
query
.
getConsignmentCodeList
();
if
(
Utils
.
isNotEmpty
(
consignmentCodeList
)
&&
consignmentCodeList
.
size
()
>
GlobalConstantFedex
.
DECLARE_COUNT
)
{
return
ResponseVo
.
fail
(
localeMessageUtil
.
getMessage
(
"conl_cus_declare_count_max"
));
}
//查询数量
Long
total
=
consignmentExtRepository
.
findAllCount
(
query
);
PageResult
pageResult
=
new
PageResult
();
pageResult
.
setTotal
(
total
);
pageResult
.
setPage
(
query
.
getPage
());
pageResult
.
setSize
(
query
.
getSize
());
if
(
total
!=
null
&&
total
>
0
)
{
List
<
FindConsignmentsDto
>
consignments
=
consignmentExtRepository
.
findConsignments
(
query
);
pageResult
.
setList
(
consignments
);
}
return
ResponseVo
.
succ
(
pageResult
);
}
/**
* @Author Szl
* @Description 功能说明 新增运单
* @Date 2024/11/5
* @param bo
...
...
server/biz-customer/src/main/java/com/fedex/connect/customer/validate/controller/biz/ConsignmentInfoValidate.java
View file @
17ae145
...
...
@@ -4,10 +4,8 @@ import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
import
com.fedex.connect.common.dependencies.enums.ResponseCode
;
import
com.fedex.connect.common.dependencies.exception.OpErrorException
;
import
com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil
;
import
com.fedex.connect.customer.data.bo.AddBo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
java.util.Objects
;
...
...
Please
register
or
login
to post a comment