tao.mo

biz-customer | 修改 | 运单提交、附件上传、DM501解析

mt
2024年11月14日17:42:11
Showing 26 changed files with 646 additions and 194 deletions
1 +package com.fedex.connect.customer.config;
2 +
3 +import lombok.Data;
4 +import org.springframework.beans.factory.annotation.Value;
5 +import org.springframework.context.annotation.Configuration;
6 +
7 +@Data
8 +@Configuration
9 +public class PropertiesConfig {
10 + @Value("${spring.profiles.env}")
11 + private String env;
12 +
13 + @Value("${upload.path.attachment}")
14 + private String attachmentPath;
15 +}
...@@ -29,5 +29,5 @@ public class ConsignmentBo { ...@@ -29,5 +29,5 @@ public class ConsignmentBo {
29 private String destinationCountry; 29 private String destinationCountry;
30 //文件业务类型AWB,INV,PKL,OTH(分运单,发票,箱单和其它这四种类型) 30 //文件业务类型AWB,INV,PKL,OTH(分运单,发票,箱单和其它这四种类型)
31 @BaseNotBlank(describe = "business_field_31008") 31 @BaseNotBlank(describe = "business_field_31008")
32 - private List<String> fileBizType; 32 + private List<String> attachmentBizTypeList;
33 } 33 }
......
1 package com.fedex.connect.customer.service.biz; 1 package com.fedex.connect.customer.service.biz;
2 2
3 +import com.fedex.connect.common.model.biz.Attachment;
4 +import com.fedex.connect.common.model.sys.User;
5 +import org.springframework.web.multipart.MultipartFile;
6 +
7 +import java.util.List;
8 +
3 public interface IAttachmentService { 9 public interface IAttachmentService {
10 + List<Attachment> uploadAttachments(MultipartFile[] files,List<String> fileBizTypeList, User user);
4 } 11 }
......
1 package com.fedex.connect.customer.service.biz.impl; 1 package com.fedex.connect.customer.service.biz.impl;
2 2
3 +import com.fedex.connect.common.model.biz.Attachment;
4 +import com.fedex.connect.common.model.sys.User;
3 import com.fedex.connect.customer.service.base.BaseService; 5 import com.fedex.connect.customer.service.base.BaseService;
4 import com.fedex.connect.customer.service.biz.IAttachmentService; 6 import com.fedex.connect.customer.service.biz.IAttachmentService;
7 +import com.fedex.connect.customer.util.service.biz.AttachmentUtil;
8 +import org.springframework.beans.factory.annotation.Autowired;
5 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
10 +import org.springframework.web.multipart.MultipartFile;
11 +
12 +import java.util.ArrayList;
13 +import java.util.List;
6 14
7 /** 15 /**
8 * @Author Szl 16 * @Author Szl
...@@ -12,4 +20,27 @@ import org.springframework.stereotype.Service; ...@@ -12,4 +20,27 @@ import org.springframework.stereotype.Service;
12 @Service 20 @Service
13 public class AttachmentServiceImpl extends BaseService implements IAttachmentService { 21 public class AttachmentServiceImpl extends BaseService implements IAttachmentService {
14 22
23 + @Autowired
24 + AttachmentUtil attachmentUtil;
25 +
26 + /**
27 + * @Author mt
28 + * @Description 文件上传到服务器,并且生成附件实体返回
29 + * 除运单ID、运单号、用户上传记录表ID,其他参数会返回
30 + * @Date 2024/11/12
31 + * @param files
32 + * @param attachmentBizTypeList
33 + * @param user
34 + * @return void
35 + */
36 + public List<Attachment> uploadAttachments(MultipartFile[] files,List<String> attachmentBizTypeList,User user){
37 + List<Attachment> attachmentList = new ArrayList<>();
38 + for (int i = 0; i < files.length; i++) {
39 + MultipartFile file = files[i];
40 + String bizType = attachmentBizTypeList.get(i);
41 + Attachment attachment = attachmentUtil.uploadFile(file,bizType,user);
42 + attachmentList.add(attachment);
43 + }
44 + return attachmentList;
45 + }
15 } 46 }
......
...@@ -2,18 +2,23 @@ package com.fedex.connect.customer.service.biz.impl; ...@@ -2,18 +2,23 @@ package com.fedex.connect.customer.service.biz.impl;
2 2
3 import com.fedex.connect.common.dependencies.date.vo.ResponseVo; 3 import com.fedex.connect.common.dependencies.date.vo.ResponseVo;
4 import com.fedex.connect.common.dependencies.util.ResponseUtils; 4 import com.fedex.connect.common.dependencies.util.ResponseUtils;
5 +import com.fedex.connect.common.model.biz.Attachment;
5 import com.fedex.connect.common.model.biz.Consignment; 6 import com.fedex.connect.common.model.biz.Consignment;
6 import com.fedex.connect.common.model.sys.User; 7 import com.fedex.connect.common.model.sys.User;
7 import com.fedex.connect.customer.data.bo.AddBo; 8 import com.fedex.connect.customer.data.bo.AddBo;
8 import com.fedex.connect.customer.data.bo.ConsignmentBo; 9 import com.fedex.connect.customer.data.bo.ConsignmentBo;
9 import com.fedex.connect.customer.service.base.BaseService; 10 import com.fedex.connect.customer.service.base.BaseService;
11 +import com.fedex.connect.customer.service.biz.IAttachmentService;
10 import com.fedex.connect.customer.service.biz.IConsignmentService; 12 import com.fedex.connect.customer.service.biz.IConsignmentService;
11 import com.fedex.connect.customer.util.service.biz.ConsignmentUtil; 13 import com.fedex.connect.customer.util.service.biz.ConsignmentUtil;
14 +import net.bytebuddy.asm.Advice;
12 import org.apache.commons.lang3.StringUtils; 15 import org.apache.commons.lang3.StringUtils;
13 import org.springframework.beans.factory.annotation.Autowired; 16 import org.springframework.beans.factory.annotation.Autowired;
14 import org.springframework.stereotype.Service; 17 import org.springframework.stereotype.Service;
15 import org.springframework.web.multipart.MultipartFile; 18 import org.springframework.web.multipart.MultipartFile;
16 19
20 +import java.util.List;
21 +
17 import java.util.Objects; 22 import java.util.Objects;
18 23
19 /** 24 /**
...@@ -26,9 +31,8 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS ...@@ -26,9 +31,8 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
26 31
27 @Autowired 32 @Autowired
28 private ConsignmentUtil consignmentUtil; 33 private ConsignmentUtil consignmentUtil;
29 -
30 @Autowired 34 @Autowired
31 - private ResponseUtils responseUtils; 35 + private IAttachmentService attachmentService;
32 36
33 /** 37 /**
34 * @Author Szl 38 * @Author Szl
...@@ -87,6 +91,10 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS ...@@ -87,6 +91,10 @@ public class ConsignmentServiceImpl extends BaseService implements IConsignmentS
87 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo 91 * @return com.fedex.connect.common.dependencies.date.vo.ResponseVo
88 */ 92 */
89 public ResponseVo submitConsignment(MultipartFile[] files,ConsignmentBo consignmentBo,User user){ 93 public ResponseVo submitConsignment(MultipartFile[] files,ConsignmentBo consignmentBo,User user){
94 + /**
95 + * 上传附件
96 + */
97 + List<Attachment> attachmentList = attachmentService.uploadAttachments(files,consignmentBo.getAttachmentBizTypeList(),user);
90 98
91 return null; 99 return null;
92 } 100 }
......
1 package com.fedex.connect.customer.util.service.biz; 1 package com.fedex.connect.customer.util.service.biz;
2 2
3 +import com.fedex.connect.common.dependencies.cache.CacheSystem;
4 +import com.fedex.connect.common.dependencies.contants.DigitConstants;
5 +import com.fedex.connect.common.dependencies.enums.base.StatusEnum;
6 +import com.fedex.connect.common.dependencies.util.NIOFileUtils;
7 +import com.fedex.connect.common.model.biz.Attachment;
3 import com.fedex.connect.common.model.sys.User; 8 import com.fedex.connect.common.model.sys.User;
9 +import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.stereotype.Component; 10 import org.springframework.stereotype.Component;
5 import org.springframework.web.multipart.MultipartFile; 11 import org.springframework.web.multipart.MultipartFile;
6 12
...@@ -11,15 +17,28 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -11,15 +17,28 @@ import org.springframework.web.multipart.MultipartFile;
11 */ 17 */
12 @Component 18 @Component
13 public class AttachmentUtil { 19 public class AttachmentUtil {
20 + @Autowired
21 + CacheSystem cacheSystem;
22 +
23 + @Autowired
24 + NIOFileUtils nioFileUtils;
25 +
14 /** 26 /**
15 * @Author mt 27 * @Author mt
16 - * @Description 文件上传 28 + * @Description 文件上传到服务器,并且生成附件实体返回
17 - * @Date 2024/11/12 29 + * 除运单ID、运单号、用户上传记录表ID,其他参数会返回
18 - * @param files 30 + * @Date 2024/11/14
31 + * @param file
32 + * @param bizType
19 * @param user 33 * @param user
20 - * @return void 34 + * @return com.fedex.connect.common.model.biz.Attachment
21 */ 35 */
22 - public void uploadFile(MultipartFile[] files, User user){ 36 + public Attachment uploadFile(MultipartFile file,String bizType, User user){
37 + Attachment attachment = new Attachment();
23 38
39 +// attachment.setBizTypeCode();
40 +// attachment.setBizTypeName();
41 + attachment.setStatus(StatusEnum.YES.getCode());
42 + return attachment;
24 } 43 }
25 } 44 }
......
1 package com.fedex.connect.customer.validate.controller.biz; 1 package com.fedex.connect.customer.validate.controller.biz;
2 2
3 import com.fedex.connect.common.dependencies.contants.DigitConstants; 3 import com.fedex.connect.common.dependencies.contants.DigitConstants;
4 -import com.fedex.connect.common.dependencies.i18n.LocaleMessageUtil; 4 +import com.fedex.connect.common.dependencies.enums.biz.AttachmentBizTypeEnum;
5 import com.fedex.connect.common.dependencies.util.ResponseUtils; 5 import com.fedex.connect.common.dependencies.util.ResponseUtils;
6 import com.fedex.connect.common.dependencies.util.Utils; 6 import com.fedex.connect.common.dependencies.util.Utils;
7 import com.fedex.connect.customer.constants.CustomerConstant; 7 import com.fedex.connect.customer.constants.CustomerConstant;
8 import com.fedex.connect.customer.data.bo.ConsignmentBo; 8 import com.fedex.connect.customer.data.bo.ConsignmentBo;
9 -import com.fedex.connect.customer.enums.FileBizTypeEnum;
10 import com.fedex.connect.customer.enums.ResponseCode; 9 import com.fedex.connect.customer.enums.ResponseCode;
11 import org.springframework.beans.factory.annotation.Autowired; 10 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Component; 11 import org.springframework.stereotype.Component;
...@@ -39,7 +38,7 @@ public class AttachmentValidate { ...@@ -39,7 +38,7 @@ public class AttachmentValidate {
39 if(Objects.isNull(files) 38 if(Objects.isNull(files)
40 || files.length == DigitConstants.DIGIT_MINUS_ONE 39 || files.length == DigitConstants.DIGIT_MINUS_ONE
41 || Objects.isNull(consignmentBo) 40 || Objects.isNull(consignmentBo)
42 - || Objects.isNull(consignmentBo.getFileBizType())){ 41 + || Objects.isNull(consignmentBo.getAttachmentBizTypeList())){
43 responseUtils.fail(ResponseCode.MESSAGE_CODE_30006); 42 responseUtils.fail(ResponseCode.MESSAGE_CODE_30006);
44 } 43 }
45 //上传最大文件个数限制 44 //上传最大文件个数限制
...@@ -58,15 +57,15 @@ public class AttachmentValidate { ...@@ -58,15 +57,15 @@ public class AttachmentValidate {
58 if(totalSize > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE){ 57 if(totalSize > CustomerConstant.VALIDATE_KEYS.UPLOAD_FILE_MAX_SIZE){
59 responseUtils.fail(ResponseCode.MESSAGE_CODE_30008); 58 responseUtils.fail(ResponseCode.MESSAGE_CODE_30008);
60 } 59 }
61 - List<String> fileBizTypeList = consignmentBo.getFileBizType(); 60 + List<String> fileBizTypeList = consignmentBo.getAttachmentBizTypeList();
62 //运单或发票未上传 61 //运单或发票未上传
63 - if(!fileBizTypeList.contains(FileBizTypeEnum.AWB.getName()) || 62 + if(!fileBizTypeList.contains(AttachmentBizTypeEnum.AWB.getExt1()) ||
64 - !fileBizTypeList.contains(FileBizTypeEnum.INV.getName())){ 63 + !fileBizTypeList.contains(AttachmentBizTypeEnum.INV.getExt1())){
65 responseUtils.fail(ResponseCode.MESSAGE_CODE_30009); 64 responseUtils.fail(ResponseCode.MESSAGE_CODE_30009);
66 } 65 }
67 //文件类型不在范围内 66 //文件类型不在范围内
68 fileBizTypeList.stream().forEach(p -> { 67 fileBizTypeList.stream().forEach(p -> {
69 - if(Objects.isNull(FileBizTypeEnum.valueOf(p))){ 68 + if(Objects.isNull(AttachmentBizTypeEnum.valueOf(p))){
70 responseUtils.fail(ResponseCode.MESSAGE_CODE_30010); 69 responseUtils.fail(ResponseCode.MESSAGE_CODE_30010);
71 }; 70 };
72 }); 71 });
......
...@@ -32,12 +32,9 @@ export: ...@@ -32,12 +32,9 @@ export:
32 needauth: true 32 needauth: true
33 proxy: 33 proxy:
34 startFlag: false 34 startFlag: false
35 - host: sin-proxy.apac.fedex.com 35 + host: proxy-cn.g.fedex.com
36 port: 3128 36 port: 3128
37 mailAccountFlag: true 37 mailAccountFlag: true
38 - mailgroup:
39 - declare: { from: 'kexin.zhou@erry.com',password: 'Zhou1234',to: 'kexin.zhou@erry.com',cc: 'kexin.zhou@erry.com' }
40 - resetpwd: { from: 'tao.mo@erry.com',password: 'xiaozhen!1'}
41 # propertyPath: 38 # propertyPath:
42 # redis: /opt/fedex/exporttw/redis/export-redis.properties 39 # redis: /opt/fedex/exporttw/redis/export-redis.properties
43 language: en_US 40 language: en_US
...@@ -45,32 +42,4 @@ export: ...@@ -45,32 +42,4 @@ export:
45 42
46 upload: 43 upload:
47 path: 44 path:
48 - declare: E:/var/fedex/exportTw/upload/declareFile
49 - image: E:/var/fedex/exportTw/upload/brandImage
50 -
51 -url:
52 - loginIndex: http://47.103.140.98:8086/icleartw
53 - twIdx: http://47.103.140.98/IcTw/
54 - twIdxImg: https://declarationuat.fedex.com.cn/Exp/manager-server/
55 -
56 -#fcl
57 -fcl:
58 - login:
59 - url: http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnLogin
60 - redjrectLogin: https://exportdeclarationuat-tw.dmz.apac.fedex.com/IcTw/#/redjrectLogin
61 - twidx:
62 - url: http://exportdeclarationuat-tw.apac.fedex.com
63 - interface:
64 - logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnForward
65 - fedex_api_address: https://api.fedex.com
66 - proxy_url: cn2-proxy.apac.fedex.com:3128
67 - token:
68 - url: /auth/oauth/v2/token
69 - grant_type : client_credentials
70 - client_id: l7c13f958213e04d1280f807789bd783a3
71 - client_secret: 3d43932198b6467a8e20d024bfa82e1c
72 - scope: oob
73 - account:
74 - url: /user/v2/accounts
75 - userinfo:
76 - url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
45 + attachment: D:/var/share/iclearConnect/upload/attachment
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -28,42 +28,14 @@ export: ...@@ -28,42 +28,14 @@ export:
28 needauth: true 28 needauth: true
29 proxy: 29 proxy:
30 startFlag: false 30 startFlag: false
31 - host: sg2-proxy.apac.fedex.com 31 + host: proxy-cn.g.fedex.com
32 port: 3128 32 port: 3128
33 mailAccountFlag: false 33 mailAccountFlag: false
34 # propertyPath: 34 # propertyPath:
35 # redis: /opt/fedex/exporttw/redis/export-redis.properties 35 # redis: /opt/fedex/exporttw/redis/export-redis.properties
36 - language: zh_TW 36 + language: en_US
37 emailActiveTime: 60 37 emailActiveTime: 60
38 38
39 upload: 39 upload:
40 path: 40 path:
41 - declare: /var/share/icleartw/upload/declareFile
42 - image: /var/share/icleartw/upload/brandImage
43 -
44 -url:
45 - loginIndex: https://exportdeclaration-tw.apac.fedex.com/IcTw/
46 - twIdx: https://exportdeclaration-tw.apac.fedex.com/IcTw/
47 - twIdxImg: https://declaration.fedex.com.cn/Exp/manager-server/
48 -
49 -#fcl
50 -fcl:
51 - login:
52 - url: https://exportdeclaration-tw.apac.fedex.com/icleartw/auth/wlgnLogin
53 - redjrectLogin: https://exportdeclaration-tw.apac.fedex.com/IcTw/#/redjrectLogin
54 - twidx:
55 - url: https://exportdeclaration-tw.apac.fedex.com
56 - interface:
57 - logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=https://exportdeclaration-tw.apac.fedex.com/icleartw/auth/wlgnForward
58 - fedex_api_address: https://api.fedex.com
59 - proxy_url: cn2-proxy.apac.fedex.com:3128
60 - token:
61 - url: /auth/oauth/v2/token
62 - grant_type : client_credentials
63 - client_id: l7c13f958213e04d1280f807789bd783a3
64 - client_secret: 3d43932198b6467a8e20d024bfa82e1c
65 - scope: oob
66 - account:
67 - url: /user/v2/accounts
68 - userinfo:
69 - url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
41 + attachment: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/attachment
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -28,42 +28,14 @@ export: ...@@ -28,42 +28,14 @@ export:
28 needauth: true 28 needauth: true
29 proxy: 29 proxy:
30 startFlag: false 30 startFlag: false
31 - host: sin-proxy.apac.fedex.com 31 + host: proxy-cn.g.fedex.com
32 port: 3128 32 port: 3128
33 mailAccountFlag: true 33 mailAccountFlag: true
34 # propertyPath: 34 # propertyPath:
35 # redis: /opt/fedex/exporttw/redis/export-redis.properties 35 # redis: /opt/fedex/exporttw/redis/export-redis.properties
36 - language: zh_TW 36 + language: en_US
37 emailActiveTime: 60 37 emailActiveTime: 60
38 38
39 upload: 39 upload:
40 path: 40 path:
41 - declare: /app/Oracle/Middleware/user_projects/domains/base_domain/exportTw/upload/declareFile
42 - image: /app/Oracle/Middleware/user_projects/domains/base_domain/exportTw/upload/brandImage
43 -
44 -url:
45 - loginIndex: http://47.103.140.98:8086/icleartw
46 - twIdx: http://47.103.140.98/IcTw/
47 - twIdxImg: https://declarationuat.fedex.com.cn/Exp/manager-server/
48 -
49 -#fcl
50 -fcl:
51 - login:
52 - url: http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnLogin
53 - redjrectLogin: https://exportdeclarationuat-tw.dmz.apac.fedex.com/IcTw/#/redjrectLogin
54 - twidx:
55 - url: http://exportdeclarationuat-tw.apac.fedex.com
56 - interface:
57 - logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnForward
58 - fedex_api_address: https://api.fedex.com
59 - proxy_url: cn2-proxy.apac.fedex.com:3128
60 - token:
61 - url: /auth/oauth/v2/token
62 - grant_type : client_credentials
63 - client_id: l7c13f958213e04d1280f807789bd783a3
64 - client_secret: 3d43932198b6467a8e20d024bfa82e1c
65 - scope: oob
66 - account:
67 - url: /user/v2/accounts
68 - userinfo:
69 - url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
41 + attachment: /app/Oracle/Middleware/user_projects/domains/base_domain/iclearConnect/upload/attachment
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -28,7 +28,7 @@ export: ...@@ -28,7 +28,7 @@ export:
28 needauth: true 28 needauth: true
29 proxy: 29 proxy:
30 startFlag: false 30 startFlag: false
31 - host: sg2-proxy.apac.fedex.com 31 + host: proxy-cn.g.fedex.com
32 port: 3128 32 port: 3128
33 mailAccountFlag: false 33 mailAccountFlag: false
34 # propertyPath: 34 # propertyPath:
...@@ -38,31 +38,4 @@ export: ...@@ -38,31 +38,4 @@ export:
38 38
39 upload: 39 upload:
40 path: 40 path:
41 - declare: /var/share/icleartw/upload/declareFile
42 - image: /var/share/icleartw/upload/brandImage
43 -
44 -url:
45 - loginIndex: http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw
46 - twIdx: http://exportdeclarationuat-tw.apac.fedex.com/IcTw/
47 - twIdxImg: https://declarationuat.fedex.com.cn/Exp/manager-server/
48 -
49 -fcl:
50 - login:
51 - url: http://exportdeclarationuat-tw.apac.fedex.com/icleartw/auth/wlgnLogin
52 - redjrectLogin: https://exportdeclarationuat-tw.dmz.apac.fedex.com/IcTw/#/redjrectLogin
53 - twidx:
54 - url: http://exportdeclarationuat-tw.apac.fedex.com
55 - interface:
56 - logurl: https://www.fedex.com/secure-login/zh-tw/#/login-credentials?redirectUrl=http://exportdeclarationuat-tw.dmz.apac.fedex.com/icleartw/auth/wlgnForward
57 - fedex_api_address: https://api.fedex.com
58 - proxy_url: cn2-proxy.apac.fedex.com:3128
59 - token:
60 - url: /auth/oauth/v2/token
61 - grant_type : client_credentials
62 - client_id: l7c13f958213e04d1280f807789bd783a3
63 - client_secret: 3d43932198b6467a8e20d024bfa82e1c
64 - scope: oob
65 - account:
66 - url: /user/v2/accounts
67 - userinfo:
68 - url: /user/v2/users/userinfo
...\ No newline at end of file ...\ No newline at end of file
41 + attachment: /var/share/iclearConnect/upload/attachment
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -33,7 +33,7 @@ business_exception_30002=单次最多可查询1000个运单号码 ...@@ -33,7 +33,7 @@ business_exception_30002=单次最多可查询1000个运单号码
33 business_exception_30003=${0}不正确,请重新输入 33 business_exception_30003=${0}不正确,请重新输入
34 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. 34 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.
35 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. 35 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.
36 -business_exception_30006=附件未上传 36 +business_exception_30006=附件上传不符合标准
37 business_exception_30007=所有上传文件数量不超过50个文件 37 business_exception_30007=所有上传文件数量不超过50个文件
38 business_exception_30008=所有上传文件总大小不超过50M 38 business_exception_30008=所有上传文件总大小不超过50M
39 business_exception_30009=运单或发票未上传 39 business_exception_30009=运单或发票未上传
......
...@@ -33,7 +33,7 @@ business_exception_30002=单次最多可查询1000个运单号码 ...@@ -33,7 +33,7 @@ business_exception_30002=单次最多可查询1000个运单号码
33 business_exception_30003=${0}不正确,请重新输入 33 business_exception_30003=${0}不正确,请重新输入
34 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. 34 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.
35 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. 35 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.
36 -business_exception_30006=附件未上传 36 +business_exception_30006=附件上传不符合标准
37 business_exception_30007=所有上传文件数量不超过50个文件 37 business_exception_30007=所有上传文件数量不超过50个文件
38 business_exception_30008=所有上传文件总大小不超过50M 38 business_exception_30008=所有上传文件总大小不超过50M
39 business_exception_30009=运单或发票未上传 39 business_exception_30009=运单或发票未上传
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
20 <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" /> 20 <result column="MODIFY_USER_NAME" jdbcType="VARCHAR" property="modifyUserName" />
21 <result column="UPLOAD_RECORD_ID" jdbcType="NUMERIC" property="uploadRecordId" /> 21 <result column="UPLOAD_RECORD_ID" jdbcType="NUMERIC" property="uploadRecordId" />
22 <result column="FILE_SIZE" jdbcType="NUMERIC" property="fileSize" /> 22 <result column="FILE_SIZE" jdbcType="NUMERIC" property="fileSize" />
23 + <result column="CONSIGNMENT_CODE" jdbcType="VARCHAR" property="consignmentCode" />
23 </resultMap> 24 </resultMap>
24 <sql id="Example_Where_Clause"> 25 <sql id="Example_Where_Clause">
25 <where> 26 <where>
...@@ -82,7 +83,7 @@ ...@@ -82,7 +83,7 @@
82 <sql id="Base_Column_List"> 83 <sql id="Base_Column_List">
83 ID, BIZ_ID, BIZ_TYPE_CODE, BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME, FILE_PATH, 84 ID, BIZ_ID, BIZ_TYPE_CODE, BIZ_TYPE_NAME, SOURCE_FILE_NAME, FILE_NAME, FILE_PATH,
84 FILE_TYPE_CODE, FILE_TYPE_NAME, STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME, 85 FILE_TYPE_CODE, FILE_TYPE_NAME, STATUS, CREATE_TIME, CREATE_USER_ID, CREATE_USER_NAME,
85 - MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, UPLOAD_RECORD_ID, FILE_SIZE 86 + MODIFY_TIME, MODIFY_USER_ID, MODIFY_USER_NAME, UPLOAD_RECORD_ID, FILE_SIZE, CONSIGNMENT_CODE
86 </sql> 87 </sql>
87 <select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultMap="BaseResultMap"> 88 <select id="selectByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultMap="BaseResultMap">
88 <include refid="OracleDialectPrefix" /> 89 <include refid="OracleDialectPrefix" />
...@@ -126,15 +127,15 @@ ...@@ -126,15 +127,15 @@
126 FILE_PATH, FILE_TYPE_CODE, FILE_TYPE_NAME, 127 FILE_PATH, FILE_TYPE_CODE, FILE_TYPE_NAME,
127 STATUS, CREATE_TIME, CREATE_USER_ID, 128 STATUS, CREATE_TIME, CREATE_USER_ID,
128 CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID, 129 CREATE_USER_NAME, MODIFY_TIME, MODIFY_USER_ID,
129 - MODIFY_USER_NAME, UPLOAD_RECORD_ID, FILE_SIZE 130 + MODIFY_USER_NAME, UPLOAD_RECORD_ID, FILE_SIZE,
130 - ) 131 + CONSIGNMENT_CODE)
131 values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizTypeCode,jdbcType=VARCHAR}, 132 values (#{id,jdbcType=NUMERIC}, #{bizId,jdbcType=NUMERIC}, #{bizTypeCode,jdbcType=VARCHAR},
132 #{bizTypeName,jdbcType=VARCHAR}, #{sourceFileName,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR}, 133 #{bizTypeName,jdbcType=VARCHAR}, #{sourceFileName,jdbcType=VARCHAR}, #{fileName,jdbcType=VARCHAR},
133 #{filePath,jdbcType=VARCHAR}, #{fileTypeCode,jdbcType=VARCHAR}, #{fileTypeName,jdbcType=VARCHAR}, 134 #{filePath,jdbcType=VARCHAR}, #{fileTypeCode,jdbcType=VARCHAR}, #{fileTypeName,jdbcType=VARCHAR},
134 #{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC}, 135 #{status,jdbcType=NUMERIC}, #{createTime,jdbcType=TIMESTAMP}, #{createUserId,jdbcType=NUMERIC},
135 #{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC}, 136 #{createUserName,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP}, #{modifyUserId,jdbcType=NUMERIC},
136 - #{modifyUserName,jdbcType=VARCHAR}, #{uploadRecordId,jdbcType=NUMERIC}, #{fileSize,jdbcType=NUMERIC} 137 + #{modifyUserName,jdbcType=VARCHAR}, #{uploadRecordId,jdbcType=NUMERIC}, #{fileSize,jdbcType=NUMERIC},
137 - ) 138 + #{consignmentCode,jdbcType=VARCHAR})
138 </insert> 139 </insert>
139 <insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Attachment"> 140 <insert id="insertSelective" parameterType="com.fedex.connect.common.model.biz.Attachment">
140 <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> 141 <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
...@@ -194,6 +195,9 @@ ...@@ -194,6 +195,9 @@
194 <if test="fileSize != null"> 195 <if test="fileSize != null">
195 FILE_SIZE, 196 FILE_SIZE,
196 </if> 197 </if>
198 + <if test="consignmentCode != null">
199 + CONSIGNMENT_CODE,
200 + </if>
197 </trim> 201 </trim>
198 <trim prefix="values (" suffix=")" suffixOverrides=","> 202 <trim prefix="values (" suffix=")" suffixOverrides=",">
199 #{id,jdbcType=NUMERIC}, 203 #{id,jdbcType=NUMERIC},
...@@ -248,6 +252,9 @@ ...@@ -248,6 +252,9 @@
248 <if test="fileSize != null"> 252 <if test="fileSize != null">
249 #{fileSize,jdbcType=NUMERIC}, 253 #{fileSize,jdbcType=NUMERIC},
250 </if> 254 </if>
255 + <if test="consignmentCode != null">
256 + #{consignmentCode,jdbcType=VARCHAR},
257 + </if>
251 </trim> 258 </trim>
252 </insert> 259 </insert>
253 <select id="countByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultType="java.lang.Long"> 260 <select id="countByExample" parameterType="com.fedex.connect.common.model.biz.AttachmentExample" resultType="java.lang.Long">
...@@ -313,6 +320,9 @@ ...@@ -313,6 +320,9 @@
313 <if test="record.fileSize != null"> 320 <if test="record.fileSize != null">
314 FILE_SIZE = #{record.fileSize,jdbcType=NUMERIC}, 321 FILE_SIZE = #{record.fileSize,jdbcType=NUMERIC},
315 </if> 322 </if>
323 + <if test="record.consignmentCode != null">
324 + CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR},
325 + </if>
316 </set> 326 </set>
317 <if test="_parameter != null"> 327 <if test="_parameter != null">
318 <include refid="Update_By_Example_Where_Clause" /> 328 <include refid="Update_By_Example_Where_Clause" />
...@@ -337,7 +347,8 @@ ...@@ -337,7 +347,8 @@
337 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC}, 347 MODIFY_USER_ID = #{record.modifyUserId,jdbcType=NUMERIC},
338 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR}, 348 MODIFY_USER_NAME = #{record.modifyUserName,jdbcType=VARCHAR},
339 UPLOAD_RECORD_ID = #{record.uploadRecordId,jdbcType=NUMERIC}, 349 UPLOAD_RECORD_ID = #{record.uploadRecordId,jdbcType=NUMERIC},
340 - FILE_SIZE = #{record.fileSize,jdbcType=NUMERIC} 350 + FILE_SIZE = #{record.fileSize,jdbcType=NUMERIC},
351 + CONSIGNMENT_CODE = #{record.consignmentCode,jdbcType=VARCHAR}
341 <if test="_parameter != null"> 352 <if test="_parameter != null">
342 <include refid="Update_By_Example_Where_Clause" /> 353 <include refid="Update_By_Example_Where_Clause" />
343 </if> 354 </if>
...@@ -396,6 +407,9 @@ ...@@ -396,6 +407,9 @@
396 <if test="fileSize != null"> 407 <if test="fileSize != null">
397 FILE_SIZE = #{fileSize,jdbcType=NUMERIC}, 408 FILE_SIZE = #{fileSize,jdbcType=NUMERIC},
398 </if> 409 </if>
410 + <if test="consignmentCode != null">
411 + CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR},
412 + </if>
399 </set> 413 </set>
400 where ID = #{id,jdbcType=NUMERIC} 414 where ID = #{id,jdbcType=NUMERIC}
401 </update> 415 </update>
...@@ -417,7 +431,8 @@ ...@@ -417,7 +431,8 @@
417 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC}, 431 MODIFY_USER_ID = #{modifyUserId,jdbcType=NUMERIC},
418 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR}, 432 MODIFY_USER_NAME = #{modifyUserName,jdbcType=VARCHAR},
419 UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC}, 433 UPLOAD_RECORD_ID = #{uploadRecordId,jdbcType=NUMERIC},
420 - FILE_SIZE = #{fileSize,jdbcType=NUMERIC} 434 + FILE_SIZE = #{fileSize,jdbcType=NUMERIC},
435 + CONSIGNMENT_CODE = #{consignmentCode,jdbcType=VARCHAR}
421 where ID = #{id,jdbcType=NUMERIC} 436 where ID = #{id,jdbcType=NUMERIC}
422 </update> 437 </update>
423 <sql id="OracleDialectPrefix"> 438 <sql id="OracleDialectPrefix">
......
...@@ -19,13 +19,13 @@ public class Attachment implements Serializable { ...@@ -19,13 +19,13 @@ public class Attachment implements Serializable {
19 private Long bizId; 19 private Long bizId;
20 20
21 /** 21 /**
22 - * 业务类型CODE。 22 + * 附件业务类型CODE。
23 关联数据字典表。指定字典目录CODE:ATTACHMENT_BIZ_TYPE 23 关联数据字典表。指定字典目录CODE:ATTACHMENT_BIZ_TYPE
24 */ 24 */
25 private String bizTypeCode; 25 private String bizTypeCode;
26 26
27 /** 27 /**
28 - * 业务类型名称(用户上传、系统生成) 28 + * 附件业务类型名称(运单、发票、箱单、其他)
29 */ 29 */
30 private String bizTypeName; 30 private String bizTypeName;
31 31
...@@ -45,12 +45,12 @@ public class Attachment implements Serializable { ...@@ -45,12 +45,12 @@ public class Attachment implements Serializable {
45 private String filePath; 45 private String filePath;
46 46
47 /** 47 /**
48 - * 文件类型CODE。关联数据字典表。指定字典目录CODE:ATTACHMENT_FILE_TYPE 48 + * 附件文件类型CODE。关联数据字典表。指定字典目录CODE:ATTACHMENT_FILE_TYPE
49 */ 49 */
50 private String fileTypeCode; 50 private String fileTypeCode;
51 51
52 /** 52 /**
53 - * 文件类型名称(压缩包、PDF) 53 + * 附件文件类型(压缩包、文件)
54 */ 54 */
55 private String fileTypeName; 55 private String fileTypeName;
56 56
...@@ -99,6 +99,11 @@ public class Attachment implements Serializable { ...@@ -99,6 +99,11 @@ public class Attachment implements Serializable {
99 */ 99 */
100 private Long fileSize; 100 private Long fileSize;
101 101
102 + /**
103 + * 运单号
104 + */
105 + private String consignmentCode;
106 +
102 private static final long serialVersionUID = 1L; 107 private static final long serialVersionUID = 1L;
103 108
104 public Long getId() { 109 public Long getId() {
...@@ -245,6 +250,14 @@ public class Attachment implements Serializable { ...@@ -245,6 +250,14 @@ public class Attachment implements Serializable {
245 this.fileSize = fileSize; 250 this.fileSize = fileSize;
246 } 251 }
247 252
253 + public String getConsignmentCode() {
254 + return consignmentCode;
255 + }
256 +
257 + public void setConsignmentCode(String consignmentCode) {
258 + this.consignmentCode = consignmentCode == null ? null : consignmentCode.trim();
259 + }
260 +
248 @Override 261 @Override
249 public String toString() { 262 public String toString() {
250 StringBuilder sb = new StringBuilder(); 263 StringBuilder sb = new StringBuilder();
...@@ -269,6 +282,7 @@ public class Attachment implements Serializable { ...@@ -269,6 +282,7 @@ public class Attachment implements Serializable {
269 sb.append(", modifyUserName=").append(modifyUserName); 282 sb.append(", modifyUserName=").append(modifyUserName);
270 sb.append(", uploadRecordId=").append(uploadRecordId); 283 sb.append(", uploadRecordId=").append(uploadRecordId);
271 sb.append(", fileSize=").append(fileSize); 284 sb.append(", fileSize=").append(fileSize);
285 + sb.append(", consignmentCode=").append(consignmentCode);
272 sb.append(", serialVersionUID=").append(serialVersionUID); 286 sb.append(", serialVersionUID=").append(serialVersionUID);
273 sb.append("]"); 287 sb.append("]");
274 return sb.toString(); 288 return sb.toString();
......
...@@ -1294,6 +1294,76 @@ public class AttachmentExample { ...@@ -1294,6 +1294,76 @@ public class AttachmentExample {
1294 addCriterion("FILE_SIZE not between", value1, value2, "fileSize"); 1294 addCriterion("FILE_SIZE not between", value1, value2, "fileSize");
1295 return (Criteria) this; 1295 return (Criteria) this;
1296 } 1296 }
1297 +
1298 + public Criteria andConsignmentCodeIsNull() {
1299 + addCriterion("CONSIGNMENT_CODE is null");
1300 + return (Criteria) this;
1301 + }
1302 +
1303 + public Criteria andConsignmentCodeIsNotNull() {
1304 + addCriterion("CONSIGNMENT_CODE is not null");
1305 + return (Criteria) this;
1306 + }
1307 +
1308 + public Criteria andConsignmentCodeEqualTo(String value) {
1309 + addCriterion("CONSIGNMENT_CODE =", value, "consignmentCode");
1310 + return (Criteria) this;
1311 + }
1312 +
1313 + public Criteria andConsignmentCodeNotEqualTo(String value) {
1314 + addCriterion("CONSIGNMENT_CODE <>", value, "consignmentCode");
1315 + return (Criteria) this;
1316 + }
1317 +
1318 + public Criteria andConsignmentCodeGreaterThan(String value) {
1319 + addCriterion("CONSIGNMENT_CODE >", value, "consignmentCode");
1320 + return (Criteria) this;
1321 + }
1322 +
1323 + public Criteria andConsignmentCodeGreaterThanOrEqualTo(String value) {
1324 + addCriterion("CONSIGNMENT_CODE >=", value, "consignmentCode");
1325 + return (Criteria) this;
1326 + }
1327 +
1328 + public Criteria andConsignmentCodeLessThan(String value) {
1329 + addCriterion("CONSIGNMENT_CODE <", value, "consignmentCode");
1330 + return (Criteria) this;
1331 + }
1332 +
1333 + public Criteria andConsignmentCodeLessThanOrEqualTo(String value) {
1334 + addCriterion("CONSIGNMENT_CODE <=", value, "consignmentCode");
1335 + return (Criteria) this;
1336 + }
1337 +
1338 + public Criteria andConsignmentCodeLike(String value) {
1339 + addCriterion("CONSIGNMENT_CODE like", value, "consignmentCode");
1340 + return (Criteria) this;
1341 + }
1342 +
1343 + public Criteria andConsignmentCodeNotLike(String value) {
1344 + addCriterion("CONSIGNMENT_CODE not like", value, "consignmentCode");
1345 + return (Criteria) this;
1346 + }
1347 +
1348 + public Criteria andConsignmentCodeIn(List<String> values) {
1349 + addCriterion("CONSIGNMENT_CODE in", values, "consignmentCode");
1350 + return (Criteria) this;
1351 + }
1352 +
1353 + public Criteria andConsignmentCodeNotIn(List<String> values) {
1354 + addCriterion("CONSIGNMENT_CODE not in", values, "consignmentCode");
1355 + return (Criteria) this;
1356 + }
1357 +
1358 + public Criteria andConsignmentCodeBetween(String value1, String value2) {
1359 + addCriterion("CONSIGNMENT_CODE between", value1, value2, "consignmentCode");
1360 + return (Criteria) this;
1361 + }
1362 +
1363 + public Criteria andConsignmentCodeNotBetween(String value1, String value2) {
1364 + addCriterion("CONSIGNMENT_CODE not between", value1, value2, "consignmentCode");
1365 + return (Criteria) this;
1366 + }
1297 } 1367 }
1298 1368
1299 public static class Criteria extends GeneratedCriteria { 1369 public static class Criteria extends GeneratedCriteria {
......
...@@ -99,30 +99,30 @@ ...@@ -99,30 +99,30 @@
99 <!-- selectByExampleQueryId="true">--> 99 <!-- selectByExampleQueryId="true">-->
100 <!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_USER_LOGIN_INFO.NEXTVAL FROM DUAL" />--> 100 <!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_LOG_USER_LOGIN_INFO.NEXTVAL FROM DUAL" />-->
101 <!-- </table>--> 101 <!-- </table>-->
102 -<!-- <table tableName="T_BIZ_ATTACHMENT" domainObjectName="Attachment"--> 102 + <table tableName="T_BIZ_ATTACHMENT" domainObjectName="Attachment"
103 + enableCountByExample="true" enableUpdateByExample="true"
104 + enableDeleteByExample="true" enableSelectByExample="true"
105 + selectByExampleQueryId="true">
106 + <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL" />
107 + </table>
108 +<!-- <table tableName="T_BIZ_UPLOAD_RECORD" domainObjectName="UploadRecord"-->
103 <!-- enableCountByExample="true" enableUpdateByExample="true"--> 109 <!-- enableCountByExample="true" enableUpdateByExample="true"-->
104 <!-- enableDeleteByExample="true" enableSelectByExample="true"--> 110 <!-- enableDeleteByExample="true" enableSelectByExample="true"-->
105 <!-- selectByExampleQueryId="true">--> 111 <!-- selectByExampleQueryId="true">-->
106 -<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_ATTACHMENT.NEXTVAL FROM DUAL" />--> 112 +<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_UPLOAD_RECORD.NEXTVAL FROM DUAL" />-->
107 <!-- </table>--> 113 <!-- </table>-->
108 -<!-- <table tableName="T_BIZ_UPLOAD_RECORD" domainObjectName="UploadRecord"--> 114 +<!-- <table schema="ICLEARIMP" tableName="T_BIZ_CE_INFO" domainObjectName="CeInfo"-->
109 <!-- enableCountByExample="true" enableUpdateByExample="true"--> 115 <!-- enableCountByExample="true" enableUpdateByExample="true"-->
110 <!-- enableDeleteByExample="true" enableSelectByExample="true"--> 116 <!-- enableDeleteByExample="true" enableSelectByExample="true"-->
111 <!-- selectByExampleQueryId="true">--> 117 <!-- selectByExampleQueryId="true">-->
112 -<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_UPLOAD_RECORD.NEXTVAL FROM DUAL" />--> 118 +<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_CE_INFO.NEXTVAL FROM DUAL" />-->
119 +<!-- </table>-->
120 +<!-- <table tableName="T_BIZ_CONSIGNMENT" domainObjectName="Consignment"-->
121 +<!-- enableCountByExample="true" enableUpdateByExample="true"-->
122 +<!-- enableDeleteByExample="true" enableSelectByExample="true"-->
123 +<!-- selectByExampleQueryId="true">-->
124 +<!-- <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_CONSIGNMENT.NEXTVAL FROM DUAL" />-->
113 <!-- </table>--> 125 <!-- </table>-->
114 - <table schema="ICLEARIMP" tableName="T_BIZ_CE_INFO" domainObjectName="CeInfo"
115 - enableCountByExample="true" enableUpdateByExample="true"
116 - enableDeleteByExample="true" enableSelectByExample="true"
117 - selectByExampleQueryId="true">
118 - <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_CE_INFO.NEXTVAL FROM DUAL" />
119 - </table>
120 - <table tableName="T_BIZ_CONSIGNMENT" domainObjectName="Consignment"
121 - enableCountByExample="true" enableUpdateByExample="true"
122 - enableDeleteByExample="true" enableSelectByExample="true"
123 - selectByExampleQueryId="true">
124 - <generatedKey column="ID" sqlStatement="SELECT SEQ_T_BIZ_CONSIGNMENT.NEXTVAL FROM DUAL" />
125 - </table>
126 <!-- <table tableName="T_BIZ_EMAIL" domainObjectName="Email"--> 126 <!-- <table tableName="T_BIZ_EMAIL" domainObjectName="Email"-->
127 <!-- enableCountByExample="true" enableUpdateByExample="true"--> 127 <!-- enableCountByExample="true" enableUpdateByExample="true"-->
128 <!-- enableDeleteByExample="true" enableSelectByExample="true"--> 128 <!-- enableDeleteByExample="true" enableSelectByExample="true"-->
......
...@@ -18,4 +18,8 @@ public interface DictionaryConstants { ...@@ -18,4 +18,8 @@ public interface DictionaryConstants {
18 String EMAIL_TYPE = "EMAIL_TYPE"; 18 String EMAIL_TYPE = "EMAIL_TYPE";
19 //邮件状态 19 //邮件状态
20 String EMAIL_STATUS = "EMAIL_STATUS"; 20 String EMAIL_STATUS = "EMAIL_STATUS";
21 + //附件业务类型
22 + String ATTACHMENT_BIZ_TYPE = "ATTACHMENT_BIZ_TYPE";
23 + //附件文件类型
24 + String ATTACHMENT_FILE_TYPE = "ATTACHMENT_FILE_TYPE";
21 } 25 }
......
1 -package com.fedex.connect.customer.enums; 1 +package com.fedex.connect.common.dependencies.enums.base;
2 2
3 /** 3 /**
4 * @Author mt 4 * @Author mt
5 - * @Description 文件类型 5 + * @Description 表记录状态
6 - * @Date 2024/11/12 6 + * @Date 2024/11/14
7 */ 7 */
8 -public enum FileBizTypeEnum { 8 +public enum StatusEnum {
9 - AWB("AWB","运单"), 9 + YES(1L,"有效"),
10 - INV("INV","发票"), 10 + NO(0L,"无效"),
11 - PKL("PKL","箱单"),
12 - OTH("OTH","其他"),
13 ; 11 ;
14 - private String code; 12 + private Long code;
15 private String name; 13 private String name;
16 14
17 - FileBizTypeEnum(String code, String name) { 15 + StatusEnum(Long code,String name) {
18 this.code = code; 16 this.code = code;
19 this.name = name; 17 this.name = name;
20 } 18 }
21 19
22 - public String getCode() { 20 + public Long getCode() {
23 return code; 21 return code;
24 } 22 }
25 23
24 + public void setCode(Long code) {
25 + this.code = code;
26 + }
27 +
26 public String getName() { 28 public String getName() {
27 return name; 29 return name;
28 } 30 }
31 +
32 + public void setName(String name) {
33 + this.name = name;
34 + }
29 } 35 }
......
1 +package com.fedex.connect.common.dependencies.enums.biz;
2 +
3 +/**
4 + * @Author mt
5 + * @Description 附件业务类型
6 + * @Date 2024/11/14
7 + */
8 +public enum AttachmentBizTypeEnum {
9 + AWB("attachmentBizType_01","waybill","运单","AWB"),
10 + INV("attachmentBizType_02","invoice","发票","INV"),
11 + PKL("attachmentBizType_03","packing","箱单","PKL"),
12 + OTH("attachmentBizType_04","other","其他","OTH"),
13 + ;
14 +
15 + private String code;
16 + private String enMsg;
17 + private String msg;
18 + private String ext1;
19 +
20 + AttachmentBizTypeEnum(String code, String enMsg, String msg,String ext1) {
21 + this.code = code;
22 + this.enMsg = enMsg;
23 + this.msg = msg;
24 + this.ext1 = ext1;
25 + }
26 +
27 + public String getCode() {
28 + return code;
29 + }
30 +
31 + public void setCode(String code) {
32 + this.code = code;
33 + }
34 +
35 + public String getEnMsg() {
36 + return enMsg;
37 + }
38 +
39 + public void setEnMsg(String enMsg) {
40 + this.enMsg = enMsg;
41 + }
42 +
43 + public String getMsg() {
44 + return msg;
45 + }
46 +
47 + public void setMsg(String msg) {
48 + this.msg = msg;
49 + }
50 +
51 + public String getExt1() {
52 + return ext1;
53 + }
54 +
55 + public void setExt1(String ext1) {
56 + this.ext1 = ext1;
57 + }
58 +}
1 +package com.fedex.connect.common.dependencies.enums.biz;
2 +
3 +/**
4 + * @Author mt
5 + * @Description 附件文件类型
6 + * @Date 2024/11/14
7 + */
8 +public enum AttachmentFileTypeEnum {
9 + ZIP("attachmentFileType_01","zip","压缩包"),
10 + FILE("attachmentFileType_02","file","文件"),
11 + ;
12 +
13 + private String code;
14 + private String enMsg;
15 + private String msg;
16 +
17 + AttachmentFileTypeEnum(String code, String enMsg, String msg) {
18 + this.code = code;
19 + this.enMsg = enMsg;
20 + this.msg = msg;
21 + }
22 +
23 + public String getCode() {
24 + return code;
25 + }
26 +
27 + public void setCode(String code) {
28 + this.code = code;
29 + }
30 +
31 + public String getEnMsg() {
32 + return enMsg;
33 + }
34 +
35 + public void setEnMsg(String enMsg) {
36 + this.enMsg = enMsg;
37 + }
38 +
39 + public String getMsg() {
40 + return msg;
41 + }
42 +
43 + public void setMsg(String msg) {
44 + this.msg = msg;
45 + }
46 +}
...@@ -6,23 +6,41 @@ package com.fedex.connect.common.dependencies.enums.biz; ...@@ -6,23 +6,41 @@ package com.fedex.connect.common.dependencies.enums.biz;
6 * @Date 2024/11/4 6 * @Date 2024/11/4
7 */ 7 */
8 public enum ConsignmentStatusEnum { 8 public enum ConsignmentStatusEnum {
9 - CONSIGNMENT_STATUS_01("consignmentStatus_01", "待上传"), 9 + CONSIGNMENT_STATUS_01("consignmentStatus_01", "success", "上传成功"),
10 - CONSIGNMENT_STATUS_02("consignmentStatus_02", "已上传"), 10 + CONSIGNMENT_STATUS_02("consignmentStatus_02", "fail","上传失败");
11 - CONSIGNMENT_STATUS_03("consignmentStatus_03", "已发送"); 11 +
12 12
13 private String code; 13 private String code;
14 - private String name; 14 + private String enMsg;
15 + private String msg;
15 16
16 - ConsignmentStatusEnum(String code, String name) { 17 + ConsignmentStatusEnum(String code, String enMsg,String msg) {
17 this.code = code; 18 this.code = code;
18 - this.name = name; 19 + this.enMsg = enMsg;
20 + this.msg = msg;
19 } 21 }
20 22
21 public String getCode() { 23 public String getCode() {
22 return code; 24 return code;
23 } 25 }
24 26
25 - public String getName() { 27 + public void setCode(String code) {
26 - return name; 28 + this.code = code;
29 + }
30 +
31 + public String getEnMsg() {
32 + return enMsg;
33 + }
34 +
35 + public void setEnMsg(String enMsg) {
36 + this.enMsg = enMsg;
37 + }
38 +
39 + public String getMsg() {
40 + return msg;
41 + }
42 +
43 + public void setMsg(String msg) {
44 + this.msg = msg;
27 } 45 }
28 } 46 }
......
1 +package com.fedex.connect.common.dependencies.util;
2 +
3 +import org.slf4j.Logger;
4 +import org.springframework.stereotype.Component;
5 +import org.springframework.util.CollectionUtils;
6 +import org.springframework.web.multipart.MultipartFile;
7 +
8 +import java.io.*;
9 +import java.nio.file.*;
10 +import java.nio.file.attribute.BasicFileAttributes;
11 +import java.time.LocalDateTime;
12 +import java.time.format.DateTimeFormatter;
13 +import java.util.ArrayList;
14 +import java.util.List;
15 +import java.util.zip.ZipEntry;
16 +import java.util.zip.ZipOutputStream;
17 +
18 +/**
19 + * @Author mt
20 + * @Description 非阻塞式文件操作工具
21 + * @Date 2024/11/14
22 + */
23 +@Component
24 +public class NIOFileUtils {
25 + public void copyFile(InputStream is,Path targetPath) throws IOException{
26 + if(is != null) {
27 + try {
28 + Files.copy(is, targetPath, StandardCopyOption.REPLACE_EXISTING);
29 + }finally {
30 + is.close();
31 + is = null;
32 + }
33 + }
34 + }
35 +
36 + public void deleteFile(String filePath) throws IOException{
37 + Files.delete(Paths.get(filePath));
38 + }
39 +
40 + public void copyFile(InputStream is,String targetPath) throws IOException{
41 + copyFile(is,Paths.get(targetPath));
42 + }
43 +
44 + public void copyFileByParent(InputStream is, String targetPath) throws IOException {
45 + if (is != null) {
46 + Path target = Paths.get(targetPath);
47 + Files.createDirectories(target.getParent());
48 + this.copyFile(is,targetPath);
49 + }
50 + }
51 +
52 + /**
53 + * @Author mt
54 + * @Description 非阻塞式文件复制
55 + * @Date 2024/11/14
56 + * @param sFilePath
57 + * @param tFilePath
58 + * @return void
59 + */
60 + public void copyFile(String sFilePath, String tFilePath) throws IOException {
61 + this.copyFile(new File(sFilePath), tFilePath);
62 +
63 + }
64 +
65 + /**
66 + * @Author mt
67 + * @Description 非阻塞式文件复制
68 + * @Date 2024/11/14
69 + * @param sFilePath
70 + * @param tFilePath
71 + * @return void
72 + */
73 + public void copyFile(File sFilePath, String tFilePath) throws IOException {
74 + this.copyFile(new FileInputStream(sFilePath),tFilePath);
75 +
76 + }
77 + /**
78 + * @Author mt
79 + * @Description 创建临时文件
80 + * @Date 2024/11/14
81 + * @param null
82 + * @return
83 + */
84 + /**
85 + * @Author mt
86 + * @Description 删除临时文件
87 + * @Date 2024/11/14
88 + * @param path
89 + * @return void
90 + */
91 + public void deleteTempFile(Path path) throws IOException{
92 + deleteIfExists(path);
93 + }
94 + /**
95 + * @Author mt
96 + * @Description 删除文件夹及其文件
97 + * @Date 2024/11/14
98 + * @param logger
99 + * @param dirPath
100 + * @param isDeleteChildDir
101 + * @return void
102 + */
103 + public void deleteDir(Logger logger,String dirPath,boolean isDeleteChildDir){
104 + Path directoryToBeDeleted = Paths.get(dirPath);
105 + List<Path> subList = new ArrayList<>();
106 + try {
107 + Files.walkFileTree(directoryToBeDeleted, new SimpleFileVisitor<Path>() {
108 + @Override
109 + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
110 + if(isDeleteChildDir
111 + || (!isDeleteChildDir && directoryToBeDeleted.equals(file.getParent()))) {
112 + Files.deleteIfExists(file);
113 + }
114 + return FileVisitResult.CONTINUE;
115 + }
116 +
117 + @Override
118 + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
119 + if(isDeleteChildDir
120 + || (!isDeleteChildDir
121 + && directoryToBeDeleted.equals(dir))) {
122 + if(subList == null || subList.isEmpty()) {
123 + Files.deleteIfExists(dir);
124 + }
125 + }else if(!isDeleteChildDir
126 + && !directoryToBeDeleted.equals(dir)){
127 + subList.add(dir);
128 + }
129 + return FileVisitResult.CONTINUE;
130 + }
131 + });
132 + } catch (IOException e) {
133 + if(logger != null) {
134 + logger.error("NIO 删除文件夹及其文件 发生异常 | {} | 具体原因为:", e.getMessage(), e);
135 + }
136 + }
137 + }
138 + /**
139 + * @Author mt
140 + * @Description 删除已存在的文件
141 + * @Date 2024/11/14
142 + * @param filePath
143 + * @return void
144 + */
145 + public void deleteIfExists(String filePath) throws IOException{
146 + deleteIfExists(Paths.get(filePath));
147 + }
148 + /**
149 + * @Author mt
150 + * @Description 删除已存在文件
151 + * @Date 2024/11/14
152 + * @param path
153 + * @return void
154 + */
155 + public void deleteIfExists(Path path) throws IOException{
156 + Files.deleteIfExists(path);
157 + }
158 +
159 + // 复制文件到目标文件夹
160 + public void copyFile(String sourceFilePath, Path targetFolderPath) throws IOException {
161 + Path sourcePath = Paths.get(sourceFilePath);
162 + Path targetFilePath = targetFolderPath.resolve(sourcePath.getFileName());
163 + Files.copy(sourcePath, targetFilePath, StandardCopyOption.REPLACE_EXISTING);
164 + }
165 +
166 + // 压缩文件夹
167 + public void zipFolder(String sourceFolderPath, String zipFilePath) throws IOException {
168 + Path sourcePath = Paths.get(sourceFolderPath);
169 + try (FileOutputStream fos = new FileOutputStream(zipFilePath);
170 + ZipOutputStream zos = new ZipOutputStream(fos)) {
171 +
172 + // 遍历文件夹并添加到压缩包
173 + Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {
174 + @Override
175 + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
176 + // 获取文件在源文件夹中的相对路径
177 + Path relativePath = sourcePath.relativize(file);
178 + zos.putNextEntry(new ZipEntry(relativePath.toString()));
179 +
180 + // 将文件内容复制到压缩流中
181 + Files.copy(file, zos);
182 + zos.closeEntry();
183 + return FileVisitResult.CONTINUE;
184 + }
185 + });
186 + }
187 + }
188 +
189 + // 删除文件夹及其内容
190 + public void deleteFolder(Path folderPath) throws IOException {
191 + Files.walk(folderPath)
192 + .sorted(java.util.Comparator.reverseOrder())
193 + .map(Path::toFile)
194 + .forEach(File::delete);
195 + }
196 +
197 + public File[] findFolder(Path folderPath,List<String> childDirs) throws IOException {
198 + List<File> files = new ArrayList<>();
199 + Files.walk(folderPath)
200 + .sorted(java.util.Comparator.reverseOrder())
201 + .map(Path::toFile)
202 + .forEach(p->{
203 + if(p.isFile()){
204 + if(CollectionUtils.isEmpty(childDirs)){
205 + files.add(p);
206 + }else {
207 + long total = childDirs.stream().filter(c -> p.getName().toUpperCase().contains(c.toUpperCase())).count();
208 + if (total > 0) {
209 + files.add(p);
210 + }
211 + }
212 + }
213 + });
214 + if(!CollectionUtils.isEmpty(files)){
215 + return files.toArray(new File[files.size()]);
216 + }
217 + return null;
218 + }
219 +
220 + /**
221 + * @Author mt
222 + * @Description 移动文件
223 + * @Date 2024/11/14
224 + * @param logger
225 + * @param sourceFilePath
226 + * @param targetDir
227 + * @return void
228 + */
229 + public void moveFile(Logger logger,String sourceFilePath,String targetDir) throws IOException{
230 + File dir = new File(targetDir);
231 + if (!dir.exists()) {
232 + dir.mkdirs();
233 + }
234 + Path sPath = Paths.get(sourceFilePath);
235 + Path tPath = Paths.get(targetDir + File.separator + sPath.getFileName());
236 + // 移动文件
237 + Files.move(sPath, tPath, StandardCopyOption.REPLACE_EXISTING);
238 + }
239 +}
...@@ -40,7 +40,7 @@ public class ConsignmentRepositoryImpl extends BaseRepository implements IConsig ...@@ -40,7 +40,7 @@ public class ConsignmentRepositoryImpl extends BaseRepository implements IConsig
40 40
41 /** 41 /**
42 * @Author mt 42 * @Author mt
43 - * @Description 根据运单号查找30天之运单 43 + * @Description 根据运单号查找30天之运单
44 * @Date 2024/11/4 44 * @Date 2024/11/4
45 * @param consignmentCode 45 * @param consignmentCode
46 * @return com.fedex.connect.common.model.biz.Consignment 46 * @return com.fedex.connect.common.model.biz.Consignment
......
...@@ -55,11 +55,9 @@ public class Dm501ServiceImpl extends BaseService implements IDm501Service { ...@@ -55,11 +55,9 @@ public class Dm501ServiceImpl extends BaseService implements IDm501Service {
55 if (Objects.isNull(bizCeInfo)) { 55 if (Objects.isNull(bizCeInfo)) {
56 CeInfo ceInfo = dm501Util.generateCeInfo(consignment501,kafKaTemporaryStorage.getSendTime()); 56 CeInfo ceInfo = dm501Util.generateCeInfo(consignment501,kafKaTemporaryStorage.getSendTime());
57 //ce数据解析正常,进行后续操作 57 //ce数据解析正常,进行后续操作
58 - if(Objects.nonNull(ceInfo)){
59 Consignment consignment = dm501Util.generateConsignment(ceInfo); 58 Consignment consignment = dm501Util.generateConsignment(ceInfo);
60 this.saveCeInfoAndConsignment(ceInfo,consignment); 59 this.saveCeInfoAndConsignment(ceInfo,consignment);
61 } 60 }
62 - }
63 }catch(Exception ex){ 61 }catch(Exception ex){
64 log.error("DM501消息处理异常:{}", ex.getMessage(),ex); 62 log.error("DM501消息处理异常:{}", ex.getMessage(),ex);
65 } 63 }
......
...@@ -190,7 +190,7 @@ public class Dm501Util { ...@@ -190,7 +190,7 @@ public class Dm501Util {
190 public Consignment generateConsignment(CeInfo ceInfo) throws Exception{ 190 public Consignment generateConsignment(CeInfo ceInfo) throws Exception{
191 Consignment rsConsignment; 191 Consignment rsConsignment;
192 /** 192 /**
193 - * 根据运单号查找30天之运单 193 + * 根据运单号查找30天之运单
194 */ 194 */
195 Consignment consignment = consignmentRepository.findThirtyDaysAgoConByCode(ceInfo.getConsignmentCode()); 195 Consignment consignment = consignmentRepository.findThirtyDaysAgoConByCode(ceInfo.getConsignmentCode());
196 if(Objects.isNull(consignment)){ 196 if(Objects.isNull(consignment)){
...@@ -201,6 +201,10 @@ public class Dm501Util { ...@@ -201,6 +201,10 @@ public class Dm501Util {
201 resultConsignment.setStatusCode(consignmentDicEntries.getCode()); 201 resultConsignment.setStatusCode(consignmentDicEntries.getCode());
202 resultConsignment.setStatusName(consignmentDicEntries.getDescription()); 202 resultConsignment.setStatusName(consignmentDicEntries.getDescription());
203 /** 203 /**
204 + * 初始化运单表原产国、目的国
205 + */
206 + this.initOriginCountryDestinationCountry(ceInfo,consignment);
207 + /**
204 * 初始化表基础字段 208 * 初始化表基础字段
205 */ 209 */
206 AssignmentFieldUtils.assignmentTableBaseField(resultConsignment); 210 AssignmentFieldUtils.assignmentTableBaseField(resultConsignment);
...@@ -210,6 +214,24 @@ public class Dm501Util { ...@@ -210,6 +214,24 @@ public class Dm501Util {
210 String[] ignoreProperties = Constant.CE_CONSIGNMENT_COPY_IGNORE_PROP_KEYS.IGNORE_PROPERTIES; 214 String[] ignoreProperties = Constant.CE_CONSIGNMENT_COPY_IGNORE_PROP_KEYS.IGNORE_PROPERTIES;
211 //字段拷贝 215 //字段拷贝
212 BeanUtils.copyProperties(ceInfo,consignment,ignoreProperties); 216 BeanUtils.copyProperties(ceInfo,consignment,ignoreProperties);
217 + /**
218 + * 初始化运单表原产国、目的国
219 + */
220 + this.initOriginCountryDestinationCountry(ceInfo,consignment);
221 + rsConsignment = consignment;
222 + }
223 + return rsConsignment;
224 + }
225 +
226 + /**
227 + * @Author mt
228 + * @Description 初始化运单表原产国、目的国
229 + * @Date 2024/11/13
230 + * @param ceInfo
231 + * @param consignment
232 + * @return void
233 + */
234 + private void initOriginCountryDestinationCountry(CeInfo ceInfo,Consignment consignment){
213 //根据发件人国家二字码获取字典 235 //根据发件人国家二字码获取字典
214 DictionaryEntries shipperCountryEntries = cacheSystem.getDicCountryByExt1(ceInfo.getShipperCountry()); 236 DictionaryEntries shipperCountryEntries = cacheSystem.getDicCountryByExt1(ceInfo.getShipperCountry());
215 //根据二字码能获取到二字码则赋值始发国全称 237 //根据二字码能获取到二字码则赋值始发国全称
...@@ -228,9 +250,6 @@ public class Dm501Util { ...@@ -228,9 +250,6 @@ public class Dm501Util {
228 //目的国全称 250 //目的国全称
229 consignment.setDestinationCountry(countryEntries.getEnglishName()); 251 consignment.setDestinationCountry(countryEntries.getEnglishName());
230 } 252 }
231 - rsConsignment = consignment;
232 - }
233 - return rsConsignment;
234 } 253 }
235 254
236 /** 255 /**
......