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
zelong.shao
2024-11-12 18:10:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
0b2908e9b0be27f37b5f362f6be417686caa8458
0b2908e9
1 parent
41409bfd
customer|多余代码去除
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
63 deletions
server/biz-customer/src/main/java/com/fedex/connect/customer/util/service/biz/ConsignmentUtil.java
server/biz-customer/src/main/java/com/fedex/connect/customer/util/service/biz/ConsignmentUtil.java
View file @
0b2908e
...
...
@@ -7,15 +7,12 @@ import com.fedex.connect.common.dependencies.util.ResponseUtils;
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.bo.ConsignmentBo
;
import
com.fedex.connect.customer.data.dto.ConsignmentAddDto
;
import
com.fedex.connect.customer.enums.ResponseCode
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Objects
;
/**
...
...
@@ -111,64 +108,4 @@ public class ConsignmentUtil {
private
boolean
isShipperAccountMatch
(
String
account1
,
String
account2
)
{
return
StringUtils
.
hasText
(
account1
)
&&
StringUtils
.
hasText
(
account2
)
&&
account1
.
equals
(
account2
);
}
/**
* @Author Szl
* @Description 功能说明 校验运单创建人
* @Date 2024/11/5
* @param consignment
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public
void
consignmentCreatorCheck
(
Consignment
consignment
,
ConsignmentBo
bo
)
{
List
<
String
>
errList
=
new
ArrayList
<>();
// 校验字段是否匹配,并将错误信息添加到errList中
checkFieldMismatch
(
bo
.
getShipperAccount
(),
consignment
.
getShipperAccount
(),
ResponseCode
.
MESSAGE_CODE_31001
.
getMsg
(),
errList
);
//checkFieldMismatch(bo.getRecipientCountry(), consignment.getRecipientCountry(), "con_recipientCountry", errList);
//checkFieldMismatch(bo.getShipperCountry(), consignment.getShipperCountry(), "con_shipperCountry", errList);
if
(!
errList
.
isEmpty
())
{
responseUtils
.
fail
(
ResponseCode
.
MESSAGE_CODE_30003
,
errList
);
}
}
/**
* @Author Szl
* @Description 功能说明 对比是否一致
* @Date 2024/11/5
* @param boField
* @param consignmentField
* @param messageKey
* @param errList
* @return void
*/
private
void
checkFieldMismatch
(
String
boField
,
String
consignmentField
,
String
messageKey
,
List
<
String
>
errList
)
{
if
(!
boField
.
equals
(
consignmentField
))
{
errList
.
add
(
localeMessageUtil
.
getMessage
(
messageKey
));
}
}
/**
* @Author Szl
* @Description 功能说明 判断是否为该用户的uuid
* @Date 2024/11/6
* @param consignment
* @param user
* @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
*/
public
ResponseVo
consignmentUuidCheck
(
Consignment
consignment
,
User
user
){
ConsignmentAddDto
consignmentAddDto
=
new
ConsignmentAddDto
();
consignmentAddDto
.
setIsCreatorFlag
(
DigitConstants
.
DIGIT_ONE
);
consignmentAddDto
.
setConsignment
(
consignment
);
if
(!
Objects
.
equals
(
consignment
.
getUserUuid
(),
user
.
getUserUuid
())){
consignmentAddDto
.
setIsCreatorFlag
(
DigitConstants
.
DIGIT_TWO
);
if
(
Objects
.
equals
(
consignment
.
getShipperAccount
(),
user
.
getAccountNo
())){
return
responseUtils
.
success
(
ResponseCode
.
MESSAGE_CODE_30004
,
consignmentAddDto
);
}
else
{
return
responseUtils
.
success
(
ResponseCode
.
MESSAGE_CODE_30005
,
consignmentAddDto
);
}
}
else
{
return
responseUtils
.
success
(
consignmentAddDto
);
}
}
}
...
...
Please
register
or
login
to post a comment