tao.mo

biz-customer | 修改 | 校验信息调整

mt
2024年11月12日14:36:30
......@@ -7,6 +7,10 @@ package com.fedex.connect.customer.enums;
*/
public enum ResponseCode {
//********************biz_customer模块
//#*********用于字段描述使用,不单独使用**********
MESSAGE_CODE_31001(31001,"business_field_31001"),
//#*********具体响应到前端**********
MESSAGE_CODE_30001(30001,"business_exception_30001"),
MESSAGE_CODE_30002(30002,"business_exception_30002"),
MESSAGE_CODE_30003(30003,"business_exception_30003"),
......@@ -17,7 +21,6 @@ public enum ResponseCode {
MESSAGE_CODE_30008(30008,"business_exception_30008"),
MESSAGE_CODE_30009(30009,"business_exception_30009"),
MESSAGE_CODE_30010(30010,"business_exception_30010"),
MESSAGE_CODE_30011(30011,"business_exception_30011"),
/******打个样,编写样例*****/
// MESSAGE_CODE_30001(30001,"business_exception_30001"),
......
......@@ -41,7 +41,7 @@ public class ConsignmentUtil {
List<String> errList = new ArrayList<>();
// 校验字段是否匹配,并将错误信息添加到errList中
checkFieldMismatch(bo.getShipperAccount(), consignment.getShipperAccount(), ResponseCode.MESSAGE_CODE_30006.getMsg(), 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()) {
......
......@@ -40,11 +40,11 @@ public class AttachmentValidate {
|| files.length == DigitConstants.DIGIT_MINUS_ONE
|| Objects.isNull(consignmentBo)
|| Objects.isNull(consignmentBo.getFileBizType())){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30007);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30006);
}
//上传最大文件个数限制
if(files.length > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_TOTAL){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30008);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30007);
}
//上传总文件大小限制
List<Long> fileSizeList = new ArrayList<>();
......@@ -56,18 +56,18 @@ public class AttachmentValidate {
.mapToLong(f -> Optional.ofNullable(f).orElse(0L)).sum();
//最大上传总文件大小超过50M
if(totalSize > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30009);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30008);
}
List<String> fileBizTypeList = consignmentBo.getFileBizType();
//运单或发票未上传
if(!fileBizTypeList.contains(FileBizTypeEnum.AWB.getName()) ||
!fileBizTypeList.contains(FileBizTypeEnum.INV.getName())){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30010);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30009);
}
//文件类型不在范围内
fileBizTypeList.stream().forEach(p -> {
if(Objects.isNull(FileBizTypeEnum.valueOf(p))){
responseUtils.fail(ResponseCode.MESSAGE_CODE_30011);
responseUtils.fail(ResponseCode.MESSAGE_CODE_30010);
};
});
}
......
......@@ -17,14 +17,18 @@ system_exception_10005=登录已过期
system_exception_10006=登录已过期,请重新登录
#******************业务相关、需要做国际化******************
#*********用于字段描述使用,不单独使用**********
business_field_31001=发货人计费账号
business_field_31002=运单ID
business_field_31003=运单号
#*********具体响应到前端**********
business_exception_30001=${0}必填字段未填写
business_exception_30002=单次最多可查询1000个运单号码
business_exception_30003=${0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30006=发货人计费账号
business_exception_30007=附件未上传
business_exception_30008=所有上传文件数量不超过50个文件
business_exception_30009=所有上传文件总大小不超过50M
business_exception_30010=运单或发票未上传
business_exception_30011=文件类型不在:运单、发票、箱单、其他
\ No newline at end of file
business_exception_30006=附件未上传
business_exception_30007=所有上传文件数量不超过50个文件
business_exception_30008=所有上传文件总大小不超过50M
business_exception_30009=运单或发票未上传
business_exception_30010=文件类型不在:运单、发票、箱单、其他
\ No newline at end of file
......
......@@ -17,13 +17,18 @@ system_exception_10005=登录已过期
system_exception_10006=登录已过期,请重新登录
#******************业务相关、需要做国际化******************
business_exception_30001=必填字段未填写
#*********用于字段描述使用,不单独使用**********
business_field_31001=发货人计费账号
business_field_31002=运单ID
business_field_31003=运单号
#*********具体响应到前端**********
business_exception_30001=${0}必填字段未填写
business_exception_30002=单次最多可查询1000个运单号码
business_exception_30003=不正确,请重新输入
business_exception_30003=${0}不正确,请重新输入
business_exception_30004=The waybill you entered is generated by another user, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30005=The waybill you entered is generated by another account, whether continue uploading? Confirm, Cancel. No more prompts in the future for the same situation.
business_exception_30006=发货人计费账号
business_exception_30007=附件未上传
business_exception_30008=所有上传文件数量不超过50个文件
business_exception_30009=所有上传文件总大小不超过50M
business_exception_30011=文件类型不在:运单、发票、箱单、其他
\ No newline at end of file
business_exception_30006=附件未上传
business_exception_30007=所有上传文件数量不超过50个文件
business_exception_30008=所有上传文件总大小不超过50M
business_exception_30009=运单或发票未上传
business_exception_30010=文件类型不在:运单、发票、箱单、其他
\ No newline at end of file
......