Commit 0b73874e1feb8f852518fba108046b1ca5fc78de
0 parents
订单商品服务初始化
Showing
61 changed files
with
2579 additions
and
0 deletions
pom.xml
0 → 100644
1 | +++ a/pom.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
5 | + <modelVersion>4.0.0</modelVersion> | |
6 | + <groupId>com.diligrp.xtrade</groupId> | |
7 | + <artifactId>xtrade-order-service</artifactId> | |
8 | + <version>0.0.1</version> | |
9 | + <name>xtrade-order-service</name> | |
10 | + <description>xtrade-order-service</description> | |
11 | + | |
12 | + <parent> | |
13 | + <groupId>org.springframework.boot</groupId> | |
14 | + <artifactId>spring-boot-starter-parent</artifactId> | |
15 | + <version>2.2.5.RELEASE</version> | |
16 | + <relativePath /> <!-- lookup parent from repository --> | |
17 | + </parent> | |
18 | + | |
19 | + <properties> | |
20 | + <java.version>11</java.version> | |
21 | + <spring-cloud-alibaba.version>2.2.0.RELEASE</spring-cloud-alibaba.version> | |
22 | + <spring-cloud.version>Hoxton.SR3</spring-cloud.version> | |
23 | + <xxl-job.version>2.0.1</xxl-job.version> | |
24 | + <mybatis-spring-boot.version>2.1.2</mybatis-spring-boot.version> | |
25 | + <nacos-client.version>1.2.0</nacos-client.version> | |
26 | + </properties> | |
27 | + | |
28 | + <dependencies> | |
29 | + | |
30 | + <dependency> | |
31 | + <groupId>com.diligrp</groupId> | |
32 | + <artifactId>xtrade-shared-spring-boot-starter</artifactId> | |
33 | + <version>0.0.1</version> | |
34 | + </dependency> | |
35 | + | |
36 | + <!-- <dependency> | |
37 | + <groupId>com.xuxueli</groupId> | |
38 | + <artifactId>xxl-job-core</artifactId> | |
39 | + <version>${xxl-job.version}</version> | |
40 | + </dependency> --> | |
41 | + | |
42 | + <dependency> | |
43 | + <groupId>com.alibaba.cloud</groupId> | |
44 | + <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> | |
45 | + </dependency> | |
46 | + | |
47 | + <dependency> | |
48 | + <groupId>com.alibaba.cloud</groupId> | |
49 | + <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId> | |
50 | + </dependency> | |
51 | + | |
52 | + <dependency> | |
53 | + <groupId>com.alibaba.nacos</groupId> | |
54 | + <artifactId>nacos-client</artifactId> | |
55 | + <version>${nacos-client.version}</version> | |
56 | + </dependency> | |
57 | + | |
58 | + <dependency> | |
59 | + <groupId>com.alibaba.nacos</groupId> | |
60 | + <artifactId>nacos-api</artifactId> | |
61 | + <version>${nacos-client.version}</version> | |
62 | + </dependency> | |
63 | + | |
64 | + <dependency> | |
65 | + <groupId>org.springframework.boot</groupId> | |
66 | + <artifactId>spring-boot-configuration-processor</artifactId> | |
67 | + <optional>true</optional> | |
68 | + </dependency> | |
69 | + | |
70 | +<!-- <dependency> | |
71 | + <groupId>com.xuxueli</groupId> | |
72 | + <artifactId>xxl-job-core</artifactId> | |
73 | + <version>${xxl-job.version}</version> | |
74 | + </dependency> --> | |
75 | + | |
76 | + <dependency> | |
77 | + <groupId>org.springframework.boot</groupId> | |
78 | + <artifactId>spring-boot-starter-web</artifactId> | |
79 | + </dependency> | |
80 | + | |
81 | + <dependency> | |
82 | + <groupId>org.springframework.cloud</groupId> | |
83 | + <artifactId>spring-cloud-starter-netflix-ribbon</artifactId> | |
84 | + </dependency> | |
85 | + | |
86 | + <dependency> | |
87 | + <groupId>org.springframework.cloud</groupId> | |
88 | + <artifactId>spring-cloud-starter-openfeign</artifactId> | |
89 | + </dependency> | |
90 | + | |
91 | + <dependency> | |
92 | + <groupId>org.mybatis.spring.boot</groupId> | |
93 | + <artifactId>mybatis-spring-boot-starter</artifactId> | |
94 | + <version>${mybatis-spring-boot.version}</version> | |
95 | + </dependency> | |
96 | + | |
97 | + <dependency> | |
98 | + <groupId>org.springframework.boot</groupId> | |
99 | + <artifactId>spring-boot-starter-data-redis</artifactId> | |
100 | + </dependency> | |
101 | + | |
102 | + <dependency> | |
103 | + <groupId>org.apache.commons</groupId> | |
104 | + <artifactId>commons-pool2</artifactId> | |
105 | + </dependency> | |
106 | + | |
107 | + <dependency> | |
108 | + <groupId>com.fasterxml.jackson.core</groupId> | |
109 | + <artifactId>jackson-annotations</artifactId> | |
110 | + </dependency> | |
111 | + | |
112 | + <dependency> | |
113 | + <groupId>com.fasterxml.jackson.core</groupId> | |
114 | + <artifactId>jackson-databind</artifactId> | |
115 | + </dependency> | |
116 | + | |
117 | + <dependency> | |
118 | + <groupId>org.springframework.boot</groupId> | |
119 | + <artifactId>spring-boot-starter-test</artifactId> | |
120 | + <scope>test</scope> | |
121 | + <exclusions> | |
122 | + <exclusion> | |
123 | + <groupId>org.junit.vintage</groupId> | |
124 | + <artifactId>junit-vintage-engine</artifactId> | |
125 | + </exclusion> | |
126 | + </exclusions> | |
127 | + </dependency> | |
128 | + </dependencies> | |
129 | + | |
130 | + <dependencyManagement> | |
131 | + <dependencies> | |
132 | + <dependency> | |
133 | + <groupId>com.alibaba.cloud</groupId> | |
134 | + <artifactId>spring-cloud-alibaba-dependencies</artifactId> | |
135 | + <version>${spring-cloud-alibaba.version}</version> | |
136 | + <type>pom</type> | |
137 | + <scope>import</scope> | |
138 | + </dependency> | |
139 | + <dependency> | |
140 | + <groupId>org.springframework.cloud</groupId> | |
141 | + <artifactId>spring-cloud-dependencies</artifactId> | |
142 | + <version>${spring-cloud.version}</version> | |
143 | + <type>pom</type> | |
144 | + <scope>import</scope> | |
145 | + </dependency> | |
146 | + </dependencies> | |
147 | + </dependencyManagement> | |
148 | + | |
149 | + <build> | |
150 | + <plugins> | |
151 | + <plugin> | |
152 | + <groupId>org.apache.maven.plugins</groupId> | |
153 | + <artifactId>maven-compiler-plugin</artifactId> | |
154 | + <!-- 编译JDK版本 --> | |
155 | + <configuration> | |
156 | + <source>11</source> | |
157 | + <target>11</target> | |
158 | + <encoding>UTF-8</encoding> | |
159 | + </configuration> | |
160 | + </plugin> | |
161 | + </plugins> | |
162 | + </build> | |
163 | + | |
164 | +</project> | ... | ... |
src/main/java/com/diligrp/xtrade/OrderApplication.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/OrderApplication.java | |
1 | +package com.diligrp.xtrade; | |
2 | + | |
3 | +import org.mybatis.spring.annotation.MapperScan; | |
4 | +import org.springframework.boot.SpringApplication; | |
5 | +import org.springframework.boot.autoconfigure.SpringBootApplication; | |
6 | +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; | |
7 | +import org.springframework.cloud.openfeign.EnableFeignClients; | |
8 | + | |
9 | +@SpringBootApplication | |
10 | +@EnableDiscoveryClient | |
11 | +@EnableFeignClients | |
12 | +@MapperScan({"com.diligrp.xtrade.order.dao","com.diligrp.xtrade.product.dao"}) | |
13 | +public class OrderApplication { | |
14 | + | |
15 | + public static void main(String[] args) { | |
16 | + SpringApplication.run(OrderApplication.class, args); | |
17 | + } | |
18 | + | |
19 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/common/constants/Constant.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/common/utils/Constant.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/config/OrderConfig.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/controllor/OrderApiControllor.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/controllor/OrderApiControllor.java | |
1 | +package com.diligrp.xtrade.order.controllor; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import javax.annotation.Resource; | |
6 | + | |
7 | +import org.springframework.validation.annotation.Validated; | |
8 | +import org.springframework.web.bind.annotation.RequestBody; | |
9 | +import org.springframework.web.bind.annotation.RequestMapping; | |
10 | +import org.springframework.web.bind.annotation.RequestMethod; | |
11 | +import org.springframework.web.bind.annotation.RestController; | |
12 | + | |
13 | +import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; | |
14 | +import com.diligrp.xtrade.order.domain.dto.OrderQueryRequestDto; | |
15 | +import com.diligrp.xtrade.order.domain.dto.OrderQueryResponseDto; | |
16 | +import com.diligrp.xtrade.order.service.Orderservice; | |
17 | +import com.diligrp.xtrade.shared.domain.Message; | |
18 | + | |
19 | +/** | |
20 | + * 订单相关接口实现 | |
21 | + * @author zhangxing | |
22 | + * @Date 2020/04/13 | |
23 | + */ | |
24 | +@RestController | |
25 | +@RequestMapping(value = "/sapi/order") | |
26 | +public class OrderApiControllor { | |
27 | + | |
28 | + @Resource | |
29 | + private Orderservice orderservice; | |
30 | + | |
31 | + /** | |
32 | + * 订单创建接口 | |
33 | + */ | |
34 | + @RequestMapping(value = "/createOrder",method = {RequestMethod.POST}) | |
35 | + public Message<Boolean> createOrder(@RequestBody @Validated OrderCreateRequestDto orderCreateRequestDto) { | |
36 | + orderservice.createOrder(orderCreateRequestDto); | |
37 | + return Message.<Boolean>builder().success(Boolean.TRUE); | |
38 | + } | |
39 | + | |
40 | + /** | |
41 | + * 订单列表接口 | |
42 | + */ | |
43 | + @RequestMapping(value = "/listOrders") | |
44 | + public Message<List<OrderQueryResponseDto>> listOrders(@RequestBody OrderQueryRequestDto orderQueryRequestDto) { | |
45 | + return Message.<List<OrderQueryResponseDto>>builder().success(orderservice.orderLists(orderQueryRequestDto)); | |
46 | + } | |
47 | + | |
48 | + /** | |
49 | + * 订单详情 | |
50 | + */ | |
51 | + @RequestMapping(value = "/orderDetail") | |
52 | + public Message<OrderQueryResponseDto> orderDetail(@RequestBody @Validated OrderQueryRequestDto orderQueryRequestDto) { | |
53 | + return Message.<OrderQueryResponseDto>builder().success(orderservice.orderDetail(orderQueryRequestDto)); | |
54 | + } | |
55 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/dao/OrderDao.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/dao/OrderDao.java | |
1 | +package com.diligrp.xtrade.order.dao; | |
2 | + | |
3 | +import org.apache.ibatis.annotations.Param; | |
4 | +import org.springframework.stereotype.Repository; | |
5 | + | |
6 | +import com.diligrp.xtrade.order.domain.entity.OrderDo; | |
7 | + | |
8 | +@Repository("orderDao") | |
9 | +public interface OrderDao { | |
10 | + | |
11 | + int insertEntity(OrderDo order); | |
12 | + | |
13 | + OrderDo selectEntityByOrderId(@Param("orderId") Long orderId); | |
14 | + | |
15 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/dao/OrderItemDao.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/builder/DefaultOrderCreator.java | |
1 | +package com.diligrp.xtrade.order.domain.builder; | |
2 | + | |
3 | +import org.springframework.beans.BeanUtils; | |
4 | + | |
5 | +import com.diligrp.xtrade.order.domain.dto.AccountDto; | |
6 | +import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; | |
7 | +import com.diligrp.xtrade.order.domain.entity.OrderDo; | |
8 | + | |
9 | +/** | |
10 | + * 订单构造相关 | |
11 | + * @author zhangxing | |
12 | + * | |
13 | + */ | |
14 | +public class DefaultOrderCreator { | |
15 | + | |
16 | + //最终订单数据 | |
17 | + private OrderDo order; | |
18 | + | |
19 | + //订单创建请求实体 | |
20 | + private OrderCreateRequestDto orderCreateRequestDto; | |
21 | + | |
22 | + //卖家实体 | |
23 | + private AccountDto saccountDto; | |
24 | + | |
25 | + //买家实体 | |
26 | + private AccountDto baccountDto; | |
27 | + | |
28 | + //无参构造器 | |
29 | + public DefaultOrderCreator(){ | |
30 | + | |
31 | + } | |
32 | + | |
33 | + public DefaultOrderCreator(OrderCreateRequestDto orderCreateRequestDto, AccountDto saccountDto, AccountDto baccountDto){ | |
34 | + this.orderCreateRequestDto = orderCreateRequestDto; | |
35 | + this.baccountDto = baccountDto; | |
36 | + this.saccountDto = saccountDto; | |
37 | + } | |
38 | + | |
39 | + /** | |
40 | + * 初始化订单数据用于后面的校验 | |
41 | + */ | |
42 | + public void initialize() { | |
43 | + | |
44 | + } | |
45 | + | |
46 | + public OrderDo getOrder() { | |
47 | + return order; | |
48 | + } | |
49 | + | |
50 | + public void setOrder(OrderDo order) { | |
51 | + this.order = order; | |
52 | + } | |
53 | + | |
54 | + public OrderCreateRequestDto getOrderCreateRequestDto() { | |
55 | + return orderCreateRequestDto; | |
56 | + } | |
57 | + | |
58 | + public void setOrderCreateRequestDto(OrderCreateRequestDto orderCreateRequestDto) { | |
59 | + this.orderCreateRequestDto = orderCreateRequestDto; | |
60 | + } | |
61 | + | |
62 | + public AccountDto getSaccountDto() { | |
63 | + return saccountDto; | |
64 | + } | |
65 | + | |
66 | + public void setSaccountDto(AccountDto saccountDto) { | |
67 | + this.saccountDto = saccountDto; | |
68 | + } | |
69 | + | |
70 | + public AccountDto getBaccountDto() { | |
71 | + return baccountDto; | |
72 | + } | |
73 | + | |
74 | + public void setBaccountDto(AccountDto baccountDto) { | |
75 | + this.baccountDto = baccountDto; | |
76 | + } | |
77 | + | |
78 | + public static OrderDo build(OrderCreateRequestDto orderCreateRequestDto) { | |
79 | + OrderDo orderDo = new OrderDo(); | |
80 | + BeanUtils.copyProperties(orderCreateRequestDto, orderDo); | |
81 | + return orderDo; | |
82 | + } | |
83 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/dto/AccountDto.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/dto/AccountDto.java | |
1 | +package com.diligrp.xtrade.order.domain.dto; | |
2 | + | |
3 | +import java.io.Serializable; | |
4 | + | |
5 | +/** | |
6 | + * 账户实体数据 | |
7 | + * @author zhangxing | |
8 | + * | |
9 | + */ | |
10 | +public class AccountDto implements Serializable { | |
11 | + | |
12 | + | |
13 | + private static final long serialVersionUID = 1L; | |
14 | + | |
15 | + /** | |
16 | + * 地利通卡号 | |
17 | + */ | |
18 | + private String cardNo; | |
19 | + | |
20 | + /** | |
21 | + * 实体卡账户ID | |
22 | + */ | |
23 | + private Long accountId; | |
24 | + | |
25 | + /** | |
26 | + * 客户信息ID | |
27 | + */ | |
28 | + private Long dltUserId; | |
29 | + | |
30 | + /** | |
31 | + * 1未激活2激活 | |
32 | + */ | |
33 | + private Byte status; | |
34 | + | |
35 | + /** | |
36 | + * 账号类型(1-买家、2-卖家) | |
37 | + */ | |
38 | + private Byte bizUsageType; | |
39 | + | |
40 | + public String getCardNo() { | |
41 | + return cardNo; | |
42 | + } | |
43 | + | |
44 | + public void setCardNo(String cardNo) { | |
45 | + this.cardNo = cardNo; | |
46 | + } | |
47 | + | |
48 | + public Long getAccountId() { | |
49 | + return accountId; | |
50 | + } | |
51 | + | |
52 | + public void setAccountId(Long accountId) { | |
53 | + this.accountId = accountId; | |
54 | + } | |
55 | + | |
56 | + public Long getDltUserId() { | |
57 | + return dltUserId; | |
58 | + } | |
59 | + | |
60 | + public void setDltUserId(Long dltUserId) { | |
61 | + this.dltUserId = dltUserId; | |
62 | + } | |
63 | + | |
64 | + public Byte getStatus() { | |
65 | + return status; | |
66 | + } | |
67 | + | |
68 | + public void setStatus(Byte status) { | |
69 | + this.status = status; | |
70 | + } | |
71 | + | |
72 | + public Byte getBizUsageType() { | |
73 | + return bizUsageType; | |
74 | + } | |
75 | + | |
76 | + public void setBizUsageType(Byte bizUsageType) { | |
77 | + this.bizUsageType = bizUsageType; | |
78 | + } | |
79 | + | |
80 | +} | |
0 | 81 | \ No newline at end of file | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/dto/OrderCreateRequestDto.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/dto/OrderCreateRequestDto.java | |
1 | +package com.diligrp.xtrade.order.domain.dto; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +/** | |
6 | + * 创建订单实体 | |
7 | + * @author zhangxing | |
8 | + * | |
9 | + */ | |
10 | +public class OrderCreateRequestDto { | |
11 | + | |
12 | + // 卖家账号 | |
13 | + private Long saccount; | |
14 | + | |
15 | + // 买家账号 | |
16 | + private Long baccount; | |
17 | + | |
18 | + // 市场编码 | |
19 | + private String marketCode; | |
20 | + | |
21 | + // 总金额 | |
22 | + private Long totalMoney; | |
23 | + | |
24 | + // 订单来源 | |
25 | + private Integer orderCreatedSrc; | |
26 | + | |
27 | + List<OrderItemDto> orderItemDtos; | |
28 | + | |
29 | + public Long getSaccount() { | |
30 | + return saccount; | |
31 | + } | |
32 | + | |
33 | + public void setSaccount(Long saccount) { | |
34 | + this.saccount = saccount; | |
35 | + } | |
36 | + | |
37 | + public Long getBaccount() { | |
38 | + return baccount; | |
39 | + } | |
40 | + | |
41 | + public void setBaccount(Long baccount) { | |
42 | + this.baccount = baccount; | |
43 | + } | |
44 | + | |
45 | + public String getMarketCode() { | |
46 | + return marketCode; | |
47 | + } | |
48 | + | |
49 | + public void setMarketCode(String marketCode) { | |
50 | + this.marketCode = marketCode; | |
51 | + } | |
52 | + | |
53 | + public Long getTotalMoney() { | |
54 | + return totalMoney; | |
55 | + } | |
56 | + | |
57 | + public void setTotalMoney(Long totalMoney) { | |
58 | + this.totalMoney = totalMoney; | |
59 | + } | |
60 | + | |
61 | + public Integer getOrderCreatedSrc() { | |
62 | + return orderCreatedSrc; | |
63 | + } | |
64 | + | |
65 | + public void setOrderCreatedSrc(Integer orderCreatedSrc) { | |
66 | + this.orderCreatedSrc = orderCreatedSrc; | |
67 | + } | |
68 | + | |
69 | + public List<OrderItemDto> getOrderItemDtos() { | |
70 | + return orderItemDtos; | |
71 | + } | |
72 | + | |
73 | + public void setOrderItemDtos(List<OrderItemDto> orderItemDtos) { | |
74 | + this.orderItemDtos = orderItemDtos; | |
75 | + } | |
76 | + | |
77 | + | |
78 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/dto/OrderItemDto.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/dto/OrderItemDto.java | |
1 | +package com.diligrp.xtrade.order.domain.dto; | |
2 | + | |
3 | +/** | |
4 | + * | |
5 | + * @author zhangxing | |
6 | + * | |
7 | + */ | |
8 | +public class OrderItemDto { | |
9 | + //商品id | |
10 | + private Long productId; | |
11 | + //商品名称 | |
12 | + private Long productName; | |
13 | + //销售单位 | |
14 | + private Integer saleUnit; | |
15 | + //价格 | |
16 | + private Integer price; | |
17 | + //数量 | |
18 | + private Double amount; | |
19 | + //件重 | |
20 | + private Double unitWeight; | |
21 | + | |
22 | + public Long getProductId() { | |
23 | + return productId; | |
24 | + } | |
25 | + | |
26 | + public void setProductId(Long productId) { | |
27 | + this.productId = productId; | |
28 | + } | |
29 | + | |
30 | + public Long getProductName() { | |
31 | + return productName; | |
32 | + } | |
33 | + | |
34 | + public void setProductName(Long productName) { | |
35 | + this.productName = productName; | |
36 | + } | |
37 | + | |
38 | + public Integer getSaleUnit() { | |
39 | + return saleUnit; | |
40 | + } | |
41 | + | |
42 | + public void setSaleUnit(Integer saleUnit) { | |
43 | + this.saleUnit = saleUnit; | |
44 | + } | |
45 | + | |
46 | + public Integer getPrice() { | |
47 | + return price; | |
48 | + } | |
49 | + | |
50 | + public void setPrice(Integer price) { | |
51 | + this.price = price; | |
52 | + } | |
53 | + | |
54 | + public Double getAmount() { | |
55 | + return amount; | |
56 | + } | |
57 | + | |
58 | + public void setAmount(Double amount) { | |
59 | + this.amount = amount; | |
60 | + } | |
61 | + | |
62 | + public Double getUnitWeight() { | |
63 | + return unitWeight; | |
64 | + } | |
65 | + | |
66 | + public void setUnitWeight(Double unitWeight) { | |
67 | + this.unitWeight = unitWeight; | |
68 | + } | |
69 | + | |
70 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/dto/OrderQueryRequestDto.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/dto/OrderQueryRequestDto.java | |
1 | +package com.diligrp.xtrade.order.domain.dto; | |
2 | + | |
3 | +import java.time.LocalDateTime; | |
4 | + | |
5 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
6 | + | |
7 | +/** | |
8 | + * 订单查询等请求实体 | |
9 | + * @author kuk | |
10 | + * | |
11 | + */ | |
12 | +public class OrderQueryRequestDto extends BaseDo{ | |
13 | + | |
14 | + // 订单业务id | |
15 | + private Long orderId; | |
16 | + | |
17 | + // 卖家账号 | |
18 | + private Long saccount; | |
19 | + | |
20 | + // 卖家卡号 | |
21 | + private String scardNo; | |
22 | + | |
23 | + // 卖家姓名 | |
24 | + private String sname; | |
25 | + | |
26 | + // 买家账号 | |
27 | + private Long baccount; | |
28 | + | |
29 | + // 买家卡号 | |
30 | + private String bcardNo; | |
31 | + | |
32 | + // 买家姓名 | |
33 | + private String bname; | |
34 | + | |
35 | + // 支付来源 | |
36 | + private Integer paySrc; | |
37 | + | |
38 | + // 订单状态 | |
39 | + private Integer orderStatus; | |
40 | + | |
41 | + // 支付方式 | |
42 | + private Integer payType; | |
43 | + | |
44 | + // 订单来源 | |
45 | + private Integer createdSrc; | |
46 | + | |
47 | + // 支付时间 | |
48 | + private LocalDateTime payTime; | |
49 | + | |
50 | + public Long getOrderId() { | |
51 | + return orderId; | |
52 | + } | |
53 | + | |
54 | + public void setOrderId(Long orderId) { | |
55 | + this.orderId = orderId; | |
56 | + } | |
57 | + | |
58 | + public Long getSaccount() { | |
59 | + return saccount; | |
60 | + } | |
61 | + | |
62 | + public void setSaccount(Long saccount) { | |
63 | + this.saccount = saccount; | |
64 | + } | |
65 | + | |
66 | + public String getScardNo() { | |
67 | + return scardNo; | |
68 | + } | |
69 | + | |
70 | + public void setScardNo(String scardNo) { | |
71 | + this.scardNo = scardNo; | |
72 | + } | |
73 | + | |
74 | + public String getSname() { | |
75 | + return sname; | |
76 | + } | |
77 | + | |
78 | + public void setSname(String sname) { | |
79 | + this.sname = sname; | |
80 | + } | |
81 | + | |
82 | + public Long getBaccount() { | |
83 | + return baccount; | |
84 | + } | |
85 | + | |
86 | + public void setBaccount(Long baccount) { | |
87 | + this.baccount = baccount; | |
88 | + } | |
89 | + | |
90 | + public String getBcardNo() { | |
91 | + return bcardNo; | |
92 | + } | |
93 | + | |
94 | + public void setBcardNo(String bcardNo) { | |
95 | + this.bcardNo = bcardNo; | |
96 | + } | |
97 | + | |
98 | + public String getBname() { | |
99 | + return bname; | |
100 | + } | |
101 | + | |
102 | + public void setBname(String bname) { | |
103 | + this.bname = bname; | |
104 | + } | |
105 | + | |
106 | + public Integer getPaySrc() { | |
107 | + return paySrc; | |
108 | + } | |
109 | + | |
110 | + public void setPaySrc(Integer paySrc) { | |
111 | + this.paySrc = paySrc; | |
112 | + } | |
113 | + | |
114 | + public Integer getOrderStatus() { | |
115 | + return orderStatus; | |
116 | + } | |
117 | + | |
118 | + public void setOrderStatus(Integer orderStatus) { | |
119 | + this.orderStatus = orderStatus; | |
120 | + } | |
121 | + | |
122 | + public Integer getPayType() { | |
123 | + return payType; | |
124 | + } | |
125 | + | |
126 | + public void setPayType(Integer payType) { | |
127 | + this.payType = payType; | |
128 | + } | |
129 | + | |
130 | + public Integer getCreatedSrc() { | |
131 | + return createdSrc; | |
132 | + } | |
133 | + | |
134 | + public void setCreatedSrc(Integer createdSrc) { | |
135 | + this.createdSrc = createdSrc; | |
136 | + } | |
137 | + | |
138 | + public LocalDateTime getPayTime() { | |
139 | + return payTime; | |
140 | + } | |
141 | + | |
142 | + public void setPayTime(LocalDateTime payTime) { | |
143 | + this.payTime = payTime; | |
144 | + } | |
145 | + | |
146 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/dto/OrderQueryResponseDto.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/dto/OrderQueryResponseDto.java | |
1 | +package com.diligrp.xtrade.order.domain.dto; | |
2 | + | |
3 | +import java.time.LocalDateTime; | |
4 | +import java.util.List; | |
5 | + | |
6 | +/** | |
7 | + * 订单响应实体 | |
8 | + * @author zhangxing | |
9 | + * | |
10 | + */ | |
11 | +public class OrderQueryResponseDto { | |
12 | + | |
13 | + | |
14 | + //订单业务id | |
15 | + private Long orderId; | |
16 | + | |
17 | + //卖家账号 | |
18 | + private Long saccount; | |
19 | + | |
20 | + //卖家卡号 | |
21 | + private String scardNo; | |
22 | + | |
23 | + //卖家卡类型 | |
24 | + private Integer scardType; | |
25 | + | |
26 | + //卖家姓名 | |
27 | + private String sname; | |
28 | + | |
29 | + //卖家手机号 | |
30 | + private String smobile; | |
31 | + | |
32 | + //买家账号 | |
33 | + private Long baccount; | |
34 | + | |
35 | + //买家卡号 | |
36 | + private String bcardNo; | |
37 | + | |
38 | + //买家卡类型 | |
39 | + private Integer bcardType; | |
40 | + | |
41 | + //买家姓名 | |
42 | + private String bname; | |
43 | + | |
44 | + //买家手机号 | |
45 | + private String bmobile; | |
46 | + | |
47 | + //支付来源 | |
48 | + private Integer paySrc; | |
49 | + | |
50 | + //市场编码 | |
51 | + private String marketCode; | |
52 | + | |
53 | + //订单状态 | |
54 | + private Integer orderStatus; | |
55 | + | |
56 | + //交易流水号或结算单号 | |
57 | + private Long tradeNo; | |
58 | + | |
59 | + //总金额 | |
60 | + private Long totalMoney; | |
61 | + | |
62 | + //卖家佣金 | |
63 | + private Long scommission; | |
64 | + | |
65 | + //买家佣金 | |
66 | + private Long bcommission; | |
67 | + | |
68 | + //总重量 | |
69 | + private Double weight; | |
70 | + | |
71 | + //支付方式 | |
72 | + private Integer payType; | |
73 | + | |
74 | + //订单来源 | |
75 | + private Integer createdSrc; | |
76 | + | |
77 | + //支付时间 | |
78 | + private LocalDateTime payTime; | |
79 | + | |
80 | + //订单详情 | |
81 | + private List<OrderItemDto> orderItemDtos; | |
82 | + | |
83 | + public Long getOrderId() { | |
84 | + return orderId; | |
85 | + } | |
86 | + | |
87 | + public void setOrderId(Long orderId) { | |
88 | + this.orderId = orderId; | |
89 | + } | |
90 | + | |
91 | + public Long getSaccount() { | |
92 | + return saccount; | |
93 | + } | |
94 | + | |
95 | + public void setSaccount(Long saccount) { | |
96 | + this.saccount = saccount; | |
97 | + } | |
98 | + | |
99 | + public String getScardNo() { | |
100 | + return scardNo; | |
101 | + } | |
102 | + | |
103 | + public void setScardNo(String scardNo) { | |
104 | + this.scardNo = scardNo; | |
105 | + } | |
106 | + | |
107 | + public Integer getScardType() { | |
108 | + return scardType; | |
109 | + } | |
110 | + | |
111 | + public void setScardType(Integer scardType) { | |
112 | + this.scardType = scardType; | |
113 | + } | |
114 | + | |
115 | + public String getSname() { | |
116 | + return sname; | |
117 | + } | |
118 | + | |
119 | + public void setSname(String sname) { | |
120 | + this.sname = sname; | |
121 | + } | |
122 | + | |
123 | + public String getSmobile() { | |
124 | + return smobile; | |
125 | + } | |
126 | + | |
127 | + public void setSmobile(String smobile) { | |
128 | + this.smobile = smobile; | |
129 | + } | |
130 | + | |
131 | + public Long getBaccount() { | |
132 | + return baccount; | |
133 | + } | |
134 | + | |
135 | + public void setBaccount(Long baccount) { | |
136 | + this.baccount = baccount; | |
137 | + } | |
138 | + | |
139 | + public String getBcardNo() { | |
140 | + return bcardNo; | |
141 | + } | |
142 | + | |
143 | + public void setBcardNo(String bcardNo) { | |
144 | + this.bcardNo = bcardNo; | |
145 | + } | |
146 | + | |
147 | + public Integer getBcardType() { | |
148 | + return bcardType; | |
149 | + } | |
150 | + | |
151 | + public void setBcardType(Integer bcardType) { | |
152 | + this.bcardType = bcardType; | |
153 | + } | |
154 | + | |
155 | + public String getBname() { | |
156 | + return bname; | |
157 | + } | |
158 | + | |
159 | + public void setBname(String bname) { | |
160 | + this.bname = bname; | |
161 | + } | |
162 | + | |
163 | + public String getBmobile() { | |
164 | + return bmobile; | |
165 | + } | |
166 | + | |
167 | + public void setBmobile(String bmobile) { | |
168 | + this.bmobile = bmobile; | |
169 | + } | |
170 | + | |
171 | + public Integer getPaySrc() { | |
172 | + return paySrc; | |
173 | + } | |
174 | + | |
175 | + public void setPaySrc(Integer paySrc) { | |
176 | + this.paySrc = paySrc; | |
177 | + } | |
178 | + | |
179 | + public String getMarketCode() { | |
180 | + return marketCode; | |
181 | + } | |
182 | + | |
183 | + public void setMarketCode(String marketCode) { | |
184 | + this.marketCode = marketCode; | |
185 | + } | |
186 | + | |
187 | + public Integer getOrderStatus() { | |
188 | + return orderStatus; | |
189 | + } | |
190 | + | |
191 | + public void setOrderStatus(Integer orderStatus) { | |
192 | + this.orderStatus = orderStatus; | |
193 | + } | |
194 | + | |
195 | + public Long getTradeNo() { | |
196 | + return tradeNo; | |
197 | + } | |
198 | + | |
199 | + public void setTradeNo(Long tradeNo) { | |
200 | + this.tradeNo = tradeNo; | |
201 | + } | |
202 | + | |
203 | + public Long getTotalMoney() { | |
204 | + return totalMoney; | |
205 | + } | |
206 | + | |
207 | + public void setTotalMoney(Long totalMoney) { | |
208 | + this.totalMoney = totalMoney; | |
209 | + } | |
210 | + | |
211 | + public Long getScommission() { | |
212 | + return scommission; | |
213 | + } | |
214 | + | |
215 | + public void setScommission(Long scommission) { | |
216 | + this.scommission = scommission; | |
217 | + } | |
218 | + | |
219 | + public Long getBcommission() { | |
220 | + return bcommission; | |
221 | + } | |
222 | + | |
223 | + public void setBcommission(Long bcommission) { | |
224 | + this.bcommission = bcommission; | |
225 | + } | |
226 | + | |
227 | + public Double getWeight() { | |
228 | + return weight; | |
229 | + } | |
230 | + | |
231 | + public void setWeight(Double weight) { | |
232 | + this.weight = weight; | |
233 | + } | |
234 | + | |
235 | + public Integer getPayType() { | |
236 | + return payType; | |
237 | + } | |
238 | + | |
239 | + public void setPayType(Integer payType) { | |
240 | + this.payType = payType; | |
241 | + } | |
242 | + | |
243 | + public Integer getCreatedSrc() { | |
244 | + return createdSrc; | |
245 | + } | |
246 | + | |
247 | + public void setCreatedSrc(Integer createdSrc) { | |
248 | + this.createdSrc = createdSrc; | |
249 | + } | |
250 | + | |
251 | + public LocalDateTime getPayTime() { | |
252 | + return payTime; | |
253 | + } | |
254 | + | |
255 | + public void setPayTime(LocalDateTime payTime) { | |
256 | + this.payTime = payTime; | |
257 | + } | |
258 | + | |
259 | + public List<OrderItemDto> getOrderItemDtos() { | |
260 | + return orderItemDtos; | |
261 | + } | |
262 | + | |
263 | + public void setOrderItemDtos(List<OrderItemDto> orderItemDtos) { | |
264 | + this.orderItemDtos = orderItemDtos; | |
265 | + } | |
266 | + | |
267 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/emuns/IDGenerator.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/emuns/IDGenerator.java | |
1 | +package com.diligrp.xtrade.order.domain.emuns; | |
2 | + | |
3 | +public enum IDGenerator { | |
4 | + | |
5 | + ORDER_SEQUENCE(1,"ORDER_SEQUENCE"); | |
6 | + | |
7 | + private int type; | |
8 | + private String name; | |
9 | + | |
10 | + private IDGenerator(int type, String name) { | |
11 | + this.type = type; | |
12 | + this.name = name; | |
13 | + } | |
14 | + | |
15 | + public int getType() { | |
16 | + return type; | |
17 | + } | |
18 | + | |
19 | + public String getName() { | |
20 | + return name; | |
21 | + } | |
22 | + | |
23 | + public static IDGenerator getByType(int type) { | |
24 | + for (IDGenerator idGenerator : values()) { | |
25 | + if (idGenerator.getType() == type) { | |
26 | + return idGenerator; | |
27 | + } | |
28 | + } | |
29 | + return null; | |
30 | + } | |
31 | + | |
32 | + public static String getName(int index) { | |
33 | + for (IDGenerator idGenerator : IDGenerator.values()) { | |
34 | + if (idGenerator.getType() == index) { | |
35 | + return idGenerator.name; | |
36 | + } | |
37 | + } | |
38 | + return null; | |
39 | + } | |
40 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/emuns/OrderCreateSrc.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/domain/emuns/OrderStatus.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/domain/emuns/PayType.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/domain/emuns/SaleUnit.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/domain/entity/OrderDo.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/entity/OrderDo.java | |
1 | +package com.diligrp.xtrade.order.domain.entity; | |
2 | + | |
3 | +import java.time.LocalDateTime; | |
4 | + | |
5 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
6 | + | |
7 | +/** | |
8 | + * 订单实体 | |
9 | + * @author zhangxing | |
10 | + * | |
11 | + */ | |
12 | +public class OrderDo extends BaseDo{ | |
13 | + | |
14 | + //订单业务id | |
15 | + private Long orderId; | |
16 | + | |
17 | + //卖家账号 | |
18 | + private Long saccount; | |
19 | + | |
20 | + //卖家卡号 | |
21 | + private String scardNo; | |
22 | + | |
23 | + //卖家卡类型 | |
24 | + private Integer scardType; | |
25 | + | |
26 | + //卖家姓名 | |
27 | + private String sname; | |
28 | + | |
29 | + //卖家手机号 | |
30 | + private String smobile; | |
31 | + | |
32 | + //买家账号 | |
33 | + private Long baccount; | |
34 | + | |
35 | + //买家卡号 | |
36 | + private String bcardNo; | |
37 | + | |
38 | + //买家卡类型 | |
39 | + private Integer bcardType; | |
40 | + | |
41 | + //买家姓名 | |
42 | + private String bname; | |
43 | + | |
44 | + //买家手机号 | |
45 | + private String bmobile; | |
46 | + | |
47 | + //支付来源 | |
48 | + private Integer paySrc; | |
49 | + | |
50 | + //市场编码 | |
51 | + private String marketCode; | |
52 | + | |
53 | + //订单状态 | |
54 | + private Integer orderStatus; | |
55 | + | |
56 | + //交易流水号或结算单号 | |
57 | + private Long tradeNo; | |
58 | + | |
59 | + //总金额 | |
60 | + private Long totalMoney; | |
61 | + | |
62 | + //卖家佣金 | |
63 | + private Long scommission; | |
64 | + | |
65 | + //买家佣金 | |
66 | + private Long bcommission; | |
67 | + | |
68 | + //总重量 | |
69 | + private Double weight; | |
70 | + | |
71 | + //支付方式 | |
72 | + private Integer payType; | |
73 | + | |
74 | + //订单来源 | |
75 | + private Integer createdSrc; | |
76 | + | |
77 | + //支付时间 | |
78 | + private LocalDateTime payTime; | |
79 | + | |
80 | + public Long getOrderId() { | |
81 | + return orderId; | |
82 | + } | |
83 | + | |
84 | + public void setOrderId(Long orderId) { | |
85 | + this.orderId = orderId; | |
86 | + } | |
87 | + | |
88 | + public Long getSaccount() { | |
89 | + return saccount; | |
90 | + } | |
91 | + | |
92 | + public void setSaccount(Long saccount) { | |
93 | + this.saccount = saccount; | |
94 | + } | |
95 | + | |
96 | + public String getScardNo() { | |
97 | + return scardNo; | |
98 | + } | |
99 | + | |
100 | + public void setScardNo(String scardNo) { | |
101 | + this.scardNo = scardNo; | |
102 | + } | |
103 | + | |
104 | + public Integer getScardType() { | |
105 | + return scardType; | |
106 | + } | |
107 | + | |
108 | + public void setScardType(Integer scardType) { | |
109 | + this.scardType = scardType; | |
110 | + } | |
111 | + | |
112 | + public String getSname() { | |
113 | + return sname; | |
114 | + } | |
115 | + | |
116 | + public void setSname(String sname) { | |
117 | + this.sname = sname; | |
118 | + } | |
119 | + | |
120 | + public String getSmobile() { | |
121 | + return smobile; | |
122 | + } | |
123 | + | |
124 | + public void setSmobile(String smobile) { | |
125 | + this.smobile = smobile; | |
126 | + } | |
127 | + | |
128 | + public Long getBaccount() { | |
129 | + return baccount; | |
130 | + } | |
131 | + | |
132 | + public void setBaccount(Long baccount) { | |
133 | + this.baccount = baccount; | |
134 | + } | |
135 | + | |
136 | + public String getBcardNo() { | |
137 | + return bcardNo; | |
138 | + } | |
139 | + | |
140 | + public void setBcardNo(String bcardNo) { | |
141 | + this.bcardNo = bcardNo; | |
142 | + } | |
143 | + | |
144 | + public Integer getBcardType() { | |
145 | + return bcardType; | |
146 | + } | |
147 | + | |
148 | + public void setBcardType(Integer bcardType) { | |
149 | + this.bcardType = bcardType; | |
150 | + } | |
151 | + | |
152 | + public String getBname() { | |
153 | + return bname; | |
154 | + } | |
155 | + | |
156 | + public void setBname(String bname) { | |
157 | + this.bname = bname; | |
158 | + } | |
159 | + | |
160 | + public String getBmobile() { | |
161 | + return bmobile; | |
162 | + } | |
163 | + | |
164 | + public void setBmobile(String bmobile) { | |
165 | + this.bmobile = bmobile; | |
166 | + } | |
167 | + | |
168 | + public Integer getPaySrc() { | |
169 | + return paySrc; | |
170 | + } | |
171 | + | |
172 | + public void setPaySrc(Integer paySrc) { | |
173 | + this.paySrc = paySrc; | |
174 | + } | |
175 | + | |
176 | + public String getMarketCode() { | |
177 | + return marketCode; | |
178 | + } | |
179 | + | |
180 | + public void setMarketCode(String marketCode) { | |
181 | + this.marketCode = marketCode; | |
182 | + } | |
183 | + | |
184 | + public Integer getOrderStatus() { | |
185 | + return orderStatus; | |
186 | + } | |
187 | + | |
188 | + public void setOrderStatus(Integer orderStatus) { | |
189 | + this.orderStatus = orderStatus; | |
190 | + } | |
191 | + | |
192 | + public Long getTradeNo() { | |
193 | + return tradeNo; | |
194 | + } | |
195 | + | |
196 | + public void setTradeNo(Long tradeNo) { | |
197 | + this.tradeNo = tradeNo; | |
198 | + } | |
199 | + | |
200 | + public Long getTotalMoney() { | |
201 | + return totalMoney; | |
202 | + } | |
203 | + | |
204 | + public void setTotalMoney(Long totalMoney) { | |
205 | + this.totalMoney = totalMoney; | |
206 | + } | |
207 | + | |
208 | + public Long getScommission() { | |
209 | + return scommission; | |
210 | + } | |
211 | + | |
212 | + public void setScommission(Long scommission) { | |
213 | + this.scommission = scommission; | |
214 | + } | |
215 | + | |
216 | + public Long getBcommission() { | |
217 | + return bcommission; | |
218 | + } | |
219 | + | |
220 | + public void setBcommission(Long bcommission) { | |
221 | + this.bcommission = bcommission; | |
222 | + } | |
223 | + | |
224 | + public Double getWeight() { | |
225 | + return weight; | |
226 | + } | |
227 | + | |
228 | + public void setWeight(Double weight) { | |
229 | + this.weight = weight; | |
230 | + } | |
231 | + | |
232 | + public Integer getPayType() { | |
233 | + return payType; | |
234 | + } | |
235 | + | |
236 | + public void setPayType(Integer payType) { | |
237 | + this.payType = payType; | |
238 | + } | |
239 | + | |
240 | + public Integer getCreatedSrc() { | |
241 | + return createdSrc; | |
242 | + } | |
243 | + | |
244 | + public void setCreatedSrc(Integer createdSrc) { | |
245 | + this.createdSrc = createdSrc; | |
246 | + } | |
247 | + | |
248 | + public LocalDateTime getPayTime() { | |
249 | + return payTime; | |
250 | + } | |
251 | + | |
252 | + public void setPayTime(LocalDateTime payTime) { | |
253 | + this.payTime = payTime; | |
254 | + } | |
255 | + | |
256 | + | |
257 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/domain/entity/OrderItemDo.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/domain/entity/OrderItemDo.java | |
1 | +package com.diligrp.xtrade.order.domain.entity; | |
2 | + | |
3 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
4 | + | |
5 | +/** | |
6 | + * 订单详情实体数据 | |
7 | + * @author zhangxing | |
8 | + * | |
9 | + */ | |
10 | +public class OrderItemDo extends BaseDo { | |
11 | + | |
12 | + //订单详情id | |
13 | + private Long itemId; | |
14 | + | |
15 | + //订单id | |
16 | + private Long orderId; | |
17 | + | |
18 | + //商品名称 | |
19 | + private String productName; | |
20 | + | |
21 | + //商品id | |
22 | + private Long productId; | |
23 | + | |
24 | + //单价 | |
25 | + private Integer price; | |
26 | + | |
27 | + //数量 | |
28 | + private Double amount; | |
29 | + | |
30 | + //单位 | |
31 | + private Integer saleUnit; | |
32 | + | |
33 | + //件重 | |
34 | + private Double unitWeight; | |
35 | + | |
36 | + //卖家佣金 | |
37 | + private Long scommission; | |
38 | + | |
39 | + //买家佣金 | |
40 | + private Long bcommission; | |
41 | + | |
42 | + //佣金规则 | |
43 | + private Long ruleId; | |
44 | + | |
45 | + //费率描述 | |
46 | + private String ruleRate; | |
47 | + | |
48 | + //订单详情id | |
49 | + private Double weight; | |
50 | + | |
51 | + //金额 | |
52 | + private Long money; | |
53 | + | |
54 | + public Long getItemId() { | |
55 | + return itemId; | |
56 | + } | |
57 | + | |
58 | + public void setItemId(Long itemId) { | |
59 | + this.itemId = itemId; | |
60 | + } | |
61 | + | |
62 | + public Long getOrderId() { | |
63 | + return orderId; | |
64 | + } | |
65 | + | |
66 | + public void setOrderId(Long orderId) { | |
67 | + this.orderId = orderId; | |
68 | + } | |
69 | + | |
70 | + public String getProductName() { | |
71 | + return productName; | |
72 | + } | |
73 | + | |
74 | + public void setProductName(String productName) { | |
75 | + this.productName = productName; | |
76 | + } | |
77 | + | |
78 | + public Long getProductId() { | |
79 | + return productId; | |
80 | + } | |
81 | + | |
82 | + public void setProductId(Long productId) { | |
83 | + this.productId = productId; | |
84 | + } | |
85 | + | |
86 | + public Integer getPrice() { | |
87 | + return price; | |
88 | + } | |
89 | + | |
90 | + public void setPrice(Integer price) { | |
91 | + this.price = price; | |
92 | + } | |
93 | + | |
94 | + public Double getAmount() { | |
95 | + return amount; | |
96 | + } | |
97 | + | |
98 | + public void setAmount(Double amount) { | |
99 | + this.amount = amount; | |
100 | + } | |
101 | + | |
102 | + public Integer getSaleUnit() { | |
103 | + return saleUnit; | |
104 | + } | |
105 | + | |
106 | + public void setSaleUnit(Integer saleUnit) { | |
107 | + this.saleUnit = saleUnit; | |
108 | + } | |
109 | + | |
110 | + public Double getUnitWeight() { | |
111 | + return unitWeight; | |
112 | + } | |
113 | + | |
114 | + public void setUnitWeight(Double unitWeight) { | |
115 | + this.unitWeight = unitWeight; | |
116 | + } | |
117 | + | |
118 | + public Long getScommission() { | |
119 | + return scommission; | |
120 | + } | |
121 | + | |
122 | + public void setScommission(Long scommission) { | |
123 | + this.scommission = scommission; | |
124 | + } | |
125 | + | |
126 | + public Long getBcommission() { | |
127 | + return bcommission; | |
128 | + } | |
129 | + | |
130 | + public void setBcommission(Long bcommission) { | |
131 | + this.bcommission = bcommission; | |
132 | + } | |
133 | + | |
134 | + public Long getRuleId() { | |
135 | + return ruleId; | |
136 | + } | |
137 | + | |
138 | + public void setRuleId(Long ruleId) { | |
139 | + this.ruleId = ruleId; | |
140 | + } | |
141 | + | |
142 | + public String getRuleRate() { | |
143 | + return ruleRate; | |
144 | + } | |
145 | + | |
146 | + public void setRuleRate(String ruleRate) { | |
147 | + this.ruleRate = ruleRate; | |
148 | + } | |
149 | + | |
150 | + public Double getWeight() { | |
151 | + return weight; | |
152 | + } | |
153 | + | |
154 | + public void setWeight(Double weight) { | |
155 | + this.weight = weight; | |
156 | + } | |
157 | + | |
158 | + public Long getMoney() { | |
159 | + return money; | |
160 | + } | |
161 | + | |
162 | + public void setMoney(Long money) { | |
163 | + this.money = money; | |
164 | + } | |
165 | + | |
166 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/exception/OrderException.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/exception/OrderException.java | |
1 | +package com.diligrp.xtrade.order.exception; | |
2 | + | |
3 | +public class OrderException extends RuntimeException{ | |
4 | + | |
5 | + private static final long serialVersionUID = 1L; | |
6 | + | |
7 | + private static final int DEFAULT_CODE = 1000; | |
8 | + | |
9 | + private int code; | |
10 | + | |
11 | + public OrderException() { | |
12 | + super(); | |
13 | + } | |
14 | + | |
15 | + public OrderException(String message, int code){ | |
16 | + super(message); | |
17 | + this.code = code; | |
18 | + } | |
19 | + | |
20 | + public OrderException(String message) { | |
21 | + this(message, DEFAULT_CODE); | |
22 | + } | |
23 | + | |
24 | + public OrderException(String message, Throwable cause) { | |
25 | + super(message, cause); | |
26 | + this.code = DEFAULT_CODE; | |
27 | + } | |
28 | + | |
29 | + public OrderException(Throwable cause) { | |
30 | + super(cause); | |
31 | + this.code = DEFAULT_CODE; | |
32 | + } | |
33 | + | |
34 | + public int getCode() { | |
35 | + return code; | |
36 | + } | |
37 | + | |
38 | + public void setCode(int code) { | |
39 | + this.code = code; | |
40 | + } | |
41 | + | |
42 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/exception/OrderExceptionHandler.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/exception/OrderExceptionHandler.java | |
1 | +package com.diligrp.xtrade.order.exception; | |
2 | + | |
3 | +import org.springframework.web.bind.annotation.ControllerAdvice; | |
4 | +import org.springframework.web.bind.annotation.ExceptionHandler; | |
5 | +import org.springframework.web.bind.annotation.ResponseBody; | |
6 | + | |
7 | +import com.diligrp.xtrade.shared.domain.Message; | |
8 | +import com.netflix.client.ClientException; | |
9 | + | |
10 | +/** | |
11 | + * @Auther: zhangxing | |
12 | + * @Date: 2020/4/17 11:22 | |
13 | + */ | |
14 | +@ControllerAdvice | |
15 | +public class OrderExceptionHandler { | |
16 | + | |
17 | + @ResponseBody | |
18 | + @ExceptionHandler({ClientException.class}) | |
19 | + public Message<?> handleFeignClientException(ClientException ex) { | |
20 | + return Message.builder().failure(ex.getMessage()); | |
21 | + } | |
22 | + | |
23 | + @ResponseBody | |
24 | + @ExceptionHandler({OrderException.class}) | |
25 | + public Message<?> handleOrderException(OrderException ex) { | |
26 | + return Message.builder().failure(ex.getCode(), ex.getMessage()); | |
27 | + } | |
28 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/rpc/feign/AccountService.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/rpc/feign/AccountService.java | |
1 | +package com.diligrp.xtrade.order.rpc.feign; | |
2 | + | |
3 | +import org.springframework.cloud.openfeign.FeignClient; | |
4 | +import org.springframework.web.bind.annotation.RequestMapping; | |
5 | + | |
6 | +import com.diligrp.xtrade.order.domain.dto.AccountDto; | |
7 | +import com.diligrp.xtrade.shared.domain.Message; | |
8 | + | |
9 | +@FeignClient(value = "user-service") | |
10 | +public interface AccountService { | |
11 | + | |
12 | + @RequestMapping("/dltAccount/getDltAccount") | |
13 | + public Message<AccountDto> getDltAccount(); | |
14 | + | |
15 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/rpc/feign/CatagoryService.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/service/OrderItemService.java
0 → 100644
src/main/java/com/diligrp/xtrade/order/service/Orderservice.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/service/Orderservice.java | |
1 | +package com.diligrp.xtrade.order.service; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; | |
6 | +import com.diligrp.xtrade.order.domain.dto.OrderQueryRequestDto; | |
7 | +import com.diligrp.xtrade.order.domain.dto.OrderQueryResponseDto; | |
8 | + | |
9 | +public interface Orderservice { | |
10 | + | |
11 | + public void createOrder(OrderCreateRequestDto orderCreateRequestDto); | |
12 | + | |
13 | + public List<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto); | |
14 | + | |
15 | + public OrderQueryResponseDto orderDetail(OrderQueryRequestDto orderQueryRequestDto); | |
16 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/order/service/impl/OrderServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/order/service/impl/OrderServiceImpl.java | |
1 | +package com.diligrp.xtrade.order.service.impl; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import javax.annotation.Resource; | |
6 | + | |
7 | +import org.springframework.beans.BeanUtils; | |
8 | +import org.springframework.stereotype.Service; | |
9 | + | |
10 | +import com.diligrp.xtrade.order.dao.OrderDao; | |
11 | +import com.diligrp.xtrade.order.domain.builder.DefaultOrderCreator; | |
12 | +import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto; | |
13 | +import com.diligrp.xtrade.order.domain.dto.OrderQueryRequestDto; | |
14 | +import com.diligrp.xtrade.order.domain.dto.OrderQueryResponseDto; | |
15 | +import com.diligrp.xtrade.order.domain.emuns.IDGenerator; | |
16 | +import com.diligrp.xtrade.order.domain.entity.OrderDo; | |
17 | +import com.diligrp.xtrade.order.service.Orderservice; | |
18 | +import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; | |
19 | + | |
20 | +@Service("orderService") | |
21 | +public class OrderServiceImpl implements Orderservice { | |
22 | + | |
23 | + @Resource private OrderDao orderDao; | |
24 | + | |
25 | + @Resource KeyGeneratorManager keyGeneratorManager; | |
26 | + | |
27 | + @Override | |
28 | + public void createOrder(OrderCreateRequestDto orderCreateRequestDto) { | |
29 | + OrderDo order = DefaultOrderCreator.build(orderCreateRequestDto); | |
30 | + order.setOrderId(keyGeneratorManager.getKeyGenerator(IDGenerator.ORDER_SEQUENCE).nextId()); | |
31 | + orderDao.insertEntity(order); | |
32 | + } | |
33 | + | |
34 | + @Override | |
35 | + public List<OrderQueryResponseDto> orderLists(OrderQueryRequestDto orderQueryRequestDto) { | |
36 | + return null; | |
37 | + } | |
38 | + | |
39 | + @Override | |
40 | + public OrderQueryResponseDto orderDetail(OrderQueryRequestDto orderQueryRequestDto) { | |
41 | + OrderDo order = orderDao.selectEntityByOrderId(orderQueryRequestDto.getOrderId()); | |
42 | + OrderQueryResponseDto queryResponseDto = new OrderQueryResponseDto(); | |
43 | + BeanUtils.copyProperties(order, queryResponseDto); | |
44 | + return queryResponseDto; | |
45 | + } | |
46 | + | |
47 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/product/common/constants/Constant.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/common/utils/Constant.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/config/ProductConfig.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/controllor/ProductApiControllor.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/product/controllor/ProductApiControllor.java | |
1 | +package com.diligrp.xtrade.product.controllor; | |
2 | + | |
3 | +import javax.annotation.Resource; | |
4 | + | |
5 | +import org.springframework.web.bind.annotation.RequestBody; | |
6 | +import org.springframework.web.bind.annotation.RequestMapping; | |
7 | +import org.springframework.web.bind.annotation.RestController; | |
8 | + | |
9 | +import com.diligrp.xtrade.product.domain.dto.ProductCreateRequestDto; | |
10 | +import com.diligrp.xtrade.product.domain.dto.ProductQueryRequestDto; | |
11 | +import com.diligrp.xtrade.product.service.ProductService; | |
12 | +import com.diligrp.xtrade.shared.domain.Message; | |
13 | + | |
14 | +@RestController | |
15 | +@RequestMapping(value = "/sapi/product") | |
16 | +public class ProductApiControllor { | |
17 | + | |
18 | + @Resource | |
19 | + private ProductService productService; | |
20 | + | |
21 | + @RequestMapping(value = "/createProduct") | |
22 | + public Message createOrder(@RequestBody ProductCreateRequestDto productCreateRequestDto) { | |
23 | + productService.createProduct(productCreateRequestDto); | |
24 | + return Message.builder().success(); | |
25 | + } | |
26 | + | |
27 | + @RequestMapping(value = "/listProducts") | |
28 | + public Message listOrders(@RequestBody ProductQueryRequestDto productQueryRequestDto) { | |
29 | + return Message.builder().success(productService.orderLists(productQueryRequestDto)); | |
30 | + } | |
31 | + | |
32 | + @RequestMapping(value = "/productDetail") | |
33 | + public Message orderDetail(@RequestBody ProductQueryRequestDto productQueryRequestDto) { | |
34 | + return Message.builder().success(productService.orderDetail(productQueryRequestDto)); | |
35 | + } | |
36 | + | |
37 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/product/dao/MerchantDao.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/dao/ProductDao.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/dao/ShopDao.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/builder/ProductBuilder.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/dto/ProductCreateRequestDto.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/dto/ProductQueryRequestDto.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/dto/ProductQueryResponsetDto.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/emuns/ProductStatus.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/emuns/ShopStatus.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/domain/entity/Merchant.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/product/domain/entity/Merchant.java | |
1 | +package com.diligrp.xtrade.product.domain.entity; | |
2 | + | |
3 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
4 | + | |
5 | +/** | |
6 | + * 商户实体 | |
7 | + * @author kuk | |
8 | + * | |
9 | + */ | |
10 | +public class Merchant extends BaseDo{ | |
11 | + | |
12 | + //商户id | |
13 | + private Long merId; | |
14 | + | |
15 | + //商户名称 | |
16 | + private String merName; | |
17 | + | |
18 | + //类型 | |
19 | + private Integer type; | |
20 | + | |
21 | + //主账号 | |
22 | + private Long accountId; | |
23 | + | |
24 | + //商户状态 | |
25 | + private Integer status; | |
26 | + | |
27 | + //市场编码 | |
28 | + private String marketCode; | |
29 | + | |
30 | + //描述 | |
31 | + private String description; | |
32 | + | |
33 | + public Merchant(){ | |
34 | + } | |
35 | + | |
36 | + public Merchant(Long merId){ | |
37 | + this.setMerId(merId); | |
38 | + } | |
39 | + | |
40 | + /** | |
41 | + * 获取 商户编码 | |
42 | + * @return | |
43 | + */ | |
44 | + public Long getMerId(){ | |
45 | + return merId; | |
46 | + } | |
47 | + | |
48 | + /** | |
49 | + * 设置 商户编码 | |
50 | + * @param merId | |
51 | + */ | |
52 | + public void setMerId(Long merId){ | |
53 | + this.merId = merId; | |
54 | + } | |
55 | + | |
56 | + /** | |
57 | + * 获取 商户名称 | |
58 | + * @return | |
59 | + */ | |
60 | + public String getMerName(){ | |
61 | + return merName; | |
62 | + } | |
63 | + | |
64 | + /** | |
65 | + * 设置 商户名称 | |
66 | + * @param merName | |
67 | + */ | |
68 | + public void setMerName(String merName){ | |
69 | + this.merName = merName; | |
70 | + } | |
71 | + | |
72 | + /** | |
73 | + * 获取 商户类型-个体、企业 | |
74 | + * @return | |
75 | + */ | |
76 | + public Integer getType(){ | |
77 | + return type; | |
78 | + } | |
79 | + | |
80 | + /** | |
81 | + * 设置 商户类型-个体、企业 | |
82 | + * @param type | |
83 | + */ | |
84 | + public void setType(Integer type){ | |
85 | + this.type = type; | |
86 | + } | |
87 | + | |
88 | + /** | |
89 | + * 获取 账户ID | |
90 | + * @return | |
91 | + */ | |
92 | + public Long getAccountId(){ | |
93 | + return accountId; | |
94 | + } | |
95 | + | |
96 | + /** | |
97 | + * 设置 账户ID | |
98 | + * @param accountId | |
99 | + */ | |
100 | + public void setAccountId(Long accountId){ | |
101 | + this.accountId = accountId; | |
102 | + } | |
103 | + | |
104 | + /** | |
105 | + * 获取 商户状态 | |
106 | + * @return | |
107 | + */ | |
108 | + public Integer getStatus(){ | |
109 | + return status; | |
110 | + } | |
111 | + | |
112 | + /** | |
113 | + * 设置 商户状态 | |
114 | + * @param status | |
115 | + */ | |
116 | + public void setStatus(Integer status){ | |
117 | + this.status = status; | |
118 | + } | |
119 | + | |
120 | + | |
121 | + /** | |
122 | + * 获取 商户描述 | |
123 | + * @return | |
124 | + */ | |
125 | + public String getDescription(){ | |
126 | + return description; | |
127 | + } | |
128 | + | |
129 | + /** | |
130 | + * 设置 商户描述 | |
131 | + * @param description | |
132 | + */ | |
133 | + public void setDescription(String description){ | |
134 | + this.description = description; | |
135 | + } | |
136 | + | |
137 | + public String getMarketCode() { | |
138 | + return marketCode; | |
139 | + } | |
140 | + | |
141 | + public void setMarketCode(String marketCode) { | |
142 | + this.marketCode = marketCode; | |
143 | + } | |
144 | +} | |
0 | 145 | \ No newline at end of file | ... | ... |
src/main/java/com/diligrp/xtrade/product/domain/entity/Product.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/product/domain/entity/Product.java | |
1 | +package com.diligrp.xtrade.product.domain.entity; | |
2 | + | |
3 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
4 | + | |
5 | +/** | |
6 | + * 商品数据实体 | |
7 | + * @author zhangxing | |
8 | + * | |
9 | + */ | |
10 | +public class Product extends BaseDo{ | |
11 | + | |
12 | + //商品业务id | |
13 | + private Long productId; | |
14 | + | |
15 | + //商品名称 | |
16 | + private String productName; | |
17 | + | |
18 | + //品类id | |
19 | + private Long cateId; | |
20 | + | |
21 | + //品类名称 | |
22 | + private String cateName; | |
23 | + | |
24 | + //账户Id | |
25 | + private Long accountId; | |
26 | + | |
27 | + //账户名称 | |
28 | + private String accountName; | |
29 | + | |
30 | + //商品状态 | |
31 | + private Integer status; | |
32 | + | |
33 | + //商品件重 | |
34 | + private Double unitWeight; | |
35 | + | |
36 | + //商品单位 | |
37 | + private Integer unit; | |
38 | + | |
39 | + //商品价格 | |
40 | + private Long price; | |
41 | + | |
42 | + //商品数量 | |
43 | + private Double amount; | |
44 | + | |
45 | + //商品重量 | |
46 | + private Double weight; | |
47 | + | |
48 | + //商品产地 | |
49 | + private String place; | |
50 | + | |
51 | + /** | |
52 | + * 获取 分类ID | |
53 | + * @return | |
54 | + */ | |
55 | + public Long getCateId() { | |
56 | + return cateId; | |
57 | + } | |
58 | + | |
59 | + /** | |
60 | + * 设置 分类ID | |
61 | + * @param cateId | |
62 | + */ | |
63 | + public void setCateId(Long cateId) { | |
64 | + this.cateId = cateId; | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + * 获取 cateName | |
69 | + * @return | |
70 | + */ | |
71 | + public String getCateName() { | |
72 | + return cateName; | |
73 | + } | |
74 | + | |
75 | + /** | |
76 | + * 设置 cateName | |
77 | + * @param cateName | |
78 | + */ | |
79 | + public void setCateName(String cateName) { | |
80 | + this.cateName = cateName; | |
81 | + } | |
82 | + | |
83 | + /** | |
84 | + * 获取 卖家用户ID | |
85 | + * @return | |
86 | + */ | |
87 | + public Long getAccountId() { | |
88 | + return accountId; | |
89 | + } | |
90 | + | |
91 | + /** | |
92 | + * 设置 卖家用户ID | |
93 | + * @param accountId | |
94 | + */ | |
95 | + public void setAccountId(Long accountId) { | |
96 | + this.accountId = accountId; | |
97 | + } | |
98 | + | |
99 | + /** | |
100 | + * 获取 卖家用户名 | |
101 | + * @return | |
102 | + */ | |
103 | + public String getAccountName() { | |
104 | + return accountName; | |
105 | + } | |
106 | + | |
107 | + /** | |
108 | + * 设置 卖家用户名 | |
109 | + * @param accountName | |
110 | + */ | |
111 | + public void setAccountName(String accountName) { | |
112 | + this.accountName = accountName; | |
113 | + } | |
114 | + | |
115 | + /** | |
116 | + * 获取 快捷卖货用 | |
117 | + * @return | |
118 | + */ | |
119 | + public Long getProductId() { | |
120 | + return productId; | |
121 | + } | |
122 | + | |
123 | + /** | |
124 | + * 设置 快捷卖货用 | |
125 | + * @param productCode | |
126 | + */ | |
127 | + public void setProductId(Long productId) { | |
128 | + this.productId = productId; | |
129 | + } | |
130 | + | |
131 | + /** | |
132 | + * 获取 productName | |
133 | + * @return | |
134 | + */ | |
135 | + public String getProductName() { | |
136 | + return productName; | |
137 | + } | |
138 | + | |
139 | + /** | |
140 | + * 设置 productName | |
141 | + * @param productName | |
142 | + */ | |
143 | + public void setProductName(String productName) { | |
144 | + this.productName = productName; | |
145 | + } | |
146 | + | |
147 | + /** | |
148 | + * 获取 商品状态 1-生效 2-失效 -1-删除 | |
149 | + * @return | |
150 | + */ | |
151 | + public Integer getStatus() { | |
152 | + return status; | |
153 | + } | |
154 | + | |
155 | + /** | |
156 | + * 设置 商品状态 1-生效 2-失效 -1-删除 | |
157 | + * @param status | |
158 | + */ | |
159 | + public void setStatus(Integer status) { | |
160 | + this.status = status; | |
161 | + } | |
162 | + | |
163 | + /** | |
164 | + * 获取 数量 | |
165 | + * @return | |
166 | + */ | |
167 | + public Double getUnitWeight() { | |
168 | + return unitWeight; | |
169 | + } | |
170 | + | |
171 | + /** | |
172 | + * 设置 数量 | |
173 | + * @param unitWeight | |
174 | + */ | |
175 | + public void setUnitWeight(Double unitWeight) { | |
176 | + this.unitWeight = unitWeight; | |
177 | + } | |
178 | + | |
179 | + public Double getAmount() { | |
180 | + return amount; | |
181 | + } | |
182 | + | |
183 | + public void setAmount(Double amount) { | |
184 | + this.amount = amount; | |
185 | + } | |
186 | + | |
187 | + /** | |
188 | + * 获取 入库单位1件2斤 | |
189 | + * @return | |
190 | + */ | |
191 | + public Integer getUnit() { | |
192 | + return unit; | |
193 | + } | |
194 | + | |
195 | + /** | |
196 | + * 设置 入库单位1件2斤 | |
197 | + * @param productUnit | |
198 | + */ | |
199 | + public void setUnit(Integer unit) { | |
200 | + this.unit = unit; | |
201 | + } | |
202 | + | |
203 | + /** | |
204 | + * 获取 单价 | |
205 | + * @return | |
206 | + */ | |
207 | + public Long getPrice() { | |
208 | + return price; | |
209 | + } | |
210 | + | |
211 | + /** | |
212 | + * 设置 单价 | |
213 | + * @param price | |
214 | + */ | |
215 | + public void setPrice(Long price) { | |
216 | + this.price = price; | |
217 | + } | |
218 | + | |
219 | + /** | |
220 | + * 获取 总重量 | |
221 | + * @return | |
222 | + */ | |
223 | + public Double getWeight() { | |
224 | + return weight; | |
225 | + } | |
226 | + | |
227 | + /** | |
228 | + * 设置 总重量 | |
229 | + * @param weight | |
230 | + */ | |
231 | + public void setWeight(Double weight) { | |
232 | + this.weight = weight; | |
233 | + } | |
234 | + | |
235 | + /** | |
236 | + * 获取 产地 | |
237 | + * @return | |
238 | + */ | |
239 | + public String getPlace() { | |
240 | + return place; | |
241 | + } | |
242 | + | |
243 | + /** | |
244 | + * 设置 产地 | |
245 | + * @param place | |
246 | + */ | |
247 | + public void setPlace(String place) { | |
248 | + this.place = place; | |
249 | + } | |
250 | + | |
251 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/product/domain/entity/Shop.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/product/domain/entity/Shop.java | |
1 | +/* | |
2 | + * Copyright (c) 2016 com.diligrp.trade101 All rights reserved. | |
3 | + * 本软件源代码版权归----所有,未经许可不得任意复制与传播. | |
4 | + */ | |
5 | +package com.diligrp.xtrade.product.domain.entity; | |
6 | + | |
7 | +import com.diligrp.xtrade.shared.domain.BaseDo; | |
8 | + | |
9 | +public class Shop extends BaseDo { | |
10 | + | |
11 | + //商户id | |
12 | + private Long merId; | |
13 | + | |
14 | + //店铺id | |
15 | + private Long shopId; | |
16 | + | |
17 | + //店铺名称 | |
18 | + private String shopName; | |
19 | + | |
20 | + //店铺类型 个体 商户 | |
21 | + private Integer type; | |
22 | + | |
23 | + //店铺状态 | |
24 | + private Integer status; | |
25 | + | |
26 | + //是否自营 | |
27 | + private Integer isSelfShop; | |
28 | + | |
29 | + //主营业务 | |
30 | + private String mainBusiness; | |
31 | + | |
32 | + //地址 | |
33 | + private String address; | |
34 | + | |
35 | + //描述 | |
36 | + private String description; | |
37 | + | |
38 | + public Shop(){ | |
39 | + } | |
40 | + | |
41 | + public Shop(Long shopId, Integer type){ | |
42 | + this.shopId = shopId; | |
43 | + this.type = type; | |
44 | + } | |
45 | + | |
46 | + /** | |
47 | + * 获取 门店编码 | |
48 | + * @return | |
49 | + */ | |
50 | + public Long getShopId(){ | |
51 | + return shopId; | |
52 | + } | |
53 | + | |
54 | + /** | |
55 | + * 设置 门店编码 | |
56 | + * @param shopId | |
57 | + */ | |
58 | + public void setShopId(Long shopId){ | |
59 | + this.shopId = shopId; | |
60 | + } | |
61 | + | |
62 | + /** | |
63 | + * 获取 门店名称 | |
64 | + * @return | |
65 | + */ | |
66 | + public String getShopName(){ | |
67 | + return shopName; | |
68 | + } | |
69 | + | |
70 | + /** | |
71 | + * 设置 门店名称 | |
72 | + * @param shopName | |
73 | + */ | |
74 | + public void setShopName(String shopName){ | |
75 | + this.shopName = shopName; | |
76 | + } | |
77 | + | |
78 | + /** | |
79 | + * 获取 门店地址 | |
80 | + * @return | |
81 | + */ | |
82 | + public String getAddress(){ | |
83 | + return address; | |
84 | + } | |
85 | + | |
86 | + /** | |
87 | + * 设置 门店地址 | |
88 | + * @param address | |
89 | + */ | |
90 | + public void setAddress(String address){ | |
91 | + this.address = address; | |
92 | + } | |
93 | + | |
94 | + /** | |
95 | + * 获取 所属商户编码 | |
96 | + * @return | |
97 | + */ | |
98 | + public Long getMerId(){ | |
99 | + return merId; | |
100 | + } | |
101 | + | |
102 | + /** | |
103 | + * 设置 所属商户编码 | |
104 | + * @param merId | |
105 | + */ | |
106 | + public void setMerId(Long merId){ | |
107 | + this.merId = merId; | |
108 | + } | |
109 | + | |
110 | + /** | |
111 | + * 获取 门店状态 | |
112 | + * @return | |
113 | + */ | |
114 | + public Integer getStatus(){ | |
115 | + return status; | |
116 | + } | |
117 | + | |
118 | + /** | |
119 | + * 设置 门店状态 | |
120 | + * @param status | |
121 | + */ | |
122 | + public void setStatus(Integer status){ | |
123 | + this.status = status; | |
124 | + } | |
125 | + | |
126 | + /** | |
127 | + * 获取 门店描述 | |
128 | + * @return | |
129 | + */ | |
130 | + public String getDescription(){ | |
131 | + return description; | |
132 | + } | |
133 | + | |
134 | + /** | |
135 | + * 设置 门店描述 | |
136 | + * @param description | |
137 | + */ | |
138 | + public void setDescription(String description){ | |
139 | + this.description = description; | |
140 | + } | |
141 | + | |
142 | + public Integer getIsSelfShop() { | |
143 | + return isSelfShop; | |
144 | + } | |
145 | + | |
146 | + public void setIsSelfShop(Integer isSelfShop) { | |
147 | + this.isSelfShop = isSelfShop; | |
148 | + } | |
149 | + | |
150 | + public Integer getType() { | |
151 | + return type; | |
152 | + } | |
153 | + | |
154 | + public void setType(Integer type) { | |
155 | + this.type = type; | |
156 | + } | |
157 | + | |
158 | + public String getMainBusiness() { | |
159 | + return mainBusiness; | |
160 | + } | |
161 | + | |
162 | + public void setMainBusiness(String mainBusiness) { | |
163 | + this.mainBusiness = mainBusiness; | |
164 | + } | |
165 | +} | |
0 | 166 | \ No newline at end of file | ... | ... |
src/main/java/com/diligrp/xtrade/product/exception/ProductException.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/rpc/feign/CardService.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/service/MerchantService.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/service/ProductService.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/product/service/ProductService.java | |
1 | +package com.diligrp.xtrade.product.service; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import com.diligrp.xtrade.product.domain.dto.ProductCreateRequestDto; | |
6 | +import com.diligrp.xtrade.product.domain.dto.ProductQueryRequestDto; | |
7 | +import com.diligrp.xtrade.product.domain.dto.ProductQueryResponsetDto; | |
8 | + | |
9 | +public interface ProductService { | |
10 | + | |
11 | + void createProduct(ProductCreateRequestDto productCreateRequestDto); | |
12 | + | |
13 | + List<ProductQueryResponsetDto> orderLists(ProductQueryRequestDto productQueryRequestDto); | |
14 | + | |
15 | + ProductQueryResponsetDto orderDetail(ProductQueryRequestDto productQueryRequestDto); | |
16 | + | |
17 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/product/service/ShopService.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/service/impl/MerchantServiceImpl.java
0 → 100644
src/main/java/com/diligrp/xtrade/product/service/impl/ProductServiceImpl.java
0 → 100644
1 | +++ a/src/main/java/com/diligrp/xtrade/product/service/impl/ProductServiceImpl.java | |
1 | +package com.diligrp.xtrade.product.service.impl; | |
2 | + | |
3 | +import java.util.List; | |
4 | + | |
5 | +import org.springframework.stereotype.Service; | |
6 | + | |
7 | +import com.diligrp.xtrade.product.domain.dto.ProductCreateRequestDto; | |
8 | +import com.diligrp.xtrade.product.domain.dto.ProductQueryRequestDto; | |
9 | +import com.diligrp.xtrade.product.domain.dto.ProductQueryResponsetDto; | |
10 | +import com.diligrp.xtrade.product.service.ProductService; | |
11 | + | |
12 | +@Service("productService") | |
13 | +public class ProductServiceImpl implements ProductService { | |
14 | + | |
15 | + @Override | |
16 | + public void createProduct(ProductCreateRequestDto productCreateRequestDto) { | |
17 | + | |
18 | + } | |
19 | + | |
20 | + @Override | |
21 | + public List<ProductQueryResponsetDto> orderLists(ProductQueryRequestDto productQueryRequestDto) { | |
22 | + return null; | |
23 | + } | |
24 | + | |
25 | + @Override | |
26 | + public ProductQueryResponsetDto orderDetail(ProductQueryRequestDto productQueryRequestDto) { | |
27 | + return null; | |
28 | + } | |
29 | + | |
30 | +} | ... | ... |
src/main/java/com/diligrp/xtrade/product/service/impl/ShopServiceImpl.java
0 → 100644
src/main/resources/bootstrap-dev.yml
0 → 100644
src/main/resources/bootstrap.yml
0 → 100644
1 | +++ a/src/main/resources/bootstrap.yml | |
1 | +server: | |
2 | + port: 8081 | |
3 | +spring: | |
4 | + application: | |
5 | + name: xtrade-order-service | |
6 | + cloud: | |
7 | + nacos: | |
8 | + discovery: | |
9 | + username: xtrade | |
10 | + password: abcd1234 | |
11 | + server-addr: 10.28.1.79:8848 | |
12 | + config: | |
13 | + username: xtrade | |
14 | + password: abcd1234 | |
15 | + server-addr: 10.28.1.79:8848 | |
16 | + prefix: ${spring.application.name} | |
17 | + context-path: /nacos | |
18 | + file-extension: properties | |
19 | + profiles: | |
20 | + active: dev | |
21 | + | |
22 | +mybatis: | |
23 | + mapper-locations: classpath:mapping/com/diligrp/xtrade/*/*Dao.xml | |
24 | + type-aliases-package: com.diligrp.xtrade.*.domain.entity | |
0 | 25 | \ No newline at end of file | ... | ... |
src/main/resources/logback.xml
0 → 100644
1 | +++ a/src/main/resources/logback.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<configuration> | |
3 | + <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> | |
4 | + <encoder> | |
5 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %level %logger{30}:%L - %msg%n</pattern> | |
6 | + </encoder> | |
7 | + </appender> | |
8 | + | |
9 | + <appender name="File" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
10 | + <file>/var/logs/xtade-order-service.log</file> | |
11 | + | |
12 | + <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | |
13 | + <fileNamePattern>/var/logs/xtade-order-service.%i.log</fileNamePattern> | |
14 | + <minIndex>1</minIndex> | |
15 | + <maxIndex>10</maxIndex> | |
16 | + </rollingPolicy> | |
17 | + | |
18 | + <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | |
19 | + <maxFileSize>10MB</maxFileSize> | |
20 | + </triggeringPolicy> | |
21 | + <encoder> | |
22 | + <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %level %logger{30}:%L - %msg%n</pattern> | |
23 | + </encoder> | |
24 | + </appender> | |
25 | + | |
26 | + <!-- <logger name="com.example.demo.order" additive="true"> | |
27 | + <level value="INFO" /> | |
28 | + <appender-ref ref="File" /> | |
29 | + </logger>--> | |
30 | + | |
31 | + <root level="INFO"> | |
32 | + <appender-ref ref="File" /> | |
33 | + <appender-ref ref="STDOUT" /> | |
34 | + </root> | |
35 | +</configuration> | |
0 | 36 | \ No newline at end of file | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/order/OrderDao.xml
0 → 100644
1 | +++ a/src/main/resources/mapping/com/diligrp/xtrade/order/OrderDao.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.diligrp.xtrade.order.dao.OrderDao"> | |
4 | + | |
5 | + <sql id="QUERY_COLUMN_LIST"> | |
6 | + <![CDATA[id , `order_id` AS orderId, `seller_account` AS sellerAccount, `seller_card_no` AS sellerCardNo, | |
7 | + `seller_card_type` AS sellerCardType, `seller_name` AS sellerName, `seller_mobile` AS sellerMobile, `buyer_account` AS buyerAccount, | |
8 | + `buyer_card_no` AS buyerCardCo, `buyer_card_type` AS buyerCardType, `buyer_name` AS buyerName, `buyer_mobile` AS buyerMobile, | |
9 | + `market_id` AS marketId, `order_status` AS orderStatus, `trade_flow_id` AS tradeFlowId, `total_money` AS totalMoney, | |
10 | + `seller_total_commission` AS sellerTotalCommission , `buyer_total_commission` AS buyerTotalCommission, `weight`, | |
11 | + `pay_type` AS payType, `pay_src` AS paySrc, `order_created_src` AS orderCreatedSrc, `order_type` AS orderType, | |
12 | + `payment_id` AS paymentId, `twice` , `pay_time` AS payTime, `created_time` AS createdTime, `modified_time`AS modifiedTime, `is_del` AS isDel]]> | |
13 | + </sql> | |
14 | + | |
15 | + <insert id="insertEntity" parameterType="orderDo"> | |
16 | + <![CDATA[ | |
17 | + INSERT INTO `order`(`order_id`, `seller_account`, `seller_card_no`, `seller_card_type`, `seller_name`, `seller_mobile`, | |
18 | + `buyer_account`, `buyer_card_no`, `buyer_card_type`, `buyer_name`, `buyer_mobile`, `market_id`, | |
19 | + `order_status`, `trade_flow_id`, `total_money`, `seller_total_commission`, `buyer_total_commission`, | |
20 | + `weight`, `pay_type`, `pay_src`, `order_created_src`, `pay_time`, `created_time`, `modified_time`, `is_del`) | |
21 | + VALUES(#{orderId}, #{sellerAccount}, #{sellerCardNo}, #{sellerCardType}, #{sellerName}, | |
22 | + #{sellerMobile}, #{buyerAccount}, #{buyerCardNo}, #{buyerCardType}, #{buyerName}, #{buyerMobile}, | |
23 | + #{marketId}, #{orderStatus}, #{tradeFlowId}, #{totalMoney}, #{sellerTotalCommission}, #{buyerTotalCommission}, | |
24 | + #{weight}, #{payType}, #{paySrc}, #{orderCreatedSrc}, NOW(), NOW(), NOW(),1); | |
25 | + ]]> | |
26 | + </insert> | |
27 | + | |
28 | + <select id="selectEntityByOrderId" parameterType="long" resultType="orderDo"> | |
29 | + SELECT | |
30 | + <include refid="QUERY_COLUMN_LIST"/> | |
31 | + FROM `order` | |
32 | + WHERE order_id =#{orderId} | |
33 | + </select> | |
34 | + | |
35 | +</mapper> | |
0 | 36 | \ No newline at end of file | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/order/OrderItemDao.xml
0 → 100644
1 | +++ a/src/main/resources/mapping/com/diligrp/xtrade/order/OrderItemDao.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.diligrp.xtrade.order.dao.OrderItemDao"> | |
4 | + | |
5 | + | |
6 | + | |
7 | +</mapper> | |
0 | 8 | \ No newline at end of file | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/product/MerchantDao.xml
0 → 100644
1 | +++ a/src/main/resources/mapping/com/diligrp/xtrade/product/MerchantDao.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.diligrp.xtrade.product.dao.MerchantDao"> | |
4 | + | |
5 | + | |
6 | + | |
7 | +</mapper> | |
0 | 8 | \ No newline at end of file | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/product/ProductDao.xml
0 → 100644
1 | +++ a/src/main/resources/mapping/com/diligrp/xtrade/product/ProductDao.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.diligrp.xtrade.product.dao.ProductDao"> | |
4 | + | |
5 | + | |
6 | + | |
7 | +</mapper> | |
0 | 8 | \ No newline at end of file | ... | ... |
src/main/resources/mapping/com/diligrp/xtrade/product/ShopDao.xml
0 → 100644
1 | +++ a/src/main/resources/mapping/com/diligrp/xtrade/product/ShopDao.xml | |
1 | +<?xml version="1.0" encoding="UTF-8"?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
3 | +<mapper namespace="com.diligrp.xtrade.product.dao.ShopDao"> | |
4 | + | |
5 | + | |
6 | + | |
7 | +</mapper> | |
0 | 8 | \ No newline at end of file | ... | ... |
src/test/java/com/diligrp/order/XtradeOrderServiceApplicationTests.java
0 → 100644
1 | +++ a/src/test/java/com/diligrp/order/XtradeOrderServiceApplicationTests.java | |
1 | +package com.diligrp.order; | |
2 | + | |
3 | +import org.junit.jupiter.api.Test; | |
4 | +import org.springframework.boot.test.context.SpringBootTest; | |
5 | + | |
6 | +@SpringBootTest | |
7 | +class XtradeOrderServiceApplicationTests { | |
8 | + | |
9 | + @Test | |
10 | + void contextLoads() { | |
11 | + } | |
12 | + | |
13 | +} | ... | ... |