Commit f108de329b122ba42e0aa315c3249e91d0c0f854
1 parent
43354af5
初始化项目
Showing
34 changed files
with
3 additions
and
4862 deletions
Too many changes to show.
To preserve performance only 34 of 39 files are displayed.
etrade-boss/src/main/java/com/diligrp/etrade/boss/EtradeBossBootstrap.java
@@ -3,7 +3,6 @@ package com.diligrp.etrade.boss; | @@ -3,7 +3,6 @@ package com.diligrp.etrade.boss; | ||
3 | import com.diligrp.etrade.admin.AdminConfiguration; | 3 | import com.diligrp.etrade.admin.AdminConfiguration; |
4 | import com.diligrp.etrade.core.CoreConfiguration; | 4 | import com.diligrp.etrade.core.CoreConfiguration; |
5 | import com.diligrp.etrade.coupon.CouponConfiguration; | 5 | import com.diligrp.etrade.coupon.CouponConfiguration; |
6 | -import com.diligrp.etrade.ecap.EcapConfiguration; | ||
7 | import com.diligrp.etrade.order.OrderConfiguration; | 6 | import com.diligrp.etrade.order.OrderConfiguration; |
8 | import com.diligrp.etrade.rpc.RpcConfiguration; | 7 | import com.diligrp.etrade.rpc.RpcConfiguration; |
9 | import com.diligrp.etrade.sentinel.SentinelConfiguration; | 8 | import com.diligrp.etrade.sentinel.SentinelConfiguration; |
@@ -20,7 +19,7 @@ import org.springframework.context.annotation.Import; | @@ -20,7 +19,7 @@ import org.springframework.context.annotation.Import; | ||
20 | @EnableDiscoveryClient | 19 | @EnableDiscoveryClient |
21 | @Import({BossConfiguration.class, SharedConfiguration.class, RpcConfiguration.class, CoreConfiguration.class, | 20 | @Import({BossConfiguration.class, SharedConfiguration.class, RpcConfiguration.class, CoreConfiguration.class, |
22 | ShopConfiguration.class, OrderConfiguration.class, CouponConfiguration.class, SentinelConfiguration.class, | 21 | ShopConfiguration.class, OrderConfiguration.class, CouponConfiguration.class, SentinelConfiguration.class, |
23 | - AdminConfiguration.class, EcapConfiguration.class}) | 22 | + AdminConfiguration.class}) |
24 | public class EtradeBossBootstrap { | 23 | public class EtradeBossBootstrap { |
25 | public static void main(String[] args) { | 24 | public static void main(String[] args) { |
26 | SpringApplication.run(EtradeBossBootstrap.class, args); | 25 | SpringApplication.run(EtradeBossBootstrap.class, args); |
etrade-boss/src/main/resources/bootstrap.properties
1 | -server.port=9850 | 1 | +server.port=9852 |
2 | server.servlet.context-path=/ | 2 | server.servlet.context-path=/ |
3 | 3 | ||
4 | spring.profiles.active=dev | 4 | spring.profiles.active=dev |
5 | -spring.application.name=etrade-boss | 5 | +spring.application.name=xtrade-boss |
6 | 6 | ||
7 | spring.cloud.nacos.discovery.enabled=true | 7 | spring.cloud.nacos.discovery.enabled=true |
8 | spring.cloud.nacos.discovery.group=MICROSERVICE | 8 | spring.cloud.nacos.discovery.group=MICROSERVICE |
etrade-ecap/build.gradle deleted
100644 → 0
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/EcapConfiguration.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.mybatis.MybatisMapperSupport; | ||
4 | -import org.mybatis.spring.annotation.MapperScan; | ||
5 | -import org.springframework.context.annotation.ComponentScan; | ||
6 | -import org.springframework.context.annotation.Configuration; | ||
7 | - | ||
8 | -@Configuration | ||
9 | -@ComponentScan("com.diligrp.etrade.ecap") | ||
10 | -@MapperScan(basePackages = {"com.diligrp.etrade.ecap.dao"}, markerInterface = MybatisMapperSupport.class) | ||
11 | -public class EcapConfiguration { | ||
12 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/config/EcapConfig.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.config; | ||
2 | - | ||
3 | -import com.lop.open.api.sdk.DefaultDomainApiClient; | ||
4 | -import com.lop.open.api.sdk.plugin.LopPlugin; | ||
5 | -import com.lop.open.api.sdk.plugin.factory.OAuth2PluginFactory; | ||
6 | -import org.springframework.beans.factory.annotation.Value; | ||
7 | -import org.springframework.boot.CommandLineRunner; | ||
8 | -import org.springframework.cloud.context.config.annotation.RefreshScope; | ||
9 | -import org.springframework.stereotype.Component; | ||
10 | - | ||
11 | -@Component | ||
12 | -@RefreshScope | ||
13 | -public class EcapConfig implements CommandLineRunner { | ||
14 | - | ||
15 | - @Value("${ecap.url:}") | ||
16 | - private String ecapUrl; | ||
17 | - | ||
18 | - @Value("${ecap.Appkey:}") | ||
19 | - private String ecapAppkey; | ||
20 | - | ||
21 | - @Value("${ecap.AppSecret:}") | ||
22 | - private String ecapAppSecret; | ||
23 | - | ||
24 | - @Value("${ecap.AccessToken:}") | ||
25 | - private String ecapAccessToken; | ||
26 | - | ||
27 | - @Value("${ecap.CustomerCode:}") | ||
28 | - private String ecapCustomerCode; | ||
29 | - | ||
30 | - @Override | ||
31 | - public void run(String... args) { | ||
32 | - if (ecapUrl == null || ecapUrl.isEmpty()) { | ||
33 | - throw new IllegalArgumentException("京东物流参数{ecap.url}未配置"); | ||
34 | - } | ||
35 | - | ||
36 | - if (ecapAppkey == null || ecapAppkey.isEmpty()) { | ||
37 | - throw new IllegalArgumentException("京东物流参数{ecap.Appkey}未配置"); | ||
38 | - } | ||
39 | - | ||
40 | - if (ecapAppSecret == null || ecapAppSecret.isEmpty()) { | ||
41 | - throw new IllegalArgumentException("京东物流参数{ecap.AppSecret}未配置"); | ||
42 | - } | ||
43 | - | ||
44 | - if (ecapAccessToken == null || ecapAccessToken.isEmpty()) { | ||
45 | - throw new IllegalArgumentException("京东物流参数{ecap.AccessToken}未配置"); | ||
46 | - } | ||
47 | - | ||
48 | - if (ecapCustomerCode == null || ecapCustomerCode.isEmpty()) { | ||
49 | - throw new IllegalArgumentException("京东物流参数{ecap.CustomerCode}未配置"); | ||
50 | - } | ||
51 | - } | ||
52 | - | ||
53 | - public DefaultDomainApiClient getDefaultDomainApiClient() { | ||
54 | - return new DefaultDomainApiClient(ecapUrl, 500, 15000); | ||
55 | - } | ||
56 | - | ||
57 | - public LopPlugin getLopPlugin() { | ||
58 | - return OAuth2PluginFactory.produceLopPlugin(ecapAppkey, ecapAppSecret, ecapAccessToken); | ||
59 | - } | ||
60 | - | ||
61 | - public String getCustomerCode() { | ||
62 | - return ecapCustomerCode; | ||
63 | - } | ||
64 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/constant/Constant.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.constant; | ||
2 | - | ||
3 | -/** | ||
4 | - * 常量类 | ||
5 | - * | ||
6 | - * @author : shaofan | ||
7 | - * @date : 2024-01-08 | ||
8 | - */ | ||
9 | -public interface Constant { | ||
10 | - | ||
11 | - /** | ||
12 | - * 支付方式(月结) | ||
13 | - */ | ||
14 | - Integer SETTLE_TYPE = 3; | ||
15 | - /** | ||
16 | - * 快递折扣 | ||
17 | - */ | ||
18 | - String EXPRESS_DISCOUNT = "express_discount"; | ||
19 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/controller/EcapContactPersonController.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.controller; | ||
2 | - | ||
3 | - | ||
4 | -import cn.hutool.core.lang.Assert; | ||
5 | -import com.diligrp.etrade.core.domain.Message; | ||
6 | -import com.diligrp.etrade.core.domain.PageMessage; | ||
7 | -import com.diligrp.etrade.core.util.NameUtil; | ||
8 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonCo; | ||
9 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonListCo; | ||
10 | -import com.diligrp.etrade.ecap.service.EcapContactPersonService; | ||
11 | -import jakarta.annotation.Resource; | ||
12 | -import org.slf4j.Logger; | ||
13 | -import org.slf4j.LoggerFactory; | ||
14 | -import org.springframework.validation.annotation.Validated; | ||
15 | -import org.springframework.web.bind.annotation.*; | ||
16 | - | ||
17 | -/** | ||
18 | - * <p> | ||
19 | - * 前端控制器 | ||
20 | - * </p> | ||
21 | - * | ||
22 | - * @author chenzhiwei | ||
23 | - * @since 2023-12-27 | ||
24 | - */ | ||
25 | -@RestController | ||
26 | -@RequestMapping("/ecapContactPerson") | ||
27 | -public class EcapContactPersonController { | ||
28 | - private static final Logger log = LoggerFactory.getLogger(EcapContactPersonController.class); | ||
29 | - @Resource | ||
30 | - EcapContactPersonService ecapContactPersonService; | ||
31 | - @GetMapping("/test") | ||
32 | - public Message<String> test() { | ||
33 | - return Message.success("test"); | ||
34 | - } | ||
35 | - | ||
36 | - /** | ||
37 | - * 新增联系人 | ||
38 | - * @param co | ||
39 | - * @return | ||
40 | - */ | ||
41 | - @PostMapping("/add") | ||
42 | - public Message<Void> add(@RequestBody @Validated EcapContactPersonCo co) { | ||
43 | - Assert.isTrue(!NameUtil.containsEmoji(co.getName()),"联系人姓名不能包含表情标签"); | ||
44 | - Assert.isTrue(NameUtil.isLessUseWord(co.getName()),"联系人姓名不能包含生僻字"); | ||
45 | - return ecapContactPersonService.saveContact(co); | ||
46 | - } | ||
47 | - | ||
48 | - /** | ||
49 | - * 更新联系人 | ||
50 | - * | ||
51 | - * @param co | ||
52 | - * @return | ||
53 | - */ | ||
54 | - @PostMapping("/update") | ||
55 | - public Message<Void> update(@RequestBody @Validated EcapContactPersonCo co) { | ||
56 | - Assert.isTrue(!NameUtil.containsEmoji(co.getName()),"联系人姓名不能包含表情标签"); | ||
57 | - Assert.isTrue(NameUtil.isLessUseWord(co.getName()),"联系人姓名不能包含生僻字"); | ||
58 | - return ecapContactPersonService.updateContact(co); | ||
59 | - } | ||
60 | - | ||
61 | - /** | ||
62 | - * 删除联系人 | ||
63 | - * @param co | ||
64 | - * @return | ||
65 | - */ | ||
66 | - @PostMapping("/delete") | ||
67 | - public Message<Void> delete(@RequestBody EcapContactPersonCo co) { | ||
68 | - return ecapContactPersonService.delete(co); | ||
69 | - } | ||
70 | - /** | ||
71 | - * 联系人列表 | ||
72 | - */ | ||
73 | - @PostMapping(value = "/list") | ||
74 | - public PageMessage list(@RequestBody @Validated EcapContactPersonListCo co) { | ||
75 | - log.info("联系人列表查询 param={}", co); | ||
76 | - return ecapContactPersonService.page(co); | ||
77 | - } | ||
78 | -} | ||
79 | - |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/controller/EcapController.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.controller; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.domain.Message; | ||
4 | -import com.diligrp.etrade.ecap.domain.request.EcapTraceMsgPush; | ||
5 | -import com.diligrp.etrade.ecap.service.EcapOrderService; | ||
6 | -import com.diligrp.etrade.ecap.service.EcapService; | ||
7 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.CommonCheckPreCreateOrderResponse; | ||
8 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceResponse; | ||
9 | -import com.lop.open.api.sdk.domain.ECAP.WaybillTrackAndTimePositionApi.getWaybillGisTrackByWaybillCode.data; | ||
10 | -import com.lop.open.api.sdk.request.ECAP.EcapV1OrdersPrecheckLopRequest; | ||
11 | -import com.lop.open.api.sdk.request.ECAP.EcapV1OrdersTraceQueryLopRequest; | ||
12 | -import org.springframework.web.bind.annotation.*; | ||
13 | - | ||
14 | -/** | ||
15 | - * 京东物流接口 | ||
16 | - */ | ||
17 | -@RestController | ||
18 | -@RequestMapping("/ecap") | ||
19 | -public class EcapController { | ||
20 | - | ||
21 | - | ||
22 | - private final EcapOrderService ecapOrderService; | ||
23 | - | ||
24 | - private final EcapService ecapService; | ||
25 | - | ||
26 | - public EcapController(EcapOrderService ecapOrderService, EcapService ecapService) { | ||
27 | - this.ecapOrderService = ecapOrderService; | ||
28 | - this.ecapService = ecapService; | ||
29 | - } | ||
30 | - | ||
31 | - /** | ||
32 | - * 下单前置校验 | ||
33 | - */ | ||
34 | - @PostMapping("/precheck") | ||
35 | - public Message<CommonCheckPreCreateOrderResponse> precheck(@RequestBody EcapV1OrdersPrecheckLopRequest request) { | ||
36 | - try { | ||
37 | - return Message.success(ecapService.precheck(request.getRequest())); | ||
38 | - } catch (Exception e) { | ||
39 | - return Message.failure(e.getMessage()); | ||
40 | - } | ||
41 | - } | ||
42 | - | ||
43 | - /** | ||
44 | - * 获取运单号 | ||
45 | - */ | ||
46 | - @GetMapping("/pregetwaybillcodes") | ||
47 | - public Message<String> preGetWaybillCodes() { | ||
48 | - try { | ||
49 | - return Message.success(ecapService.preGetWaybillCodes()); | ||
50 | - } catch (Exception e) { | ||
51 | - return Message.failure(e.getMessage()); | ||
52 | - } | ||
53 | - } | ||
54 | - | ||
55 | - /** | ||
56 | - * 接收推送到订单的轨迹信息并更新订单 | ||
57 | - * | ||
58 | - * @param trace 轨迹信息 | ||
59 | - */ | ||
60 | - @PostMapping("/push") | ||
61 | - public void push(@RequestBody EcapTraceMsgPush trace) { | ||
62 | - ecapOrderService.updateByTrace(trace); | ||
63 | - } | ||
64 | - | ||
65 | - | ||
66 | - /** | ||
67 | - * 根据传入的订单追踪请求查询订单的追踪信息 | ||
68 | - * | ||
69 | - * @param request 订单追踪查询请求对象 | ||
70 | - * @return 订单追踪查询结果消息 | ||
71 | - */ | ||
72 | - @PostMapping("/traceQuery") | ||
73 | - public Message<CommonOrderTraceResponse> traceQuery(@RequestBody EcapV1OrdersTraceQueryLopRequest request) { | ||
74 | - try { | ||
75 | - return Message.success(ecapService.traceQuery(request.getCommonOrderTraceRequest())); | ||
76 | - } catch (Exception e) { | ||
77 | - return Message.failure(e.getMessage()); | ||
78 | - } | ||
79 | - } | ||
80 | - | ||
81 | - @GetMapping("/getWaybillGisTrack") | ||
82 | - public Message<data> getWaybillGisTrack(String waybillCode) { | ||
83 | - try { | ||
84 | - return Message.success(ecapService.getWaybillGisTrack(waybillCode)); | ||
85 | - } catch (Exception e) { | ||
86 | - return Message.failure(e.getMessage()); | ||
87 | - } | ||
88 | - } | ||
89 | - | ||
90 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/controller/EcapOrderController.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.controller; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.Message; | ||
5 | -import com.diligrp.etrade.core.domain.PageMessage; | ||
6 | -import com.diligrp.etrade.core.util.NameUtil; | ||
7 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderCo; | ||
8 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderListCo; | ||
9 | -import com.diligrp.etrade.ecap.domain.request.EcapWeChatPayTrade; | ||
10 | -import com.diligrp.etrade.ecap.service.EcapOrderService; | ||
11 | -import com.diligrp.etrade.rpc.dto.WeChatPayTradeBackDto; | ||
12 | -import com.diligrp.idempotent.spring.boot.annotation.Idempotent; | ||
13 | -import jakarta.annotation.Resource; | ||
14 | -import org.slf4j.Logger; | ||
15 | -import org.slf4j.LoggerFactory; | ||
16 | -import org.springframework.util.Assert; | ||
17 | -import org.springframework.util.ObjectUtils; | ||
18 | -import org.springframework.validation.annotation.Validated; | ||
19 | -import org.springframework.web.bind.annotation.PostMapping; | ||
20 | -import org.springframework.web.bind.annotation.RequestBody; | ||
21 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
22 | -import org.springframework.web.bind.annotation.RestController; | ||
23 | - | ||
24 | - | ||
25 | -/** | ||
26 | - * <p> | ||
27 | - * 前端控制器 | ||
28 | - * </p> | ||
29 | - * | ||
30 | - * @author chenzhiwei | ||
31 | - * @since 2023-12-28 | ||
32 | - */ | ||
33 | -@RestController | ||
34 | -@RequestMapping("/ecapOrder") | ||
35 | -public class EcapOrderController { | ||
36 | - private static final Logger log = LoggerFactory.getLogger(EcapContactPersonController.class); | ||
37 | - @Resource | ||
38 | - private EcapOrderService ecapOrderService; | ||
39 | - | ||
40 | - /** | ||
41 | - * 新增 | ||
42 | - * | ||
43 | - * @param co | ||
44 | - * @return | ||
45 | - */ | ||
46 | - @PostMapping("/add") | ||
47 | - @Idempotent(unlockKey = false) | ||
48 | - public Message<Long> add(@RequestBody @Validated EcapOrderCo co) { | ||
49 | - log.info("下单入参,{}", co); | ||
50 | - Assert.isTrue(!NameUtil.containsEmoji(co.getSenderName()), "寄件人姓名不能包含表情标签"); | ||
51 | - Assert.isTrue(NameUtil.isLessUseWord(co.getSenderName()), "寄件人姓名不能包含生僻字"); | ||
52 | - Assert.isTrue(!NameUtil.containsEmoji(co.getReceiverName()), "收件人姓名不能包含表情标签"); | ||
53 | - Assert.isTrue(NameUtil.isLessUseWord(co.getReceiverName()), "收件人姓名不能包含生僻字"); | ||
54 | - return ecapOrderService.insert(co); | ||
55 | - } | ||
56 | - | ||
57 | - /** | ||
58 | - * 更新 | ||
59 | - * | ||
60 | - * @param co | ||
61 | - * @return | ||
62 | - */ | ||
63 | - @PostMapping("/update") | ||
64 | - public Message<Void> update(@RequestBody @Validated EcapOrderCo co) { | ||
65 | - return ecapOrderService.update(co); | ||
66 | - } | ||
67 | - | ||
68 | - /** | ||
69 | - * 修改订单支付状态 | ||
70 | - */ | ||
71 | - @PostMapping("/update/payState") | ||
72 | - public Message<Void> updatePayState(@RequestBody EcapOrderCo co) { | ||
73 | - log.info("修改订单支付状态入参,{}", co); | ||
74 | - Assert.notNull(co.getId(), "修改订单状态时id不能为空"); | ||
75 | - Assert.notNull(co.getPayState(), "修改订单状态时状态值不能为空"); | ||
76 | - Assert.notNull(co.getVersion(), "修改订单状态时订单版本号不能为空"); | ||
77 | - return ecapOrderService.updatePayState(co); | ||
78 | - } | ||
79 | - | ||
80 | - /** | ||
81 | - * 微信支付订单回调接口 | ||
82 | - */ | ||
83 | - @PostMapping("/payState/callback") | ||
84 | - public Message<Void> payStateCallback(@RequestBody String param) { | ||
85 | - log.info("微信支付订单回调接口,{}", param); | ||
86 | - Assert.notNull(param, "回调入参不能为空"); | ||
87 | - return ecapOrderService.payStateCallback(param); | ||
88 | - } | ||
89 | - | ||
90 | - /** | ||
91 | - * 微信退款回调接口 | ||
92 | - */ | ||
93 | - @PostMapping("/refund/callback") | ||
94 | - public Message<Void> refundCallback(@RequestBody String param) { | ||
95 | - log.info("微信退款回调接口,{}", param); | ||
96 | - Assert.notNull(param, "回调入参不能为空"); | ||
97 | - return ecapOrderService.refundCallback(param); | ||
98 | - } | ||
99 | - | ||
100 | - /** | ||
101 | - * 列表 | ||
102 | - */ | ||
103 | - @PostMapping(value = "/list") | ||
104 | - public PageMessage list(@RequestBody @Validated EcapOrderListCo co) { | ||
105 | - | ||
106 | - return ecapOrderService.page(co); | ||
107 | - } | ||
108 | - | ||
109 | - /** | ||
110 | - * 客户查询快递信息 | ||
111 | - * | ||
112 | - * @param co | ||
113 | - * @return | ||
114 | - */ | ||
115 | - @PostMapping(value = "/listByCustomer") | ||
116 | - public PageMessage listByCustomer(@RequestBody @Validated EcapOrderListCo co) { | ||
117 | - log.info("客户查询快递信息入参,{}", co); | ||
118 | - if (1 == co.getTag() || 3 == co.getTag()) { | ||
119 | - Assert.isTrue(!ObjectUtils.isEmpty(co.getCustomerId()), "查询快递信息,必须传入客户信息"); | ||
120 | - } | ||
121 | - if (2 == co.getTag()) { | ||
122 | - Assert.isTrue(!ObjectUtils.isEmpty(co.getReceiverMobile()), "查询‘我收’部分信息,必须传入收件人电话"); | ||
123 | - } | ||
124 | - return ecapOrderService.listByCustomer(co); | ||
125 | - } | ||
126 | - | ||
127 | - /** | ||
128 | - * 微信支付 | ||
129 | - * @return | ||
130 | - */ | ||
131 | - @PostMapping("/wechatPay") | ||
132 | - public Message<WeChatPayTradeBackDto> wechatPay(@RequestBody EcapWeChatPayTrade ecapWeChatPayTrade) { | ||
133 | - ecapWeChatPayTrade.validate(); | ||
134 | - return ecapOrderService.wechatPay(ecapWeChatPayTrade); | ||
135 | - } | ||
136 | -} | ||
137 | - |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/dao/EcapContactPersonMapper.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.dao; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.mybatis.MybatisMapperSupport; | ||
5 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonListCo; | ||
6 | -import com.diligrp.etrade.ecap.domain.response.EcapContactPersonListVo; | ||
7 | -import com.diligrp.etrade.ecap.model.EcapContactPersonDo; | ||
8 | -import com.github.pagehelper.Page; | ||
9 | - | ||
10 | -/** | ||
11 | - * <p> | ||
12 | - * Mapper 接口 | ||
13 | - * </p> | ||
14 | - * | ||
15 | - * @author chenzhiwei | ||
16 | - * @since 2023-12-27 | ||
17 | - */ | ||
18 | -public interface EcapContactPersonMapper extends MybatisMapperSupport { | ||
19 | - int insert(EcapContactPersonDo entity); | ||
20 | - | ||
21 | - int update(EcapContactPersonDo entity); | ||
22 | - Page<EcapContactPersonListVo> list(EcapContactPersonListCo co); | ||
23 | - | ||
24 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/dao/EcapOrderMapper.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.dao; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.mybatis.MybatisMapperSupport; | ||
5 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderCo; | ||
6 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderListCo; | ||
7 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderUpdateOrderStateCo; | ||
8 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderUpdatePayStateCo; | ||
9 | -import com.diligrp.etrade.ecap.domain.response.EcapContactPersonListVo; | ||
10 | -import com.diligrp.etrade.ecap.domain.response.EcapOrderListVo; | ||
11 | -import com.diligrp.etrade.ecap.model.EcapOrderDo; | ||
12 | -import com.github.pagehelper.Page; | ||
13 | - | ||
14 | -/** | ||
15 | - * <p> | ||
16 | - * Mapper 接口 | ||
17 | - * </p> | ||
18 | - * | ||
19 | - * @author chenzhiwei | ||
20 | - * @since 2023-12-28 | ||
21 | - */ | ||
22 | -public interface EcapOrderMapper extends MybatisMapperSupport { | ||
23 | - /** | ||
24 | - * 新增记录 | ||
25 | - * @param ecapOrderDo | ||
26 | - * @return | ||
27 | - */ | ||
28 | - int insert(EcapOrderDo ecapOrderDo); | ||
29 | - | ||
30 | - /** | ||
31 | - * 更新单据 | ||
32 | - * @param ecapOrderDo | ||
33 | - * @return | ||
34 | - */ | ||
35 | - int update(EcapOrderDo ecapOrderDo); | ||
36 | - | ||
37 | - /** | ||
38 | - * 更新支付状态 | ||
39 | - * @param payStateCo | ||
40 | - * @return | ||
41 | - */ | ||
42 | - int updatePayState(EcapOrderUpdatePayStateCo payStateCo); | ||
43 | - | ||
44 | - /** | ||
45 | - * 更新订单状态 | ||
46 | - * @param payStateCo | ||
47 | - * @return | ||
48 | - */ | ||
49 | - int updateOrderState(EcapOrderUpdateOrderStateCo payStateCo); | ||
50 | - | ||
51 | - /** | ||
52 | - * 查询分页记录 | ||
53 | - * @param ecapOrderListCo | ||
54 | - * @return | ||
55 | - */ | ||
56 | - Page<EcapOrderListVo> page(EcapOrderListCo ecapOrderListCo); | ||
57 | - | ||
58 | - /** | ||
59 | - * 客户查询快递信息 | ||
60 | - * @param co | ||
61 | - * @return | ||
62 | - */ | ||
63 | - Page<EcapOrderListVo> listByCustomer(EcapOrderListCo co); | ||
64 | - /** | ||
65 | - * 根据id、运单号、订单号查询快递信息(本地) | ||
66 | - */ | ||
67 | - EcapOrderListVo getOrderByNumber(EcapOrderCo co); | ||
68 | - | ||
69 | - /** | ||
70 | - * 更新京东运单号 | ||
71 | - * @param co | ||
72 | - * @return | ||
73 | - */ | ||
74 | - | ||
75 | - int updateJDNum(EcapOrderListVo co); | ||
76 | - | ||
77 | - /** | ||
78 | - * 更新费用及订单状态 | ||
79 | - * @param entity | ||
80 | - * @return | ||
81 | - */ | ||
82 | - int updateFeeAndOrderState(EcapOrderUpdatePayStateCo entity); | ||
83 | - | ||
84 | - /** | ||
85 | - * | ||
86 | - * @param entity | ||
87 | - * @return | ||
88 | - */ | ||
89 | - int updateReFund(EcapOrderListVo entity); | ||
90 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapContactPersonCo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
5 | -import jakarta.validation.constraints.NotNull; | ||
6 | -import jakarta.validation.constraints.Pattern; | ||
7 | -import netscape.javascript.JSObject; | ||
8 | -import org.hibernate.validator.constraints.Length; | ||
9 | - | ||
10 | - | ||
11 | -/** | ||
12 | - * 由MyBatis Generator工具自动生成 | ||
13 | - * | ||
14 | - * This file was generated on 2023-12-27 10:53:06. | ||
15 | - */ | ||
16 | - | ||
17 | -public class EcapContactPersonCo extends BaseDo { | ||
18 | - /** | ||
19 | - * 创建人id | ||
20 | - */ | ||
21 | - private Long createrId; | ||
22 | - /** | ||
23 | - * 创建人 | ||
24 | - */ | ||
25 | - private String creater; | ||
26 | - /** | ||
27 | - * 姓名 | ||
28 | - */ | ||
29 | - @NotNull(message = "联系人姓名不能为空") | ||
30 | - @Length(max = 50,message = "联系人姓名长度最大不能超过50字") | ||
31 | - private String name; | ||
32 | - | ||
33 | - /** | ||
34 | - * 电话 | ||
35 | - */ | ||
36 | - @NotNull(message = "电话号码不能为空") | ||
37 | - @Length(max = 11,message = "电话号码不能超过11位") | ||
38 | - @Pattern(regexp = "\\d+", message = "电话号码只能输入数字") | ||
39 | - private String mobile; | ||
40 | - | ||
41 | - /** | ||
42 | - * 地址 | ||
43 | - */ | ||
44 | - @NotNull(message = "详细地址不能为空") | ||
45 | - @Length(max = 100,message = "详细地址不能超过100个字符") | ||
46 | - private String address; | ||
47 | - /** | ||
48 | - * 分机号 | ||
49 | - */ | ||
50 | - @Length(max = 10,message = "分机号最长不能超过10位") | ||
51 | - private String extensionNumber; | ||
52 | - /** | ||
53 | - * 省份 | ||
54 | - */ | ||
55 | - private Long provinceId; | ||
56 | - /** | ||
57 | - * 省份 | ||
58 | - */ | ||
59 | - @NotNull(message = "省份不能为空") | ||
60 | - private String provinceName; | ||
61 | - /** | ||
62 | - * 城市 | ||
63 | - */ | ||
64 | - private Long cityId; | ||
65 | - /** | ||
66 | - * 城市 | ||
67 | - */ | ||
68 | - @NotNull(message = "城市不能为空") | ||
69 | - private String cityName; | ||
70 | - /** | ||
71 | - * 区县 | ||
72 | - */ | ||
73 | - private Long districtId; | ||
74 | - /** | ||
75 | - * 区县 | ||
76 | - */ | ||
77 | - @NotNull(message = "区县不能为空") | ||
78 | - private String districtName; | ||
79 | - | ||
80 | - /** | ||
81 | - * 状态 1:启用 2:禁用 | ||
82 | - * @return | ||
83 | - */ | ||
84 | - private Integer state; | ||
85 | - | ||
86 | - public Long getProvinceId() { | ||
87 | - return provinceId; | ||
88 | - } | ||
89 | - | ||
90 | - public void setProvinceId(Long provinceId) { | ||
91 | - this.provinceId = provinceId; | ||
92 | - } | ||
93 | - | ||
94 | - public String getProvinceName() { | ||
95 | - return provinceName; | ||
96 | - } | ||
97 | - | ||
98 | - public void setProvinceName(String provinceName) { | ||
99 | - this.provinceName = provinceName; | ||
100 | - } | ||
101 | - | ||
102 | - public Long getCityId() { | ||
103 | - return cityId; | ||
104 | - } | ||
105 | - | ||
106 | - public void setCityId(Long cityId) { | ||
107 | - this.cityId = cityId; | ||
108 | - } | ||
109 | - | ||
110 | - public String getCityName() { | ||
111 | - return cityName; | ||
112 | - } | ||
113 | - | ||
114 | - public void setCityName(String cityName) { | ||
115 | - this.cityName = cityName; | ||
116 | - } | ||
117 | - | ||
118 | - public Long getDistrictId() { | ||
119 | - return districtId; | ||
120 | - } | ||
121 | - | ||
122 | - public void setDistrictId(Long districtId) { | ||
123 | - this.districtId = districtId; | ||
124 | - } | ||
125 | - | ||
126 | - public String getDistrictName() { | ||
127 | - return districtName; | ||
128 | - } | ||
129 | - | ||
130 | - public void setDistrictName(String districtName) { | ||
131 | - this.districtName = districtName; | ||
132 | - } | ||
133 | - | ||
134 | - public String getExtensionNumber() { | ||
135 | - return extensionNumber; | ||
136 | - } | ||
137 | - | ||
138 | - public void setExtensionNumber(String extensionNumber) { | ||
139 | - this.extensionNumber = extensionNumber; | ||
140 | - } | ||
141 | - | ||
142 | - public Long getCreaterId() { | ||
143 | - return createrId; | ||
144 | - } | ||
145 | - | ||
146 | - public void setCreaterId(Long createrId) { | ||
147 | - this.createrId = createrId; | ||
148 | - } | ||
149 | - | ||
150 | - public String getCreater() { | ||
151 | - return creater; | ||
152 | - } | ||
153 | - | ||
154 | - public void setCreater(String creater) { | ||
155 | - this.creater = creater; | ||
156 | - } | ||
157 | - | ||
158 | - public String getName() { | ||
159 | - return name; | ||
160 | - } | ||
161 | - | ||
162 | - public void setName(String name) { | ||
163 | - this.name = name; | ||
164 | - } | ||
165 | - | ||
166 | - public String getMobile() { | ||
167 | - return mobile; | ||
168 | - } | ||
169 | - | ||
170 | - public void setMobile(String mobile) { | ||
171 | - this.mobile = mobile; | ||
172 | - } | ||
173 | - | ||
174 | - public String getAddress() { | ||
175 | - return address; | ||
176 | - } | ||
177 | - | ||
178 | - public void setAddress(String address) { | ||
179 | - this.address = address; | ||
180 | - } | ||
181 | - | ||
182 | - public Integer getState() { | ||
183 | - return state; | ||
184 | - } | ||
185 | - | ||
186 | - public void setState(Integer state) { | ||
187 | - this.state = state; | ||
188 | - } | ||
189 | - | ||
190 | - @Override | ||
191 | - public String toString() { | ||
192 | - return "EcapContactPersonCo{" + | ||
193 | - "createrId=" + createrId + | ||
194 | - ", creater='" + creater + '\'' + | ||
195 | - ", name='" + name + '\'' + | ||
196 | - ", mobile='" + mobile + '\'' + | ||
197 | - ", address='" + address + '\'' + | ||
198 | - ", extensionNumber='" + extensionNumber + '\'' + | ||
199 | - ", provinceId=" + provinceId + | ||
200 | - ", provinceName='" + provinceName + '\'' + | ||
201 | - ", cityId=" + cityId + | ||
202 | - ", cityName='" + cityName + '\'' + | ||
203 | - ", districtId=" + districtId + | ||
204 | - ", districtName='" + districtName + '\'' + | ||
205 | - ", state=" + state + | ||
206 | - ", id=" + id + | ||
207 | - ", version=" + version + | ||
208 | - ", createdTime=" + createdTime + | ||
209 | - ", modifiedTime=" + modifiedTime + | ||
210 | - '}'; | ||
211 | - } | ||
212 | -} | ||
213 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapContactPersonListCo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.BasePageQuery; | ||
5 | -import org.hibernate.validator.constraints.Length; | ||
6 | - | ||
7 | - | ||
8 | -/** | ||
9 | - * 由MyBatis Generator工具自动生成 | ||
10 | - * | ||
11 | - * This file was generated on 2023-12-27 10:53:06. | ||
12 | - */ | ||
13 | - | ||
14 | -public class EcapContactPersonListCo extends BasePageQuery { | ||
15 | - /** | ||
16 | - * 创建人id | ||
17 | - */ | ||
18 | - private Long createrId; | ||
19 | - | ||
20 | - /** | ||
21 | - * 姓名 | ||
22 | - */ | ||
23 | - private String name; | ||
24 | - | ||
25 | - /** | ||
26 | - * 电话 | ||
27 | - */ | ||
28 | - private String mobile; | ||
29 | - | ||
30 | - /** | ||
31 | - * 关键词 | ||
32 | - * @return | ||
33 | - */ | ||
34 | - @Length(max =20,message = "最大输入20个字符") | ||
35 | - private String keyWords; | ||
36 | - | ||
37 | - public String getKeyWords() { | ||
38 | - return keyWords; | ||
39 | - } | ||
40 | - | ||
41 | - public void setKeyWords(String keyWords) { | ||
42 | - this.keyWords = keyWords; | ||
43 | - } | ||
44 | - | ||
45 | - public Long getCreaterId() { | ||
46 | - return createrId; | ||
47 | - } | ||
48 | - | ||
49 | - public void setCreaterId(Long createrId) { | ||
50 | - this.createrId = createrId; | ||
51 | - } | ||
52 | - | ||
53 | - public String getName() { | ||
54 | - return name; | ||
55 | - } | ||
56 | - | ||
57 | - public void setName(String name) { | ||
58 | - this.name = name; | ||
59 | - } | ||
60 | - | ||
61 | - public String getMobile() { | ||
62 | - return mobile; | ||
63 | - } | ||
64 | - | ||
65 | - public void setMobile(String mobile) { | ||
66 | - this.mobile = mobile; | ||
67 | - } | ||
68 | -} | ||
69 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapOrderCo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
4 | -import jakarta.validation.constraints.Max; | ||
5 | -import jakarta.validation.constraints.Min; | ||
6 | -import jakarta.validation.constraints.NotNull; | ||
7 | -import jakarta.validation.constraints.Pattern; | ||
8 | -import org.hibernate.validator.constraints.Length; | ||
9 | - | ||
10 | -import java.time.LocalDateTime; | ||
11 | -import java.util.Date; | ||
12 | - | ||
13 | - | ||
14 | -/** | ||
15 | - * <p> | ||
16 | - * | ||
17 | - * </p> | ||
18 | - * | ||
19 | - * @author chenzhiwei | ||
20 | - * @since 2023-12-28 | ||
21 | - */ | ||
22 | - | ||
23 | -public class EcapOrderCo extends BaseDo { | ||
24 | - | ||
25 | - | ||
26 | - /** | ||
27 | - * 订单编号 | ||
28 | - */ | ||
29 | - private String orderNumber; | ||
30 | - | ||
31 | - /** | ||
32 | - * JD运单号 | ||
33 | - */ | ||
34 | - @NotNull(message = "京东运单号不能为空") | ||
35 | - private String jdNumber; | ||
36 | - | ||
37 | - /** | ||
38 | - * 创建人客户Id | ||
39 | - */ | ||
40 | - private Long customerId; | ||
41 | - | ||
42 | - /** | ||
43 | - * 创建人客户 | ||
44 | - */ | ||
45 | - private String customerName; | ||
46 | - | ||
47 | - /** | ||
48 | - * 创建人客户编码 | ||
49 | - */ | ||
50 | - private String customerCode; | ||
51 | - | ||
52 | - /** | ||
53 | - * 创建人电话 | ||
54 | - */ | ||
55 | - private String customerMobile; | ||
56 | - | ||
57 | - /** | ||
58 | - * 创建人 | ||
59 | - */ | ||
60 | - private String creater; | ||
61 | - | ||
62 | - | ||
63 | - /** | ||
64 | - * 寄件人姓名 | ||
65 | - */ | ||
66 | - @NotNull(message = "寄件人姓名不能为空") | ||
67 | - @Length(max = 50,message = "寄件人姓名长度最大不能超过50字") | ||
68 | - private String senderName; | ||
69 | - | ||
70 | - /** | ||
71 | - * 寄件人电话 | ||
72 | - */ | ||
73 | - private String senderMobile; | ||
74 | - /** | ||
75 | - * 分机号 | ||
76 | - */ | ||
77 | - private String senderPhone; | ||
78 | - /** | ||
79 | - * 省 | ||
80 | - */ | ||
81 | - @NotNull(message = "寄件人地址省份不能为空") | ||
82 | - private String senderProvince; | ||
83 | - | ||
84 | - /** | ||
85 | - * 城市 | ||
86 | - */ | ||
87 | - @NotNull(message = "寄件人地址城市不能为空") | ||
88 | - private String senderCity; | ||
89 | - | ||
90 | - /** | ||
91 | - * 区县 | ||
92 | - */ | ||
93 | - private String senderDistrict; | ||
94 | - | ||
95 | - /** | ||
96 | - * 寄件人地址 | ||
97 | - */ | ||
98 | - @NotNull(message = "寄件人地址不能为空") | ||
99 | - private String senderAddress; | ||
100 | - | ||
101 | - /** | ||
102 | - * 收件人名字 | ||
103 | - */ | ||
104 | - @NotNull(message = "收件人姓名不能为空") | ||
105 | - @Length(max = 50,message = "收件人姓名长度最大不能超过50字") | ||
106 | - private String receiverName; | ||
107 | - | ||
108 | - /** | ||
109 | - * 收件人电话 | ||
110 | - */ | ||
111 | - private String receiverMobile; | ||
112 | - /** | ||
113 | - * 分机号 | ||
114 | - */ | ||
115 | - private String receiverPhone; | ||
116 | - /** | ||
117 | - * 省 | ||
118 | - */ | ||
119 | - @NotNull(message = "收件人地址省份不能为空") | ||
120 | - private String receiverProvince; | ||
121 | - | ||
122 | - /** | ||
123 | - * 城市 | ||
124 | - */ | ||
125 | - @NotNull(message = "收件人地址城市不能为空") | ||
126 | - private String receiverCity; | ||
127 | - | ||
128 | - /** | ||
129 | - * 区县 | ||
130 | - */ | ||
131 | - private String receiverDistrict; | ||
132 | - | ||
133 | - /** | ||
134 | - * 收件人地址 | ||
135 | - */ | ||
136 | - @NotNull(message = "收件人地址不能为空") | ||
137 | - private String receiverAddress; | ||
138 | - /** | ||
139 | - * 期望上门时间--开始 | ||
140 | - */ | ||
141 | - private Date pickupStartTime; | ||
142 | - /** | ||
143 | - * 期望上门时间--结束 | ||
144 | - */ | ||
145 | - private Date pickupEndTime; | ||
146 | - /** | ||
147 | - * 重量 单位公斤 | ||
148 | - */ | ||
149 | - @NotNull(message = "重量不能为空") | ||
150 | - @Min(value=1,message = "重量不能小于1") | ||
151 | - @Max(value=5000,message = "重量不能大于5000") | ||
152 | - private Long weight; | ||
153 | - /** | ||
154 | - * 货物信息 | ||
155 | - */ | ||
156 | - private String goodsInfo; | ||
157 | - | ||
158 | - /** | ||
159 | - * 产品信息标件 | ||
160 | - */ | ||
161 | - private String productInfo; | ||
162 | - | ||
163 | - /** | ||
164 | - * 总费用单位分 | ||
165 | - */ | ||
166 | - private Long totalAmount; | ||
167 | - /** | ||
168 | - * 实际支付金额 | ||
169 | - */ | ||
170 | - private Long totalStandardAmount; | ||
171 | - /** | ||
172 | - * 补缴金额 | ||
173 | - */ | ||
174 | - private Long paidBackAmount; | ||
175 | - /** | ||
176 | - * 退款金额 | ||
177 | - */ | ||
178 | - private Long refundAmount; | ||
179 | - /** | ||
180 | - * 抵扣 | ||
181 | - */ | ||
182 | - private Integer discount; | ||
183 | - | ||
184 | - /** | ||
185 | - * 状态编码:100(已接单);390(已下发);420(已揽收);430(运输中);440(派送中);480(已拦截);500(异常终止);510(妥投);530(拒收);690(已取消) | ||
186 | - */ | ||
187 | - private Integer orderState; | ||
188 | - | ||
189 | - /** | ||
190 | - * 状态文本 | ||
191 | - */ | ||
192 | - private String orderStateDesc; | ||
193 | - | ||
194 | - /** | ||
195 | - * 订单状态 0:已创建 1:待支付 2:已支付 | ||
196 | - */ | ||
197 | - private Integer payState; | ||
198 | - | ||
199 | - /** | ||
200 | - * 支付时间 | ||
201 | - */ | ||
202 | - private LocalDateTime payTime; | ||
203 | - | ||
204 | - /** | ||
205 | - * 支付交易号 | ||
206 | - */ | ||
207 | - private String tradeNo; | ||
208 | - /** | ||
209 | - * 第二次支付的流水号 | ||
210 | - */ | ||
211 | - private String paymentId; | ||
212 | - /** | ||
213 | - * 退款支付交易号 | ||
214 | - */ | ||
215 | - private String refundTradeNo; | ||
216 | - | ||
217 | - /** | ||
218 | - * 下单用户所属市场 | ||
219 | - */ | ||
220 | - private Integer marketId; | ||
221 | - | ||
222 | - /** | ||
223 | - * 快件服务协议 | ||
224 | - */ | ||
225 | - @NotNull(message = "必须勾选快件服务协议") | ||
226 | - @Max(value =1,message="必须勾选快件服务协议") | ||
227 | - @Min(value =1,message="必须勾选快件服务协议") | ||
228 | - private Integer agreementState; | ||
229 | - public String getOrderNumber() { | ||
230 | - return orderNumber; | ||
231 | - } | ||
232 | - | ||
233 | - public void setOrderNumber(String orderNumber) { | ||
234 | - this.orderNumber = orderNumber; | ||
235 | - } | ||
236 | - | ||
237 | - public String getJdNumber() { | ||
238 | - return jdNumber; | ||
239 | - } | ||
240 | - | ||
241 | - public void setJdNumber(String jdNumber) { | ||
242 | - this.jdNumber = jdNumber; | ||
243 | - } | ||
244 | - | ||
245 | - public Long getCustomerId() { | ||
246 | - return customerId; | ||
247 | - } | ||
248 | - | ||
249 | - public void setCustomerId(Long customerId) { | ||
250 | - this.customerId = customerId; | ||
251 | - } | ||
252 | - | ||
253 | - public String getCustomerName() { | ||
254 | - return customerName; | ||
255 | - } | ||
256 | - | ||
257 | - public void setCustomerName(String customerName) { | ||
258 | - this.customerName = customerName; | ||
259 | - } | ||
260 | - | ||
261 | - public String getCustomerCode() { | ||
262 | - return customerCode; | ||
263 | - } | ||
264 | - | ||
265 | - public void setCustomerCode(String customerCode) { | ||
266 | - this.customerCode = customerCode; | ||
267 | - } | ||
268 | - | ||
269 | - public String getCustomerMobile() { | ||
270 | - return customerMobile; | ||
271 | - } | ||
272 | - | ||
273 | - public void setCustomerMobile(String customerMobile) { | ||
274 | - this.customerMobile = customerMobile; | ||
275 | - } | ||
276 | - | ||
277 | - public String getCreater() { | ||
278 | - return creater; | ||
279 | - } | ||
280 | - | ||
281 | - public void setCreater(String creater) { | ||
282 | - this.creater = creater; | ||
283 | - } | ||
284 | - | ||
285 | - public String getSenderName() { | ||
286 | - return senderName; | ||
287 | - } | ||
288 | - | ||
289 | - public void setSenderName(String senderName) { | ||
290 | - this.senderName = senderName; | ||
291 | - } | ||
292 | - | ||
293 | - public String getSenderMobile() { | ||
294 | - return senderMobile; | ||
295 | - } | ||
296 | - | ||
297 | - public void setSenderMobile(String senderMobile) { | ||
298 | - this.senderMobile = senderMobile; | ||
299 | - } | ||
300 | - | ||
301 | - public String getSenderProvince() { | ||
302 | - return senderProvince; | ||
303 | - } | ||
304 | - | ||
305 | - public void setSenderProvince(String senderProvince) { | ||
306 | - this.senderProvince = senderProvince; | ||
307 | - } | ||
308 | - | ||
309 | - public String getSenderCity() { | ||
310 | - return senderCity; | ||
311 | - } | ||
312 | - | ||
313 | - public void setSenderCity(String senderCity) { | ||
314 | - this.senderCity = senderCity; | ||
315 | - } | ||
316 | - | ||
317 | - public String getSenderDistrict() { | ||
318 | - return senderDistrict; | ||
319 | - } | ||
320 | - | ||
321 | - public void setSenderDistrict(String senderDistrict) { | ||
322 | - this.senderDistrict = senderDistrict; | ||
323 | - } | ||
324 | - | ||
325 | - public String getSenderAddress() { | ||
326 | - return senderAddress; | ||
327 | - } | ||
328 | - | ||
329 | - public void setSenderAddress(String senderAddress) { | ||
330 | - this.senderAddress = senderAddress; | ||
331 | - } | ||
332 | - | ||
333 | - public String getReceiverName() { | ||
334 | - return receiverName; | ||
335 | - } | ||
336 | - | ||
337 | - public void setReceiverName(String receiverName) { | ||
338 | - this.receiverName = receiverName; | ||
339 | - } | ||
340 | - | ||
341 | - public String getReceiverMobile() { | ||
342 | - return receiverMobile; | ||
343 | - } | ||
344 | - | ||
345 | - public void setReceiverMobile(String receiverMobile) { | ||
346 | - this.receiverMobile = receiverMobile; | ||
347 | - } | ||
348 | - | ||
349 | - public String getReceiverProvince() { | ||
350 | - return receiverProvince; | ||
351 | - } | ||
352 | - | ||
353 | - public void setReceiverProvince(String receiverProvince) { | ||
354 | - this.receiverProvince = receiverProvince; | ||
355 | - } | ||
356 | - | ||
357 | - public String getReceiverCity() { | ||
358 | - return receiverCity; | ||
359 | - } | ||
360 | - | ||
361 | - public void setReceiverCity(String receiverCity) { | ||
362 | - this.receiverCity = receiverCity; | ||
363 | - } | ||
364 | - | ||
365 | - public String getReceiverDistrict() { | ||
366 | - return receiverDistrict; | ||
367 | - } | ||
368 | - | ||
369 | - public void setReceiverDistrict(String receiverDistrict) { | ||
370 | - this.receiverDistrict = receiverDistrict; | ||
371 | - } | ||
372 | - | ||
373 | - public String getReceiverAddress() { | ||
374 | - return receiverAddress; | ||
375 | - } | ||
376 | - | ||
377 | - public void setReceiverAddress(String receiverAddress) { | ||
378 | - this.receiverAddress = receiverAddress; | ||
379 | - } | ||
380 | - | ||
381 | - public String getGoodsInfo() { | ||
382 | - return goodsInfo; | ||
383 | - } | ||
384 | - | ||
385 | - public void setGoodsInfo(String goodsInfo) { | ||
386 | - this.goodsInfo = goodsInfo; | ||
387 | - } | ||
388 | - | ||
389 | - public String getProductInfo() { | ||
390 | - return productInfo; | ||
391 | - } | ||
392 | - | ||
393 | - public void setProductInfo(String productInfo) { | ||
394 | - this.productInfo = productInfo; | ||
395 | - } | ||
396 | - | ||
397 | - public Long getTotalAmount() { | ||
398 | - return totalAmount; | ||
399 | - } | ||
400 | - | ||
401 | - public void setTotalAmount(Long totalAmount) { | ||
402 | - this.totalAmount = totalAmount; | ||
403 | - } | ||
404 | - | ||
405 | - public Integer getOrderState() { | ||
406 | - return orderState; | ||
407 | - } | ||
408 | - | ||
409 | - public void setOrderState(Integer orderState) { | ||
410 | - this.orderState = orderState; | ||
411 | - } | ||
412 | - | ||
413 | - public String getOrderStateDesc() { | ||
414 | - return orderStateDesc; | ||
415 | - } | ||
416 | - | ||
417 | - public void setOrderStateDesc(String orderStateDesc) { | ||
418 | - this.orderStateDesc = orderStateDesc; | ||
419 | - } | ||
420 | - | ||
421 | - public Integer getPayState() { | ||
422 | - return payState; | ||
423 | - } | ||
424 | - | ||
425 | - public void setPayState(Integer payState) { | ||
426 | - this.payState = payState; | ||
427 | - } | ||
428 | - | ||
429 | - public LocalDateTime getPayTime() { | ||
430 | - return payTime; | ||
431 | - } | ||
432 | - | ||
433 | - public void setPayTime(LocalDateTime payTime) { | ||
434 | - this.payTime = payTime; | ||
435 | - } | ||
436 | - | ||
437 | - public String getTradeNo() { | ||
438 | - return tradeNo; | ||
439 | - } | ||
440 | - | ||
441 | - public void setTradeNo(String tradeNo) { | ||
442 | - this.tradeNo = tradeNo; | ||
443 | - } | ||
444 | - | ||
445 | - public Integer getMarketId() { | ||
446 | - return marketId; | ||
447 | - } | ||
448 | - | ||
449 | - public void setMarketId(Integer marketId) { | ||
450 | - this.marketId = marketId; | ||
451 | - } | ||
452 | - | ||
453 | - public Date getPickupStartTime() { | ||
454 | - return pickupStartTime; | ||
455 | - } | ||
456 | - | ||
457 | - public void setPickupStartTime(Date pickupStartTime) { | ||
458 | - this.pickupStartTime = pickupStartTime; | ||
459 | - } | ||
460 | - | ||
461 | - public Date getPickupEndTime() { | ||
462 | - return pickupEndTime; | ||
463 | - } | ||
464 | - | ||
465 | - public void setPickupEndTime(Date pickupEndTime) { | ||
466 | - this.pickupEndTime = pickupEndTime; | ||
467 | - } | ||
468 | - | ||
469 | - public Long getWeight() { | ||
470 | - return weight; | ||
471 | - } | ||
472 | - | ||
473 | - public void setWeight(Long weight) { | ||
474 | - this.weight = weight; | ||
475 | - } | ||
476 | - | ||
477 | - public Integer getAgreementState() { | ||
478 | - return agreementState; | ||
479 | - } | ||
480 | - | ||
481 | - public void setAgreementState(Integer agreementState) { | ||
482 | - this.agreementState = agreementState; | ||
483 | - } | ||
484 | - | ||
485 | - public String getSenderPhone() { | ||
486 | - return senderPhone; | ||
487 | - } | ||
488 | - | ||
489 | - public void setSenderPhone(String senderPhone) { | ||
490 | - this.senderPhone = senderPhone; | ||
491 | - } | ||
492 | - | ||
493 | - public String getReceiverPhone() { | ||
494 | - return receiverPhone; | ||
495 | - } | ||
496 | - | ||
497 | - public void setReceiverPhone(String receiverPhone) { | ||
498 | - this.receiverPhone = receiverPhone; | ||
499 | - } | ||
500 | - | ||
501 | - public Long getTotalStandardAmount() { | ||
502 | - return totalStandardAmount; | ||
503 | - } | ||
504 | - | ||
505 | - public void setTotalStandardAmount(Long totalStandardAmount) { | ||
506 | - this.totalStandardAmount = totalStandardAmount; | ||
507 | - } | ||
508 | - | ||
509 | - public String getRefundTradeNo() { | ||
510 | - return refundTradeNo; | ||
511 | - } | ||
512 | - | ||
513 | - public void setRefundTradeNo(String refundTradeNo) { | ||
514 | - this.refundTradeNo = refundTradeNo; | ||
515 | - } | ||
516 | - | ||
517 | - public Long getPaidBackAmount() { | ||
518 | - return paidBackAmount; | ||
519 | - } | ||
520 | - | ||
521 | - public void setPaidBackAmount(Long paidBackAmount) { | ||
522 | - this.paidBackAmount = paidBackAmount; | ||
523 | - } | ||
524 | - | ||
525 | - public Long getRefundAmount() { | ||
526 | - return refundAmount; | ||
527 | - } | ||
528 | - | ||
529 | - public void setRefundAmount(Long refundAmount) { | ||
530 | - this.refundAmount = refundAmount; | ||
531 | - } | ||
532 | - | ||
533 | - public Integer getDiscount() { | ||
534 | - return discount; | ||
535 | - } | ||
536 | - | ||
537 | - public void setDiscount(Integer discount) { | ||
538 | - this.discount = discount; | ||
539 | - } | ||
540 | - | ||
541 | - public String getPaymentId() { | ||
542 | - return paymentId; | ||
543 | - } | ||
544 | - | ||
545 | - public void setPaymentId(String paymentId) { | ||
546 | - this.paymentId = paymentId; | ||
547 | - } | ||
548 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapOrderListCo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.domain.BasePageQuery; | ||
4 | -import org.hibernate.validator.constraints.Length; | ||
5 | - | ||
6 | -import java.time.LocalDateTime; | ||
7 | - | ||
8 | - | ||
9 | -/** | ||
10 | - * <p> | ||
11 | - * | ||
12 | - * </p> | ||
13 | - * | ||
14 | - * @author chenzhiwei | ||
15 | - * @since 2023-12-28 | ||
16 | - */ | ||
17 | - | ||
18 | -public class EcapOrderListCo extends BasePageQuery { | ||
19 | - | ||
20 | - // 查询起始创建时间 | ||
21 | - protected LocalDateTime startTime; | ||
22 | - // 查询结束创建时间 | ||
23 | - protected LocalDateTime endTime; | ||
24 | - /** | ||
25 | - * 订单编号 | ||
26 | - */ | ||
27 | - @Length(max = 14, message = "订单号最大长度14位") | ||
28 | - private String orderNumber; | ||
29 | - | ||
30 | - /** | ||
31 | - * JD运单号 | ||
32 | - */ | ||
33 | - @Length(max = 50, message = "运单号最大长度50位") | ||
34 | - private String jdNumber; | ||
35 | - | ||
36 | - /** | ||
37 | - * 创建人客户Id | ||
38 | - */ | ||
39 | - private Long customerId; | ||
40 | - | ||
41 | - /** | ||
42 | - * 状态编码:100(已接单);390(已下发);420(已揽收);430(运输中);440(派送中);480(已拦截);500(异常终止);510(妥投);530(拒收);690(已取消) | ||
43 | - */ | ||
44 | - private Integer orderState; | ||
45 | - | ||
46 | - | ||
47 | - /** | ||
48 | - * 支付状态1待支付;2已支付 | ||
49 | - */ | ||
50 | - private Integer payState; | ||
51 | - | ||
52 | - /** | ||
53 | - * 关键词 | ||
54 | - */ | ||
55 | - @Length(max = 50, message = "最多输入50个字") | ||
56 | - private String senderKeyWords; | ||
57 | - /** | ||
58 | - * 关键词 | ||
59 | - */ | ||
60 | - @Length(max = 50, message = "最多输入50个字") | ||
61 | - private String receiverKeyWords; | ||
62 | - | ||
63 | - /** | ||
64 | - * 客户查询快递信息关键词 | ||
65 | - */ | ||
66 | - @Length(max = 50, message = "最多输入50个字") | ||
67 | - private String customerKeyWords; | ||
68 | - | ||
69 | - /** | ||
70 | - * 标签 1:我寄 2:我收 3:待支付 | ||
71 | - */ | ||
72 | - private Integer tag; | ||
73 | - | ||
74 | - /** | ||
75 | - * 收件人电话 | ||
76 | - */ | ||
77 | - private String receiverMobile; | ||
78 | - public LocalDateTime getStartTime() { | ||
79 | - return startTime; | ||
80 | - } | ||
81 | - | ||
82 | - public void setStartTime(LocalDateTime startTime) { | ||
83 | - this.startTime = startTime; | ||
84 | - } | ||
85 | - | ||
86 | - public LocalDateTime getEndTime() { | ||
87 | - return endTime; | ||
88 | - } | ||
89 | - | ||
90 | - public void setEndTime(LocalDateTime endTime) { | ||
91 | - this.endTime = endTime; | ||
92 | - } | ||
93 | - | ||
94 | - public String getOrderNumber() { | ||
95 | - return orderNumber; | ||
96 | - } | ||
97 | - | ||
98 | - public void setOrderNumber(String orderNumber) { | ||
99 | - this.orderNumber = orderNumber; | ||
100 | - } | ||
101 | - | ||
102 | - public String getJdNumber() { | ||
103 | - return jdNumber; | ||
104 | - } | ||
105 | - | ||
106 | - public void setJdNumber(String jdNumber) { | ||
107 | - this.jdNumber = jdNumber; | ||
108 | - } | ||
109 | - | ||
110 | - public Long getCustomerId() { | ||
111 | - return customerId; | ||
112 | - } | ||
113 | - | ||
114 | - public void setCustomerId(Long customerId) { | ||
115 | - this.customerId = customerId; | ||
116 | - } | ||
117 | - | ||
118 | - public Integer getOrderState() { | ||
119 | - return orderState; | ||
120 | - } | ||
121 | - | ||
122 | - public void setOrderState(Integer orderState) { | ||
123 | - this.orderState = orderState; | ||
124 | - } | ||
125 | - | ||
126 | - public Integer getPayState() { | ||
127 | - return payState; | ||
128 | - } | ||
129 | - | ||
130 | - public void setPayState(Integer payState) { | ||
131 | - this.payState = payState; | ||
132 | - } | ||
133 | - | ||
134 | - public String getSenderKeyWords() { | ||
135 | - return senderKeyWords; | ||
136 | - } | ||
137 | - | ||
138 | - public void setSenderKeyWords(String senderKeyWords) { | ||
139 | - this.senderKeyWords = senderKeyWords; | ||
140 | - } | ||
141 | - | ||
142 | - public String getReceiverKeyWords() { | ||
143 | - return receiverKeyWords; | ||
144 | - } | ||
145 | - | ||
146 | - public void setReceiverKeyWords(String receiverKeyWords) { | ||
147 | - this.receiverKeyWords = receiverKeyWords; | ||
148 | - } | ||
149 | - | ||
150 | - public String getCustomerKeyWords() { | ||
151 | - return customerKeyWords; | ||
152 | - } | ||
153 | - | ||
154 | - public void setCustomerKeyWords(String customerKeyWords) { | ||
155 | - this.customerKeyWords = customerKeyWords; | ||
156 | - } | ||
157 | - | ||
158 | - public Integer getTag() { | ||
159 | - return tag; | ||
160 | - } | ||
161 | - | ||
162 | - public void setTag(Integer tag) { | ||
163 | - this.tag = tag; | ||
164 | - } | ||
165 | - | ||
166 | - public String getReceiverMobile() { | ||
167 | - return receiverMobile; | ||
168 | - } | ||
169 | - | ||
170 | - public void setReceiverMobile(String receiverMobile) { | ||
171 | - this.receiverMobile = receiverMobile; | ||
172 | - } | ||
173 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapOrderUpdateOrderStateCo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
4 | - | ||
5 | -import java.time.LocalDateTime; | ||
6 | - | ||
7 | - | ||
8 | -/** | ||
9 | - * <p> | ||
10 | - * | ||
11 | - * </p> | ||
12 | - * | ||
13 | - * @author chenzhiwei | ||
14 | - * @since 2023-12-28 | ||
15 | - */ | ||
16 | - | ||
17 | -public class EcapOrderUpdateOrderStateCo extends BaseDo { | ||
18 | - | ||
19 | - /** | ||
20 | - * 状态编码:100(已接单);390(已下发);420(已揽收);430(运输中);440(派送中);480(已拦截);500(异常终止);510(妥投);530(拒收);690(已取消) | ||
21 | - */ | ||
22 | - private Integer orderState; | ||
23 | - | ||
24 | - /** | ||
25 | - * 状态文本 | ||
26 | - */ | ||
27 | - private String orderStateDesc; | ||
28 | - | ||
29 | - public Integer getOrderState() { | ||
30 | - return orderState; | ||
31 | - } | ||
32 | - | ||
33 | - public void setOrderState(Integer orderState) { | ||
34 | - this.orderState = orderState; | ||
35 | - } | ||
36 | - | ||
37 | - public String getOrderStateDesc() { | ||
38 | - return orderStateDesc; | ||
39 | - } | ||
40 | - | ||
41 | - public void setOrderStateDesc(String orderStateDesc) { | ||
42 | - this.orderStateDesc = orderStateDesc; | ||
43 | - } | ||
44 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapOrderUpdatePayStateCo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
4 | -import com.diligrp.etrade.ecap.model.EcapOrderDo; | ||
5 | -import com.diligrp.etrade.ecap.util.EcapConstant; | ||
6 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCreateOrderResponse; | ||
7 | -import org.apache.commons.lang3.ObjectUtils; | ||
8 | - | ||
9 | -import java.math.BigDecimal; | ||
10 | -import java.time.LocalDateTime; | ||
11 | - | ||
12 | - | ||
13 | -/** | ||
14 | - * <p> | ||
15 | - * | ||
16 | - * </p> | ||
17 | - * | ||
18 | - * @author chenzhiwei | ||
19 | - * @since 2023-12-28 | ||
20 | - */ | ||
21 | - | ||
22 | -public class EcapOrderUpdatePayStateCo extends BaseDo { | ||
23 | - | ||
24 | - /** | ||
25 | - * 支付状态1待支付;2已支付 | ||
26 | - */ | ||
27 | - private Integer payState; | ||
28 | - | ||
29 | - /** | ||
30 | - * 支付时间 | ||
31 | - */ | ||
32 | - private LocalDateTime payTime; | ||
33 | - | ||
34 | - /** | ||
35 | - * 支付交易号 | ||
36 | - */ | ||
37 | - private String tradeNo; | ||
38 | - | ||
39 | - /** | ||
40 | - * 费用 | ||
41 | - * @return | ||
42 | - */ | ||
43 | - private Long totalAmount; | ||
44 | - /** | ||
45 | - * 实际支付金额 | ||
46 | - */ | ||
47 | - private Long totalStandardAmount; | ||
48 | - /** | ||
49 | - * 补缴金额 | ||
50 | - */ | ||
51 | - private Long paidBackAmount; | ||
52 | - /** | ||
53 | - * 退款金额 | ||
54 | - */ | ||
55 | - private Long refundAmount; | ||
56 | - /** | ||
57 | - * 抵扣 | ||
58 | - */ | ||
59 | - private Integer discount; | ||
60 | - /** | ||
61 | - * 状态编码:100(已接单);390(已下发);420(已揽收);430(运输中);440(派送中);480(已拦截);500(异常终止);510(妥投);530(拒收);690(已取消) | ||
62 | - */ | ||
63 | - private Integer orderState; | ||
64 | - | ||
65 | - /** | ||
66 | - * 状态文本 | ||
67 | - */ | ||
68 | - private String orderStateDesc; | ||
69 | - /** | ||
70 | - * 退款交易号 | ||
71 | - */ | ||
72 | - private String refundTradeNo; | ||
73 | - | ||
74 | - public String getRefundTradeNo() { | ||
75 | - return refundTradeNo; | ||
76 | - } | ||
77 | - | ||
78 | - public void setRefundTradeNo(String refundTradeNo) { | ||
79 | - this.refundTradeNo = refundTradeNo; | ||
80 | - } | ||
81 | - | ||
82 | - @Override | ||
83 | - public Long getId() { | ||
84 | - return id; | ||
85 | - } | ||
86 | - | ||
87 | - @Override | ||
88 | - public void setId(Long id) { | ||
89 | - this.id = id; | ||
90 | - } | ||
91 | - | ||
92 | - public Integer getPayState() { | ||
93 | - return payState; | ||
94 | - } | ||
95 | - | ||
96 | - public void setPayState(Integer payState) { | ||
97 | - this.payState = payState; | ||
98 | - } | ||
99 | - | ||
100 | - public LocalDateTime getPayTime() { | ||
101 | - return payTime; | ||
102 | - } | ||
103 | - | ||
104 | - public void setPayTime(LocalDateTime payTime) { | ||
105 | - this.payTime = payTime; | ||
106 | - } | ||
107 | - | ||
108 | - public String getTradeNo() { | ||
109 | - return tradeNo; | ||
110 | - } | ||
111 | - | ||
112 | - public void setTradeNo(String tradeNo) { | ||
113 | - this.tradeNo = tradeNo; | ||
114 | - } | ||
115 | - | ||
116 | - public Long getTotalAmount() { | ||
117 | - return totalAmount; | ||
118 | - } | ||
119 | - | ||
120 | - public void setTotalAmount(Long totalAmount) { | ||
121 | - this.totalAmount = totalAmount; | ||
122 | - } | ||
123 | - | ||
124 | - public Integer getOrderState() { | ||
125 | - return orderState; | ||
126 | - } | ||
127 | - | ||
128 | - public void setOrderState(Integer orderState) { | ||
129 | - this.orderState = orderState; | ||
130 | - } | ||
131 | - | ||
132 | - public String getOrderStateDesc() { | ||
133 | - return orderStateDesc; | ||
134 | - } | ||
135 | - | ||
136 | - public void setOrderStateDesc(String orderStateDesc) { | ||
137 | - this.orderStateDesc = orderStateDesc; | ||
138 | - } | ||
139 | - | ||
140 | - public Long getTotalStandardAmount() { | ||
141 | - return totalStandardAmount; | ||
142 | - } | ||
143 | - | ||
144 | - public void setTotalStandardAmount(Long totalStandardAmount) { | ||
145 | - this.totalStandardAmount = totalStandardAmount; | ||
146 | - } | ||
147 | - | ||
148 | - public Long getPaidBackAmount() { | ||
149 | - return paidBackAmount; | ||
150 | - } | ||
151 | - | ||
152 | - public void setPaidBackAmount(Long paidBackAmount) { | ||
153 | - this.paidBackAmount = paidBackAmount; | ||
154 | - } | ||
155 | - | ||
156 | - public Long getRefundAmount() { | ||
157 | - return refundAmount; | ||
158 | - } | ||
159 | - | ||
160 | - public void setRefundAmount(Long refundAmount) { | ||
161 | - this.refundAmount = refundAmount; | ||
162 | - } | ||
163 | - | ||
164 | - public Integer getDiscount() { | ||
165 | - return discount; | ||
166 | - } | ||
167 | - | ||
168 | - public void setDiscount(Integer discount) { | ||
169 | - this.discount = discount; | ||
170 | - } | ||
171 | - | ||
172 | - public static EcapOrderUpdatePayStateCo createInstance(CommonCreateOrderResponse commonCreateOrderResponse, EcapOrderDo entity){ | ||
173 | - EcapOrderUpdatePayStateCo orderUpdatePayStateCo = new EcapOrderUpdatePayStateCo(); | ||
174 | - orderUpdatePayStateCo.setId(entity.getId()); | ||
175 | - orderUpdatePayStateCo.setVersion(entity.getVersion()); | ||
176 | - orderUpdatePayStateCo.setPayState(EcapConstant.PAY_STATE_1); | ||
177 | - BigDecimal freightPre = commonCreateOrderResponse.getFreightPre(); | ||
178 | - Long fee = ObjectUtils.isNotEmpty(freightPre) ? freightPre.multiply(new BigDecimal(100)).longValue():0L; | ||
179 | - orderUpdatePayStateCo.setTotalAmount(fee); | ||
180 | - return orderUpdatePayStateCo; | ||
181 | - } | ||
182 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapTraceMsgPush.java deleted
100644 → 0
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/request/EcapWeChatPayTrade.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.request; | ||
2 | - | ||
3 | -/** | ||
4 | - * 微信支付请求参数 | ||
5 | - */ | ||
6 | -public record EcapWeChatPayTrade(Long id, String payType, String openId,Long accountId) { | ||
7 | - public void validate() throws IllegalArgumentException { | ||
8 | - if (id == null) { | ||
9 | - throw new IllegalArgumentException("id不能为空"); | ||
10 | - } | ||
11 | - if (payType == null) { | ||
12 | - throw new IllegalArgumentException("payType不能为空"); | ||
13 | - } | ||
14 | - if (openId == null) { | ||
15 | - throw new IllegalArgumentException("openId不能为空"); | ||
16 | - } | ||
17 | - } | ||
18 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/response/EcapContactPersonListVo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.response; | ||
2 | - | ||
3 | - | ||
4 | - | ||
5 | -import java.io.Serializable; | ||
6 | - | ||
7 | - | ||
8 | -/** | ||
9 | - * 由MyBatis Generator工具自动生成 | ||
10 | - * | ||
11 | - * This file was generated on 2023-12-27 10:53:06. | ||
12 | - */ | ||
13 | - | ||
14 | -public class EcapContactPersonListVo implements Serializable { | ||
15 | - /** | ||
16 | - * id | ||
17 | - */ | ||
18 | - private Long id; | ||
19 | - /** | ||
20 | - * 创建人id | ||
21 | - */ | ||
22 | - private Long createrId; | ||
23 | - /** | ||
24 | - * 创建人 | ||
25 | - */ | ||
26 | - private String creater; | ||
27 | - /** | ||
28 | - * 姓名 | ||
29 | - */ | ||
30 | - private String name; | ||
31 | - | ||
32 | - /** | ||
33 | - * 电话 | ||
34 | - */ | ||
35 | - private String mobile; | ||
36 | - /** | ||
37 | - * 分机号 | ||
38 | - */ | ||
39 | - private String extensionNumber; | ||
40 | - | ||
41 | - /** | ||
42 | - * 地址 | ||
43 | - */ | ||
44 | - private String address; | ||
45 | - /** | ||
46 | - * 地址 | ||
47 | - */ | ||
48 | - private String fullAddress; | ||
49 | - /** | ||
50 | - * 省份 | ||
51 | - */ | ||
52 | - private Long provinceId; | ||
53 | - /** | ||
54 | - * 省份 | ||
55 | - */ | ||
56 | - private String provinceName; | ||
57 | - /** | ||
58 | - * 城市 | ||
59 | - */ | ||
60 | - private Long cityId; | ||
61 | - /** | ||
62 | - * 城市 | ||
63 | - */ | ||
64 | - private String cityName; | ||
65 | - /** | ||
66 | - * 区县 | ||
67 | - */ | ||
68 | - private Long districtId; | ||
69 | - /** | ||
70 | - * 区县 | ||
71 | - */ | ||
72 | - private String districtName; | ||
73 | - | ||
74 | - /** | ||
75 | - * 版本号 | ||
76 | - * @return | ||
77 | - */ | ||
78 | - private Integer version; | ||
79 | - | ||
80 | - public Long getId() { | ||
81 | - return id; | ||
82 | - } | ||
83 | - | ||
84 | - public void setId(Long id) { | ||
85 | - this.id = id; | ||
86 | - } | ||
87 | - | ||
88 | - public Long getProvinceId() { | ||
89 | - return provinceId; | ||
90 | - } | ||
91 | - | ||
92 | - public void setProvinceId(Long provinceId) { | ||
93 | - this.provinceId = provinceId; | ||
94 | - } | ||
95 | - | ||
96 | - public String getProvinceName() { | ||
97 | - return provinceName; | ||
98 | - } | ||
99 | - | ||
100 | - public void setProvinceName(String provinceName) { | ||
101 | - this.provinceName = provinceName; | ||
102 | - } | ||
103 | - | ||
104 | - public Long getCityId() { | ||
105 | - return cityId; | ||
106 | - } | ||
107 | - | ||
108 | - public void setCityId(Long cityId) { | ||
109 | - this.cityId = cityId; | ||
110 | - } | ||
111 | - | ||
112 | - public String getCityName() { | ||
113 | - return cityName; | ||
114 | - } | ||
115 | - | ||
116 | - public void setCityName(String cityName) { | ||
117 | - this.cityName = cityName; | ||
118 | - } | ||
119 | - | ||
120 | - public Long getDistrictId() { | ||
121 | - return districtId; | ||
122 | - } | ||
123 | - | ||
124 | - public void setDistrictId(Long districtId) { | ||
125 | - this.districtId = districtId; | ||
126 | - } | ||
127 | - | ||
128 | - public String getDistrictName() { | ||
129 | - return districtName; | ||
130 | - } | ||
131 | - | ||
132 | - public void setDistrictName(String districtName) { | ||
133 | - this.districtName = districtName; | ||
134 | - } | ||
135 | - | ||
136 | - public String getExtensionNumber() { | ||
137 | - return extensionNumber; | ||
138 | - } | ||
139 | - | ||
140 | - public void setExtensionNumber(String extensionNumber) { | ||
141 | - this.extensionNumber = extensionNumber; | ||
142 | - } | ||
143 | - | ||
144 | - public Long getCreaterId() { | ||
145 | - return createrId; | ||
146 | - } | ||
147 | - | ||
148 | - public void setCreaterId(Long createrId) { | ||
149 | - this.createrId = createrId; | ||
150 | - } | ||
151 | - | ||
152 | - public String getCreater() { | ||
153 | - return creater; | ||
154 | - } | ||
155 | - | ||
156 | - public void setCreater(String creater) { | ||
157 | - this.creater = creater; | ||
158 | - } | ||
159 | - | ||
160 | - public String getName() { | ||
161 | - return name; | ||
162 | - } | ||
163 | - | ||
164 | - public void setName(String name) { | ||
165 | - this.name = name; | ||
166 | - } | ||
167 | - | ||
168 | - public String getMobile() { | ||
169 | - return mobile; | ||
170 | - } | ||
171 | - | ||
172 | - public void setMobile(String mobile) { | ||
173 | - this.mobile = mobile; | ||
174 | - } | ||
175 | - | ||
176 | - public String getAddress() { | ||
177 | - return address; | ||
178 | - } | ||
179 | - | ||
180 | - public void setAddress(String address) { | ||
181 | - this.address = address; | ||
182 | - } | ||
183 | - | ||
184 | - public String getFullAddress() { | ||
185 | - if(provinceName!=null){ | ||
186 | - fullAddress=provinceName+cityName+districtName+address; | ||
187 | - } | ||
188 | - return fullAddress; | ||
189 | - } | ||
190 | - | ||
191 | - public void setFullAddress(String fullAddress) { | ||
192 | - this.fullAddress = fullAddress; | ||
193 | - } | ||
194 | - | ||
195 | - public Integer getVersion() { | ||
196 | - return version; | ||
197 | - } | ||
198 | - | ||
199 | - public void setVersion(Integer version) { | ||
200 | - this.version = version; | ||
201 | - } | ||
202 | -} | ||
203 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/response/EcapOrderListVo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.response; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
4 | - | ||
5 | -import java.time.LocalDateTime; | ||
6 | - | ||
7 | - | ||
8 | -/** | ||
9 | - * <p> | ||
10 | - * | ||
11 | - * </p> | ||
12 | - * | ||
13 | - * @author chenzhiwei | ||
14 | - * @since 2023-12-28 | ||
15 | - */ | ||
16 | - | ||
17 | -public class EcapOrderListVo extends BaseDo { | ||
18 | - | ||
19 | - | ||
20 | - /** | ||
21 | - * 订单编号 | ||
22 | - */ | ||
23 | - private String orderNumber; | ||
24 | - | ||
25 | - /** | ||
26 | - * JD运单号 | ||
27 | - */ | ||
28 | - private String jdNumber; | ||
29 | - | ||
30 | - /** | ||
31 | - * 创建人客户Id | ||
32 | - */ | ||
33 | - private Long customerId; | ||
34 | - | ||
35 | - /** | ||
36 | - * 创建人客户 | ||
37 | - */ | ||
38 | - private String customerName; | ||
39 | - | ||
40 | - /** | ||
41 | - * 创建人客户编码 | ||
42 | - */ | ||
43 | - private String customerCode; | ||
44 | - | ||
45 | - /** | ||
46 | - * 创建人电话 | ||
47 | - */ | ||
48 | - private String customerMobile; | ||
49 | - | ||
50 | - /** | ||
51 | - * 创建人 | ||
52 | - */ | ||
53 | - private String creater; | ||
54 | - | ||
55 | - | ||
56 | - /** | ||
57 | - * 寄件人姓名 | ||
58 | - */ | ||
59 | - private String senderName; | ||
60 | - | ||
61 | - /** | ||
62 | - * 寄件人电话 | ||
63 | - */ | ||
64 | - private String senderMobile; | ||
65 | - | ||
66 | - /** | ||
67 | - * 省 | ||
68 | - */ | ||
69 | - private String senderProvince; | ||
70 | - | ||
71 | - /** | ||
72 | - * 城市 | ||
73 | - */ | ||
74 | - private String senderCity; | ||
75 | - | ||
76 | - /** | ||
77 | - * 区县 | ||
78 | - */ | ||
79 | - private String senderDistrict; | ||
80 | - | ||
81 | - /** | ||
82 | - * 寄件人地址 | ||
83 | - */ | ||
84 | - private String senderAddress; | ||
85 | - | ||
86 | - /** | ||
87 | - * 收件人名字 | ||
88 | - */ | ||
89 | - private String receiverName; | ||
90 | - | ||
91 | - /** | ||
92 | - * 收件人电话 | ||
93 | - */ | ||
94 | - private String receiverMobile; | ||
95 | - | ||
96 | - /** | ||
97 | - * 省 | ||
98 | - */ | ||
99 | - private String receiverProvince; | ||
100 | - | ||
101 | - /** | ||
102 | - * 城市 | ||
103 | - */ | ||
104 | - private String receiverCity; | ||
105 | - | ||
106 | - /** | ||
107 | - * 区县 | ||
108 | - */ | ||
109 | - private String receiverDistrict; | ||
110 | - | ||
111 | - /** | ||
112 | - * 收件人地址 | ||
113 | - */ | ||
114 | - private String receiverAddress; | ||
115 | - | ||
116 | - /** | ||
117 | - * 货位信息土豆 | ||
118 | - */ | ||
119 | - private String goodsInfo; | ||
120 | - | ||
121 | - /** | ||
122 | - * 产品信息标件 | ||
123 | - */ | ||
124 | - private String productInfo; | ||
125 | - | ||
126 | - /** | ||
127 | - * 预估运费用 单位分 | ||
128 | - */ | ||
129 | - private Long totalAmount; | ||
130 | - private String totalAmountText; | ||
131 | - /** | ||
132 | - * 预估运费用 单位分 | ||
133 | - */ | ||
134 | - private Long totalStandardAmount; | ||
135 | - private String totalStandardAmountText; | ||
136 | - /** | ||
137 | - * 补缴金额 | ||
138 | - */ | ||
139 | - private Long paidBackAmount; | ||
140 | - private String paidBackAmountText; | ||
141 | - /** | ||
142 | - * 退款金额 | ||
143 | - */ | ||
144 | - private Long refundAmount; | ||
145 | - private String refundAmountText; | ||
146 | - /** | ||
147 | - * 差额 | ||
148 | - */ | ||
149 | - private String compensationAmountText; | ||
150 | - /** | ||
151 | - * 抵扣 | ||
152 | - */ | ||
153 | - private Integer discount; | ||
154 | - /** | ||
155 | - * 待交运费 = 预计字段 - 实际字段 的绝对值 | ||
156 | - */ | ||
157 | - private String freightPayable; | ||
158 | - /** | ||
159 | - * 状态编码:100(已接单);390(已下发);420(已揽收);430(运输中);440(派送中);480(已拦截);500(异常终止);510(妥投);530(拒收);690(已取消) | ||
160 | - */ | ||
161 | - private Integer orderState; | ||
162 | - | ||
163 | - /** | ||
164 | - * 状态文本 | ||
165 | - */ | ||
166 | - private String orderStateDesc; | ||
167 | - | ||
168 | - /** | ||
169 | - * 支付状态1待支付;2已支付 | ||
170 | - */ | ||
171 | - private Integer payState; | ||
172 | - private String payStateText; | ||
173 | - | ||
174 | - /** | ||
175 | - * 支付时间 | ||
176 | - */ | ||
177 | - private LocalDateTime payTime; | ||
178 | - | ||
179 | - /** | ||
180 | - * 支付交易号 | ||
181 | - */ | ||
182 | - private String tradeNo; | ||
183 | - /** | ||
184 | - * 二次支付流水 | ||
185 | - */ | ||
186 | - private String paymentId; | ||
187 | - /** | ||
188 | - * 退款交易号 | ||
189 | - */ | ||
190 | - private String refundTradeNo; | ||
191 | - /** | ||
192 | - * 下单用户所属市场 | ||
193 | - */ | ||
194 | - private Integer marketId; | ||
195 | - | ||
196 | - public String getPayStateText() { | ||
197 | - return payStateText; | ||
198 | - } | ||
199 | - | ||
200 | - public void setPayStateText(String payStateText) { | ||
201 | - this.payStateText = payStateText; | ||
202 | - } | ||
203 | - | ||
204 | - public String getOrderNumber() { | ||
205 | - return orderNumber; | ||
206 | - } | ||
207 | - | ||
208 | - public void setOrderNumber(String orderNumber) { | ||
209 | - this.orderNumber = orderNumber; | ||
210 | - } | ||
211 | - | ||
212 | - public String getJdNumber() { | ||
213 | - return jdNumber; | ||
214 | - } | ||
215 | - | ||
216 | - public void setJdNumber(String jdNumber) { | ||
217 | - this.jdNumber = jdNumber; | ||
218 | - } | ||
219 | - | ||
220 | - public Long getCustomerId() { | ||
221 | - return customerId; | ||
222 | - } | ||
223 | - | ||
224 | - public void setCustomerId(Long customerId) { | ||
225 | - this.customerId = customerId; | ||
226 | - } | ||
227 | - | ||
228 | - public String getCustomerName() { | ||
229 | - return customerName; | ||
230 | - } | ||
231 | - | ||
232 | - public void setCustomerName(String customerName) { | ||
233 | - this.customerName = customerName; | ||
234 | - } | ||
235 | - | ||
236 | - public String getCustomerCode() { | ||
237 | - return customerCode; | ||
238 | - } | ||
239 | - | ||
240 | - public void setCustomerCode(String customerCode) { | ||
241 | - this.customerCode = customerCode; | ||
242 | - } | ||
243 | - | ||
244 | - public String getCustomerMobile() { | ||
245 | - return customerMobile; | ||
246 | - } | ||
247 | - | ||
248 | - public void setCustomerMobile(String customerMobile) { | ||
249 | - this.customerMobile = customerMobile; | ||
250 | - } | ||
251 | - | ||
252 | - public String getCreater() { | ||
253 | - return creater; | ||
254 | - } | ||
255 | - | ||
256 | - public void setCreater(String creater) { | ||
257 | - this.creater = creater; | ||
258 | - } | ||
259 | - | ||
260 | - public String getSenderName() { | ||
261 | - return senderName; | ||
262 | - } | ||
263 | - | ||
264 | - public void setSenderName(String senderName) { | ||
265 | - this.senderName = senderName; | ||
266 | - } | ||
267 | - | ||
268 | - public String getSenderMobile() { | ||
269 | - return senderMobile; | ||
270 | - } | ||
271 | - | ||
272 | - public void setSenderMobile(String senderMobile) { | ||
273 | - this.senderMobile = senderMobile; | ||
274 | - } | ||
275 | - | ||
276 | - public String getSenderProvince() { | ||
277 | - return senderProvince; | ||
278 | - } | ||
279 | - | ||
280 | - public void setSenderProvince(String senderProvince) { | ||
281 | - this.senderProvince = senderProvince; | ||
282 | - } | ||
283 | - | ||
284 | - public String getSenderCity() { | ||
285 | - return senderCity; | ||
286 | - } | ||
287 | - | ||
288 | - public void setSenderCity(String senderCity) { | ||
289 | - this.senderCity = senderCity; | ||
290 | - } | ||
291 | - | ||
292 | - public String getSenderDistrict() { | ||
293 | - return senderDistrict; | ||
294 | - } | ||
295 | - | ||
296 | - public void setSenderDistrict(String senderDistrict) { | ||
297 | - this.senderDistrict = senderDistrict; | ||
298 | - } | ||
299 | - | ||
300 | - public String getSenderAddress() { | ||
301 | - return senderAddress; | ||
302 | - } | ||
303 | - | ||
304 | - public void setSenderAddress(String senderAddress) { | ||
305 | - this.senderAddress = senderAddress; | ||
306 | - } | ||
307 | - | ||
308 | - public String getReceiverName() { | ||
309 | - return receiverName; | ||
310 | - } | ||
311 | - | ||
312 | - public void setReceiverName(String receiverName) { | ||
313 | - this.receiverName = receiverName; | ||
314 | - } | ||
315 | - | ||
316 | - public String getReceiverMobile() { | ||
317 | - return receiverMobile; | ||
318 | - } | ||
319 | - | ||
320 | - public void setReceiverMobile(String receiverMobile) { | ||
321 | - this.receiverMobile = receiverMobile; | ||
322 | - } | ||
323 | - | ||
324 | - public String getReceiverProvince() { | ||
325 | - return receiverProvince; | ||
326 | - } | ||
327 | - | ||
328 | - public void setReceiverProvince(String receiverProvince) { | ||
329 | - this.receiverProvince = receiverProvince; | ||
330 | - } | ||
331 | - | ||
332 | - public String getReceiverCity() { | ||
333 | - return receiverCity; | ||
334 | - } | ||
335 | - | ||
336 | - public void setReceiverCity(String receiverCity) { | ||
337 | - this.receiverCity = receiverCity; | ||
338 | - } | ||
339 | - | ||
340 | - public String getReceiverDistrict() { | ||
341 | - return receiverDistrict; | ||
342 | - } | ||
343 | - | ||
344 | - public void setReceiverDistrict(String receiverDistrict) { | ||
345 | - this.receiverDistrict = receiverDistrict; | ||
346 | - } | ||
347 | - | ||
348 | - public String getReceiverAddress() { | ||
349 | - return receiverAddress; | ||
350 | - } | ||
351 | - | ||
352 | - public void setReceiverAddress(String receiverAddress) { | ||
353 | - this.receiverAddress = receiverAddress; | ||
354 | - } | ||
355 | - | ||
356 | - public String getGoodsInfo() { | ||
357 | - return goodsInfo; | ||
358 | - } | ||
359 | - | ||
360 | - public void setGoodsInfo(String goodsInfo) { | ||
361 | - this.goodsInfo = goodsInfo; | ||
362 | - } | ||
363 | - | ||
364 | - public String getProductInfo() { | ||
365 | - return productInfo; | ||
366 | - } | ||
367 | - | ||
368 | - public void setProductInfo(String productInfo) { | ||
369 | - this.productInfo = productInfo; | ||
370 | - } | ||
371 | - | ||
372 | - public Long getTotalAmount() { | ||
373 | - return totalAmount; | ||
374 | - } | ||
375 | - | ||
376 | - public void setTotalAmount(Long totalAmount) { | ||
377 | - this.totalAmount = totalAmount; | ||
378 | - } | ||
379 | - | ||
380 | - public Integer getOrderState() { | ||
381 | - return orderState; | ||
382 | - } | ||
383 | - | ||
384 | - public void setOrderState(Integer orderState) { | ||
385 | - this.orderState = orderState; | ||
386 | - } | ||
387 | - | ||
388 | - public String getOrderStateDesc() { | ||
389 | - return orderStateDesc; | ||
390 | - } | ||
391 | - | ||
392 | - public void setOrderStateDesc(String orderStateDesc) { | ||
393 | - this.orderStateDesc = orderStateDesc; | ||
394 | - } | ||
395 | - | ||
396 | - public Integer getPayState() { | ||
397 | - return payState; | ||
398 | - } | ||
399 | - | ||
400 | - public void setPayState(Integer payState) { | ||
401 | - this.payState = payState; | ||
402 | - } | ||
403 | - | ||
404 | - public LocalDateTime getPayTime() { | ||
405 | - return payTime; | ||
406 | - } | ||
407 | - | ||
408 | - public void setPayTime(LocalDateTime payTime) { | ||
409 | - this.payTime = payTime; | ||
410 | - } | ||
411 | - | ||
412 | - public String getTradeNo() { | ||
413 | - return tradeNo; | ||
414 | - } | ||
415 | - | ||
416 | - public void setTradeNo(String tradeNo) { | ||
417 | - this.tradeNo = tradeNo; | ||
418 | - } | ||
419 | - | ||
420 | - public Integer getMarketId() { | ||
421 | - return marketId; | ||
422 | - } | ||
423 | - | ||
424 | - public void setMarketId(Integer marketId) { | ||
425 | - this.marketId = marketId; | ||
426 | - } | ||
427 | - | ||
428 | - public String getTotalAmountText() { | ||
429 | - return totalAmountText; | ||
430 | - } | ||
431 | - | ||
432 | - public void setTotalAmountText(String totalAmountText) { | ||
433 | - this.totalAmountText = totalAmountText; | ||
434 | - } | ||
435 | - | ||
436 | - public Long getTotalStandardAmount() { | ||
437 | - return totalStandardAmount; | ||
438 | - } | ||
439 | - | ||
440 | - public void setTotalStandardAmount(Long totalStandardAmount) { | ||
441 | - this.totalStandardAmount = totalStandardAmount; | ||
442 | - } | ||
443 | - | ||
444 | - public String getTotalStandardAmountText() { | ||
445 | - return totalStandardAmountText; | ||
446 | - } | ||
447 | - | ||
448 | - public void setTotalStandardAmountText(String totalStandardAmountText) { | ||
449 | - this.totalStandardAmountText = totalStandardAmountText; | ||
450 | - } | ||
451 | - | ||
452 | - public String getFreightPayable() { | ||
453 | - return freightPayable; | ||
454 | - } | ||
455 | - | ||
456 | - public void setFreightPayable(String freightPayable) { | ||
457 | - this.freightPayable = freightPayable; | ||
458 | - } | ||
459 | - | ||
460 | - public String getRefundTradeNo() { | ||
461 | - return refundTradeNo; | ||
462 | - } | ||
463 | - | ||
464 | - public void setRefundTradeNo(String refundTradeNo) { | ||
465 | - this.refundTradeNo = refundTradeNo; | ||
466 | - } | ||
467 | - | ||
468 | - public Long getPaidBackAmount() { | ||
469 | - return paidBackAmount; | ||
470 | - } | ||
471 | - | ||
472 | - public void setPaidBackAmount(Long paidBackAmount) { | ||
473 | - this.paidBackAmount = paidBackAmount; | ||
474 | - } | ||
475 | - | ||
476 | - public String getPaidBackAmountText() { | ||
477 | - return paidBackAmountText; | ||
478 | - } | ||
479 | - | ||
480 | - public void setPaidBackAmountText(String paidBackAmountText) { | ||
481 | - this.paidBackAmountText = paidBackAmountText; | ||
482 | - } | ||
483 | - | ||
484 | - public Long getRefundAmount() { | ||
485 | - return refundAmount; | ||
486 | - } | ||
487 | - | ||
488 | - public void setRefundAmount(Long refundAmount) { | ||
489 | - this.refundAmount = refundAmount; | ||
490 | - } | ||
491 | - | ||
492 | - public String getRefundAmountText() { | ||
493 | - return refundAmountText; | ||
494 | - } | ||
495 | - | ||
496 | - public void setRefundAmountText(String refundAmountText) { | ||
497 | - this.refundAmountText = refundAmountText; | ||
498 | - } | ||
499 | - | ||
500 | - public Integer getDiscount() { | ||
501 | - return discount; | ||
502 | - } | ||
503 | - | ||
504 | - public void setDiscount(Integer discount) { | ||
505 | - this.discount = discount; | ||
506 | - } | ||
507 | - | ||
508 | - public String getCompensationAmountText() { | ||
509 | - return compensationAmountText; | ||
510 | - } | ||
511 | - | ||
512 | - public void setCompensationAmountText(String compensationAmountText) { | ||
513 | - this.compensationAmountText = compensationAmountText; | ||
514 | - } | ||
515 | - | ||
516 | - public String getPaymentId() { | ||
517 | - return paymentId; | ||
518 | - } | ||
519 | - | ||
520 | - public void setPaymentId(String paymentId) { | ||
521 | - this.paymentId = paymentId; | ||
522 | - } | ||
523 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/domain/response/TradeResponseVo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.domain.response; | ||
2 | - | ||
3 | -import com.fasterxml.jackson.annotation.JsonFormat; | ||
4 | -import org.springframework.format.annotation.DateTimeFormat; | ||
5 | - | ||
6 | -import java.time.LocalDateTime; | ||
7 | -import java.util.List; | ||
8 | - | ||
9 | -public class TradeResponseVo { | ||
10 | - | ||
11 | - private Integer state; | ||
12 | - private String paymentId; | ||
13 | - | ||
14 | - public Integer getState() { | ||
15 | - return state; | ||
16 | - } | ||
17 | - | ||
18 | - public void setState(Integer state) { | ||
19 | - this.state = state; | ||
20 | - } | ||
21 | - | ||
22 | - public String getPaymentId() { | ||
23 | - return paymentId; | ||
24 | - } | ||
25 | - | ||
26 | - public void setPaymentId(String paymentId) { | ||
27 | - this.paymentId = paymentId; | ||
28 | - } | ||
29 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/exception/EcapErrorCode.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.exception; | ||
2 | - | ||
3 | -/** | ||
4 | - * 系统错误码列表 - 错误码前三位用于区分模块 | ||
5 | - */ | ||
6 | -public class EcapErrorCode { | ||
7 | - // 参数异常 | ||
8 | - public static final int PARAM_ERROR = 920001; | ||
9 | - | ||
10 | - // 重复提交 | ||
11 | - public static final int REPEATED_SUBMISSION = 920011; | ||
12 | - | ||
13 | - // 未找到支付中的订单信息 | ||
14 | - public static final int NOTFOUND_ORDER = 920012; | ||
15 | - //订单系统异常 | ||
16 | - public static final int ORDER_SYSTEM_ERROR = 921001; | ||
17 | - | ||
18 | - //订单创建成功 | ||
19 | - public static final int ORDER_CREATE_FINISH = 920002; | ||
20 | - // token过期 | ||
21 | - public static final int TOKEN_OVER_TIME = 920003; | ||
22 | - | ||
23 | - // 账户异常 | ||
24 | - public static final int ACCOUNT_ERROR = 920013; | ||
25 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/exception/EcapException.java deleted
100644 → 0
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/model/EcapContactPersonDo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.model; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
5 | - | ||
6 | - | ||
7 | -/** | ||
8 | - * 由MyBatis Generator工具自动生成 | ||
9 | - * | ||
10 | - * This file was generated on 2023-12-27 10:53:06. | ||
11 | - */ | ||
12 | - | ||
13 | -public class EcapContactPersonDo extends BaseDo { | ||
14 | - /** | ||
15 | - * 创建人id | ||
16 | - */ | ||
17 | - private Long createrId; | ||
18 | - /** | ||
19 | - * 创建人 | ||
20 | - */ | ||
21 | - private String creater; | ||
22 | - | ||
23 | - /** | ||
24 | - * 姓名 | ||
25 | - */ | ||
26 | - private String name; | ||
27 | - | ||
28 | - /** | ||
29 | - * 电话 | ||
30 | - */ | ||
31 | - private String mobile; | ||
32 | - | ||
33 | - /** | ||
34 | - * 地址 | ||
35 | - */ | ||
36 | - private String address; | ||
37 | - /** | ||
38 | - * 分机号 | ||
39 | - */ | ||
40 | - private String extensionNumber; | ||
41 | - /** | ||
42 | - * 省份 | ||
43 | - */ | ||
44 | - private Long provinceId; | ||
45 | - /** | ||
46 | - * 省份 | ||
47 | - */ | ||
48 | - private String provinceName; | ||
49 | - /** | ||
50 | - * 城市 | ||
51 | - */ | ||
52 | - private Long cityId; | ||
53 | - /** | ||
54 | - * 城市 | ||
55 | - */ | ||
56 | - private String cityName; | ||
57 | - /** | ||
58 | - * 区县 | ||
59 | - */ | ||
60 | - private Long districtId; | ||
61 | - /** | ||
62 | - * 区县 | ||
63 | - */ | ||
64 | - private String districtName; | ||
65 | - | ||
66 | - /** | ||
67 | - * 状态 1:启用 2:禁用 | ||
68 | - * @return | ||
69 | - */ | ||
70 | - private Integer state; | ||
71 | - | ||
72 | - public Long getProvinceId() { | ||
73 | - return provinceId; | ||
74 | - } | ||
75 | - | ||
76 | - public void setProvinceId(Long provinceId) { | ||
77 | - this.provinceId = provinceId; | ||
78 | - } | ||
79 | - | ||
80 | - public String getProvinceName() { | ||
81 | - return provinceName; | ||
82 | - } | ||
83 | - | ||
84 | - public void setProvinceName(String provinceName) { | ||
85 | - this.provinceName = provinceName; | ||
86 | - } | ||
87 | - | ||
88 | - public Long getCityId() { | ||
89 | - return cityId; | ||
90 | - } | ||
91 | - | ||
92 | - public void setCityId(Long cityId) { | ||
93 | - this.cityId = cityId; | ||
94 | - } | ||
95 | - | ||
96 | - public String getCityName() { | ||
97 | - return cityName; | ||
98 | - } | ||
99 | - | ||
100 | - public void setCityName(String cityName) { | ||
101 | - this.cityName = cityName; | ||
102 | - } | ||
103 | - | ||
104 | - public Long getDistrictId() { | ||
105 | - return districtId; | ||
106 | - } | ||
107 | - | ||
108 | - public void setDistrictId(Long districtId) { | ||
109 | - this.districtId = districtId; | ||
110 | - } | ||
111 | - | ||
112 | - public String getDistrictName() { | ||
113 | - return districtName; | ||
114 | - } | ||
115 | - | ||
116 | - public void setDistrictName(String districtName) { | ||
117 | - this.districtName = districtName; | ||
118 | - } | ||
119 | - | ||
120 | - public String getExtensionNumber() { | ||
121 | - return extensionNumber; | ||
122 | - } | ||
123 | - | ||
124 | - public void setExtensionNumber(String extensionNumber) { | ||
125 | - this.extensionNumber = extensionNumber; | ||
126 | - } | ||
127 | - | ||
128 | - public Long getCreaterId() { | ||
129 | - return createrId; | ||
130 | - } | ||
131 | - | ||
132 | - public void setCreaterId(Long createrId) { | ||
133 | - this.createrId = createrId; | ||
134 | - } | ||
135 | - | ||
136 | - public String getCreater() { | ||
137 | - return creater; | ||
138 | - } | ||
139 | - | ||
140 | - public void setCreater(String creater) { | ||
141 | - this.creater = creater; | ||
142 | - } | ||
143 | - | ||
144 | - public String getName() { | ||
145 | - return name; | ||
146 | - } | ||
147 | - | ||
148 | - public void setName(String name) { | ||
149 | - this.name = name; | ||
150 | - } | ||
151 | - | ||
152 | - public String getMobile() { | ||
153 | - return mobile; | ||
154 | - } | ||
155 | - | ||
156 | - public void setMobile(String mobile) { | ||
157 | - this.mobile = mobile; | ||
158 | - } | ||
159 | - | ||
160 | - public String getAddress() { | ||
161 | - return address; | ||
162 | - } | ||
163 | - | ||
164 | - public void setAddress(String address) { | ||
165 | - this.address = address; | ||
166 | - } | ||
167 | - | ||
168 | - public Integer getState() { | ||
169 | - return state; | ||
170 | - } | ||
171 | - | ||
172 | - public void setState(Integer state) { | ||
173 | - this.state = state; | ||
174 | - } | ||
175 | - | ||
176 | - @Override | ||
177 | - public String toString() { | ||
178 | - return "EcapContactPersonDo{" + | ||
179 | - "createrId=" + createrId + | ||
180 | - ", creater='" + creater + '\'' + | ||
181 | - ", name='" + name + '\'' + | ||
182 | - ", mobile='" + mobile + '\'' + | ||
183 | - ", address='" + address + '\'' + | ||
184 | - ", extensionNumber='" + extensionNumber + '\'' + | ||
185 | - ", provinceId=" + provinceId + | ||
186 | - ", provinceName='" + provinceName + '\'' + | ||
187 | - ", cityId=" + cityId + | ||
188 | - ", cityName='" + cityName + '\'' + | ||
189 | - ", districtId=" + districtId + | ||
190 | - ", districtName='" + districtName + '\'' + | ||
191 | - ", state=" + state + | ||
192 | - ", id=" + id + | ||
193 | - ", version=" + version + | ||
194 | - ", createdTime=" + createdTime + | ||
195 | - ", modifiedTime=" + modifiedTime + | ||
196 | - '}'; | ||
197 | - } | ||
198 | -} | ||
199 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/model/EcapOrderDo.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.model; | ||
2 | - | ||
3 | -import java.time.LocalDateTime; | ||
4 | -import java.util.Date; | ||
5 | - | ||
6 | -import com.diligrp.etrade.core.domain.BaseDo; | ||
7 | -import jakarta.validation.constraints.Min; | ||
8 | -import jakarta.validation.constraints.NotNull; | ||
9 | - | ||
10 | - | ||
11 | -/** | ||
12 | - * <p> | ||
13 | - * | ||
14 | - * </p> | ||
15 | - * | ||
16 | - * @author chenzhiwei | ||
17 | - * @since 2023-12-28 | ||
18 | - */ | ||
19 | - | ||
20 | -public class EcapOrderDo extends BaseDo { | ||
21 | - | ||
22 | - | ||
23 | - /** | ||
24 | - * 订单编号 | ||
25 | - */ | ||
26 | - private String orderNumber; | ||
27 | - | ||
28 | - /** | ||
29 | - * JD运单号 | ||
30 | - */ | ||
31 | - private String jdNumber; | ||
32 | - | ||
33 | - /** | ||
34 | - * 创建人客户Id | ||
35 | - */ | ||
36 | - private Long customerId; | ||
37 | - | ||
38 | - /** | ||
39 | - * 创建人客户 | ||
40 | - */ | ||
41 | - private String customerName; | ||
42 | - | ||
43 | - /** | ||
44 | - * 创建人客户编码 | ||
45 | - */ | ||
46 | - private String customerCode; | ||
47 | - | ||
48 | - /** | ||
49 | - * 创建人电话 | ||
50 | - */ | ||
51 | - private String customerMobile; | ||
52 | - | ||
53 | - /** | ||
54 | - * 创建人 | ||
55 | - */ | ||
56 | - private String creater; | ||
57 | - | ||
58 | - | ||
59 | - /** | ||
60 | - * 寄件人姓名 | ||
61 | - */ | ||
62 | - private String senderName; | ||
63 | - | ||
64 | - /** | ||
65 | - * 寄件人电话 | ||
66 | - */ | ||
67 | - private String senderMobile; | ||
68 | - | ||
69 | - /** | ||
70 | - * 省 | ||
71 | - */ | ||
72 | - private String senderProvince; | ||
73 | - | ||
74 | - /** | ||
75 | - * 城市 | ||
76 | - */ | ||
77 | - private String senderCity; | ||
78 | - | ||
79 | - /** | ||
80 | - * 区县 | ||
81 | - */ | ||
82 | - private String senderDistrict; | ||
83 | - | ||
84 | - /** | ||
85 | - * 寄件人地址 | ||
86 | - */ | ||
87 | - private String senderAddress; | ||
88 | - | ||
89 | - /** | ||
90 | - * 收件人名字 | ||
91 | - */ | ||
92 | - private String receiverName; | ||
93 | - | ||
94 | - /** | ||
95 | - * 收件人电话 | ||
96 | - */ | ||
97 | - private String receiverMobile; | ||
98 | - | ||
99 | - /** | ||
100 | - * 省 | ||
101 | - */ | ||
102 | - private String receiverProvince; | ||
103 | - | ||
104 | - /** | ||
105 | - * 城市 | ||
106 | - */ | ||
107 | - private String receiverCity; | ||
108 | - | ||
109 | - /** | ||
110 | - * 区县 | ||
111 | - */ | ||
112 | - private String receiverDistrict; | ||
113 | - | ||
114 | - /** | ||
115 | - * 收件人地址 | ||
116 | - */ | ||
117 | - private String receiverAddress; | ||
118 | - | ||
119 | - /** | ||
120 | - * 货位信息土豆 | ||
121 | - */ | ||
122 | - private String goodsInfo; | ||
123 | - | ||
124 | - /** | ||
125 | - * 产品信息标件 | ||
126 | - * 主产品类型:1-特惠送,2-特快送,4-特瞬送城际,5-同城当日达,6-特快次晨,7-微小件,8-生鲜专送,9-尊享专送,10-京准达2H,11-京准达5H,12-O2O-1小时,13-O2O-2小时,14-特瞬送同城,15-同城速配,16-生鲜速达,17-生鲜惠达,18-京准达0.5H,19-京准达1H,20-函速达,21-特惠小包,22-医药冷链,23-全城送,24-特惠小件,25-智享送,26-冷链专送 | ||
127 | - */ | ||
128 | - private String productInfo; | ||
129 | - | ||
130 | - /** | ||
131 | - * 预估运用 单位分 | ||
132 | - */ | ||
133 | - private Long totalAmount; | ||
134 | - /** | ||
135 | - * 实际运费 | ||
136 | - */ | ||
137 | - private Long totalStandardAmount; | ||
138 | - /** | ||
139 | - * 补缴金额 | ||
140 | - */ | ||
141 | - private Long paidBackAmount; | ||
142 | - /** | ||
143 | - * 退款金额 | ||
144 | - */ | ||
145 | - private Long refundAmount; | ||
146 | - /** | ||
147 | - * 抵扣 | ||
148 | - */ | ||
149 | - private Integer discount; | ||
150 | - /** | ||
151 | - * 状态编码:100(已接单);390(已下发);420(已揽收);430(运输中);440(派送中);480(已拦截);500(异常终止);510(妥投);530(拒收);690(已取消) | ||
152 | - */ | ||
153 | - private Integer orderState; | ||
154 | - | ||
155 | - /** | ||
156 | - * 状态文本 | ||
157 | - */ | ||
158 | - private String orderStateDesc; | ||
159 | - | ||
160 | - /** | ||
161 | - * 支付状态1待支付;2已支付 | ||
162 | - */ | ||
163 | - private Integer payState; | ||
164 | - | ||
165 | - /** | ||
166 | - * 支付时间 | ||
167 | - */ | ||
168 | - private LocalDateTime payTime; | ||
169 | - | ||
170 | - /** | ||
171 | - * 支付交易号 | ||
172 | - */ | ||
173 | - private String tradeNo; | ||
174 | - | ||
175 | - /** | ||
176 | - * 下单用户所属市场 | ||
177 | - */ | ||
178 | - private Integer marketId; | ||
179 | - | ||
180 | - /** | ||
181 | - * 期望上门时间--开始 | ||
182 | - */ | ||
183 | - private Date pickupStartTime; | ||
184 | - /** | ||
185 | - * 期望上门时间--结束 | ||
186 | - */ | ||
187 | - private Date pickupEndTime; | ||
188 | - /** | ||
189 | - * 重量 单位公斤 | ||
190 | - */ | ||
191 | - private Long weight; | ||
192 | - /** | ||
193 | - * 快件服务协议 | ||
194 | - */ | ||
195 | - private Integer agreementState; | ||
196 | - | ||
197 | - public Date getPickupStartTime() { | ||
198 | - return pickupStartTime; | ||
199 | - } | ||
200 | - | ||
201 | - public void setPickupStartTime(Date pickupStartTime) { | ||
202 | - this.pickupStartTime = pickupStartTime; | ||
203 | - } | ||
204 | - | ||
205 | - public Date getPickupEndTime() { | ||
206 | - return pickupEndTime; | ||
207 | - } | ||
208 | - | ||
209 | - public void setPickupEndTime(Date pickupEndTime) { | ||
210 | - this.pickupEndTime = pickupEndTime; | ||
211 | - } | ||
212 | - | ||
213 | - public Long getWeight() { | ||
214 | - return weight; | ||
215 | - } | ||
216 | - | ||
217 | - public void setWeight(Long weight) { | ||
218 | - this.weight = weight; | ||
219 | - } | ||
220 | - | ||
221 | - public Integer getAgreementState() { | ||
222 | - return agreementState; | ||
223 | - } | ||
224 | - | ||
225 | - public void setAgreementState(Integer agreementState) { | ||
226 | - this.agreementState = agreementState; | ||
227 | - } | ||
228 | - | ||
229 | - public String getOrderNumber() { | ||
230 | - return orderNumber; | ||
231 | - } | ||
232 | - | ||
233 | - public void setOrderNumber(String orderNumber) { | ||
234 | - this.orderNumber = orderNumber; | ||
235 | - } | ||
236 | - | ||
237 | - public String getJdNumber() { | ||
238 | - return jdNumber; | ||
239 | - } | ||
240 | - | ||
241 | - public void setJdNumber(String jdNumber) { | ||
242 | - this.jdNumber = jdNumber; | ||
243 | - } | ||
244 | - | ||
245 | - public Long getCustomerId() { | ||
246 | - return customerId; | ||
247 | - } | ||
248 | - | ||
249 | - public void setCustomerId(Long customerId) { | ||
250 | - this.customerId = customerId; | ||
251 | - } | ||
252 | - | ||
253 | - public String getCustomerName() { | ||
254 | - return customerName; | ||
255 | - } | ||
256 | - | ||
257 | - public void setCustomerName(String customerName) { | ||
258 | - this.customerName = customerName; | ||
259 | - } | ||
260 | - | ||
261 | - public String getCustomerCode() { | ||
262 | - return customerCode; | ||
263 | - } | ||
264 | - | ||
265 | - public void setCustomerCode(String customerCode) { | ||
266 | - this.customerCode = customerCode; | ||
267 | - } | ||
268 | - | ||
269 | - public String getCustomerMobile() { | ||
270 | - return customerMobile; | ||
271 | - } | ||
272 | - | ||
273 | - public void setCustomerMobile(String customerMobile) { | ||
274 | - this.customerMobile = customerMobile; | ||
275 | - } | ||
276 | - | ||
277 | - public String getCreater() { | ||
278 | - return creater; | ||
279 | - } | ||
280 | - | ||
281 | - public void setCreater(String creater) { | ||
282 | - this.creater = creater; | ||
283 | - } | ||
284 | - | ||
285 | - public String getSenderName() { | ||
286 | - return senderName; | ||
287 | - } | ||
288 | - | ||
289 | - public void setSenderName(String senderName) { | ||
290 | - this.senderName = senderName; | ||
291 | - } | ||
292 | - | ||
293 | - public String getSenderMobile() { | ||
294 | - return senderMobile; | ||
295 | - } | ||
296 | - | ||
297 | - public void setSenderMobile(String senderMobile) { | ||
298 | - this.senderMobile = senderMobile; | ||
299 | - } | ||
300 | - | ||
301 | - public String getSenderProvince() { | ||
302 | - return senderProvince; | ||
303 | - } | ||
304 | - | ||
305 | - public void setSenderProvince(String senderProvince) { | ||
306 | - this.senderProvince = senderProvince; | ||
307 | - } | ||
308 | - | ||
309 | - public String getSenderCity() { | ||
310 | - return senderCity; | ||
311 | - } | ||
312 | - | ||
313 | - public void setSenderCity(String senderCity) { | ||
314 | - this.senderCity = senderCity; | ||
315 | - } | ||
316 | - | ||
317 | - public String getSenderDistrict() { | ||
318 | - return senderDistrict; | ||
319 | - } | ||
320 | - | ||
321 | - public void setSenderDistrict(String senderDistrict) { | ||
322 | - this.senderDistrict = senderDistrict; | ||
323 | - } | ||
324 | - | ||
325 | - public String getSenderAddress() { | ||
326 | - return senderAddress; | ||
327 | - } | ||
328 | - | ||
329 | - public void setSenderAddress(String senderAddress) { | ||
330 | - this.senderAddress = senderAddress; | ||
331 | - } | ||
332 | - | ||
333 | - public String getReceiverName() { | ||
334 | - return receiverName; | ||
335 | - } | ||
336 | - | ||
337 | - public void setReceiverName(String receiverName) { | ||
338 | - this.receiverName = receiverName; | ||
339 | - } | ||
340 | - | ||
341 | - public String getReceiverMobile() { | ||
342 | - return receiverMobile; | ||
343 | - } | ||
344 | - | ||
345 | - public void setReceiverMobile(String receiverMobile) { | ||
346 | - this.receiverMobile = receiverMobile; | ||
347 | - } | ||
348 | - | ||
349 | - public String getReceiverProvince() { | ||
350 | - return receiverProvince; | ||
351 | - } | ||
352 | - | ||
353 | - public void setReceiverProvince(String receiverProvince) { | ||
354 | - this.receiverProvince = receiverProvince; | ||
355 | - } | ||
356 | - | ||
357 | - public String getReceiverCity() { | ||
358 | - return receiverCity; | ||
359 | - } | ||
360 | - | ||
361 | - public void setReceiverCity(String receiverCity) { | ||
362 | - this.receiverCity = receiverCity; | ||
363 | - } | ||
364 | - | ||
365 | - public String getReceiverDistrict() { | ||
366 | - return receiverDistrict; | ||
367 | - } | ||
368 | - | ||
369 | - public void setReceiverDistrict(String receiverDistrict) { | ||
370 | - this.receiverDistrict = receiverDistrict; | ||
371 | - } | ||
372 | - | ||
373 | - public String getReceiverAddress() { | ||
374 | - return receiverAddress; | ||
375 | - } | ||
376 | - | ||
377 | - public void setReceiverAddress(String receiverAddress) { | ||
378 | - this.receiverAddress = receiverAddress; | ||
379 | - } | ||
380 | - | ||
381 | - public String getGoodsInfo() { | ||
382 | - return goodsInfo; | ||
383 | - } | ||
384 | - | ||
385 | - public void setGoodsInfo(String goodsInfo) { | ||
386 | - this.goodsInfo = goodsInfo; | ||
387 | - } | ||
388 | - | ||
389 | - public String getProductInfo() { | ||
390 | - return productInfo; | ||
391 | - } | ||
392 | - | ||
393 | - public void setProductInfo(String productInfo) { | ||
394 | - this.productInfo = productInfo; | ||
395 | - } | ||
396 | - | ||
397 | - public Long getTotalAmount() { | ||
398 | - return totalAmount; | ||
399 | - } | ||
400 | - | ||
401 | - public void setTotalAmount(Long totalAmount) { | ||
402 | - this.totalAmount = totalAmount; | ||
403 | - } | ||
404 | - | ||
405 | - public Long getTotalStandardAmount() { | ||
406 | - return totalStandardAmount; | ||
407 | - } | ||
408 | - | ||
409 | - public void setTotalStandardAmount(Long totalStandardAmount) { | ||
410 | - this.totalStandardAmount = totalStandardAmount; | ||
411 | - } | ||
412 | - | ||
413 | - public Integer getOrderState() { | ||
414 | - return orderState; | ||
415 | - } | ||
416 | - | ||
417 | - public void setOrderState(Integer orderState) { | ||
418 | - this.orderState = orderState; | ||
419 | - } | ||
420 | - | ||
421 | - public String getOrderStateDesc() { | ||
422 | - return orderStateDesc; | ||
423 | - } | ||
424 | - | ||
425 | - public void setOrderStateDesc(String orderStateDesc) { | ||
426 | - this.orderStateDesc = orderStateDesc; | ||
427 | - } | ||
428 | - | ||
429 | - public Integer getPayState() { | ||
430 | - return payState; | ||
431 | - } | ||
432 | - | ||
433 | - public void setPayState(Integer payState) { | ||
434 | - this.payState = payState; | ||
435 | - } | ||
436 | - | ||
437 | - public LocalDateTime getPayTime() { | ||
438 | - return payTime; | ||
439 | - } | ||
440 | - | ||
441 | - public void setPayTime(LocalDateTime payTime) { | ||
442 | - this.payTime = payTime; | ||
443 | - } | ||
444 | - | ||
445 | - public String getTradeNo() { | ||
446 | - return tradeNo; | ||
447 | - } | ||
448 | - | ||
449 | - public void setTradeNo(String tradeNo) { | ||
450 | - this.tradeNo = tradeNo; | ||
451 | - } | ||
452 | - | ||
453 | - public Integer getMarketId() { | ||
454 | - return marketId; | ||
455 | - } | ||
456 | - | ||
457 | - public void setMarketId(Integer marketId) { | ||
458 | - this.marketId = marketId; | ||
459 | - } | ||
460 | - | ||
461 | - public Long getPaidBackAmount() { | ||
462 | - return paidBackAmount; | ||
463 | - } | ||
464 | - | ||
465 | - public void setPaidBackAmount(Long paidBackAmount) { | ||
466 | - this.paidBackAmount = paidBackAmount; | ||
467 | - } | ||
468 | - | ||
469 | - public Long getRefundAmount() { | ||
470 | - return refundAmount; | ||
471 | - } | ||
472 | - | ||
473 | - public void setRefundAmount(Long refundAmount) { | ||
474 | - this.refundAmount = refundAmount; | ||
475 | - } | ||
476 | - | ||
477 | - public Integer getDiscount() { | ||
478 | - return discount; | ||
479 | - } | ||
480 | - | ||
481 | - public void setDiscount(Integer discount) { | ||
482 | - this.discount = discount; | ||
483 | - } | ||
484 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/service/EcapContactPersonService.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.service; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.Message; | ||
5 | -import com.diligrp.etrade.core.domain.PageMessage; | ||
6 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonCo; | ||
7 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonListCo; | ||
8 | -import com.diligrp.etrade.ecap.domain.response.EcapContactPersonListVo; | ||
9 | - | ||
10 | -/** | ||
11 | - * <p> | ||
12 | - * 服务类 | ||
13 | - * </p> | ||
14 | - * | ||
15 | - * @author chenzhiwei | ||
16 | - * @since 2023-12-27 | ||
17 | - */ | ||
18 | -public interface EcapContactPersonService{ | ||
19 | - Message<Void> saveContact(EcapContactPersonCo co); | ||
20 | - Message<Void> updateContact(EcapContactPersonCo co); | ||
21 | - PageMessage<EcapContactPersonListVo> page(EcapContactPersonListCo co); | ||
22 | - | ||
23 | - Message<Void> delete(EcapContactPersonCo co); | ||
24 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/service/EcapOrderService.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.service; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.Message; | ||
5 | -import com.diligrp.etrade.core.domain.PageMessage; | ||
6 | -import com.diligrp.etrade.ecap.domain.request.*; | ||
7 | -import com.diligrp.etrade.rpc.dto.WeChatPayTradeBackDto; | ||
8 | - | ||
9 | -/** | ||
10 | - * <p> | ||
11 | - * 服务类 | ||
12 | - * </p> | ||
13 | - * | ||
14 | - * @author chenzhiwei | ||
15 | - * @since 2023-12-28 | ||
16 | - */ | ||
17 | -public interface EcapOrderService { | ||
18 | - /** | ||
19 | - * 新增记录 | ||
20 | - * @param ecapOrderCo | ||
21 | - * @return | ||
22 | - */ | ||
23 | - Message<Long> insert(EcapOrderCo ecapOrderCo); | ||
24 | - | ||
25 | - /** | ||
26 | - * 更新记录 | ||
27 | - * @param ecapOrderCo | ||
28 | - * @return | ||
29 | - */ | ||
30 | - Message<Void> update(EcapOrderCo ecapOrderCo); | ||
31 | - /** | ||
32 | - * 更新支付状态 | ||
33 | - * @param payStateCo | ||
34 | - * @return | ||
35 | - */ | ||
36 | - Message<Void> updatePayState(EcapOrderCo payStateCo); | ||
37 | - | ||
38 | - /** | ||
39 | - * 更新订单状态 | ||
40 | - * @param payStateCo | ||
41 | - * @return | ||
42 | - */ | ||
43 | - Message<Void> updateOrderState(EcapOrderUpdateOrderStateCo payStateCo); | ||
44 | - | ||
45 | - /** | ||
46 | - * 查询分页记录 | ||
47 | - * @param ecapOrderListCo | ||
48 | - * @return | ||
49 | - */ | ||
50 | - PageMessage page(EcapOrderListCo ecapOrderListCo); | ||
51 | - | ||
52 | - /** | ||
53 | - * 根据物流轨迹修改订单 | ||
54 | - * @param trace | ||
55 | - */ | ||
56 | - void updateByTrace(EcapTraceMsgPush trace); | ||
57 | - | ||
58 | - /** | ||
59 | - * 客户查询快递信息 | ||
60 | - * @param co | ||
61 | - * @return | ||
62 | - */ | ||
63 | - PageMessage listByCustomer(EcapOrderListCo co); | ||
64 | - | ||
65 | - /** | ||
66 | - * 微信支付回调 | ||
67 | - * @param param | ||
68 | - * @return | ||
69 | - */ | ||
70 | - Message<Void> payStateCallback(String param); | ||
71 | - | ||
72 | - /** | ||
73 | - * 微信退款回调接口 | ||
74 | - * @param param | ||
75 | - * @return | ||
76 | - */ | ||
77 | - Message<Void> refundCallback(String param); | ||
78 | - | ||
79 | - /** | ||
80 | - * 微信支付 | ||
81 | - */ | ||
82 | - Message<WeChatPayTradeBackDto> wechatPay(EcapWeChatPayTrade ecapWeChatPayTrade); | ||
83 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/service/EcapService.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.service; | ||
2 | - | ||
3 | -import cn.hutool.core.thread.ThreadUtil; | ||
4 | -import com.diligrp.etrade.core.domain.Message; | ||
5 | -import com.diligrp.etrade.core.util.JsonUtils; | ||
6 | -import com.diligrp.etrade.ecap.config.EcapConfig; | ||
7 | -import com.diligrp.etrade.ecap.constant.Constant; | ||
8 | -import com.diligrp.etrade.ecap.dao.EcapOrderMapper; | ||
9 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderCo; | ||
10 | -import com.diligrp.etrade.ecap.domain.request.EcapOrderUpdatePayStateCo; | ||
11 | -import com.diligrp.etrade.ecap.domain.response.EcapOrderListVo; | ||
12 | -import com.diligrp.etrade.ecap.exception.EcapException; | ||
13 | -import com.diligrp.etrade.ecap.type.JDState; | ||
14 | -import com.diligrp.etrade.ecap.type.OrderOrigin; | ||
15 | -import com.diligrp.etrade.ecap.type.OrderState; | ||
16 | -import com.diligrp.etrade.ecap.type.PayState; | ||
17 | -import com.diligrp.etrade.rpc.UapRpc; | ||
18 | -import com.diligrp.etrade.rpc.dto.FeeDto; | ||
19 | -import com.diligrp.etrade.rpc.dto.WeChatPayTradeDto; | ||
20 | -import com.diligrp.etrade.rpc.dto.response.DataDictionaryValueDTO; | ||
21 | -import com.diligrp.etrade.rpc.dto.response.EcapWeChatRefundVo; | ||
22 | -import com.diligrp.etrade.rpc.resolver.WeChatPayRpcResolver; | ||
23 | -import com.diligrp.etrade.rpc.type.WeChatPayType; | ||
24 | -import com.lop.open.api.sdk.DefaultDomainApiClient; | ||
25 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.CommonCheckPreCreateOrderResponse; | ||
26 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.CommonCreateOrderRequest; | ||
27 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.CommonProductInfo; | ||
28 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCheckPreCreateOrderV1.Response; | ||
29 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCreateOrderResponse; | ||
30 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.preGetWaybillCodes.PreGetWaybillCodesRequest; | ||
31 | -import com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonCancelOrderV1.CommonModifyCancelOrderResponse; | ||
32 | -import com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonCancelOrderV1.CommonOrderCancelRequest; | ||
33 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetActualFeeInfoV1.CommonActualFeeRequest; | ||
34 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetActualFeeInfoV1.CommonActualFeeResponse; | ||
35 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderStatusV1.CommonOrderStatusRequest; | ||
36 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderStatusV1.CommonOrderStatusResponse; | ||
37 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceDetail; | ||
38 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceRequest; | ||
39 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceResponse; | ||
40 | -import com.lop.open.api.sdk.domain.ECAP.WaybillTrackAndTimePositionApi.getWaybillGisTrackByWaybillCode.WaybillDto; | ||
41 | -import com.lop.open.api.sdk.domain.ECAP.WaybillTrackAndTimePositionApi.getWaybillGisTrackByWaybillCode.WaybillGisTrackDto; | ||
42 | -import com.lop.open.api.sdk.domain.ECAP.WaybillTrackAndTimePositionApi.getWaybillGisTrackByWaybillCode.data; | ||
43 | -import com.lop.open.api.sdk.request.ECAP.*; | ||
44 | -import com.lop.open.api.sdk.response.ECAP.EcapV1OrdersActualfeeQueryLopResponse; | ||
45 | -import com.lop.open.api.sdk.response.ECAP.EcapV1OrdersCancelLopResponse; | ||
46 | -import com.lop.open.api.sdk.response.ECAP.EcapV1OrdersCreateLopResponse; | ||
47 | -import com.lop.open.api.sdk.response.ECAP.EcapV1OrdersStatusGetLopResponse; | ||
48 | -import jakarta.annotation.Resource; | ||
49 | -import org.apache.commons.collections4.CollectionUtils; | ||
50 | -import org.apache.commons.lang3.ObjectUtils; | ||
51 | -import org.slf4j.Logger; | ||
52 | -import org.slf4j.LoggerFactory; | ||
53 | -import org.springframework.beans.factory.annotation.Value; | ||
54 | -import org.springframework.data.redis.core.StringRedisTemplate; | ||
55 | -import org.springframework.stereotype.Service; | ||
56 | - | ||
57 | -import java.math.BigDecimal; | ||
58 | -import java.util.*; | ||
59 | -import java.util.concurrent.TimeUnit; | ||
60 | - | ||
61 | -/** | ||
62 | - * 物流相关接口 | ||
63 | - */ | ||
64 | -@Service | ||
65 | -public class EcapService { | ||
66 | - private static Logger logger = LoggerFactory.getLogger(EcapService.class); | ||
67 | - private final EcapConfig ecapConfig; | ||
68 | - | ||
69 | - public EcapService(EcapConfig ecapConfig) { | ||
70 | - this.ecapConfig = ecapConfig; | ||
71 | - } | ||
72 | - private final static String URL = "ecapOrder/refund/callback"; | ||
73 | - private final static String BACK_KEY = "BACK_ECAP_ORDER_"; | ||
74 | - @Value("${weChatPay.backUrl.base}") | ||
75 | - private String path; | ||
76 | - @Resource | ||
77 | - EcapOrderMapper mapper; | ||
78 | - @Resource | ||
79 | - private UapRpc uapRpc; | ||
80 | - @Resource | ||
81 | - private WeChatPayRpcResolver weChatPayRpcResolver; | ||
82 | - @Resource | ||
83 | - private StringRedisTemplate stringRedisTemplate; | ||
84 | - /** | ||
85 | - * 对给定的创建订单请求进行前置检查 | ||
86 | - * | ||
87 | - * @param createOrderRequest 创建订单请求对象 | ||
88 | - * @return 前置检查结果的响应对象 | ||
89 | - * @throws Exception 发生异常时抛出 | ||
90 | - */ | ||
91 | - public CommonCheckPreCreateOrderResponse precheck(CommonCreateOrderRequest createOrderRequest) throws Exception { | ||
92 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
93 | - EcapV1OrdersPrecheckLopRequest request = new EcapV1OrdersPrecheckLopRequest(); | ||
94 | - setPrecheckRequestParams(createOrderRequest, request); | ||
95 | - Response<CommonCheckPreCreateOrderResponse> result = client.execute(request).getResult(); | ||
96 | - handleResponseError(result.getCode(), result.getMsg()); | ||
97 | - return result.getData(); | ||
98 | - } | ||
99 | - | ||
100 | - | ||
101 | - /** | ||
102 | - * 预获取运单号 | ||
103 | - * | ||
104 | - * @return 运单号列表中的第一个运单号 | ||
105 | - * @throws Exception | ||
106 | - */ | ||
107 | - public String preGetWaybillCodes() throws Exception { | ||
108 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
109 | - EcapV1OrdersPregetwaybillcodesLopRequest request = new EcapV1OrdersPregetwaybillcodesLopRequest(); | ||
110 | - setPregetwaybillcodesRequestParams(request); | ||
111 | - com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.preGetWaybillCodes.Response<List<String>> result = client.execute(request).getResult(); | ||
112 | - handleResponseError(result.getCode(), result.getMsg()); | ||
113 | - return result.getData().get(0); | ||
114 | - } | ||
115 | - | ||
116 | - | ||
117 | - /** | ||
118 | - * 追踪查询公共订单响应 | ||
119 | - * | ||
120 | - * @param orderTraceRequest 订单追踪请求对象 | ||
121 | - * @return 追踪查询公共订单响应对象 | ||
122 | - * @throws Exception 异常情况 | ||
123 | - */ | ||
124 | - public CommonOrderTraceResponse traceQuery(CommonOrderTraceRequest orderTraceRequest) throws Exception { | ||
125 | - //更新运费信息 | ||
126 | - ThreadUtil.execute(()->{ | ||
127 | - updateFee(orderTraceRequest); | ||
128 | - }); | ||
129 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
130 | - EcapV1OrdersTraceQueryLopRequest request = new EcapV1OrdersTraceQueryLopRequest(); | ||
131 | - setTraceQueryRequestParams(orderTraceRequest, request); | ||
132 | - // 调用通用查询订单追踪接口 | ||
133 | - com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.Response<CommonOrderTraceResponse> result = client.execute(request).getResult(); | ||
134 | - // 处理响应错误 | ||
135 | - handleResponseError(result.getCode(), result.getMsg()); | ||
136 | - // 返回追踪查询公共订单响应数据 | ||
137 | - return result.getData(); | ||
138 | - } | ||
139 | - | ||
140 | - /** | ||
141 | - * | ||
142 | - * @param orderTraceRequest | ||
143 | - * @return | ||
144 | - * @throws Exception | ||
145 | - */ | ||
146 | - public CommonOrderTraceResponse doTraceQuery(CommonOrderTraceRequest orderTraceRequest) throws Exception { | ||
147 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
148 | - EcapV1OrdersTraceQueryLopRequest request = new EcapV1OrdersTraceQueryLopRequest(); | ||
149 | - setTraceQueryRequestParams(orderTraceRequest, request); | ||
150 | - // 调用通用查询订单追踪接口 | ||
151 | - com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.Response<CommonOrderTraceResponse> result = client.execute(request).getResult(); | ||
152 | - // 处理响应错误 | ||
153 | - handleResponseError(result.getCode(), result.getMsg()); | ||
154 | - // 返回追踪查询公共订单响应数据 | ||
155 | - return result.getData(); | ||
156 | - } | ||
157 | - /** | ||
158 | - * 手动更新运费信息 | ||
159 | - * | ||
160 | - * @param trace | ||
161 | - */ | ||
162 | - public void updateFee(CommonOrderTraceRequest trace) { | ||
163 | - logger.info("手动更新运费信息:{}", trace); | ||
164 | - try { | ||
165 | - Boolean b = stringRedisTemplate.opsForValue().setIfAbsent(trace.getWaybillCode(), trace.getWaybillCode(), 30, TimeUnit.SECONDS); | ||
166 | - if (!b) { | ||
167 | - logger.info("频繁刷新物流信息,{}", trace); | ||
168 | - return; | ||
169 | - } | ||
170 | - EcapOrderCo co = new EcapOrderCo(); | ||
171 | - co.setJdNumber(trace.getWaybillCode()); | ||
172 | - EcapOrderListVo order = mapper.getOrderByNumber(co); | ||
173 | - if (ObjectUtils.isEmpty(order)) { | ||
174 | - logger.info("手动更新运费信息,未查询到对应的订单信息,{}", trace); | ||
175 | - return; | ||
176 | - } | ||
177 | - Long before = order.getTotalAmount() + order.getPaidBackAmount(); | ||
178 | - Long after = order.getTotalStandardAmount()+order.getRefundAmount(); | ||
179 | - if(isaBoolean(order, before, after)){ | ||
180 | - logger.info("已经完成支付且实际运费与预计运费一致"); | ||
181 | - return; | ||
182 | - } | ||
183 | - EcapOrderUpdatePayStateCo entity = JsonUtils.convertValue(order, EcapOrderUpdatePayStateCo.class); | ||
184 | - //查询物流信息 | ||
185 | - CommonOrderTraceResponse commonOrderTraceResponse = doTraceQuery(trace); | ||
186 | - List<CommonOrderTraceDetail> traceDetails = commonOrderTraceResponse.getTraceDetails(); | ||
187 | - if (CollectionUtils.isEmpty(traceDetails)){ | ||
188 | - logger.info("物流信息为空,{}",trace); | ||
189 | - return; | ||
190 | - } | ||
191 | - CommonOrderTraceDetail commonOrderTraceDetail = traceDetails.get(0); | ||
192 | - //CommonOrderStatusResponse statusResponse = getOrderStatus(order.getJdNumber()); | ||
193 | - logger.info("京东返回的物流信息,{}", commonOrderTraceDetail); | ||
194 | - if (isTrue(order, commonOrderTraceDetail)){ | ||
195 | - List<DataDictionaryValueDTO> dtoList = uapRpc.listDict(Constant.EXPRESS_DISCOUNT); | ||
196 | - int discount = CollectionUtils.isEmpty(dtoList)? 100: Integer.valueOf(dtoList.get(0).getCode()); | ||
197 | - CommonActualFeeResponse actualFee = getActualFeeInfo(trace.getWaybillCode()); | ||
198 | - BigDecimal sumMoney = actualFee.getTotalStandardAmount() == null ? BigDecimal.ZERO : actualFee.getTotalStandardAmount(); | ||
199 | - Long money = sumMoney.multiply(new BigDecimal(discount)).longValue(); | ||
200 | - logger.info("京东返回运费,{}", money); | ||
201 | - money = money.compareTo(0L) <= 0 ? entity.getTotalAmount() :money; | ||
202 | - entity.setTotalStandardAmount(money); | ||
203 | - int state = entity.getTotalAmount().compareTo(money)<0 ? PayState.UNPAID.getCode() : order.getPayState(); | ||
204 | - //如果订单本身就是待支付就改预计运费,反之如果是支付状态则需要判断支付金额是否满足实际运费 | ||
205 | - if (Objects.isNull(entity.getPayTime())){ | ||
206 | - //是待支付时就把真实运费更新到预计运费中,且是从未支付过的 | ||
207 | - entity.setTotalAmount(money); | ||
208 | - } | ||
209 | - entity.setPayState(state); | ||
210 | - entity.setDiscount(discount); | ||
211 | - } | ||
212 | - if(!"406".equals(String.valueOf(commonOrderTraceDetail.getCategory()))){ | ||
213 | - entity.setOrderState(Integer.valueOf(commonOrderTraceDetail.getCategory())); | ||
214 | - entity.setOrderStateDesc(OrderState.getName(entity.getOrderState())); | ||
215 | - } | ||
216 | - if (isTrue(order, commonOrderTraceDetail) && PayState.PAID.getCode() == order.getPayState() && entity.getTotalAmount().compareTo(entity.getTotalStandardAmount())>0){ | ||
217 | - refund(order, entity); | ||
218 | - } | ||
219 | - //如果是取消订单,现在取消 | ||
220 | - if (OrderState.CANCELLED.getCode() == entity.getOrderState() && PayState.PAID.getCode() == entity.getPayState()){ | ||
221 | - refund(order, entity); | ||
222 | - entity.setPayState(PayState.CANCELLED.getCode()); | ||
223 | - } | ||
224 | - mapper.updateFeeAndOrderState(entity); | ||
225 | - } catch (Exception e) { | ||
226 | - logger.error("更新运费失败,忽略,{}", e); | ||
227 | - throw new EcapException(11,e.getMessage()); | ||
228 | - }finally { | ||
229 | - stringRedisTemplate.delete(trace.getWaybillCode()); | ||
230 | - } | ||
231 | - } | ||
232 | - | ||
233 | - public boolean isaBoolean(EcapOrderListVo order, Long before, Long after) { | ||
234 | - return (String.valueOf(JDState.DELIVERED.getCode()).equals(String.valueOf(order.getOrderState())) || | ||
235 | - String.valueOf(JDState.REJECTION.getCode()).equals(String.valueOf(order.getOrderState())) || | ||
236 | - String.valueOf(OrderState.DELIVERED.getCode()).equals(String.valueOf(order.getOrderState())) || | ||
237 | - String.valueOf(OrderState.REJECTION.getCode()).equals(String.valueOf(order.getOrderState()))) && | ||
238 | - PayState.PAID.getCode() == order.getPayState() && before.compareTo(after) == 0; | ||
239 | - } | ||
240 | - | ||
241 | - /** | ||
242 | - * 退款 | ||
243 | - * @param order | ||
244 | - * @param entity | ||
245 | - */ | ||
246 | - public void refund(EcapOrderListVo order, EcapOrderUpdatePayStateCo entity) { | ||
247 | - String key = BACK_KEY + order.getOrderNumber(); | ||
248 | - boolean b = stringRedisTemplate.opsForValue().setIfAbsent(key, order.getOrderNumber(), 30, TimeUnit.SECONDS); | ||
249 | - if (!b||Objects.nonNull(order.getRefundTradeNo())){ | ||
250 | - logger.info("已经退款或正在有其他操作退款,{}", order); | ||
251 | - return; | ||
252 | - } | ||
253 | - WeChatPayTradeDto weChatPayTradeDto = new WeChatPayTradeDto(); | ||
254 | - weChatPayTradeDto.setPaymentId(order.getTradeNo()); | ||
255 | - weChatPayTradeDto.setMarketId(1L); | ||
256 | - weChatPayTradeDto.setAmount(entity.getTotalAmount() - entity.getTotalStandardAmount()); | ||
257 | - weChatPayTradeDto.setNotifyUrl(path+URL); | ||
258 | - FeeDto feeDto = new FeeDto(); | ||
259 | - feeDto.setAmount(weChatPayTradeDto.getAmount()); | ||
260 | - feeDto.setType(WeChatPayType.PAYMENT.getCode()); | ||
261 | - feeDto.setTypeName("退快递费"); | ||
262 | - weChatPayTradeDto.setFees(Collections.singletonList(feeDto)); | ||
263 | - Message<EcapWeChatRefundVo> refund = weChatPayRpcResolver.refund(weChatPayTradeDto); | ||
264 | - if (200 != refund.getCode()) { | ||
265 | - logger.error("退款失败,{}",refund.getMessage()); | ||
266 | - throw new EcapException(refund.getCode(),"退款失败"); | ||
267 | - } | ||
268 | - EcapWeChatRefundVo ecapWeChatRefundVo = refund.getData(); | ||
269 | - //直接返回成功 | ||
270 | - if (ecapWeChatRefundVo.getState() == 4){ | ||
271 | - //将预估运费改成实际支付运费金额 | ||
272 | - entity.setRefundAmount(entity.getTotalAmount() - entity.getTotalStandardAmount()); | ||
273 | - } | ||
274 | - if (ecapWeChatRefundVo.getState() == 1){ | ||
275 | - entity.setRefundTradeNo(ecapWeChatRefundVo.getPaymentId()); | ||
276 | - } | ||
277 | - } | ||
278 | - /** | ||
279 | - * 需要查询运费的节点 | ||
280 | - * @param order | ||
281 | - * @param statusResponse | ||
282 | - * @return | ||
283 | - */ | ||
284 | - public boolean isTrue(EcapOrderListVo order, CommonOrderTraceDetail statusResponse) { | ||
285 | - return String.valueOf(JDState.DELIVERED.getCode()).equals(String.valueOf(order.getOrderState())) || | ||
286 | - String.valueOf(JDState.REJECTION.getCode()).equals(String.valueOf(order.getOrderState())) || | ||
287 | - String.valueOf(JDState.DELIVERED.getCode()).equals(statusResponse.getCategory()) || | ||
288 | - String.valueOf(JDState.REJECTION.getCode()).equals(statusResponse.getCategory())|| | ||
289 | - String.valueOf(OrderState.DELIVERED.getCode()).equals(String.valueOf(statusResponse.getCategory()))|| | ||
290 | - String.valueOf(OrderState.REJECTION.getCode()).equals(String.valueOf(statusResponse.getCategory())); | ||
291 | - } | ||
292 | - | ||
293 | - /** | ||
294 | - * 创建订单 | ||
295 | - * | ||
296 | - * @param createOrderRequest 订单创建请求对象 | ||
297 | - * @return 订单创建响应对象 | ||
298 | - * @throws Exception 异常情况 | ||
299 | - */ | ||
300 | - public CommonCreateOrderResponse create(com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCreateOrderRequest createOrderRequest) throws Exception { | ||
301 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
302 | - EcapV1OrdersCreateLopRequest request = new EcapV1OrdersCreateLopRequest(); | ||
303 | - setCreateOrderRequestParams(createOrderRequest, request); | ||
304 | - EcapV1OrdersCreateLopResponse response = client.execute(request); | ||
305 | - com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.Response<CommonCreateOrderResponse> result = response.getResult(); | ||
306 | - handleResponseError(result.getCode(), result.getMsg() + ":" + result.getSubMsg()); | ||
307 | - return result.getData(); | ||
308 | - } | ||
309 | - | ||
310 | - | ||
311 | - /** | ||
312 | - * 取消Ecap订单 | ||
313 | - * | ||
314 | - * @param waybillCode 运单号码 | ||
315 | - * @return 取消订单的响应对象 | ||
316 | - * @throws Exception 异常情况 | ||
317 | - */ | ||
318 | - public CommonModifyCancelOrderResponse cancelEcapOrder(String waybillCode) throws Exception { | ||
319 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
320 | - EcapV1OrdersCancelLopRequest request = new EcapV1OrdersCancelLopRequest(); | ||
321 | - setCancelOrderRequestParams(waybillCode, request); | ||
322 | - EcapV1OrdersCancelLopResponse response = client.execute(request); | ||
323 | - com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonCancelOrderV1.Response<CommonModifyCancelOrderResponse> result = response.getResult(); | ||
324 | - handleResponseError(result.getCode(), result.getMsg()); | ||
325 | - return result.getData(); | ||
326 | - } | ||
327 | - | ||
328 | - | ||
329 | - /** | ||
330 | - * 获取订单状态 | ||
331 | - * | ||
332 | - * @param waybillCode 运单号码 | ||
333 | - * @return 订单状态响应对象 | ||
334 | - * @throws Exception 异常情况 | ||
335 | - */ | ||
336 | - public CommonOrderStatusResponse getOrderStatus(String waybillCode) throws Exception { | ||
337 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
338 | - EcapV1OrdersStatusGetLopRequest request = new EcapV1OrdersStatusGetLopRequest(); | ||
339 | - setOrderStatusRequestParams(waybillCode, request); | ||
340 | - EcapV1OrdersStatusGetLopResponse response = client.execute(request); | ||
341 | - com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderStatusV1.Response<CommonOrderStatusResponse> result = response.getResult(); | ||
342 | - handleResponseError(result.getCode(), result.getMsg()); | ||
343 | - return result.getData(); | ||
344 | - } | ||
345 | - | ||
346 | - | ||
347 | - /** | ||
348 | - * 获取实际费用信息 | ||
349 | - * | ||
350 | - * @param waybillCode 运单号 | ||
351 | - * @return 实际费用响应对象 | ||
352 | - * @throws Exception 异常情况 | ||
353 | - */ | ||
354 | - public CommonActualFeeResponse getActualFeeInfo(String waybillCode) throws Exception { | ||
355 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
356 | - EcapV1OrdersActualfeeQueryLopRequest request = new EcapV1OrdersActualfeeQueryLopRequest(); | ||
357 | - setActualFeeRequestParams(waybillCode, request); | ||
358 | - EcapV1OrdersActualfeeQueryLopResponse response = client.execute(request); | ||
359 | - com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetActualFeeInfoV1.Response<CommonActualFeeResponse> result = response.getResult(); | ||
360 | - return result.getData(); | ||
361 | - } | ||
362 | - | ||
363 | - /** | ||
364 | - * 根据运单号获取GIS轨迹信息 | ||
365 | - * | ||
366 | - * @param waybillCode 运单号 | ||
367 | - * @return 运单的GIS轨迹信息 | ||
368 | - * @throws Exception 异常情况 | ||
369 | - */ | ||
370 | - public data getWaybillGisTrack(String waybillCode) throws Exception { | ||
371 | - DefaultDomainApiClient client = getDefaultDomainApiClient(); | ||
372 | - EcapV1OrdersWaybillGisTrackLopRequest request = new EcapV1OrdersWaybillGisTrackLopRequest(); | ||
373 | - setWaybillGisTrackRequestParams(waybillCode, request); | ||
374 | - WaybillGisTrackDto waybillGisTrackDto = client.execute(request).getWaybillGisTrackDto(); | ||
375 | - if (waybillGisTrackDto.getStatusCode() != 1) { | ||
376 | - throw new Exception(waybillGisTrackDto.getStatusMessage()); | ||
377 | - } | ||
378 | - return waybillGisTrackDto.getData(); | ||
379 | - } | ||
380 | - | ||
381 | - | ||
382 | - /** | ||
383 | - * 获取默认的DomainApiClient实例 | ||
384 | - * | ||
385 | - * @return 返回DefaultDomainApiClient实例 | ||
386 | - */ | ||
387 | - private DefaultDomainApiClient getDefaultDomainApiClient() { | ||
388 | - return ecapConfig.getDefaultDomainApiClient(); | ||
389 | - } | ||
390 | - | ||
391 | - | ||
392 | - /** | ||
393 | - * 设置跟踪请求参数 | ||
394 | - * | ||
395 | - * @param waybillCode 运单号 | ||
396 | - * @param request 跟踪请求 | ||
397 | - */ | ||
398 | - private void setWaybillGisTrackRequestParams(String waybillCode, EcapV1OrdersWaybillGisTrackLopRequest request) { | ||
399 | - // 创建运单信息对象 | ||
400 | - WaybillDto waybillDto = new WaybillDto(); | ||
401 | - // 设置客户代码 | ||
402 | - waybillDto.setCustomerCode(ecapConfig.getCustomerCode()); | ||
403 | - // 设置运单号 | ||
404 | - waybillDto.setWaybillCode(waybillCode); | ||
405 | - // 将运单信息对象添加到跟踪请求中 | ||
406 | - request.setWaybillDto(waybillDto); | ||
407 | - // 添加跟踪插件 | ||
408 | - request.addLopPlugin(ecapConfig.getLopPlugin()); | ||
409 | - } | ||
410 | - | ||
411 | - /** | ||
412 | - * 设置预检查请求参数 | ||
413 | - * | ||
414 | - * @param createOrderRequest 创建订单请求 | ||
415 | - * @param request 预检查请求 | ||
416 | - */ | ||
417 | - private void setPrecheckRequestParams(CommonCreateOrderRequest createOrderRequest, EcapV1OrdersPrecheckLopRequest request) { | ||
418 | - createOrderRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); // 设置订单来源为B2C | ||
419 | - createOrderRequest.setCustomerCode(ecapConfig.getCustomerCode()); // 设置顾客代码 | ||
420 | - CommonProductInfo productInfo = new CommonProductInfo(); | ||
421 | - productInfo.setProductCode("ed-m-0001"); // 设置产品代码 | ||
422 | - createOrderRequest.setProductsReq(productInfo); // 设置产品请求 | ||
423 | - request.setRequest(createOrderRequest); // 设置请求 | ||
424 | - request.addLopPlugin(ecapConfig.getLopPlugin()); // 添加预检查插件 | ||
425 | - } | ||
426 | - | ||
427 | - | ||
428 | - /** | ||
429 | - * 为请求对象设置预取运单号参数 | ||
430 | - * | ||
431 | - * @param request 请求对象 | ||
432 | - */ | ||
433 | - private void setPregetwaybillcodesRequestParams(EcapV1OrdersPregetwaybillcodesLopRequest request) { | ||
434 | - // 创建一个PreGetWaybillCodesRequest对象 | ||
435 | - PreGetWaybillCodesRequest preGetWaybillCodesRequest = new PreGetWaybillCodesRequest(); | ||
436 | - // 设置客户代码 | ||
437 | - preGetWaybillCodesRequest.setCustomerCode(ecapConfig.getCustomerCode()); | ||
438 | - // 设置订单来源为B2C | ||
439 | - preGetWaybillCodesRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); | ||
440 | - // 设置数量为1 | ||
441 | - preGetWaybillCodesRequest.setSum(1); | ||
442 | - // 将preGetWaybillCodesRequest设置为request的请求参数 | ||
443 | - request.setRequest(preGetWaybillCodesRequest); | ||
444 | - // 添加ecapConfig的LopPlugin插件到request的lop插件列表中 | ||
445 | - request.addLopPlugin(ecapConfig.getLopPlugin()); | ||
446 | - } | ||
447 | - | ||
448 | - | ||
449 | - /** | ||
450 | - * 设置追踪查询请求参数 | ||
451 | - * | ||
452 | - * @param orderTraceRequest 订单追踪请求 | ||
453 | - * @param request 追踪查询请求 | ||
454 | - */ | ||
455 | - private void setTraceQueryRequestParams(CommonOrderTraceRequest orderTraceRequest, EcapV1OrdersTraceQueryLopRequest request) { | ||
456 | - orderTraceRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); // 设置订单来源为B2C | ||
457 | - orderTraceRequest.setCustomerCode(ecapConfig.getCustomerCode()); // 设置顾客代码 | ||
458 | - request.addLopPlugin(ecapConfig.getLopPlugin()); // 添加插件 | ||
459 | - request.setCommonOrderTraceRequest(orderTraceRequest); // 设置通用订单追踪请求 | ||
460 | - } | ||
461 | - | ||
462 | - | ||
463 | - /** | ||
464 | - * 设置创建订单请求参数 | ||
465 | - * | ||
466 | - * @param createOrderRequest 创建订单请求 | ||
467 | - * @param request 追踪查询请求 | ||
468 | - */ | ||
469 | - private void setCreateOrderRequestParams(com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCreateOrderRequest createOrderRequest, EcapV1OrdersCreateLopRequest request) { | ||
470 | - createOrderRequest.setCustomerCode(ecapConfig.getCustomerCode()); // 设置顾客代码 | ||
471 | - createOrderRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); // 设置订单来源为B2C | ||
472 | - com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonProductInfo productInfo = new com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonProductInfo(); // 创建商品信息 | ||
473 | - productInfo.setProductCode("ed-m-0001"); // 设置商品代码 | ||
474 | - createOrderRequest.setProductsReq(productInfo); // 设置商品信息请求 | ||
475 | - createOrderRequest.setSettleType(Constant.SETTLE_TYPE); // 设置结算类型 | ||
476 | - Map<String, String> extraParams = new HashMap<>(); // 创建额外参数集合 | ||
477 | - extraParams.put("autoSubscribe", "1"); // 设置自动订阅为1 | ||
478 | - createOrderRequest.setExtendProps(extraParams); // 设置扩展属性 | ||
479 | - request.addLopPlugin(ecapConfig.getLopPlugin()); // 添加插件 | ||
480 | - request.setRequest(createOrderRequest); // 设置请求 | ||
481 | - } | ||
482 | - | ||
483 | - | ||
484 | - /** | ||
485 | - * 设置取消订单请求参数 | ||
486 | - * | ||
487 | - * @param waybillCode 运单号 | ||
488 | - * @param request 取消订单请求对象 | ||
489 | - */ | ||
490 | - private void setCancelOrderRequestParams(String waybillCode, EcapV1OrdersCancelLopRequest request) { | ||
491 | - // 创建通用取消订单请求对象 | ||
492 | - CommonOrderCancelRequest cancelRequest = new CommonOrderCancelRequest(); | ||
493 | - // 设置订单来源为B2C | ||
494 | - cancelRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); | ||
495 | - // 设置客户代码 | ||
496 | - cancelRequest.setCustomerCode(ecapConfig.getCustomerCode()); | ||
497 | - // 设置运单号 | ||
498 | - cancelRequest.setWaybillCode(waybillCode); | ||
499 | - // 设置取消原因 | ||
500 | - cancelRequest.setCancelReason("用户取消"); | ||
501 | - // 设置取消类型为1 | ||
502 | - cancelRequest.setCancelReasonCode("1"); | ||
503 | - // 将请求对象设置给请求体 | ||
504 | - request.setRequest(cancelRequest); | ||
505 | - // 添加Lop插件 | ||
506 | - request.addLopPlugin(ecapConfig.getLopPlugin()); | ||
507 | - } | ||
508 | - | ||
509 | - | ||
510 | - // 设置订单状态请求参数 | ||
511 | - private void setOrderStatusRequestParams(String waybillCode, EcapV1OrdersStatusGetLopRequest request) { | ||
512 | - CommonOrderStatusRequest orderStatusRequest = new CommonOrderStatusRequest(); | ||
513 | - orderStatusRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); // 设置订单来源为B2C | ||
514 | - orderStatusRequest.setCustomerCode(ecapConfig.getCustomerCode()); // 设置客户代码 | ||
515 | - orderStatusRequest.setWaybillCode(waybillCode); // 设置运单代码 | ||
516 | - request.setRequest(orderStatusRequest); // 设置请求参数 | ||
517 | - request.addLopPlugin(ecapConfig.getLopPlugin()); // 添加Lop插件 | ||
518 | - } | ||
519 | - | ||
520 | - // 设置实际费用请求参数 | ||
521 | - private void setActualFeeRequestParams(String waybillCode, EcapV1OrdersActualfeeQueryLopRequest request) { | ||
522 | - CommonActualFeeRequest actualFeeRequest = new CommonActualFeeRequest(); | ||
523 | - actualFeeRequest.setOrderOrigin(OrderOrigin.B2C.getCode()); // 设置订单来源为B2C | ||
524 | - actualFeeRequest.setCustomerCode(ecapConfig.getCustomerCode()); // 设置客户代码 | ||
525 | - actualFeeRequest.setWaybillCode(waybillCode); // 设置运单代码 | ||
526 | - request.setRequest(actualFeeRequest); // 设置请求参数 | ||
527 | - request.addLopPlugin(ecapConfig.getLopPlugin()); // 添加Lop插件 | ||
528 | - } | ||
529 | - | ||
530 | - // 处理响应错误 | ||
531 | - private void handleResponseError(int code, String msg) throws Exception { | ||
532 | - if (code != 0) { // 如果错误码不为0,则抛出异常 | ||
533 | - throw new Exception(msg); // 抛出异常 | ||
534 | - } | ||
535 | - } | ||
536 | - | ||
537 | -} | ||
538 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/service/impl/EcapContactPersonServiceImpl.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.service.impl; | ||
2 | - | ||
3 | - | ||
4 | -import com.diligrp.etrade.core.domain.Message; | ||
5 | -import com.diligrp.etrade.core.domain.PageMessage; | ||
6 | -import com.diligrp.etrade.core.util.JsonUtils; | ||
7 | -import com.diligrp.etrade.ecap.dao.EcapContactPersonMapper; | ||
8 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonCo; | ||
9 | -import com.diligrp.etrade.ecap.domain.request.EcapContactPersonListCo; | ||
10 | -import com.diligrp.etrade.ecap.domain.response.EcapContactPersonListVo; | ||
11 | -import com.diligrp.etrade.ecap.model.EcapContactPersonDo; | ||
12 | -import com.diligrp.etrade.ecap.service.EcapContactPersonService; | ||
13 | -import com.github.pagehelper.Page; | ||
14 | -import com.github.pagehelper.PageHelper; | ||
15 | -import jakarta.annotation.Resource; | ||
16 | -import org.apache.commons.collections4.CollectionUtils; | ||
17 | -import org.apache.commons.lang3.ObjectUtils; | ||
18 | -import org.slf4j.Logger; | ||
19 | -import org.slf4j.LoggerFactory; | ||
20 | -import org.springframework.stereotype.Service; | ||
21 | - | ||
22 | -import java.util.ArrayList; | ||
23 | -import java.util.List; | ||
24 | - | ||
25 | -/** | ||
26 | - * <p> | ||
27 | - * 服务实现类 | ||
28 | - * </p> | ||
29 | - * | ||
30 | - * @author chenzhiwei | ||
31 | - * @since 2023-12-27 | ||
32 | - */ | ||
33 | -@Service | ||
34 | -public class EcapContactPersonServiceImpl implements EcapContactPersonService { | ||
35 | - private final static Logger logger = LoggerFactory.getLogger(EcapContactPersonServiceImpl.class); | ||
36 | - @Resource | ||
37 | - private EcapContactPersonMapper mapper; | ||
38 | - | ||
39 | - @Override | ||
40 | - public Message<Void> saveContact(EcapContactPersonCo co) { | ||
41 | - logger.info("保存联系人 :{}", co); | ||
42 | - EcapContactPersonDo entity = JsonUtils.convertValue(co, EcapContactPersonDo.class); | ||
43 | - mapper.insert(entity); | ||
44 | - return Message.success(); | ||
45 | - } | ||
46 | - | ||
47 | - @Override | ||
48 | - public Message<Void> updateContact(EcapContactPersonCo co) { | ||
49 | - logger.info("保存联系人 :{}", co); | ||
50 | - EcapContactPersonDo entity = JsonUtils.convertValue(co, EcapContactPersonDo.class); | ||
51 | - int num = mapper.update(entity); | ||
52 | - return num > 0 ? Message.success() : Message.failure("修改失败"); | ||
53 | - } | ||
54 | - | ||
55 | - @Override | ||
56 | - public Message<Void> delete(EcapContactPersonCo co) { | ||
57 | - logger.info("删除联系人 :{}", co); | ||
58 | - if (ObjectUtils.isEmpty(co.getState())) { | ||
59 | - co.setState(2); | ||
60 | - } | ||
61 | - EcapContactPersonDo entity = JsonUtils.convertValue(co, EcapContactPersonDo.class); | ||
62 | - mapper.update(entity); | ||
63 | - return Message.success(); | ||
64 | - } | ||
65 | - | ||
66 | - @Override | ||
67 | - public PageMessage<EcapContactPersonListVo> page(EcapContactPersonListCo co) { | ||
68 | - logger.info("联系人分页查询:{}", co); | ||
69 | - PageHelper.startPage(ObjectUtils.defaultIfNull(co.getPageNo(), 1), | ||
70 | - ObjectUtils.defaultIfNull(co.getPageSize(), 10)); | ||
71 | - Page<EcapContactPersonListVo> pageList = mapper.list(co); | ||
72 | - | ||
73 | - return PageMessage.success(pageList.getTotal(), pageList.getResult()); | ||
74 | - } | ||
75 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/service/impl/EcapOrderServiceImpl.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.service.impl; | ||
2 | - | ||
3 | - | ||
4 | -import cn.hutool.core.date.DatePattern; | ||
5 | -import cn.hutool.core.date.DateTime; | ||
6 | -import cn.hutool.core.date.DateUtil; | ||
7 | -import cn.hutool.core.util.StrUtil; | ||
8 | -import com.diligrp.etrade.core.domain.Message; | ||
9 | -import com.diligrp.etrade.core.domain.PageMessage; | ||
10 | -import com.diligrp.etrade.core.util.JsonUtils; | ||
11 | -import com.diligrp.etrade.core.util.MoneyUtil; | ||
12 | -import com.diligrp.etrade.ecap.constant.Constant; | ||
13 | -import com.diligrp.etrade.ecap.dao.EcapOrderMapper; | ||
14 | -import com.diligrp.etrade.ecap.domain.request.*; | ||
15 | -import com.diligrp.etrade.ecap.domain.response.EcapOrderListVo; | ||
16 | -import com.diligrp.etrade.ecap.domain.response.TradeResponseVo; | ||
17 | -import com.diligrp.etrade.ecap.exception.EcapErrorCode; | ||
18 | -import com.diligrp.etrade.ecap.exception.EcapException; | ||
19 | -import com.diligrp.etrade.ecap.model.EcapOrderDo; | ||
20 | -import com.diligrp.etrade.ecap.service.EcapOrderService; | ||
21 | -import com.diligrp.etrade.ecap.service.EcapService; | ||
22 | -import com.diligrp.etrade.ecap.type.JDState; | ||
23 | -import com.diligrp.etrade.ecap.type.OrderState; | ||
24 | -import com.diligrp.etrade.ecap.type.PayState; | ||
25 | -import com.diligrp.etrade.ecap.util.EcapConstant; | ||
26 | -import com.diligrp.etrade.ecap.util.GenericRpcResolver; | ||
27 | -import com.diligrp.etrade.rpc.UapRpc; | ||
28 | -import com.diligrp.etrade.rpc.UidRpc; | ||
29 | -import com.diligrp.etrade.rpc.dto.*; | ||
30 | -import com.diligrp.etrade.rpc.dto.response.DataDictionaryValueDTO; | ||
31 | -import com.diligrp.etrade.rpc.dto.response.EcapWeChatRefundVo; | ||
32 | -import com.diligrp.etrade.rpc.resolver.WeChatPayRpcResolver; | ||
33 | -import com.diligrp.etrade.rpc.type.WeChatPayState; | ||
34 | -import com.diligrp.etrade.rpc.type.WeChatPayType; | ||
35 | -import com.github.pagehelper.Page; | ||
36 | -import com.github.pagehelper.PageHelper; | ||
37 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCargoInfo; | ||
38 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCreateOrderRequest; | ||
39 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.CommonCreateOrderResponse; | ||
40 | -import com.lop.open.api.sdk.domain.ECAP.CommonCreateOrderApi.commonCreateOrderV1.Contact; | ||
41 | -import com.lop.open.api.sdk.domain.ECAP.CommonModifyCancelOrderApi.commonCancelOrderV1.CommonModifyCancelOrderResponse; | ||
42 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetActualFeeInfoV1.CommonActualFeeResponse; | ||
43 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceDetail; | ||
44 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceRequest; | ||
45 | -import com.lop.open.api.sdk.domain.ECAP.CommonQueryOrderApi.commonGetOrderTraceV1.CommonOrderTraceResponse; | ||
46 | -import jakarta.annotation.Resource; | ||
47 | -import org.apache.commons.lang3.ObjectUtils; | ||
48 | -import org.apache.commons.lang3.StringUtils; | ||
49 | -import org.slf4j.Logger; | ||
50 | -import org.slf4j.LoggerFactory; | ||
51 | -import org.springframework.beans.factory.annotation.Autowired; | ||
52 | -import org.springframework.beans.factory.annotation.Value; | ||
53 | -import org.springframework.cloud.context.config.annotation.RefreshScope; | ||
54 | -import org.springframework.data.redis.core.StringRedisTemplate; | ||
55 | -import org.springframework.stereotype.Service; | ||
56 | -import org.springframework.transaction.annotation.Transactional; | ||
57 | -import org.springframework.util.Assert; | ||
58 | -import org.springframework.util.CollectionUtils; | ||
59 | - | ||
60 | -import java.math.BigDecimal; | ||
61 | -import java.time.LocalDateTime; | ||
62 | -import java.util.ArrayList; | ||
63 | -import java.util.Collections; | ||
64 | -import java.util.List; | ||
65 | -import java.util.Objects; | ||
66 | -import java.util.concurrent.TimeUnit; | ||
67 | -import java.util.stream.Collectors; | ||
68 | - | ||
69 | -/** | ||
70 | - * <p> | ||
71 | - * 服务实现类 | ||
72 | - * </p> | ||
73 | - * | ||
74 | - * @author chenzhiwei | ||
75 | - * @since 2023-12-28 | ||
76 | - */ | ||
77 | -@Service | ||
78 | -@RefreshScope | ||
79 | -public class EcapOrderServiceImpl implements EcapOrderService { | ||
80 | - private final static Logger logger = LoggerFactory.getLogger(EcapContactPersonServiceImpl.class); | ||
81 | - private final static String KEY = "ECAP_ORDER_"; | ||
82 | - private final static String BACK_KEY = "BACK_ECAP_ORDER_"; | ||
83 | - private final static String URL = "ecapOrder/refund/callback"; | ||
84 | - @Value("${weChatPay.backUrl.base}") | ||
85 | - private String path; | ||
86 | - @Resource | ||
87 | - EcapOrderMapper mapper; | ||
88 | - @Resource | ||
89 | - private UidRpc uidRpc; | ||
90 | - @Autowired | ||
91 | - private EcapService ecapService; | ||
92 | - @Resource | ||
93 | - private StringRedisTemplate stringRedisTemplate; | ||
94 | - @Resource | ||
95 | - private UapRpc uapRpc; | ||
96 | - | ||
97 | - @Resource | ||
98 | - private WeChatPayRpcResolver weChatPayRpcResolver; | ||
99 | - | ||
100 | - | ||
101 | - @Override | ||
102 | - @Transactional() | ||
103 | - public Message<Long> insert(EcapOrderCo ecapOrderCo) { | ||
104 | - logger.info("插入快递信息 :{}", ecapOrderCo); | ||
105 | - Long id = 0L; | ||
106 | - //防重操作 | ||
107 | - String limitRedisKey = KEY + ecapOrderCo.getCustomerId(); | ||
108 | - if (stringRedisTemplate.hasKey(limitRedisKey)) { | ||
109 | - return Message.failure("频繁下单"); | ||
110 | - } | ||
111 | - stringRedisTemplate.opsForValue().set(limitRedisKey, String.valueOf(ecapOrderCo.getCustomerId()), 60L, TimeUnit.SECONDS); | ||
112 | - //校验未支付的订单 | ||
113 | - checkUnPay(ecapOrderCo); | ||
114 | - try { | ||
115 | - //下单 | ||
116 | - EcapOrderDo entity = createOrder(ecapOrderCo); | ||
117 | - //调用京东下单 | ||
118 | - CommonCreateOrderRequest createOrderRequest = getCommonCreateOrderRequest(ecapOrderCo); | ||
119 | - CommonCreateOrderResponse commonCreateOrderResponse = ecapService.create(createOrderRequest); | ||
120 | - logger.info("京东下单完成,{}", commonCreateOrderResponse); | ||
121 | - //更新预估运费 | ||
122 | - entity.setTotalAmount(ObjectUtils.isNotEmpty(commonCreateOrderResponse.getFreightPre()) ? commonCreateOrderResponse.getFreightPre().multiply(new BigDecimal(100)).longValue() : 0L); | ||
123 | - entity.setPayState(EcapConstant.PAY_STATE_1); | ||
124 | - mapper.update(entity); | ||
125 | - id = entity.getId(); | ||
126 | - } catch (Exception e) { | ||
127 | - logger.error("下单报错,{}", e); | ||
128 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, e.getMessage()); | ||
129 | - } finally { | ||
130 | - if (stringRedisTemplate.hasKey(limitRedisKey)) { | ||
131 | - stringRedisTemplate.delete(limitRedisKey); | ||
132 | - } | ||
133 | - } | ||
134 | - return Message.success(id); | ||
135 | - } | ||
136 | - | ||
137 | - @Override | ||
138 | - public Message<Void> update(EcapOrderCo ecapOrderCo) { | ||
139 | - logger.info("更新快递信息 :{}", ecapOrderCo); | ||
140 | - EcapOrderDo entity = JsonUtils.convertValue(ecapOrderCo, EcapOrderDo.class); | ||
141 | - mapper.update(entity); | ||
142 | - return Message.success(); | ||
143 | - } | ||
144 | - | ||
145 | - @Override | ||
146 | - @Transactional | ||
147 | - public Message<Void> updatePayState(EcapOrderCo payStateCo) { | ||
148 | - try { | ||
149 | - logger.info("取消订单信息 :{}", payStateCo); | ||
150 | - EcapOrderListVo order = mapper.getOrderByNumber(payStateCo); | ||
151 | - Assert.notNull(order, "未查询到对应订单"); | ||
152 | - Assert.isTrue(!String.valueOf(payStateCo.getPayState()).equals(String.valueOf(order.getPayState())), "订单已经是" + PayState.getName(payStateCo.getPayState()) + ",不能重复操作"); | ||
153 | - Assert.isTrue((OrderState.RECEIVED_ORDER.getCode() != order.getOrderState() || OrderState.ISSUED.getCode() != order.getOrderState()), "快递单已过揽收阶段,不能取消"); | ||
154 | - EcapOrderUpdatePayStateCo ecapOrderUpdatePayStateCo = JsonUtils.convertValue(payStateCo, EcapOrderUpdatePayStateCo.class); | ||
155 | - //调用京东取消订单 | ||
156 | - boolean b = String.valueOf(PayState.CANCELLED.getCode()).equals(String.valueOf(payStateCo.getPayState())); | ||
157 | - if (b) { | ||
158 | - ecapOrderUpdatePayStateCo.setOrderState(OrderState.CANCELLED.getCode()); | ||
159 | - ecapOrderUpdatePayStateCo.setOrderStateDesc(OrderState.CANCELLED.getName()); | ||
160 | - } else { | ||
161 | - ecapOrderUpdatePayStateCo.setOrderState(order.getOrderState()); | ||
162 | - ecapOrderUpdatePayStateCo.setOrderStateDesc(order.getOrderStateDesc()); | ||
163 | - ecapOrderUpdatePayStateCo.setPayTime(LocalDateTime.now()); | ||
164 | - } | ||
165 | - if (b) { | ||
166 | - CommonModifyCancelOrderResponse commonModifyCancelOrderResponse = ecapService.cancelEcapOrder(order.getJdNumber()); | ||
167 | - logger.info("京东返回的取消结果,{}", commonModifyCancelOrderResponse); | ||
168 | - if (commonModifyCancelOrderResponse.getResultType() == 2 || commonModifyCancelOrderResponse.getResultType() == 3) { | ||
169 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, "取消失败"); | ||
170 | - } | ||
171 | - } | ||
172 | - //如果支付了就办理退款,产品说的先处理快递状态不管退款结果,有问题人工处理,单子必须先取消了 | ||
173 | - if (order.getPayState() == PayState.PAID.getCode()) { | ||
174 | - refund(order, ecapOrderUpdatePayStateCo, order.getTotalAmount() - order.getTotalStandardAmount()); | ||
175 | - } | ||
176 | - int num = mapper.updateFeeAndOrderState(ecapOrderUpdatePayStateCo); | ||
177 | - return num > 0 ? Message.success() : Message.failure("取消失败"); | ||
178 | - } catch (Exception e) { | ||
179 | - logger.error("修改支付状态失败,{}", e); | ||
180 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, e.getMessage()); | ||
181 | - } | ||
182 | - } | ||
183 | - | ||
184 | - @Override | ||
185 | - public Message<Void> updateOrderState(EcapOrderUpdateOrderStateCo orderStateCo) { | ||
186 | - logger.info("更新快递状态信息 :{}", orderStateCo); | ||
187 | - mapper.updateOrderState(orderStateCo); | ||
188 | - return Message.success(); | ||
189 | - } | ||
190 | - | ||
191 | - @Override | ||
192 | - public PageMessage page(EcapOrderListCo co) { | ||
193 | - logger.info("联系人分页查询:{}", co); | ||
194 | - if (ObjectUtils.isEmpty(co.getStartTime()) && ObjectUtils.isEmpty(co.getEndTime())) { | ||
195 | - LocalDateTime now = LocalDateTime.now(); | ||
196 | - co.setStartTime(now.minusDays(7)); | ||
197 | - co.setEndTime(now); | ||
198 | - } | ||
199 | - validateDateRange(co.getStartTime(), co.getEndTime(), 90); | ||
200 | - PageHelper.startPage(ObjectUtils.defaultIfNull(co.getPageNo(), 1), | ||
201 | - ObjectUtils.defaultIfNull(co.getPageSize(), 10)); | ||
202 | - Page<EcapOrderListVo> pageList = mapper.page(co); | ||
203 | - List<EcapOrderListVo> result = pageList.getResult(); | ||
204 | - if (!CollectionUtils.isEmpty(result)) { | ||
205 | - result.stream().forEach(e -> { | ||
206 | - String standarAmountText = e.getTotalStandardAmount().compareTo(0L) == 0 ? MoneyUtil.centToYuan(e.getTotalAmount()) : MoneyUtil.centToYuan(e.getTotalStandardAmount()); | ||
207 | - Long standarAmount = e.getTotalStandardAmount().compareTo(0L) == 0 ? e.getTotalAmount() : e.getTotalStandardAmount(); | ||
208 | - String amountText = Objects.isNull(e.getPayTime()) || PayState.CANCELLED.getCode() == e.getPayState() ? "0.00" : MoneyUtil.centToYuan(e.getTotalAmount()); | ||
209 | - Long amount = Objects.isNull(e.getPayTime()) || PayState.CANCELLED.getCode() == e.getPayState() ? 0L : e.getTotalAmount(); | ||
210 | - e.setTotalAmountText(amountText); | ||
211 | - e.setTotalAmount(amount); | ||
212 | - e.setTotalStandardAmountText(standarAmountText); | ||
213 | - e.setTotalStandardAmount(standarAmount); | ||
214 | - e.setPayStateText(PayState.getName(e.getPayState())); | ||
215 | - e.setCompensationAmountText(e.getPaidBackAmount().compareTo(e.getRefundAmount()) >= 0 ? MoneyUtil.centToYuan(e.getPaidBackAmount()) : "-" + MoneyUtil.centToYuan(e.getRefundAmount())); | ||
216 | - }); | ||
217 | - } | ||
218 | - return PageMessage.success(pageList.getTotal(), result); | ||
219 | - } | ||
220 | - | ||
221 | - @Override | ||
222 | - @Transactional | ||
223 | - public void updateByTrace(EcapTraceMsgPush trace) { | ||
224 | - logger.info("根据物流轨迹修改订单:{}", trace); | ||
225 | - EcapOrderCo co = new EcapOrderCo(); | ||
226 | - co.setJdNumber(trace.waybillCode()); | ||
227 | - EcapOrderListVo order = mapper.getOrderByNumber(co); | ||
228 | - if (ObjectUtils.isEmpty(order)) { | ||
229 | - logger.info("未查询到对应的订单信息,{}", trace); | ||
230 | - return; | ||
231 | - } | ||
232 | - //如果换了运单号,需先更新 | ||
233 | - updateJDNumber(trace, order); | ||
234 | - //揽收成功后更新运费及更新物流信息 | ||
235 | - updateFeeAndOrderState(trace, order); | ||
236 | - } | ||
237 | - | ||
238 | - /** | ||
239 | - * 客户查询快递信息 | ||
240 | - * | ||
241 | - * @param co | ||
242 | - * @return | ||
243 | - */ | ||
244 | - @Override | ||
245 | - public PageMessage listByCustomer(EcapOrderListCo co) { | ||
246 | - PageHelper.startPage(ObjectUtils.defaultIfNull(co.getPageNo(), 1), | ||
247 | - ObjectUtils.defaultIfNull(co.getPageSize(), 10)); | ||
248 | - Page<EcapOrderListVo> pageList = mapper.listByCustomer(co); | ||
249 | - List<EcapOrderListVo> result = pageList.getResult(); | ||
250 | - if (!CollectionUtils.isEmpty(result)) { | ||
251 | - result.stream().forEach(e -> { | ||
252 | - e.setTotalStandardAmountText(MoneyUtil.centToYuan(e.getTotalStandardAmount())); | ||
253 | - e.setPayStateText(PayState.getName(e.getPayState())); | ||
254 | - Long totalAmount = ObjectUtils.isNotEmpty(e.getTotalAmount()) ? e.getTotalAmount() : 0L; | ||
255 | - Long totalStandardAmount = ObjectUtils.isNotEmpty(e.getTotalStandardAmount()) ? e.getTotalStandardAmount() : 0L; | ||
256 | - totalAmount = Objects.isNull(e.getPayTime()) ? totalAmount : Math.abs(totalAmount - totalStandardAmount); | ||
257 | - e.setTotalAmountText(MoneyUtil.centToYuan(totalAmount)); | ||
258 | - e.setTotalAmount(totalAmount); | ||
259 | - }); | ||
260 | - } | ||
261 | - return PageMessage.success(pageList.getTotal(), result); | ||
262 | - } | ||
263 | - | ||
264 | - /** | ||
265 | - * 微信支付回调 | ||
266 | - * | ||
267 | - * @param param | ||
268 | - * @return { | ||
269 | - * "paymentId": "单号", | ||
270 | - * "state": 4, | ||
271 | - * "stateCode": "微信状态码" | ||
272 | - * } | ||
273 | - */ | ||
274 | - @Override | ||
275 | - public Message<Void> payStateCallback(String param) { | ||
276 | - //解析入参 | ||
277 | - TradeResponseVo tradeResponseVo = createTradeResponseVo(param); | ||
278 | - Message<Void> 未查询到对应快递信息 = handleState(tradeResponseVo); | ||
279 | - if (未查询到对应快递信息 != null) return 未查询到对应快递信息; | ||
280 | - return Message.success(); | ||
281 | - } | ||
282 | - | ||
283 | - public Message<Void> handleState(TradeResponseVo tradeResponseVo) { | ||
284 | - synchronized (tradeResponseVo.getPaymentId()) { | ||
285 | - //查回快递信息 | ||
286 | - EcapOrderCo co = new EcapOrderCo(); | ||
287 | - co.setTradeNo(tradeResponseVo.getPaymentId()); | ||
288 | - EcapOrderListVo order = mapper.getOrderByNumber(co); | ||
289 | - if (ObjectUtils.isEmpty(order)) { | ||
290 | - co.setTradeNo(null); | ||
291 | - co.setPaymentId(tradeResponseVo.getPaymentId()); | ||
292 | - order = mapper.getOrderByNumber(co); | ||
293 | - } | ||
294 | - if (ObjectUtils.isEmpty(order)) { | ||
295 | - logger.error("未查询到对应快递信息"); | ||
296 | - return Message.failure("未查询到对应快递信息"); | ||
297 | - } | ||
298 | - if (PayState.PAID.getCode() == order.getPayState()) { | ||
299 | - logger.info("快递已经完成支付,{}", order); | ||
300 | - return Message.success(); | ||
301 | - } | ||
302 | - //如果支付失败或取消支付,则不处理订单状态 假设支付定的5 | ||
303 | - if (5 == tradeResponseVo.getState() || 3 == order.getPayState()) { | ||
304 | - logger.info("订单支付失败,{}", order); | ||
305 | - return Message.failure("订单支付失败"); | ||
306 | - } | ||
307 | - //支付成功 | ||
308 | - if (4 == tradeResponseVo.getState()) { | ||
309 | - order.setPayState(PayState.PAID.getCode()); | ||
310 | - if (Objects.nonNull(order.getPayTime())) { | ||
311 | - //第二次补缴 | ||
312 | - order.setPaidBackAmount(order.getTotalStandardAmount() - order.getTotalAmount()); | ||
313 | - } | ||
314 | - order.setPayTime(LocalDateTime.now()); | ||
315 | - EcapOrderUpdatePayStateCo entity = new EcapOrderUpdatePayStateCo(); | ||
316 | - EcapOrderUpdatePayStateCo ecapOrderUpdatePayStateCo = JsonUtils.convertValue(order, EcapOrderUpdatePayStateCo.class); | ||
317 | - mapper.updateFeeAndOrderState(ecapOrderUpdatePayStateCo); | ||
318 | - String limitRedisKey = KEY + order.getCustomerId(); | ||
319 | - if (stringRedisTemplate.hasKey(limitRedisKey)) { | ||
320 | - stringRedisTemplate.delete(limitRedisKey); | ||
321 | - } | ||
322 | - } | ||
323 | - } | ||
324 | - return null; | ||
325 | - } | ||
326 | - | ||
327 | - /** | ||
328 | - * 微信退款回调 | ||
329 | - */ | ||
330 | - @Override | ||
331 | - public Message<Void> refundCallback(String param) { | ||
332 | - //解析参数 | ||
333 | - TradeResponseVo tradeResponseVo = createTradeResponseVo(param); | ||
334 | - synchronized (tradeResponseVo.getPaymentId()) { | ||
335 | - //查回快递信息 | ||
336 | - EcapOrderCo co = new EcapOrderCo(); | ||
337 | - co.setRefundTradeNo(tradeResponseVo.getPaymentId()); | ||
338 | - EcapOrderListVo order = mapper.getOrderByNumber(co); | ||
339 | - if (ObjectUtils.isEmpty(order)) { | ||
340 | - logger.error("未查询到对应快递信息"); | ||
341 | - return Message.failure("未查询到对应快递信息"); | ||
342 | - } | ||
343 | - Long before = order.getTotalAmount() + order.getPaidBackAmount(); | ||
344 | - Long after = order.getTotalStandardAmount() + order.getRefundAmount(); | ||
345 | - if (before.compareTo(after) == 0) { | ||
346 | - logger.info("退款已经完成,{}", order); | ||
347 | - return Message.success(); | ||
348 | - } | ||
349 | - //退款失败,则不处理 | ||
350 | - if (5 == tradeResponseVo.getState()) { | ||
351 | - logger.info("退款失败,{}", order); | ||
352 | - //退款失败就需要把之前的退款流水去掉,以便可以再次发起退款 | ||
353 | - order.setRefundTradeNo(null); | ||
354 | - mapper.updateReFund(order); | ||
355 | - return Message.failure("退款失败"); | ||
356 | - } | ||
357 | - if (4 == tradeResponseVo.getState()) { | ||
358 | - EcapOrderUpdatePayStateCo entity = new EcapOrderUpdatePayStateCo(); | ||
359 | - EcapOrderUpdatePayStateCo ecapOrderUpdatePayStateCo = JsonUtils.convertValue(order, EcapOrderUpdatePayStateCo.class); | ||
360 | - ecapOrderUpdatePayStateCo.setRefundAmount(order.getTotalAmount() - order.getTotalStandardAmount()); | ||
361 | - mapper.updateFeeAndOrderState(ecapOrderUpdatePayStateCo); | ||
362 | - } | ||
363 | - } | ||
364 | - return Message.success(); | ||
365 | - } | ||
366 | - | ||
367 | - /** | ||
368 | - * 处理微信支付请求,生成支付参数并调用微信支付接口。 | ||
369 | - * | ||
370 | - * @param ecapWeChatPayTrade 包含支付信息的对象,如订单ID、支付方式、openid等。 | ||
371 | - * @return 返回微信支付返回信息,包含支付交易ID等。如果失败,则返回错误信息。 | ||
372 | - */ | ||
373 | - @Override | ||
374 | - public Message<WeChatPayTradeBackDto> wechatPay(EcapWeChatPayTrade ecapWeChatPayTrade) { | ||
375 | - // 根据订单编号获取订单详情 | ||
376 | - EcapOrderCo co = new EcapOrderCo(); | ||
377 | - co.setId(ecapWeChatPayTrade.id()); | ||
378 | - EcapOrderListVo order = this.mapper.getOrderByNumber(co); | ||
379 | - if (order == null) { | ||
380 | - return Message.failure("未找到订单信息"); | ||
381 | - } | ||
382 | - if (order.getPayState() == PayState.PAID.getCode()) { | ||
383 | - return Message.failure("订单已支付完成"); | ||
384 | - } | ||
385 | - if (order.getPayTime() == null) { | ||
386 | - if (!StringUtils.isEmpty(order.getTradeNo())) { | ||
387 | - WeChatPayFunctionDto functionDto = new WeChatPayFunctionDto(order.getTradeNo(), "online", 1L); | ||
388 | - if (checkWechat(order, functionDto)) return Message.failure("已支付完成,请勿重复支付"); | ||
389 | - } | ||
390 | - } else { | ||
391 | - if (!StringUtils.isEmpty(order.getPaymentId())) { | ||
392 | - WeChatPayFunctionDto functionDto = new WeChatPayFunctionDto(order.getPaymentId(), "online", 1L); | ||
393 | - if (checkWechat(order, functionDto)) return Message.failure("已支付完成,请勿重复支付"); | ||
394 | - } | ||
395 | - } | ||
396 | - | ||
397 | - // 构建微信支付参数 | ||
398 | - WeChatPayTradeDto weChatPayTradeDto = new WeChatPayTradeDto(); | ||
399 | - weChatPayTradeDto.setAmount(order.getPayTime() != null ? Math.abs(order.getTotalAmount() - order.getTotalStandardAmount()) : order.getTotalAmount()); | ||
400 | - weChatPayTradeDto.setPayType(ecapWeChatPayTrade.payType()); | ||
401 | - weChatPayTradeDto.setType(WeChatPayType.PAYMENT.getCode()); | ||
402 | - weChatPayTradeDto.setGoodsDesc(String.format("快递费(%s)", order.getJdNumber())); | ||
403 | - weChatPayTradeDto.setOpenId(ecapWeChatPayTrade.openId()); | ||
404 | - weChatPayTradeDto.setNotifyUrl("ecapOrder/payState/callback"); | ||
405 | - weChatPayTradeDto.setMarketId(1L); | ||
406 | - weChatPayTradeDto.setDescription("电子结算微信交易"); | ||
407 | - weChatPayTradeDto.setSerialNo(order.getOrderNumber()); | ||
408 | - weChatPayTradeDto.setAccountId(ecapWeChatPayTrade.accountId()); | ||
409 | - FeeDto feeDto = new FeeDto(); | ||
410 | - feeDto.setAmount(weChatPayTradeDto.getAmount()); | ||
411 | - feeDto.setType(WeChatPayType.PAYMENT.getCode()); | ||
412 | - feeDto.setTypeName("快递费"); | ||
413 | - weChatPayTradeDto.setFees(Collections.singletonList(feeDto)); | ||
414 | - logger.info("调用支付参数,{}", weChatPayTradeDto); | ||
415 | - // 调用RPC服务,创建微信支付交易 | ||
416 | - Message<WeChatPayTradeBackDto> weChatPayTrade = weChatPayRpcResolver.createWeChatPayTrade(weChatPayTradeDto); | ||
417 | - logger.info("调用支付结果,{}", weChatPayTrade); | ||
418 | - if (weChatPayTrade.isSuccess()) { | ||
419 | - // 如果支付交易创建成功,则更新订单交易号,并返回成功消息 | ||
420 | - if (order.getPayTime() == null) { | ||
421 | - order.setTradeNo(weChatPayTrade.getData().getPaymentId()); | ||
422 | - mapper.updateJDNum(order); | ||
423 | - } else { | ||
424 | - order.setPaymentId(weChatPayTrade.getData().getPaymentId()); | ||
425 | - mapper.updateJDNum(order); | ||
426 | - } | ||
427 | - return Message.success(weChatPayTrade.getData()); | ||
428 | - } | ||
429 | - return Message.failure(weChatPayTrade.getMessage()); | ||
430 | - } | ||
431 | - | ||
432 | - private boolean checkWechat(EcapOrderListVo order, WeChatPayFunctionDto functionDto) { | ||
433 | - WeChatPayFunctionBackDto weChatPayFunctionBackDto = weChatPayRpcResolver.checkWeChatPayState(functionDto).getData(); | ||
434 | - if (weChatPayFunctionBackDto.getState().equals(WeChatPayState.SUCCESS.getCode())) { | ||
435 | - TradeResponseVo tradeResponseVo = new TradeResponseVo(); | ||
436 | - tradeResponseVo.setPaymentId(weChatPayFunctionBackDto.getPaymentId()); | ||
437 | - tradeResponseVo.setState(4); | ||
438 | - this.handleState(tradeResponseVo); | ||
439 | - return true; | ||
440 | - } | ||
441 | - return false; | ||
442 | - } | ||
443 | - | ||
444 | - /** | ||
445 | - * 构建请求参数 | ||
446 | - * | ||
447 | - * @param ecapOrderCo | ||
448 | - * @return | ||
449 | - */ | ||
450 | - public CommonCreateOrderRequest getCommonCreateOrderRequest(EcapOrderCo ecapOrderCo) { | ||
451 | - CommonCreateOrderRequest createOrderRequest = new CommonCreateOrderRequest(); | ||
452 | - createOrderRequest.setOrderId(ecapOrderCo.getOrderNumber()); | ||
453 | - createOrderRequest.setWaybillCode(ecapOrderCo.getJdNumber()); | ||
454 | - Contact senderContact = new Contact(); | ||
455 | - senderContact.setName(ecapOrderCo.getSenderName()); | ||
456 | - senderContact.setFullAddress(ecapOrderCo.getSenderAddress()); | ||
457 | - senderContact.setMobile(ecapOrderCo.getSenderMobile()); | ||
458 | - senderContact.setPhone(ecapOrderCo.getSenderPhone()); | ||
459 | - createOrderRequest.setSenderContact(senderContact); | ||
460 | - Contact receiverContact = new Contact(); | ||
461 | - receiverContact.setName(ecapOrderCo.getReceiverName()); | ||
462 | - receiverContact.setMobile(ecapOrderCo.getReceiverMobile()); | ||
463 | - receiverContact.setPhone(ecapOrderCo.getReceiverPhone()); | ||
464 | - receiverContact.setFullAddress(ecapOrderCo.getReceiverAddress()); | ||
465 | - createOrderRequest.setReceiverContact(receiverContact); | ||
466 | - List<CommonCargoInfo> cargoes = new ArrayList<>(); | ||
467 | - CommonCargoInfo commonCargoInfo = new CommonCargoInfo(); | ||
468 | - commonCargoInfo.setName(ecapOrderCo.getGoodsInfo()); | ||
469 | - commonCargoInfo.setWeight(new BigDecimal(ecapOrderCo.getWeight())); | ||
470 | - commonCargoInfo.setQuantity(1); | ||
471 | - cargoes.add(commonCargoInfo); | ||
472 | - createOrderRequest.setCargoes(cargoes); | ||
473 | - createOrderRequest.setPickupStartTime(ecapOrderCo.getPickupStartTime().getTime()); | ||
474 | - createOrderRequest.setPickupEndTime(ecapOrderCo.getPickupEndTime().getTime()); | ||
475 | - return createOrderRequest; | ||
476 | - } | ||
477 | - | ||
478 | - /** | ||
479 | - * 验证是否有未支付的订单 | ||
480 | - * | ||
481 | - * @param ecapOrderCo | ||
482 | - */ | ||
483 | - public void checkUnPay(EcapOrderCo ecapOrderCo) { | ||
484 | - EcapOrderListCo co = new EcapOrderListCo(); | ||
485 | - co.setCustomerId(ecapOrderCo.getCustomerId()); | ||
486 | - Page<EcapOrderListVo> page = mapper.page(co); | ||
487 | - if (!CollectionUtils.isEmpty(page) && !CollectionUtils.isEmpty(page.getResult())) { | ||
488 | - List<EcapOrderListVo> list = page.getResult().stream().filter(e -> (String.valueOf(e.getPayState()).equals("1")) || (String.valueOf(e.getPayState()).equals("0"))).collect(Collectors.toList()); | ||
489 | - if (!CollectionUtils.isEmpty(list)) { | ||
490 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, "有未支付订单,请先完成支付"); | ||
491 | - } | ||
492 | - } | ||
493 | - } | ||
494 | - | ||
495 | - /** | ||
496 | - * 本地记录下单信息 | ||
497 | - * | ||
498 | - * @param ecapOrderCo | ||
499 | - * @return | ||
500 | - */ | ||
501 | - public EcapOrderDo createOrder(EcapOrderCo ecapOrderCo) { | ||
502 | - EcapOrderDo entity = JsonUtils.convertValue(ecapOrderCo, EcapOrderDo.class); | ||
503 | - //因为快递下单不分市场,所以配置一个市场通用即可, | ||
504 | - String orderId = GenericRpcResolver.resolver(uidRpc.getBizNumber(EcapConstant.OrderCodeType), "uid"); | ||
505 | - ecapOrderCo.setOrderNumber(orderId); | ||
506 | - entity.setOrderNumber(orderId); | ||
507 | - entity.setPayState(EcapConstant.PAY_STATE_O); | ||
508 | - entity.setVersion(1); | ||
509 | - entity.setOrderState(OrderState.RECEIVED_ORDER.getCode()); | ||
510 | - entity.setOrderStateDesc(OrderState.RECEIVED_ORDER.getName()); | ||
511 | - entity.setTotalStandardAmount(0L); | ||
512 | - entity.setPaidBackAmount(0L); | ||
513 | - entity.setRefundAmount(0L); | ||
514 | - entity.setDiscount(0); | ||
515 | - mapper.insert(entity); | ||
516 | - return entity; | ||
517 | - } | ||
518 | - | ||
519 | - /** | ||
520 | - * 换打运单号后,需更新本地运单号 | ||
521 | - * | ||
522 | - * @param trace | ||
523 | - * @param order | ||
524 | - */ | ||
525 | - @Transactional | ||
526 | - public void updateJDNumber(EcapTraceMsgPush trace, EcapOrderListVo order) { | ||
527 | - if (String.valueOf(JDState.CHANGE_AND_PRINT.getCode()).equals(String.valueOf(trace.state()))) { | ||
528 | - String remark = trace.operationRemark(); | ||
529 | - if (StrUtil.isNotEmpty(remark)) { | ||
530 | - String keyword = "JD"; | ||
531 | - int startIndex = remark.indexOf(keyword); | ||
532 | - if (startIndex != -1) { | ||
533 | - remark = remark.substring(startIndex); | ||
534 | - order.setJdNumber(remark); | ||
535 | - mapper.updateJDNum(order); | ||
536 | - } | ||
537 | - } | ||
538 | - } | ||
539 | - } | ||
540 | - | ||
541 | - /** | ||
542 | - * 更新运费及订单状态 | ||
543 | - * | ||
544 | - * @param trace | ||
545 | - * @param order | ||
546 | - */ | ||
547 | - @Transactional | ||
548 | - public void updateFeeAndOrderState(EcapTraceMsgPush trace, EcapOrderListVo order) { | ||
549 | - EcapOrderUpdatePayStateCo entity = JsonUtils.convertValue(order, EcapOrderUpdatePayStateCo.class); | ||
550 | - try { | ||
551 | - if (isTrue(trace)) { | ||
552 | - List<DataDictionaryValueDTO> dtoList = uapRpc.listDict(Constant.EXPRESS_DISCOUNT); | ||
553 | - int discount = CollectionUtils.isEmpty(dtoList) ? 100 : Integer.valueOf(dtoList.get(0).getCode()); | ||
554 | - CommonActualFeeResponse actualFeeInfo = ecapService.getActualFeeInfo(trace.waybillCode()); | ||
555 | - BigDecimal sumMoney = actualFeeInfo.getTotalStandardAmount() == null ? BigDecimal.ZERO : actualFeeInfo.getTotalStandardAmount(); | ||
556 | - Long money = sumMoney.multiply(new BigDecimal(discount)).longValue(); | ||
557 | - logger.info("京东返回运费,{}", money); | ||
558 | - //更新实际运费 | ||
559 | - money = money.compareTo(0L) <= 0 ? entity.getTotalAmount() :money; | ||
560 | - entity.setTotalStandardAmount(money); | ||
561 | - //如果订单本身就是待支付就改预计运费,反之如果是支付状态则需要判断支付金额是否满足实际运费 | ||
562 | - int state = entity.getTotalAmount().compareTo(money) < 0 ? PayState.UNPAID.getCode() : order.getPayState(); | ||
563 | - if (Objects.isNull(entity.getPayTime())) { | ||
564 | - //是待支付时就把真实运费更新到预计运费中,且未支付过的 | ||
565 | - entity.setTotalAmount(money); | ||
566 | - } | ||
567 | - entity.setPayState(state); | ||
568 | - entity.setDiscount(discount); | ||
569 | - } | ||
570 | - if (String.valueOf(JDState.TERMINATION_TAKE.getCode()).equals(String.valueOf(trace.state())) || String.valueOf(JDState.TAKE_COMPLETED.getCode()).equals(String.valueOf(trace.state()))) { | ||
571 | - entity.setOrderState(Integer.valueOf(OrderState.CANCELLED.getCode())); | ||
572 | - entity.setOrderStateDesc(OrderState.getName(entity.getOrderState())); | ||
573 | - } else { | ||
574 | - //CommonOrderStatusResponse statusResponse = ecapService.getOrderStatus(order.getJdNumber()); | ||
575 | - CommonOrderTraceRequest orderTraceRequest = new CommonOrderTraceRequest(); | ||
576 | - orderTraceRequest.setWaybillCode(trace.waybillCode()); | ||
577 | - CommonOrderTraceResponse commonOrderTraceResponse = ecapService.doTraceQuery(orderTraceRequest); | ||
578 | - List<CommonOrderTraceDetail> traceDetails = commonOrderTraceResponse.getTraceDetails(); | ||
579 | - if (!CollectionUtils.isEmpty(traceDetails)){ | ||
580 | - CommonOrderTraceDetail commonOrderTraceDetail = traceDetails.get(0); | ||
581 | - if (!"406".equals(String.valueOf(commonOrderTraceDetail.getCategory()))) { | ||
582 | - entity.setOrderState(commonOrderTraceDetail.getCategory()); | ||
583 | - entity.setOrderStateDesc(OrderState.getName(entity.getOrderState())); | ||
584 | - } | ||
585 | - } | ||
586 | - } | ||
587 | - //如果是支付状态且实际运费小于预计运费,则退款 | ||
588 | - if (isTrue(trace) && PayState.PAID.getCode() == entity.getPayState() && entity.getTotalAmount().compareTo(entity.getTotalStandardAmount()) > 0) { | ||
589 | - refund(order, entity, entity.getTotalAmount() - entity.getTotalStandardAmount()); | ||
590 | - } | ||
591 | - //如果是取消订单,现在取消 | ||
592 | - if (OrderState.CANCELLED.getCode() == entity.getOrderState() && PayState.PAID.getCode() == entity.getPayState()) { | ||
593 | - refund(order, entity, order.getTotalAmount()); | ||
594 | - } | ||
595 | - //如果是取消订单,但本身未支付 | ||
596 | - if (OrderState.CANCELLED.getCode() == entity.getOrderState()) { | ||
597 | - entity.setPayState(PayState.CANCELLED.getCode()); | ||
598 | - } | ||
599 | - mapper.updateFeeAndOrderState(entity); | ||
600 | - } catch (Exception e) { | ||
601 | - logger.error("更新运费及订单状态失败,{}", e); | ||
602 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, e.getMessage()); | ||
603 | - } | ||
604 | - } | ||
605 | - | ||
606 | - /** | ||
607 | - * 退款 | ||
608 | - * | ||
609 | - * @param order | ||
610 | - * @param entity | ||
611 | - */ | ||
612 | - public void refund(EcapOrderListVo order, EcapOrderUpdatePayStateCo entity, Long amount) { | ||
613 | - String key = BACK_KEY + order.getOrderNumber(); | ||
614 | - boolean b = stringRedisTemplate.opsForValue().setIfAbsent(key, order.getOrderNumber(), 30, TimeUnit.SECONDS); | ||
615 | - if (!b || Objects.nonNull(order.getRefundTradeNo())) { | ||
616 | - logger.info("已经退款或正在有其他操作退款,{}", order); | ||
617 | - return; | ||
618 | - } | ||
619 | - WeChatPayTradeDto weChatPayTradeDto = new WeChatPayTradeDto(); | ||
620 | - weChatPayTradeDto.setPaymentId(order.getTradeNo()); | ||
621 | - weChatPayTradeDto.setMarketId(1L); | ||
622 | - weChatPayTradeDto.setAmount(amount); | ||
623 | - weChatPayTradeDto.setNotifyUrl(path + URL); | ||
624 | - FeeDto feeDto = new FeeDto(); | ||
625 | - feeDto.setAmount(weChatPayTradeDto.getAmount()); | ||
626 | - feeDto.setType(WeChatPayType.PAYMENT.getCode()); | ||
627 | - feeDto.setTypeName("退快递费"); | ||
628 | - weChatPayTradeDto.setFees(Collections.singletonList(feeDto)); | ||
629 | - Message<EcapWeChatRefundVo> refund = weChatPayRpcResolver.refund(weChatPayTradeDto); | ||
630 | - if (200 != refund.getCode()) { | ||
631 | - logger.error("退款失败,{}", refund.getMessage()); | ||
632 | - throw new EcapException(refund.getCode(), "退款失败"); | ||
633 | - } | ||
634 | - EcapWeChatRefundVo ecapWeChatRefundVo = refund.getData(); | ||
635 | - //直接返回成功 | ||
636 | - if (ecapWeChatRefundVo.getState() == 4) { | ||
637 | - entity.setRefundAmount(entity.getTotalAmount() - entity.getTotalStandardAmount()); | ||
638 | - } | ||
639 | - if (ecapWeChatRefundVo.getState() == 1) { | ||
640 | - entity.setRefundTradeNo(ecapWeChatRefundVo.getPaymentId()); | ||
641 | - } | ||
642 | - } | ||
643 | - | ||
644 | - /** | ||
645 | - * 判断是否为可查询运费的节点 | ||
646 | - * | ||
647 | - * @param trace | ||
648 | - * @return | ||
649 | - */ | ||
650 | - public boolean isTrue(EcapTraceMsgPush trace) { | ||
651 | - return String.valueOf(JDState.DELIVERED.getCode()).equals(String.valueOf(trace.state())) || | ||
652 | - String.valueOf(JDState.REJECTION.getCode()).equals(String.valueOf(trace.state())) || | ||
653 | - String.valueOf(OrderState.DELIVERED.getCode()).equals(String.valueOf(trace.state())) || | ||
654 | - String.valueOf(OrderState.REJECTION.getCode()).equals(String.valueOf(trace.state()) | ||
655 | - ); | ||
656 | - } | ||
657 | - | ||
658 | - private void validateDateRange(LocalDateTime startTime, LocalDateTime endTime, int max) { | ||
659 | - try { | ||
660 | - if (endTime.isBefore(startTime)) { | ||
661 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, "开始时间必须早于等于结束时间"); | ||
662 | - } | ||
663 | - DateTime start = DateUtil.parse(startTime.toString(), DatePattern.NORM_DATE_FORMAT); | ||
664 | - DateTime end = DateUtil.parse(endTime.toString(), DatePattern.NORM_DATE_FORMAT); | ||
665 | - DateTime dateTime = DateUtil.offsetDay(start, max); | ||
666 | - if (dateTime.before(end.toJdkDate())) { | ||
667 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, StrUtil.format("只允许查询{}天内的数据", max)); | ||
668 | - } | ||
669 | - } catch (EcapException e) { | ||
670 | - throw e; | ||
671 | - } catch (Exception e) { | ||
672 | - logger.error("时间转换:", e); | ||
673 | - throw new EcapException(EcapErrorCode.PARAM_ERROR, "时间格式转换异常"); | ||
674 | - } | ||
675 | - } | ||
676 | - | ||
677 | - /** | ||
678 | - * 将回调的JSON参数组装成实体类 | ||
679 | - * { "paymentId": "退款单号", | ||
680 | - * "state": 4, | ||
681 | - * "stateCode": "微信状态码" | ||
682 | - * } | ||
683 | - */ | ||
684 | - public TradeResponseVo createTradeResponseVo(String json) { | ||
685 | - TradeResponseVo tradeResponseVo = JsonUtils.fromJsonString(json, TradeResponseVo.class); | ||
686 | - logger.info("组装后的支付结果,{}", tradeResponseVo); | ||
687 | - return tradeResponseVo; | ||
688 | - } | ||
689 | -} |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/type/JDState.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.type; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.type.IEnumType; | ||
4 | - | ||
5 | -import java.util.Arrays; | ||
6 | -import java.util.List; | ||
7 | -import java.util.Optional; | ||
8 | -import java.util.stream.Stream; | ||
9 | - | ||
10 | -/** | ||
11 | - * 京东物流状态值 | ||
12 | - */ | ||
13 | -public enum JDState implements IEnumType { | ||
14 | - DRIVER_TAKE("揽收任务分配司机-揽收",200018), | ||
15 | - TAKE("揽收任务分配-揽收",200034), | ||
16 | - DELIVERYMAN_TAKE("配送员接受揽收任务-揽收",200035), | ||
17 | - TAKED("揽收-揽收",200001), | ||
18 | - CHANGE_AND_PRINT("换单打印-打印",200020), | ||
19 | - CANCELED("取消完成-取消",200010), | ||
20 | - TERMINATION_TAKE("终止揽收-揽收",200052), | ||
21 | - TAKE_AGAIN("揽件再取-揽收",200053), | ||
22 | - TAKE_COMPLETED("上门接货退货完成-揽收",200054), | ||
23 | - SITE_RECEIVING("站点收货-运输",200075), | ||
24 | - SEAL_UP_CAR("封车-运输",200076), | ||
25 | - SITE_PACKING("站点装箱-运输",200077), | ||
26 | - SORTING_CENTER("分拣中心收货-运输",200017), | ||
27 | - SORTING_ACCEPTANCE("分拣验收-运输",10032), | ||
28 | - SORT_OUT("分拣中心分拣-运输",200072), | ||
29 | - DELIVER_GOODS("分拣中心发货-运输",10054), | ||
30 | - DELIVERY("派件-派送",11000), | ||
31 | - REINVESTMENT("协商再投-派送",200023), | ||
32 | - SITE_REPROJECTION("站点再投-派送",200003), | ||
33 | - DELIVERED("妥投-完成",10034), | ||
34 | - REJECTION("拒收-完成",10035); | ||
35 | - private final String name; | ||
36 | - private final int code; | ||
37 | - | ||
38 | - private JDState(String name, int code) { | ||
39 | - this.name = name; | ||
40 | - this.code = code; | ||
41 | - } | ||
42 | - | ||
43 | - public static Optional<JDState> get(int code) { | ||
44 | - Stream<JDState> stream = Arrays.stream(values()); | ||
45 | - return stream.filter((gender) -> { | ||
46 | - return gender.getCode() == code; | ||
47 | - }).findFirst(); | ||
48 | - } | ||
49 | - | ||
50 | - public static String getName(int code) { | ||
51 | - Stream<JDState> stream = Arrays.stream(values()); | ||
52 | - Optional<String> result = stream.filter((gender) -> { | ||
53 | - return gender.getCode() == code; | ||
54 | - }).map(JDState::getName).findFirst(); | ||
55 | - return result.isPresent() ? (String) result.get() : null; | ||
56 | - } | ||
57 | - | ||
58 | - public static List<JDState> getList() { | ||
59 | - return Arrays.asList(values()); | ||
60 | - } | ||
61 | - | ||
62 | - public static JDState fromValue(int value) { | ||
63 | - return Arrays.stream(values()) | ||
64 | - .filter(stockOperate -> stockOperate.code == value) | ||
65 | - .findFirst() | ||
66 | - .orElseThrow(() -> new IllegalArgumentException("Invalid source type value: " + value)); | ||
67 | - } | ||
68 | - | ||
69 | - public String getName() { | ||
70 | - return this.name; | ||
71 | - } | ||
72 | - | ||
73 | - public int getCode() { | ||
74 | - return this.code; | ||
75 | - } | ||
76 | - | ||
77 | - public String toString() { | ||
78 | - return this.name; | ||
79 | - } | ||
80 | - } | ||
81 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/type/OrderOrigin.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.type; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.type.IEnumType; | ||
4 | - | ||
5 | -import java.util.Arrays; | ||
6 | -import java.util.List; | ||
7 | -import java.util.Optional; | ||
8 | -import java.util.stream.Stream; | ||
9 | - | ||
10 | -public enum OrderOrigin implements IEnumType { | ||
11 | - B2C("快递B2C", 1); | ||
12 | - | ||
13 | - private final String name; | ||
14 | - private final int code; | ||
15 | - | ||
16 | - private OrderOrigin(String name, int code) { | ||
17 | - this.name = name; | ||
18 | - this.code = code; | ||
19 | - } | ||
20 | - | ||
21 | - public static Optional<OrderOrigin> get(int code) { | ||
22 | - Stream<OrderOrigin> stream = Arrays.stream(values()); | ||
23 | - return stream.filter((gender) -> { | ||
24 | - return gender.getCode() == code; | ||
25 | - }).findFirst(); | ||
26 | - } | ||
27 | - | ||
28 | - public static String getName(int code) { | ||
29 | - Stream<OrderOrigin> stream = Arrays.stream(values()); | ||
30 | - Optional<String> result = stream.filter((gender) -> { | ||
31 | - return gender.getCode() == code; | ||
32 | - }).map(OrderOrigin::getName).findFirst(); | ||
33 | - return result.isPresent() ? (String) result.get() : null; | ||
34 | - } | ||
35 | - | ||
36 | - public static List<OrderOrigin> getList() { | ||
37 | - return Arrays.asList(values()); | ||
38 | - } | ||
39 | - | ||
40 | - public static OrderOrigin fromValue(int value) { | ||
41 | - return Arrays.stream(values()) | ||
42 | - .filter(stockOperate -> stockOperate.code == value) | ||
43 | - .findFirst() | ||
44 | - .orElseThrow(() -> new IllegalArgumentException("Invalid source type value: " + value)); | ||
45 | - } | ||
46 | - | ||
47 | - public String getName() { | ||
48 | - return this.name; | ||
49 | - } | ||
50 | - | ||
51 | - public int getCode() { | ||
52 | - return this.code; | ||
53 | - } | ||
54 | - | ||
55 | - public String toString() { | ||
56 | - return this.name; | ||
57 | - } | ||
58 | -} | ||
59 | \ No newline at end of file | 0 | \ No newline at end of file |
etrade-ecap/src/main/java/com/diligrp/etrade/ecap/type/OrderState.java deleted
100644 → 0
1 | -package com.diligrp.etrade.ecap.type; | ||
2 | - | ||
3 | -import com.diligrp.etrade.core.type.IEnumType; | ||
4 | - | ||
5 | -import java.util.Arrays; | ||
6 | -import java.util.List; | ||
7 | -import java.util.Optional; | ||
8 | -import java.util.stream.Stream; | ||
9 | - | ||
10 | -public enum OrderState implements IEnumType { | ||
11 | - RECEIVED_ORDER("已接单", 100), | ||
12 | - ISSUED("揽收中", 390), | ||
13 | - RECEIVED("已揽收", 420), | ||
14 | - IN_TRANSIT("运输中", 430), | ||
15 | - DELIVERY("派送中", 440), | ||
16 | - INTERCEPTED("已拦截", 480), | ||
17 | - ABNORMAL_TERMINATION("异常终止", 500), | ||
18 | - DELIVERED("妥投", 510), | ||
19 | - REJECTION("拒收", 530), | ||
20 | - CANCELLED("已取消", 690); | ||
21 | - | ||
22 | - private final String name; | ||
23 | - private final int code; | ||
24 | - | ||
25 | - private OrderState(String name, int code) { | ||
26 | - this.name = name; | ||
27 | - this.code = code; | ||
28 | - } | ||
29 | - | ||
30 | - public static Optional<OrderState> get(int code) { | ||
31 | - Stream<OrderState> stream = Arrays.stream(values()); | ||
32 | - return stream.filter((gender) -> { | ||
33 | - return gender.getCode() == code; | ||
34 | - }).findFirst(); | ||
35 | - } | ||
36 | - | ||
37 | - public static String getName(int code) { | ||
38 | - Stream<OrderState> stream = Arrays.stream(values()); | ||
39 | - Optional<String> result = stream.filter((gender) -> { | ||
40 | - return gender.getCode() == code; | ||
41 | - }).map(OrderState::getName).findFirst(); | ||
42 | - return result.isPresent() ? (String) result.get() : null; | ||
43 | - } | ||
44 | - | ||
45 | - public static List<OrderState> getList() { | ||
46 | - return Arrays.asList(values()); | ||
47 | - } | ||
48 | - | ||
49 | - public static OrderState fromValue(int value) { | ||
50 | - return Arrays.stream(values()) | ||
51 | - .filter(stockOperate -> stockOperate.code == value) | ||
52 | - .findFirst() | ||
53 | - .orElseThrow(() -> new IllegalArgumentException("Invalid source type value: " + value)); | ||
54 | - } | ||
55 | - | ||
56 | - public String getName() { | ||
57 | - return this.name; | ||
58 | - } | ||
59 | - | ||
60 | - public int getCode() { | ||
61 | - return this.code; | ||
62 | - } | ||
63 | - | ||
64 | - public String toString() { | ||
65 | - return this.name; | ||
66 | - } | ||
67 | - } | ||
68 | \ No newline at end of file | 0 | \ No newline at end of file |