Commit 1038e16635eef4f05db41c92278b786356c80c18

Authored by Jiang
1 parent 1d49e3c8

增加swagger配置,暂无法运行

Showing 63 changed files with 1892 additions and 1381 deletions
.project
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <projectDescription> 2 <projectDescription>
3 - <name>orders-parent</name> 3 + <name>b2c-orders-parent</name>
4 <comment></comment> 4 <comment></comment>
5 <projects> 5 <projects>
6 </projects> 6 </projects>
b2c-orders-client/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-client/pom.xml
@@ -3,13 +3,59 @@ @@ -3,13 +3,59 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-client</artifactId>  
10 - <version>1.1.0-SNAPSHOT</version> 9 + <artifactId>b2c-orders-client</artifactId>
11 10
12 <dependencies> 11 <dependencies>
  12 + <!--swagger -->
  13 + <dependency>
  14 + <groupId>io.springfox</groupId>
  15 + <artifactId>springfox-swagger2</artifactId>
  16 + <exclusions>
  17 + <exclusion>
  18 + <groupId>org.springframework</groupId>
  19 + <artifactId>spring-web</artifactId>
  20 + </exclusion>
  21 + <exclusion>
  22 + <groupId>org.springframework</groupId>
  23 + <artifactId>spring-beans</artifactId>
  24 + </exclusion>
  25 + <exclusion>
  26 + <groupId>org.springframework</groupId>
  27 + <artifactId>spring-webmvc</artifactId>
  28 + </exclusion>
  29 + <exclusion>
  30 + <groupId>org.springframework</groupId>
  31 + <artifactId>spring-beans</artifactId>
  32 + </exclusion>
  33 + <exclusion>
  34 + <groupId>org.springframework</groupId>
  35 + <artifactId>spring-context</artifactId>
  36 + </exclusion>
  37 + <exclusion>
  38 + <groupId>org.springframework</groupId>
  39 + <artifactId>spring-core</artifactId>
  40 + </exclusion>
  41 + <exclusion>
  42 + <groupId>org.springframework</groupId>
  43 + <artifactId>spring-aop</artifactId>
  44 + </exclusion>
  45 + <exclusion>
  46 + <groupId>org.aspectj</groupId>
  47 + <artifactId>aspectjweaver</artifactId>
  48 + </exclusion>
  49 + <exclusion>
  50 + <groupId>org.slf4j</groupId>
  51 + <artifactId>slf4j-api</artifactId>
  52 + </exclusion>
  53 + <exclusion>
  54 + <groupId>com.fasterxml.jackson.core</groupId>
  55 + <artifactId>jackson-annotations</artifactId>
  56 + </exclusion>
  57 + </exclusions>
  58 + </dependency>
13 <dependency> 59 <dependency>
14 <groupId>org.hibernate</groupId> 60 <groupId>org.hibernate</groupId>
15 <artifactId>hibernate-validator</artifactId> 61 <artifactId>hibernate-validator</artifactId>
@@ -34,45 +80,22 @@ @@ -34,45 +80,22 @@
34 <groupId>org.slf4j</groupId> 80 <groupId>org.slf4j</groupId>
35 <artifactId>slf4j-api</artifactId> 81 <artifactId>slf4j-api</artifactId>
36 </dependency> 82 </dependency>
37 - <dependency>  
38 - <groupId>com.fasterxml.jackson.core</groupId>  
39 - <artifactId>jackson-core</artifactId>  
40 - </dependency>  
41 -  
42 - <!-- Just the annotations; use this dependency if you want to attach annotations  
43 - to classes without connecting them to the code. -->  
44 - <dependency>  
45 - <groupId>com.fasterxml.jackson.core</groupId>  
46 - <artifactId>jackson-annotations</artifactId>  
47 - </dependency>  
48 -  
49 - <!-- databinding; ObjectMapper, JsonNode and related classes are here -->  
50 - <dependency>  
51 - <groupId>com.fasterxml.jackson.core</groupId>  
52 - <artifactId>jackson-databind</artifactId>  
53 - </dependency>  
54 - <!-- smile (binary JSON). Other artifacts in this group do other formats. -->  
55 - <dependency>  
56 - <groupId>com.fasterxml.jackson.dataformat</groupId>  
57 - <artifactId>jackson-dataformat-smile</artifactId>  
58 - </dependency>  
59 - <dependency>  
60 - <groupId>com.fasterxml.jackson.dataformat</groupId>  
61 - <artifactId>jackson-dataformat-xml</artifactId>  
62 - </dependency>  
63 - <dependency>  
64 - <groupId>org.codehaus.woodstox</groupId>  
65 - <artifactId>woodstox-core-asl</artifactId>  
66 - </dependency>  
67 - <!-- JAX-RS provider -->  
68 - <dependency>  
69 - <groupId>com.fasterxml.jackson.jaxrs</groupId>  
70 - <artifactId>jackson-jaxrs-json-provider</artifactId>  
71 - </dependency>  
72 - <!-- Support for JAX-B annotations as additional configuration -->  
73 - <dependency>  
74 - <groupId>com.fasterxml.jackson.module</groupId>  
75 - <artifactId>jackson-module-jaxb-annotations</artifactId>  
76 - </dependency> 83 + <!-- <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId>
  84 + </dependency> Just the annotations; use this dependency if you want to attach
  85 + annotations to classes without connecting them to the code. <dependency>
  86 + <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId>
  87 + </dependency> databinding; ObjectMapper, JsonNode and related classes are
  88 + here <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId>
  89 + </dependency> smile (binary JSON). Other artifacts in this group do other
  90 + formats. <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId>
  91 + <artifactId>jackson-dataformat-smile</artifactId> </dependency> <dependency>
  92 + <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId>
  93 + </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>woodstox-core-asl</artifactId>
  94 + </dependency> JAX-RS provider <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId>
  95 + <artifactId>jackson-jaxrs-json-provider</artifactId> </dependency> Support
  96 + for JAX-B annotations as additional configuration <dependency> <groupId>com.fasterxml.jackson.module</groupId>
  97 + <artifactId>jackson-module-jaxb-annotations</artifactId> </dependency> -->
  98 + <!-- <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId>
  99 + </dependency> -->
77 </dependencies> 100 </dependencies>
78 </project> 101 </project>
79 \ No newline at end of file 102 \ No newline at end of file
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/BuyerCancelRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
  5 +import io.swagger.annotations.ApiParam;
  6 +
3 public class BuyerCancelRequestDto extends BaseRequestDto { 7 public class BuyerCancelRequestDto extends BaseRequestDto {
4 8
5 /** 9 /**
6 * 10 *
7 */ 11 */
8 private static final long serialVersionUID = -5338664730613120833L; 12 private static final long serialVersionUID = -5338664730613120833L;
9 - 13 +
  14 + @ApiParam(value = "订单id", required = true)
  15 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 16 private Long orderId;
  17 + @ApiParam(value = "买家id", required = true)
  18 + @NotNull(message = "买家id不能为空")
11 private Long buyerId; 19 private Long buyerId;
12 20
13 public Long getOrderId() { 21 public Long getOrderId() {
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/BuyerConfirmRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
3 public class BuyerConfirmRequestDto extends BaseRequestDto { 5 public class BuyerConfirmRequestDto extends BaseRequestDto {
4 6
5 /** 7 /**
@@ -7,7 +9,11 @@ public class BuyerConfirmRequestDto extends BaseRequestDto { @@ -7,7 +9,11 @@ public class BuyerConfirmRequestDto extends BaseRequestDto {
7 */ 9 */
8 private static final long serialVersionUID = 5323840474125840652L; 10 private static final long serialVersionUID = 5323840474125840652L;
9 11
  12 +// @ApiParam(value = "订单id", required = true)
  13 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 14 private Long orderId;
  15 +// @ApiParam(value = "买家id", required = true)
  16 + @NotNull(message = "买家id不能为空")
11 private Long buyerId; 17 private Long buyerId;
12 18
13 public Long getOrderId() { 19 public Long getOrderId() {
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/DtmsConfirmRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
3 public class DtmsConfirmRequestDto extends BaseRequestDto { 5 public class DtmsConfirmRequestDto extends BaseRequestDto {
4 6
5 /** 7 /**
@@ -7,6 +9,8 @@ public class DtmsConfirmRequestDto extends BaseRequestDto { @@ -7,6 +9,8 @@ public class DtmsConfirmRequestDto extends BaseRequestDto {
7 */ 9 */
8 private static final long serialVersionUID = 7519820743736468349L; 10 private static final long serialVersionUID = 7519820743736468349L;
9 11
  12 +// @ApiParam(value = "订单id", required = true)
  13 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 14 private Long orderId;
11 15
12 public Long getOrderId() { 16 public Long getOrderId() {
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/DtmsTimeoutRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
3 public class DtmsTimeoutRequestDto extends BaseRequestDto { 5 public class DtmsTimeoutRequestDto extends BaseRequestDto {
4 6
5 /** 7 /**
6 * 8 *
7 */ 9 */
8 private static final long serialVersionUID = 8454009010057359942L; 10 private static final long serialVersionUID = 8454009010057359942L;
9 - 11 +
  12 +// @ApiParam(value = "订单id", required = true)
  13 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 14 private Long orderId;
11 15
12 public Long getOrderId() { 16 public Long getOrderId() {
@@ -16,6 +20,5 @@ public class DtmsTimeoutRequestDto extends BaseRequestDto { @@ -16,6 +20,5 @@ public class DtmsTimeoutRequestDto extends BaseRequestDto {
16 public void setOrderId(Long orderId) { 20 public void setOrderId(Long orderId) {
17 this.orderId = orderId; 21 this.orderId = orderId;
18 } 22 }
19 -  
20 23
21 } 24 }
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/OrderItemDto.java
@@ -2,6 +2,11 @@ package com.b2c.orders.client.domain.dto.request; @@ -2,6 +2,11 @@ package com.b2c.orders.client.domain.dto.request;
2 2
3 import java.io.Serializable; 3 import java.io.Serializable;
4 4
  5 +import javax.validation.constraints.Min;
  6 +import javax.validation.constraints.NotNull;
  7 +
  8 +import org.hibernate.validator.constraints.NotBlank;
  9 +
5 public class OrderItemDto implements Serializable { 10 public class OrderItemDto implements Serializable {
6 11
7 /** 12 /**
@@ -9,23 +14,50 @@ public class OrderItemDto implements Serializable { @@ -9,23 +14,50 @@ public class OrderItemDto implements Serializable {
9 */ 14 */
10 private static final long serialVersionUID = 2876508071333281636L; 15 private static final long serialVersionUID = 2876508071333281636L;
11 16
12 - private ProductDto product;  
13 - private Long buyerId; 17 +// @ApiParam(value = "商品id", required = true)
  18 + private Long productId;
  19 +// @ApiParam(value = "商品sku", required = true)
  20 + @NotBlank(message = "商品sku不能为空")
  21 + private String sku;
  22 +// @ApiParam(value = "购买数量", required = true)
  23 + @NotNull(message = "商品购买数量amount不能为空")
  24 + @Min(value = 1, message = "商品购买数量amount必须大于等于1")
  25 + private Integer amount;
  26 +// @ApiParam(value = "商品价格,整型,单位:分 ", required = true)
  27 + @NotNull(message = "商品价格price不能为空")
  28 + @Min(value = 0, message = "商品价格price必须大于等于0分")
  29 + private Long price;
  30 +
  31 + public Long getProductId() {
  32 + return productId;
  33 + }
  34 +
  35 + public void setProductId(Long productId) {
  36 + this.productId = productId;
  37 + }
  38 +
  39 + public String getSku() {
  40 + return sku;
  41 + }
  42 +
  43 + public void setSku(String sku) {
  44 + this.sku = sku;
  45 + }
14 46
15 - public ProductDto getProduct() {  
16 - return product; 47 + public Integer getAmount() {
  48 + return amount;
17 } 49 }
18 50
19 - public void setProduct(ProductDto product) {  
20 - this.product = product; 51 + public void setAmount(Integer amount) {
  52 + this.amount = amount;
21 } 53 }
22 54
23 - public Long getBuyerId() {  
24 - return buyerId; 55 + public Long getPrice() {
  56 + return price;
25 } 57 }
26 58
27 - public void setBuyerId(Long buyerId) {  
28 - this.buyerId = buyerId; 59 + public void setPrice(Long price) {
  60 + this.price = price;
29 } 61 }
30 62
31 } 63 }
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/OrderListRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +import java.util.Date;
  4 +
  5 +import com.b2c.orders.enums.OrderDeliveryType;
  6 +import com.b2c.orders.enums.OrderStatus;
  7 +import com.b2c.orders.enums.PayStatus;
  8 +import com.b2c.orders.enums.PayType;
  9 +
  10 +public class OrderListRequestDto {
  11 +
  12 + /**
  13 + * 买家
  14 + */
  15 + private Long buyerId;
  16 + /**
  17 + * 卖家
  18 + */
  19 + private Long sellerId;
  20 + /** 配送类型 */
  21 + private OrderDeliveryType deliveryType;
  22 + /** 订单状态 */
  23 + private OrderStatus orderStatus;
  24 + /** 支付状态 */
  25 + private PayStatus payStatus;
  26 + /** 买家备注说明 */
  27 + private String buyerMemo;
  28 + /** 支付时间 */
  29 + private Date payTime;
  30 + /**
  31 + * 送货时间
  32 + */
  33 + private Date deliveryTime;
  34 + /**
  35 + * 提货时间
  36 + */
  37 + private Date reservationTime;
  38 + /**
  39 + * 买家确认收货时间
  40 + */
  41 + private Date buyerConfirmTime;
  42 + /**
  43 + * 订单提交时间
  44 + */
  45 + private Date submitTime;
  46 + /** 支付类型 */
  47 + private PayType payType;
  48 + private Integer pageSize = 10;
  49 + private Integer page = 1;
  50 + private Integer start;
  51 + private Integer limit;
  52 +
  53 + public Long getBuyerId() {
  54 + return buyerId;
  55 + }
  56 +
  57 + public void setBuyerId(Long buyerId) {
  58 + this.buyerId = buyerId;
  59 + }
  60 +
  61 + public Long getSellerId() {
  62 + return sellerId;
  63 + }
  64 +
  65 + public void setSellerId(Long sellerId) {
  66 + this.sellerId = sellerId;
  67 + }
  68 +
  69 + public OrderDeliveryType getDeliveryType() {
  70 + return deliveryType;
  71 + }
  72 +
  73 + public void setDeliveryType(OrderDeliveryType deliveryType) {
  74 + this.deliveryType = deliveryType;
  75 + }
  76 +
  77 + public OrderStatus getOrderStatus() {
  78 + return orderStatus;
  79 + }
  80 +
  81 + public void setOrderStatus(OrderStatus orderStatus) {
  82 + this.orderStatus = orderStatus;
  83 + }
  84 +
  85 + public PayStatus getPayStatus() {
  86 + return payStatus;
  87 + }
  88 +
  89 + public void setPayStatus(PayStatus payStatus) {
  90 + this.payStatus = payStatus;
  91 + }
  92 +
  93 + public String getBuyerMemo() {
  94 + return buyerMemo;
  95 + }
  96 +
  97 + public void setBuyerMemo(String buyerMemo) {
  98 + this.buyerMemo = buyerMemo;
  99 + }
  100 +
  101 + public Date getPayTime() {
  102 + return payTime;
  103 + }
  104 +
  105 + public void setPayTime(Date payTime) {
  106 + this.payTime = payTime;
  107 + }
  108 +
  109 + public Date getDeliveryTime() {
  110 + return deliveryTime;
  111 + }
  112 +
  113 + public void setDeliveryTime(Date deliveryTime) {
  114 + this.deliveryTime = deliveryTime;
  115 + }
  116 +
  117 + public Date getReservationTime() {
  118 + return reservationTime;
  119 + }
  120 +
  121 + public void setReservationTime(Date reservationTime) {
  122 + this.reservationTime = reservationTime;
  123 + }
  124 +
  125 + public Date getBuyerConfirmTime() {
  126 + return buyerConfirmTime;
  127 + }
  128 +
  129 + public void setBuyerConfirmTime(Date buyerConfirmTime) {
  130 + this.buyerConfirmTime = buyerConfirmTime;
  131 + }
  132 +
  133 + public Date getSubmitTime() {
  134 + return submitTime;
  135 + }
  136 +
  137 + public void setSubmitTime(Date submitTime) {
  138 + this.submitTime = submitTime;
  139 + }
  140 +
  141 + public PayType getPayType() {
  142 + return payType;
  143 + }
  144 +
  145 + public void setPayType(PayType payType) {
  146 + this.payType = payType;
  147 + }
  148 +
  149 + public Integer getPageSize() {
  150 + return pageSize;
  151 + }
  152 +
  153 + public void setPageSize(Integer pageSize) {
  154 + this.pageSize = pageSize;
  155 + }
  156 +
  157 + public Integer getPage() {
  158 + return page;
  159 + }
  160 +
  161 + public void setPage(Integer page) {
  162 + this.page = page;
  163 + }
  164 +
  165 + public Integer getStart() {
  166 + return start;
  167 + }
  168 +
  169 + public void setStart(Integer start) {
  170 + this.start = start;
  171 + }
  172 +
  173 + public Integer getLimit() {
  174 + return limit;
  175 + }
  176 +
  177 + public void setLimit(Integer limit) {
  178 + this.limit = limit;
  179 + }
  180 +
  181 +}
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/PayOrderRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
3 public class PayOrderRequestDto extends BaseRequestDto { 5 public class PayOrderRequestDto extends BaseRequestDto {
4 6
5 /** 7 /**
@@ -7,7 +9,11 @@ public class PayOrderRequestDto extends BaseRequestDto { @@ -7,7 +9,11 @@ public class PayOrderRequestDto extends BaseRequestDto {
7 */ 9 */
8 private static final long serialVersionUID = 7438455154625322536L; 10 private static final long serialVersionUID = 7438455154625322536L;
9 11
  12 +// @ApiParam(value = "订单id", required = true)
  13 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 14 private Long orderId;
  15 +// @ApiParam(value = "买家id", required = true)
  16 + @NotNull(message = "买家id不能为空")
11 private Long buyerId; 17 private Long buyerId;
12 18
13 public Long getOrderId() { 19 public Long getOrderId() {
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/SellerConfirmRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
3 public class SellerConfirmRequestDto extends BaseRequestDto { 5 public class SellerConfirmRequestDto extends BaseRequestDto {
4 6
5 /** 7 /**
@@ -7,7 +9,11 @@ public class SellerConfirmRequestDto extends BaseRequestDto { @@ -7,7 +9,11 @@ public class SellerConfirmRequestDto extends BaseRequestDto {
7 */ 9 */
8 private static final long serialVersionUID = -6873506335794369709L; 10 private static final long serialVersionUID = -6873506335794369709L;
9 11
  12 +// @ApiParam(value = "订单id", required = true)
  13 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 14 private Long orderId;
  15 +// @ApiParam(value = "商家id", required = true)
  16 + @NotNull(message = "商家id不能为空")
11 private Long sellerId; 17 private Long sellerId;
12 18
13 public Long getOrderId() { 19 public Long getOrderId() {
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/SellerRefuseRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
  3 +import javax.validation.constraints.NotNull;
  4 +
3 public class SellerRefuseRequestDto extends BaseRequestDto { 5 public class SellerRefuseRequestDto extends BaseRequestDto {
4 6
5 /** 7 /**
6 * 8 *
7 */ 9 */
8 private static final long serialVersionUID = 1563792094069115492L; 10 private static final long serialVersionUID = 1563792094069115492L;
9 - 11 +
  12 +// @ApiParam(value = "订单id", required = true)
  13 + @NotNull(message = "订单id不能为空")
10 private Long orderId; 14 private Long orderId;
  15 +// @ApiParam(value = "商家id", required = true)
  16 + @NotNull(message = "商家id不能为空")
11 private Long sellerId; 17 private Long sellerId;
12 18
13 public Long getOrderId() { 19 public Long getOrderId() {
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/SubmitOrderRequestDto.java
1 package com.b2c.orders.client.domain.dto.request; 1 package com.b2c.orders.client.domain.dto.request;
2 2
3 import java.io.Serializable; 3 import java.io.Serializable;
  4 +import java.util.Date;
4 import java.util.List; 5 import java.util.List;
5 6
6 import com.b2c.orders.enums.OrderDeliveryType; 7 import com.b2c.orders.enums.OrderDeliveryType;
7 -import com.b2c.orders.enums.OrderStatus;  
8 import com.b2c.orders.enums.PayType; 8 import com.b2c.orders.enums.PayType;
9 9
10 public class SubmitOrderRequestDto implements Serializable { 10 public class SubmitOrderRequestDto implements Serializable {
@@ -14,28 +14,26 @@ public class SubmitOrderRequestDto implements Serializable { @@ -14,28 +14,26 @@ public class SubmitOrderRequestDto implements Serializable {
14 */ 14 */
15 private static final long serialVersionUID = 5060629945327592074L; 15 private static final long serialVersionUID = 5060629945327592074L;
16 16
17 - /** 买家ID与姓名 */ 17 +// @ApiParam(value = "买家id", required = true)
18 private Long buyerId; 18 private Long buyerId;
19 - private String buyerName;  
20 - /** 卖家ID与姓名 */ 19 +// @ApiParam(value = "卖家id", required = true)
21 private Long sellerId; 20 private Long sellerId;
22 private String sellerName; 21 private String sellerName;
23 - /** 配送类型 */ 22 +// @ApiParam(value = "配送类型", required = true)
24 private OrderDeliveryType deliveryType; 23 private OrderDeliveryType deliveryType;
25 - /** 订单状态 */  
26 - private OrderStatus orderStatus;  
27 - /** 买家备注说明 */ 24 +// @ApiParam(value = "买家备注说明", required = true)
28 private String buyerMemo; 25 private String buyerMemo;
29 - /** 支付类型 */ 26 +// @ApiParam(value = "支付类型", required = true)
30 private PayType payType; 27 private PayType payType;
31 - /** 最新商品总金额 */ 28 +// @ApiParam(value = "最新商品总金额", required = true)
32 private Long priceTotal; 29 private Long priceTotal;
33 - /** 店铺ID */ 30 +// @ApiParam(value = "店铺ID", required = true)
34 private Long shopId; 31 private Long shopId;
35 - private Long userId;  
36 - /**  
37 - * 订单项  
38 - */ 32 +// @ApiParam(value = "送货时间")
  33 + private Date deliveryTime;
  34 +// @ApiParam(value = "提货时间")
  35 + private Date reservationTime;
  36 +// @ApiParam(value = "订单项", required = true)
39 private List<OrderItemDto> orderItems; 37 private List<OrderItemDto> orderItems;
40 38
41 public Long getBuyerId() { 39 public Long getBuyerId() {
@@ -46,14 +44,6 @@ public class SubmitOrderRequestDto implements Serializable { @@ -46,14 +44,6 @@ public class SubmitOrderRequestDto implements Serializable {
46 this.buyerId = buyerId; 44 this.buyerId = buyerId;
47 } 45 }
48 46
49 - public String getBuyerName() {  
50 - return buyerName;  
51 - }  
52 -  
53 - public void setBuyerName(String buyerName) {  
54 - this.buyerName = buyerName;  
55 - }  
56 -  
57 public Long getSellerId() { 47 public Long getSellerId() {
58 return sellerId; 48 return sellerId;
59 } 49 }
@@ -78,14 +68,6 @@ public class SubmitOrderRequestDto implements Serializable { @@ -78,14 +68,6 @@ public class SubmitOrderRequestDto implements Serializable {
78 this.deliveryType = deliveryType; 68 this.deliveryType = deliveryType;
79 } 69 }
80 70
81 - public OrderStatus getOrderStatus() {  
82 - return orderStatus;  
83 - }  
84 -  
85 - public void setOrderStatus(OrderStatus orderStatus) {  
86 - this.orderStatus = orderStatus;  
87 - }  
88 -  
89 public String getBuyerMemo() { 71 public String getBuyerMemo() {
90 return buyerMemo; 72 return buyerMemo;
91 } 73 }
@@ -118,14 +100,6 @@ public class SubmitOrderRequestDto implements Serializable { @@ -118,14 +100,6 @@ public class SubmitOrderRequestDto implements Serializable {
118 this.shopId = shopId; 100 this.shopId = shopId;
119 } 101 }
120 102
121 - public Long getUserId() {  
122 - return userId;  
123 - }  
124 -  
125 - public void setUserId(Long userId) {  
126 - this.userId = userId;  
127 - }  
128 -  
129 public List<OrderItemDto> getOrderItems() { 103 public List<OrderItemDto> getOrderItems() {
130 return orderItems; 104 return orderItems;
131 } 105 }
@@ -134,4 +108,20 @@ public class SubmitOrderRequestDto implements Serializable { @@ -134,4 +108,20 @@ public class SubmitOrderRequestDto implements Serializable {
134 this.orderItems = orderItems; 108 this.orderItems = orderItems;
135 } 109 }
136 110
  111 + public Date getDeliveryTime() {
  112 + return deliveryTime;
  113 + }
  114 +
  115 + public void setDeliveryTime(Date deliveryTime) {
  116 + this.deliveryTime = deliveryTime;
  117 + }
  118 +
  119 + public Date getReservationTime() {
  120 + return reservationTime;
  121 + }
  122 +
  123 + public void setReservationTime(Date reservationTime) {
  124 + this.reservationTime = reservationTime;
  125 + }
  126 +
137 } 127 }
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/TakeOrderRequestDto.java
@@ -9,13 +9,16 @@ public class TakeOrderRequestDto extends BaseRequestDto { @@ -9,13 +9,16 @@ public class TakeOrderRequestDto extends BaseRequestDto {
9 */ 9 */
10 private static final long serialVersionUID = -1409059930851556435L; 10 private static final long serialVersionUID = -1409059930851556435L;
11 11
  12 +// @ApiParam(value = "订单id", required = true)
12 @NotNull(message = "订单id不能为空") 13 @NotNull(message = "订单id不能为空")
13 private Long orderId; 14 private Long orderId;
  15 +// @ApiParam(value = "商家id", required = true)
14 @NotNull(message = "商家id不能为空") 16 @NotNull(message = "商家id不能为空")
15 private Long sellerId; 17 private Long sellerId;
16 /** 18 /**
17 * 订单总价 19 * 订单总价
18 */ 20 */
  21 +// @ApiParam(value = "订单总价", required = true)
19 @NotNull(message = "订单总价不能为空") 22 @NotNull(message = "订单总价不能为空")
20 private Long totalPrice; 23 private Long totalPrice;
21 24
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/response/OrderItemResponseDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.response;
  2 +
  3 +public class OrderItemResponseDto {
  4 +
  5 + private Long orderId;
  6 + private Long productId;
  7 + private String sku;
  8 + private String skuTitle;
  9 + private String skuAttributes;
  10 + private Integer skuNum;
  11 + private Long skuPrice;
  12 + private String skuPicture;
  13 + private String priceUnit;
  14 +
  15 + public Long getOrderId() {
  16 + return orderId;
  17 + }
  18 +
  19 + public void setOrderId(Long orderId) {
  20 + this.orderId = orderId;
  21 + }
  22 +
  23 + public Long getProductId() {
  24 + return productId;
  25 + }
  26 +
  27 + public void setProductId(Long productId) {
  28 + this.productId = productId;
  29 + }
  30 +
  31 + public String getSku() {
  32 + return sku;
  33 + }
  34 +
  35 + public void setSku(String sku) {
  36 + this.sku = sku;
  37 + }
  38 +
  39 + public String getSkuTitle() {
  40 + return skuTitle;
  41 + }
  42 +
  43 + public void setSkuTitle(String skuTitle) {
  44 + this.skuTitle = skuTitle;
  45 + }
  46 +
  47 + public String getSkuAttributes() {
  48 + return skuAttributes;
  49 + }
  50 +
  51 + public void setSkuAttributes(String skuAttributes) {
  52 + this.skuAttributes = skuAttributes;
  53 + }
  54 +
  55 + public Integer getSkuNum() {
  56 + return skuNum;
  57 + }
  58 +
  59 + public void setSkuNum(Integer skuNum) {
  60 + this.skuNum = skuNum;
  61 + }
  62 +
  63 + public Long getSkuPrice() {
  64 + return skuPrice;
  65 + }
  66 +
  67 + public void setSkuPrice(Long skuPrice) {
  68 + this.skuPrice = skuPrice;
  69 + }
  70 +
  71 + public String getSkuPicture() {
  72 + return skuPicture;
  73 + }
  74 +
  75 + public void setSkuPicture(String skuPicture) {
  76 + this.skuPicture = skuPicture;
  77 + }
  78 +
  79 + public String getPriceUnit() {
  80 + return priceUnit;
  81 + }
  82 +
  83 + public void setPriceUnit(String priceUnit) {
  84 + this.priceUnit = priceUnit;
  85 + }
  86 +}
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/response/OrderListResponseDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.response;
  2 +
  3 +import java.util.Date;
  4 +import java.util.List;
  5 +
  6 +import com.b2c.orders.enums.OrderDeliveryType;
  7 +import com.b2c.orders.enums.OrderStatus;
  8 +import com.b2c.orders.enums.PayStatus;
  9 +import com.b2c.orders.enums.PayType;
  10 +
  11 +public class OrderListResponseDto {
  12 +
  13 + /**
  14 + * 店铺id
  15 + */
  16 + private Long shopId;
  17 + /**
  18 + * 商家id
  19 + */
  20 + private Long sellerId;
  21 + /**
  22 + * 用户id
  23 + */
  24 + private Long buyerId;
  25 + /** 配送类型 */
  26 + private OrderDeliveryType deliveryType;
  27 + /** 订单状态 */
  28 + private OrderStatus orderStatus;
  29 + /** 支付状态 */
  30 + private PayStatus payStatus;
  31 + /** 买家备注说明 */
  32 + private String buyerMemo;
  33 + /** 支付时间 */
  34 + private Date payTime;
  35 + /**
  36 + * 送货时间
  37 + */
  38 + private Date deliveryTime;
  39 + /** 提货时间 */
  40 + private Date reservationTime;
  41 + /** 买家确认收货时间 */
  42 + private Date buyerConfirmTime;
  43 + /** 订单提交时间 */
  44 + private Date submitTime;
  45 + /** 支付类型 */
  46 + private PayType payType;
  47 + /** 总金额 */
  48 + private Long totalPrice;
  49 + /** 进入当前状态说明或原因,如取消原因,退款审批通过原因等 */
  50 + private String statusInReason;
  51 + /**
  52 + * 订单项
  53 + */
  54 + private List<OrderItemResponseDto> orderItems;
  55 +
  56 + public Long getShopId() {
  57 + return shopId;
  58 + }
  59 +
  60 + public void setShopId(Long shopId) {
  61 + this.shopId = shopId;
  62 + }
  63 +
  64 + public Long getSellerId() {
  65 + return sellerId;
  66 + }
  67 +
  68 + public void setSellerId(Long sellerId) {
  69 + this.sellerId = sellerId;
  70 + }
  71 +
  72 + public Long getBuyerId() {
  73 + return buyerId;
  74 + }
  75 +
  76 + public void setBuyerId(Long buyerId) {
  77 + this.buyerId = buyerId;
  78 + }
  79 +
  80 + public OrderDeliveryType getDeliveryType() {
  81 + return deliveryType;
  82 + }
  83 +
  84 + public void setDeliveryType(OrderDeliveryType deliveryType) {
  85 + this.deliveryType = deliveryType;
  86 + }
  87 +
  88 + public OrderStatus getOrderStatus() {
  89 + return orderStatus;
  90 + }
  91 +
  92 + public void setOrderStatus(OrderStatus orderStatus) {
  93 + this.orderStatus = orderStatus;
  94 + }
  95 +
  96 + public PayStatus getPayStatus() {
  97 + return payStatus;
  98 + }
  99 +
  100 + public void setPayStatus(PayStatus payStatus) {
  101 + this.payStatus = payStatus;
  102 + }
  103 +
  104 + public String getBuyerMemo() {
  105 + return buyerMemo;
  106 + }
  107 +
  108 + public void setBuyerMemo(String buyerMemo) {
  109 + this.buyerMemo = buyerMemo;
  110 + }
  111 +
  112 + public Date getPayTime() {
  113 + return payTime;
  114 + }
  115 +
  116 + public void setPayTime(Date payTime) {
  117 + this.payTime = payTime;
  118 + }
  119 +
  120 + public Date getDeliveryTime() {
  121 + return deliveryTime;
  122 + }
  123 +
  124 + public void setDeliveryTime(Date deliveryTime) {
  125 + this.deliveryTime = deliveryTime;
  126 + }
  127 +
  128 + public Date getReservationTime() {
  129 + return reservationTime;
  130 + }
  131 +
  132 + public void setReservationTime(Date reservationTime) {
  133 + this.reservationTime = reservationTime;
  134 + }
  135 +
  136 + public Date getBuyerConfirmTime() {
  137 + return buyerConfirmTime;
  138 + }
  139 +
  140 + public void setBuyerConfirmTime(Date buyerConfirmTime) {
  141 + this.buyerConfirmTime = buyerConfirmTime;
  142 + }
  143 +
  144 + public Date getSubmitTime() {
  145 + return submitTime;
  146 + }
  147 +
  148 + public void setSubmitTime(Date submitTime) {
  149 + this.submitTime = submitTime;
  150 + }
  151 +
  152 + public PayType getPayType() {
  153 + return payType;
  154 + }
  155 +
  156 + public void setPayType(PayType payType) {
  157 + this.payType = payType;
  158 + }
  159 +
  160 + public Long getTotalPrice() {
  161 + return totalPrice;
  162 + }
  163 +
  164 + public void setTotalPrice(Long totalPrice) {
  165 + this.totalPrice = totalPrice;
  166 + }
  167 +
  168 + public String getStatusInReason() {
  169 + return statusInReason;
  170 + }
  171 +
  172 + public void setStatusInReason(String statusInReason) {
  173 + this.statusInReason = statusInReason;
  174 + }
  175 +
  176 + public List<OrderItemResponseDto> getOrderItems() {
  177 + return orderItems;
  178 + }
  179 +
  180 + public void setOrderItems(List<OrderItemResponseDto> orderItems) {
  181 + this.orderItems = orderItems;
  182 + }
  183 +}
b2c-orders-client/src/main/java/com/b2c/orders/enums/PayType.java
@@ -2,7 +2,6 @@ package com.b2c.orders.enums; @@ -2,7 +2,6 @@ package com.b2c.orders.enums;
2 2
3 import java.util.Map; 3 import java.util.Map;
4 4
5 -import com.fasterxml.jackson.annotation.JsonValue;  
6 import com.google.common.collect.Maps; 5 import com.google.common.collect.Maps;
7 6
8 /** 7 /**
@@ -46,7 +45,6 @@ public enum PayType { @@ -46,7 +45,6 @@ public enum PayType {
46 this.index = index; 45 this.index = index;
47 } 46 }
48 47
49 - @JsonValue  
50 public String getValue() { 48 public String getValue() {
51 return value; 49 return value;
52 } 50 }
b2c-orders-commons/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-commons/pom.xml
@@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-commons</artifactId> 9 + <artifactId>b2c-orders-commons</artifactId>
10 10
11 <dependencies> 11 <dependencies>
12 <dependency> 12 <dependency>
b2c-orders-dao/.gitignore deleted 100644 → 0
1 -/target/  
b2c-orders-dao/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-dao/pom.xml
@@ -3,20 +3,41 @@ @@ -3,20 +3,41 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-dao</artifactId> 9 + <artifactId>b2c-orders-dao</artifactId>
  10 +
10 <dependencies> 11 <dependencies>
11 <dependency> 12 <dependency>
12 <groupId>${project.groupId}</groupId> 13 <groupId>${project.groupId}</groupId>
13 - <artifactId>orders-domain</artifactId> 14 + <artifactId>b2c-orders-domain</artifactId>
14 <version>${project.version}</version> 15 <version>${project.version}</version>
15 </dependency> 16 </dependency>
16 <dependency> 17 <dependency>
  18 + <groupId>com.b2c.website</groupId>
  19 + <artifactId>diligrp-website-util</artifactId>
  20 + <exclusions>
  21 + <exclusion>
  22 + <groupId>velocity</groupId>
  23 + <artifactId>velocity-dep</artifactId>
  24 + </exclusion>
  25 + <exclusion>
  26 + <groupId>org.apache.hbase</groupId>
  27 + <artifactId>hbase-client</artifactId>
  28 + </exclusion>
  29 + </exclusions>
  30 + </dependency>
  31 + <dependency>
  32 + <groupId>org.springframework</groupId>
  33 + <artifactId>spring-jdbc</artifactId>
  34 + </dependency>
  35 + <dependency>
17 <groupId>org.mariadb.jdbc</groupId> 36 <groupId>org.mariadb.jdbc</groupId>
18 <artifactId>mariadb-java-client</artifactId> 37 <artifactId>mariadb-java-client</artifactId>
19 </dependency> 38 </dependency>
  39 + <!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId>
  40 + </dependency> -->
20 <dependency> 41 <dependency>
21 <groupId>org.mybatis</groupId> 42 <groupId>org.mybatis</groupId>
22 <artifactId>mybatis</artifactId> 43 <artifactId>mybatis</artifactId>
@@ -29,23 +50,5 @@ @@ -29,23 +50,5 @@
29 <groupId>com.alibaba</groupId> 50 <groupId>com.alibaba</groupId>
30 <artifactId>druid</artifactId> 51 <artifactId>druid</artifactId>
31 </dependency> 52 </dependency>
32 - <dependency>  
33 - <groupId>org.springframework</groupId>  
34 - <artifactId>spring-jdbc</artifactId>  
35 - </dependency>  
36 - <dependency>  
37 - <groupId>com.b2c.website</groupId>  
38 - <artifactId>diligrp-website-util</artifactId>  
39 - <exclusions>  
40 - <exclusion>  
41 - <groupId>velocity</groupId>  
42 - <artifactId>velocity-dep</artifactId>  
43 - </exclusion>  
44 - <exclusion>  
45 - <groupId>org.apache.hbase</groupId>  
46 - <artifactId>hbase-client</artifactId>  
47 - </exclusion>  
48 - </exclusions>  
49 - </dependency>  
50 </dependencies> 53 </dependencies>
51 </project> 54 </project>
52 \ No newline at end of file 55 \ No newline at end of file
b2c-orders-dao/src/main/java/com/b2c/orders/dao/BaseDao.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.dao;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * dao基类<实体,主键>
  12 + * @author dev-center
  13 + * @since 2014-05-15
  14 + * @param <T> 实体
  15 + * @param <KEY> 主键
  16 + */
  17 +public interface BaseDao<T,KEY extends Serializable> {
  18 +
  19 + /**
  20 + * 添加对象
  21 + * @param t
  22 + * @return 影响条数
  23 + */
  24 + @SuppressWarnings("unchecked")
  25 + int insertEntry(T...t);
  26 +
  27 +// /**
  28 +// * 添加对象并设置ID到对象上(需开启事务)
  29 +// * @param t
  30 +// * @return 影响条数
  31 +// */
  32 +// int insertEntryCreateId(T t);
  33 +
  34 + /**
  35 + * 删除对象,主键
  36 + * @param key
  37 + * @return 影响条数
  38 + */
  39 + @SuppressWarnings("unchecked")
  40 + int deleteByKey(KEY...key);
  41 +
  42 + /**
  43 + * 删除对象,条件
  44 + * @param condtion
  45 + * @return 影响条数
  46 + */
  47 + int deleteByKey(T condtion);
  48 +
  49 + /**
  50 + * 更新对象,条件主键ID
  51 + * @param t
  52 + * @return 影响条数
  53 + */
  54 + int updateByKey(T t);
  55 +
  56 + /**
  57 + * 查询对象,条件主键
  58 + * @param key
  59 + * @return
  60 + */
  61 + T selectEntry(KEY key);
  62 +
  63 + /**
  64 + * 查询对象,条件主键数组
  65 + * @param key
  66 + * @return
  67 + */
  68 + @SuppressWarnings("unchecked")
  69 + List<T> selectEntryList(KEY...key);
  70 +
  71 + /**
  72 + * 查询对象,只要不为NULL与空则为条件
  73 + * @param t
  74 + * @return
  75 + */
  76 + List<T> selectEntryList(T t);
  77 +
  78 + /**
  79 + * 查询对象总数
  80 + * @param t
  81 + * @return
  82 + */
  83 + Integer selectEntryListCount(T t);
  84 +
  85 + /**
  86 + * 批量更新
  87 + * @param t
  88 + * @return
  89 + */
  90 + int updateBatch(List<T> t);
  91 +
  92 + /**
  93 + * 批量更新
  94 + * @param t
  95 + * @return
  96 + */
  97 + @SuppressWarnings("unchecked")
  98 + int updateBatch(T ... t);
  99 +
  100 +
  101 + /**
  102 + * 批量插入
  103 + * @param t
  104 + * @return
  105 + */
  106 + int insertBatch(List<T> t);
  107 +
  108 + /**
  109 + * 批量插入
  110 + * @param t
  111 + * @return
  112 + */
  113 + @SuppressWarnings("unchecked")
  114 + int insertBatch(T ... t);
  115 +}
b2c-orders-dao/src/main/java/com/b2c/orders/dao/MyBatisSupport.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.dao;
  6 +
  7 +import java.util.List;
  8 +import java.util.Map;
  9 +
  10 +import javax.annotation.Resource;
  11 +
  12 +import org.apache.ibatis.session.SqlSession;
  13 +import org.mybatis.spring.SqlSessionTemplate;
  14 +import org.slf4j.Logger;
  15 +import org.slf4j.LoggerFactory;
  16 +
  17 +import com.b2c.orders.commons.exceptions.ApplicationException;
  18 +
  19 +/**
  20 + * 对mybatis的支持<br/>
  21 + * spring配置文件需定义sqlTemplate与batchSqlTemplate
  22 + *
  23 + * @author dev-center
  24 + * @since 2014-05-15
  25 + */
  26 +public abstract class MyBatisSupport {
  27 + protected static final Logger LOGGER = LoggerFactory.getLogger(MyBatisSupport.class);
  28 + @Resource
  29 + private SqlSessionTemplate sqlTemplate;
  30 + @Resource
  31 + private SqlSessionTemplate batchSqlTemplate;
  32 +
  33 + /**
  34 + * SqlSessionTemplate
  35 + *
  36 + * @param batch
  37 + * 是否批处理
  38 + * @param readonly
  39 + * 是否只读
  40 + * @return
  41 + */
  42 + protected SqlSessionTemplate getSqlTemplate(boolean batch, boolean readonly) {
  43 +
  44 + if (readonly) {
  45 + }
  46 +
  47 + if (batch) {
  48 + return batchSqlTemplate;
  49 + }
  50 + return sqlTemplate;
  51 + }
  52 +
  53 + /**
  54 + * 新增对象
  55 + *
  56 + * @param statement
  57 + * @param parameter
  58 + * @return
  59 + */
  60 + protected int insert(String statement, Object parameter) {
  61 + int res = 0;
  62 + try {
  63 + if (parameter != null) {
  64 + res = getSqlTemplate(false, false).insert(statement, parameter);
  65 + }
  66 + } catch (Exception ex) {
  67 + throw new RuntimeException(ex);
  68 + }
  69 + return res;
  70 + }
  71 +
  72 + /**
  73 + * 删除对象
  74 + *
  75 + * @param statement
  76 + * @param parameter
  77 + * @return
  78 + */
  79 + protected int delete(String statement, Object parameter) {
  80 + int res = 0;
  81 + try {
  82 + res = getSqlTemplate(false, false).delete(statement, parameter);
  83 + } catch (Exception ex) {
  84 + throw new RuntimeException(ex);
  85 + }
  86 + return res;
  87 + }
  88 +
  89 + /**
  90 + * 更新对象
  91 + *
  92 + * @param statement
  93 + * @param parameter
  94 + * @return
  95 + */
  96 + protected int update(String statement, Object parameter) {
  97 + int res = 0;
  98 + try {
  99 + if (parameter != null) {
  100 + res = getSqlTemplate(false, false).update(statement, parameter);
  101 + }
  102 + } catch (Exception ex) {
  103 + throw new RuntimeException(ex);
  104 + }
  105 + return res;
  106 + }
  107 +
  108 + /**
  109 + * 批量更新对象
  110 + *
  111 + * @param statement
  112 + * @param list
  113 + * @return
  114 + */
  115 + @SuppressWarnings("rawtypes")
  116 + protected int updateBatch(String statement, List parameterList) {
  117 + int res = 0;
  118 + SqlSession session = null;
  119 + try {
  120 + if (parameterList != null && parameterList.size() > 0) {
  121 + session = getSqlTemplate(true, false).getSqlSessionFactory().openSession();
  122 + for (int i = 0; i < parameterList.size(); i++) {
  123 + int row = session.update(statement, parameterList.get(i));
  124 + res += row;
  125 + }
  126 + session.flushStatements();
  127 + session.commit();
  128 + }
  129 + } catch (Exception ex) {
  130 + // 回滚由外层服务决定
  131 + throw new RuntimeException(ex);
  132 + } finally {
  133 + if (session != null) {
  134 + session.close();
  135 + }
  136 + }
  137 + return res;
  138 + }
  139 +
  140 + /**
  141 + * 批量更新对象
  142 + *
  143 + * @param statement
  144 + * @param list
  145 + * @return
  146 + */
  147 + protected int updateBatch(String statement, Object... parameterArray) {
  148 + int res = 0;
  149 + SqlSession session = null;
  150 + try {
  151 + if (parameterArray != null && parameterArray.length > 0) {
  152 + session = getSqlTemplate(true, false).getSqlSessionFactory().openSession();
  153 + for (int i = 0; i < parameterArray.length; i++) {
  154 + int row = session.update(statement, parameterArray[i]);
  155 + res += row;
  156 + }
  157 + session.flushStatements();
  158 + session.commit();
  159 + }
  160 + } catch (Exception ex) {
  161 + // 回滚由外层服务决定
  162 + throw new RuntimeException(ex);
  163 + } finally {
  164 + if (session != null) {
  165 + session.close();
  166 + }
  167 + }
  168 + return res;
  169 + }
  170 +
  171 + /**
  172 + *
  173 + * 批量插入对象
  174 + *
  175 + * @param statement
  176 + * @param parameterList
  177 + * @return
  178 + */
  179 + @SuppressWarnings("rawtypes")
  180 + protected int insertBatch(String statement, List parameterList) {
  181 + int res = 0;
  182 + SqlSession session = null;
  183 + try {
  184 + if (parameterList != null && parameterList.size() > 0) {
  185 + session = getSqlTemplate(true, false).getSqlSessionFactory().openSession();
  186 + for (int i = 0; i < parameterList.size(); i++) {
  187 + int row = session.insert(statement, parameterList.get(i));
  188 + res += row;
  189 + }
  190 + session.flushStatements();
  191 + session.commit();
  192 + }
  193 + } catch (Exception ex) {
  194 + // 回滚由外层服务决定
  195 + throw new RuntimeException(ex);
  196 + } finally {
  197 + if (session != null) {
  198 + session.close();
  199 + }
  200 + }
  201 + return res;
  202 + }
  203 +
  204 + /**
  205 + * 批量更新对象
  206 + *
  207 + * @param statement
  208 + * @param list
  209 + * @return
  210 + */
  211 + protected int insertBatch(String statement, Object... parameterArray) {
  212 + int res = 0;
  213 + SqlSession session = null;
  214 + try {
  215 + if (parameterArray != null && parameterArray.length > 0) {
  216 + session = getSqlTemplate(true, false).getSqlSessionFactory().openSession();
  217 + for (int i = 0; i < parameterArray.length; i++) {
  218 + int row = session.insert(statement, parameterArray[i]);
  219 + res += row;
  220 + }
  221 + session.flushStatements();
  222 + session.commit();
  223 + }
  224 + } catch (Exception ex) {
  225 + // 回滚由外层服务决定
  226 + throw new RuntimeException(ex);
  227 + } finally {
  228 + if (session != null) {
  229 + session.close();
  230 + }
  231 + }
  232 + return res;
  233 + }
  234 +
  235 + /**
  236 + * 查询一条记录
  237 + *
  238 + * @param <T>
  239 + * @param statement
  240 + * @param parameter
  241 + * @param clz
  242 + * @return
  243 + */
  244 + @SuppressWarnings("unchecked")
  245 + protected <T> T select(String statement, Object parameter) {
  246 + T obj = null;
  247 + try {
  248 + obj = (T) getSqlTemplate(false, true).selectOne(statement, parameter);
  249 + } catch (Exception ex) {
  250 + throw new RuntimeException(ex);
  251 + }
  252 + return obj;
  253 + }
  254 +
  255 + /**
  256 + * 查询列表
  257 + *
  258 + * @param <T>
  259 + * @param statement
  260 + * @param parameter
  261 + * @param clz
  262 + * @return
  263 + */
  264 + protected <T> List<T> selectList(String statement, Object parameter) {
  265 + List<T> list = null;
  266 + try {
  267 + list = getSqlTemplate(false, true).selectList(statement, parameter);
  268 + } catch (Exception ex) {
  269 + throw new RuntimeException(ex);
  270 + }
  271 + return list;
  272 + }
  273 +
  274 + /**
  275 + * 查询Map
  276 + *
  277 + * @param <K>
  278 + * @param <V>
  279 + * @param statement
  280 + * @param parameter
  281 + * @param mapKey
  282 + * @return
  283 + */
  284 + protected <K, V> Map<K, V> selectMap(String statement, Object parameter, String mapKey) {
  285 + Map<K, V> map = null;
  286 + try {
  287 + map = getSqlTemplate(false, true).selectMap(statement, parameter, mapKey);
  288 + } catch (Exception ex) {
  289 + throw new RuntimeException(ex);
  290 + }
  291 + return map;
  292 + }
  293 +}
b2c-orders-dao/src/main/java/com/b2c/orders/dao/OrderMaxidDao.java
@@ -7,7 +7,6 @@ package com.b2c.orders.dao; @@ -7,7 +7,6 @@ package com.b2c.orders.dao;
7 import java.util.concurrent.atomic.AtomicLong; 7 import java.util.concurrent.atomic.AtomicLong;
8 8
9 import com.b2c.orders.domain.OrderMaxid; 9 import com.b2c.orders.domain.OrderMaxid;
10 -import com.diligrp.website.util.dao.IBaseDao;  
11 10
12 /** 11 /**
13 * OrderMaxidDao 接口 12 * OrderMaxidDao 接口
@@ -15,7 +14,7 @@ import com.diligrp.website.util.dao.IBaseDao; @@ -15,7 +14,7 @@ import com.diligrp.website.util.dao.IBaseDao;
15 * @author dev-center 14 * @author dev-center
16 * @since 2014-05-19 15 * @since 2014-05-19
17 */ 16 */
18 -public interface OrderMaxidDao extends IBaseDao<OrderMaxid> { 17 +public interface OrderMaxidDao extends BaseDao<OrderMaxid, Long> {
19 // 自定义扩展 18 // 自定义扩展
20 public OrderMaxid getOrderMaxIdByIdType(String idType); 19 public OrderMaxid getOrderMaxIdByIdType(String idType);
21 20
b2c-orders-dao/src/main/java/com/b2c/orders/dao/impl/BaseDaoImpl.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.dao.impl;
  6 +
  7 +import java.io.Serializable;
  8 +import java.util.List;
  9 +
  10 +import com.b2c.orders.dao.BaseDao;
  11 +import com.b2c.orders.dao.MyBatisSupport;
  12 +
  13 +/**
  14 + * dao实现类
  15 + * @author dev-center
  16 + * @since 2014-05-15
  17 + * @param <T> 实体
  18 + * @param <KEY> 主键
  19 + */
  20 +public abstract class BaseDaoImpl<T, KEY extends Serializable> extends MyBatisSupport implements BaseDao<T, KEY> {
  21 + private static final String DEFAULT_INSERT_KEY = "insertEntry";
  22 + //private static final String DEFAULT_INSERT_LAST_SEQUENCE_KEY = "lastSequence";
  23 + private static final String DEFAULT_DELETE_ARRAY_KEY = "deleteByArrayKey";
  24 + private static final String DEFAULT_DELETE_CONDTION = "deleteByCondtion";
  25 + private static final String DEFAULT_UPDATE_KEY = "updateByKey";
  26 + private static final String DEFAULT_SELECT_ARRAY_KEY = "selectEntryArray";
  27 + private static final String DEFAULT_SELECT_CONDTION = "selectEntryList";
  28 + private static final String DEFAULT_SELECT_CONDTION_COUNT = "selectEntryListCount";
  29 +
  30 + /**
  31 + * 获取命名空前前缀
  32 + * @param statement
  33 + * @return
  34 + */
  35 + public abstract String getNameSpace(String statement);
  36 +
  37 + @SuppressWarnings("unchecked")
  38 + public int insertEntry(T...t){
  39 + int result = 0;
  40 + if (t == null || t.length <= 0) {return result;}
  41 + for (T o : t) {
  42 + if(o != null) {
  43 + result += this.insert(getNameSpace(DEFAULT_INSERT_KEY), o);
  44 + }
  45 + }
  46 + return result;
  47 + }
  48 +
  49 +// public int insertEntryCreateId(T t) {
  50 +// @SuppressWarnings("unchecked")
  51 +// int result = this.insertEntry(t);
  52 +// if (result > 0) {
  53 +// Integer id = (Integer)select(getNameSpace(DEFAULT_INSERT_LAST_SEQUENCE_KEY),null);
  54 +// if (id != null && id >0) {
  55 +// try {
  56 +// Class<?> clz = t.getClass();
  57 +// clz.getMethod("setId", Long.class).invoke(t, id.longValue());//最后一次插入编号
  58 +// } catch (Exception e) {
  59 +// throw new AppException("设置新增主键失败", e);
  60 +// }
  61 +// }
  62 +// }
  63 +// return result;
  64 +// }
  65 +
  66 + @SuppressWarnings("unchecked")
  67 + public int deleteByKey(KEY...key) {
  68 + return this.delete(getNameSpace(DEFAULT_DELETE_ARRAY_KEY), key);
  69 + }
  70 +
  71 + public int deleteByKey(T t) {
  72 + return this.delete(getNameSpace(DEFAULT_DELETE_CONDTION), t);
  73 + }
  74 +
  75 + public int updateByKey(T t) {
  76 + return this.update(getNameSpace(DEFAULT_UPDATE_KEY), t);
  77 + }
  78 +
  79 + public int updateBatch(List<T> t) {
  80 + return this.updateBatch(getNameSpace(DEFAULT_UPDATE_KEY),t);
  81 + }
  82 +
  83 +
  84 + @SuppressWarnings("unchecked")
  85 + public int updateBatch(T ... t) {
  86 + return this.updateBatch(getNameSpace(DEFAULT_UPDATE_KEY), t);
  87 + }
  88 +
  89 + public int insertBatch(List<T> t) {
  90 + return this.insertBatch(getNameSpace(DEFAULT_INSERT_KEY),t);
  91 + }
  92 +
  93 + @SuppressWarnings("unchecked")
  94 + public int insertBatch(T ... t) {
  95 + return this.insertBatch(getNameSpace(DEFAULT_INSERT_KEY),t);
  96 + }
  97 +
  98 + public T selectEntry(KEY key) {
  99 + @SuppressWarnings("unchecked")
  100 + List<T> list = this.selectEntryList(key);
  101 + if(list != null && list.size() > 0) {
  102 + return list.get(0);
  103 + }
  104 + return null;
  105 + }
  106 +
  107 + @SuppressWarnings("unchecked")
  108 + public List<T> selectEntryList(KEY...key) {
  109 + if (key == null || key.length <= 0) {return null;}
  110 + return this.selectList(getNameSpace(DEFAULT_SELECT_ARRAY_KEY), key);
  111 + }
  112 +
  113 + public List<T> selectEntryList(T t) {
  114 + return this.selectList(getNameSpace(DEFAULT_SELECT_CONDTION), t);
  115 + }
  116 +
  117 + public Integer selectEntryListCount(T t) {
  118 + return this.select(getNameSpace(DEFAULT_SELECT_CONDTION_COUNT), t);
  119 + }
  120 +}
b2c-orders-dao/src/main/java/com/b2c/orders/dao/OrderDaoBean.java renamed to b2c-orders-dao/src/main/java/com/b2c/orders/dao/impl/OrderDaoBean.java
1 -package com.b2c.orders.dao; 1 +package com.b2c.orders.dao.impl;
2 2
3 import org.springframework.stereotype.Repository; 3 import org.springframework.stereotype.Repository;
4 4
  5 +import com.b2c.orders.dao.OrderDao;
5 import com.b2c.orders.domain.Order; 6 import com.b2c.orders.domain.Order;
6 import com.diligrp.website.util.dao.impl.BaseDaoImpl; 7 import com.diligrp.website.util.dao.impl.BaseDaoImpl;
7 8
b2c-orders-dao/src/main/java/com/b2c/orders/dao/impl/OrderMaxIdDaoBean.java 0 → 100644
  1 +package com.b2c.orders.dao.impl;
  2 +
  3 +import java.util.List;
  4 +
  5 +import org.springframework.stereotype.Repository;
  6 +import org.springframework.transaction.annotation.Propagation;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +
  9 +import com.b2c.orders.dao.OrderMaxidDao;
  10 +import com.b2c.orders.domain.OrderMaxid;
  11 +
  12 +@Repository
  13 +public class OrderMaxIdDaoBean extends BaseDaoImpl<OrderMaxid, Long> implements OrderMaxidDao {
  14 +
  15 + private final static String NAMESPACE = "com.b2c.orders.dao.OrderMaxidDao.";
  16 +
  17 + // 返回本DAO命名空间,并添加statement
  18 + public String getNameSpace(String statement) {
  19 + return NAMESPACE + statement;
  20 + }
  21 +
  22 + @Override
  23 + public OrderMaxid getOrderMaxIdByIdType(String idType) {
  24 + OrderMaxid orderMaxid = new OrderMaxid();
  25 + orderMaxid.setIdType(idType);
  26 + List<OrderMaxid> list = this.selectEntryList(orderMaxid);
  27 + if (list == null || list.isEmpty()) {
  28 + return null;
  29 + }
  30 + if (list.size() > 1) {
  31 + StringBuilder sb = new StringBuilder();
  32 + sb.append("重复的id生成类型");
  33 + sb.append(idType);
  34 + sb.append(",无法确定使用哪一个");
  35 + throw new RuntimeException(sb.toString());
  36 + }
  37 + return list.get(0);
  38 + }
  39 +
  40 + @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
  41 + public SequenceNo getSeqNoByNewTransactional(SequenceNo idSequence, String seqIdKey, Long startSeq) {
  42 + OrderMaxid orderMaxid = this.getOrderMaxIdByIdType(seqIdKey);
  43 + if (startSeq != null && startSeq > orderMaxid.getIdValue()) {// orderMaxid.getIdValue()
  44 + idSequence.setStartSeq(startSeq);
  45 + } else {
  46 + idSequence.setStartSeq(orderMaxid.getIdValue());
  47 + }
  48 + idSequence.setFinishSeq(idSequence.getStartSeq() + idSequence.getStep());
  49 + orderMaxid.setIdValue(idSequence.getFinishSeq());
  50 + Integer result = this.updateByKey(orderMaxid);
  51 + // 当更新失败后,返回空,外层进行重试
  52 + if (null == result || result < 1) {
  53 + return null;
  54 + }
  55 + return idSequence;
  56 + }
  57 +}
b2c-orders-dao/src/main/resources/spring-dao.xml
@@ -10,9 +10,9 @@ @@ -10,9 +10,9 @@
10 http://www.springframework.org/schema/aop/spring-aop.xsd" 10 http://www.springframework.org/schema/aop/spring-aop.xsd"
11 default-autowire="byName"> 11 default-autowire="byName">
12 12
13 - <context:component-scan base-package="com.diligrp.orders.dao" /> 13 + <context:component-scan base-package="com.b2c.orders.dao" />
14 14
15 - <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" 15 + <bean id="masterDataSource" class="com.alibaba.druid.pool.DruidDataSource"
16 init-method="init" destroy-method="close"> 16 init-method="init" destroy-method="close">
17 <property name="driverClassName" value="${jdbc.driverClass}" /> 17 <property name="driverClassName" value="${jdbc.driverClass}" />
18 <property name="url" value="${jdbc.jdbcUrl}" /> 18 <property name="url" value="${jdbc.jdbcUrl}" />
@@ -52,17 +52,16 @@ @@ -52,17 +52,16 @@
52 <!-- 配置事务管理器 --> 52 <!-- 配置事务管理器 -->
53 <bean id="transactionManager" 53 <bean id="transactionManager"
54 class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> 54 class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
55 - <property name="dataSource" ref="dataSource" /> 55 + <property name="dataSource" ref="masterDataSource" />
56 </bean> 56 </bean>
57 57
58 <!-- 集成Mybatis --> 58 <!-- 集成Mybatis -->
59 - <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">  
60 - <property name="configLocation" value="classpath:/mybatis/sqlmap-config.xml"></property>  
61 - <property name="dataSource" ref="dataSource" /> 59 + <bean id="sessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
  60 + <property name="dataSource" ref="masterDataSource" />
  61 + <property name="configLocation" value="classpath:sqlmap-config.xml" />
62 </bean> 62 </bean>
63 -  
64 - <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">  
65 - <constructor-arg index="0" ref="sqlSessionFactory" /> 63 + <bean id="sqlTemplate" class="org.mybatis.spring.SqlSessionTemplate">
  64 + <constructor-arg index="0" ref="sessionFactory" />
66 </bean> 65 </bean>
67 - 66 +
68 </beans> 67 </beans>
69 \ No newline at end of file 68 \ No newline at end of file
b2c-orders-dao/src/main/resources/sqlmap-config.xml
@@ -11,37 +11,28 @@ @@ -11,37 +11,28 @@
11 <setting name="useColumnLabel" value="true" /> 11 <setting name="useColumnLabel" value="true" />
12 <!-- 数据库超过25000秒仍未响应则超时 --> 12 <!-- 数据库超过25000秒仍未响应则超时 -->
13 <setting name="defaultStatementTimeout" value="25000" /> 13 <setting name="defaultStatementTimeout" value="25000" />
14 - <!-- <setting name="logImpl" value="STDOUT_LOGGING" /> --> 14 + <setting name="logImpl" value="STDOUT_LOGGING" />
15 </settings> 15 </settings>
16 16
17 <!-- 全局别名设置,在映射文件中只需写别名,而不必写出整个类路径 --> 17 <!-- 全局别名设置,在映射文件中只需写别名,而不必写出整个类路径 -->
18 <typeAliases> 18 <typeAliases>
19 -  
20 - 19 + <typeAlias type="com.b2c.orders.domain.OrderMaxid" alias="orderMaxid"/>
21 </typeAliases> 20 </typeAliases>
22 21
23 <typeHandlers> 22 <typeHandlers>
24 - <typeHandler  
25 - handler="com.diligrp.orders.dao.typehandler.OrderManStatusHandler"  
26 - javaType="com.diligrp.orders.common.enums.order.OrderManStatus" />  
27 - <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderPayTypeHandler"  
28 - javaType="com.diligrp.orders.publics.enums.PayType" />  
29 - <typeHandler handler="com.diligrp.orders.dao.typehandler.ReOrderStatusHandler"  
30 - javaType="com.diligrp.orders.publics.enums.ReOrderStatus" />  
31 - <typeHandler  
32 - handler="com.diligrp.orders.dao.typehandler.OrderPayStatusHandler"  
33 - javaType="com.diligrp.orders.publics.enums.PayStatus" />  
34 - <typeHandler  
35 - handler="com.diligrp.orders.dao.typehandler.OrderDeliveryTypeHandler"  
36 - javaType="com.diligrp.orders.publics.enums.OrderDeliveryType" /> 23 + <!-- <typeHandler handler="com.b2c.dtms.dao.typehandler.OrderManStatusHandler"
  24 + javaType="com.b2c.dtms.common.enums.order.OrderManStatus" />
  25 + <typeHandler handler="com.b2c.dtms.dao.typehandler.OrderPayTypeHandler"
  26 + javaType="com.b2c.dtms.publics.enums.PayType" />
  27 + <typeHandler handler="com.b2c.dtms.dao.typehandler.OrderPayStatusHandler"
  28 + javaType="com.b2c.dtms.publics.enums.PayStatus" />
  29 + <typeHandler handler="com.b2c.dtms.dao.typehandler.OrderDeliveryTypeHandler"
  30 + javaType="com.b2c.dtms.publics.enums.OrderDeliveryType" /> -->
37 </typeHandlers> 31 </typeHandlers>
38 32
39 <!-- 映射文件路径 --> 33 <!-- 映射文件路径 -->
40 <mappers> 34 <mappers>
41 - <mapper resource="sqlmap/OrderItem.xml" />  
42 - <mapper resource="sqlmap/Orders.xml" />  
43 <mapper resource="sqlmap/OrderMaxid.xml" /> 35 <mapper resource="sqlmap/OrderMaxid.xml" />
44 - <mapper resource="sqlmap/OrdersJob.xml" />  
45 </mappers> 36 </mappers>
46 37
47 38
b2c-orders-dao/src/main/resources/sqlmap/OrderItem.xml deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  
3 - "http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
4 -<mapper namespace="com.diligrp.orders.dao.OrderItemDao">  
5 -  
6 - <!-- order_item 所有查询列 -->  
7 - <sql id="QUERY_COLUMN_LIST">  
8 - <![CDATA[id,order_id AS orderId,product_id AS productId,buyer_id AS buyerId,seller_id AS sellerId,sale_type AS saleType,sku,sku_title AS skuTitle,sku_attributes AS skuAttributes,sku_num AS skuNum,sku_price AS skuPrice,sku_original_price AS skuOriginalPrice,create_time AS createTime,edit_time AS editTime,is_commented AS isCommented,version_num as versionNum,sku_picture as skuPicture,shop_id as shopId,price_unit as priceUnit]]>  
9 - </sql>  
10 -  
11 - <!-- order_item 查询列来源表-->  
12 - <sql id="QUERY_FROM_TABLE"><![CDATA[FROM order_item]]></sql>  
13 -  
14 - <!-- 全部条件(更多功能可以通过queryData扩展实现) -->  
15 - <sql id="QUERY_WHERE_CLAUSE">  
16 - <where>  
17 - <if test="id != null and id != ''"><![CDATA[AND id = #{id}]]></if>  
18 - <if test="orderId != null and orderId != ''"><![CDATA[AND order_id = #{orderId}]]></if>  
19 - <if test="productId != null and productId != ''"><![CDATA[AND product_id = #{productId}]]></if>  
20 - <if test="sellerId != null and sellerId != ''"><![CDATA[AND seller_id = #{sellerId}]]></if>  
21 - <if test="buyerId != null and buyerId != ''"><![CDATA[AND buyer_id = #{buyerId}]]></if>  
22 - <if test="saleType != null and saleType != ''"><![CDATA[AND sale_type = #{saleType}]]></if>  
23 - <if test="sku != null and sku != ''"><![CDATA[AND sku = #{sku}]]></if>  
24 - <if test="skuTitle != null and skuTitle != ''"><![CDATA[AND sku_title = #{skuTitle}]]></if>  
25 - <if test="skuAttributes != null and skuAttributes != ''"><![CDATA[AND sku_attributes = #{skuAttributes}]]></if>  
26 - <if test="skuNum != null and skuNum != ''"><![CDATA[AND sku_num = #{skuNum}]]></if>  
27 - <if test="skuPrice != null and skuPrice != ''"><![CDATA[AND sku_price = #{skuPrice}]]></if>  
28 - <if test="skuOriginalPrice != null and skuOriginalPrice != ''"><![CDATA[AND sku_original_price = #{skuOriginalPrice}]]></if>  
29 - <if test="createTime != null and createTime != ''"><![CDATA[AND create_time = #{createTime}]]></if>  
30 - <if test="editTime != null and editTime != ''"><![CDATA[AND edit_time = #{editTime}]]></if>  
31 - <if test="(isCommented != null and isCommented != '') or isCommented==0"><![CDATA[AND is_commented = #{isCommented}]]></if>  
32 - <if test="skuPicture != null and skuPicture != ''"><![CDATA[AND sku_picture = #{skuPicture}]]></if>  
33 - <if test="shopId != null and shopId != ''"><![CDATA[AND shop_id = #{shopId}]]></if>  
34 - <if test="priceUnit != null and priceUnit != ''"><![CDATA[AND price_unit = #{price_unit}]]></if>  
35 - <if test="queryData != null">  
36 - <if test="queryData.orderIdSet!=null and queryData.orderIdSet.size()>0">  
37 - AND order_id in  
38 - <foreach collection="queryData.orderIdSet" index="index" item="orderId" open="(" separator="," close=")">  
39 - #{orderId}  
40 - </foreach>  
41 - </if>  
42 - </if>  
43 - </where>  
44 - </sql>  
45 -  
46 - <!-- 智能排序与分页 -->  
47 - <sql id="QUERY_ORDER_LIMIT_CONDTION">  
48 - <choose>  
49 - <when test="orderField != null and orderField != ''">  
50 - <choose>  
51 - <when test="orderFieldType != null and orderFieldType != ''">  
52 - <![CDATA[ORDER BY ${orderField} ${orderFieldType}]]>  
53 - </when>  
54 - <otherwise>  
55 - <![CDATA[ORDER BY ${orderField} desc]]>  
56 - </otherwise>  
57 - </choose>  
58 - </when>  
59 - <otherwise>  
60 - <![CDATA[ORDER BY id desc]]>  
61 - </otherwise>  
62 - </choose>  
63 - <if test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0"><![CDATA[LIMIT #{startIndex},#{pageSize}]]></if>  
64 - </sql>  
65 -  
66 - <!-- 更新列字段,只要不为NULL则更新,除开主键列 -->  
67 - <sql id="UPDATE_COLUMN_SET">  
68 - <set>  
69 - <if test="orderId != null"><![CDATA[order_id = #{orderId},]]></if>  
70 - <if test="productId != null"><![CDATA[product_id = #{productId},]]></if>  
71 - <if test="sellerId != null"><![CDATA[seller_id = #{sellerId},]]></if>  
72 - <if test="buyerId != null"><![CDATA[buyer_id = #{buyerId},]]></if>  
73 - <if test="saleType != null"><![CDATA[sale_type = #{saleType},]]></if>  
74 - <if test="sku != null"><![CDATA[sku = #{sku},]]></if>  
75 - <if test="skuTitle != null"><![CDATA[sku_title = #{skuTitle},]]></if>  
76 - <if test="skuAttributes != null"><![CDATA[sku_attributes = #{skuAttributes},]]></if>  
77 - <if test="skuNum != null"><![CDATA[sku_num = #{skuNum},]]></if>  
78 - <if test="skuPrice != null"><![CDATA[sku_price = #{skuPrice},]]></if>  
79 - <if test="skuOriginalPrice != null"><![CDATA[sku_original_price = #{skuOriginalPrice},]]></if>  
80 - <if test="isCommented != null"><![CDATA[is_commented = #{isCommented},]]></if>  
81 - <if test="versionNum != null"><![CDATA[version_num = #{versionNum}+1,]]></if>  
82 -<!-- <if test="createTime != null"><![CDATA[create_time = #{createTime},]]></if> -->  
83 - <![CDATA[edit_time = now(),]]><if test="editTime != null"></if>  
84 - <if test="skuPicture != null"><![CDATA[sku_picture = #{skuPicture},]]></if>  
85 - <if test="shopId != null"><![CDATA[shop_id = #{shopId},]]></if>  
86 - <if test="priceUnit != null"><![CDATA[price_unit = #{price_unit},]]></if>  
87 - </set>  
88 - </sql>  
89 -  
90 - <!-- 插入order_item记录 -->  
91 - <insert id="insertEntry" parameterType="orderItem" >  
92 - <![CDATA[  
93 - INSERT INTO order_item (id,order_id,product_id,buyer_id,seller_id,sale_type,sku,sku_title,sku_attributes,sku_num,sku_price,sku_original_price,create_time,edit_time,sku_picture,shop_id,price_unit)  
94 - VALUES (#{id},#{orderId},#{productId},#{buyerId},#{sellerId},#{saleType},#{sku},#{skuTitle},#{skuAttributes},#{skuNum},#{skuPrice},#{skuOriginalPrice},#{createTime},#{editTime},#{skuPicture},#{shopId},#{priceUnit})  
95 - ]]>  
96 - </insert>  
97 -  
98 - <!-- 返回插入的编号,在事务开启状态下有效 -->  
99 - <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select>  
100 -  
101 - <!-- 删除记录,主键IN(array) -->  
102 - <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array" >  
103 - <![CDATA[DELETE FROM order_item WHERE id IN]]>  
104 - <foreach collection="array" item="id" open="(" separator="," close=")">  
105 - <![CDATA[#{id}]]>  
106 - </foreach>  
107 - </delete>  
108 -  
109 - <!-- 删除,通过条件 -->  
110 - <update id="deleteByCondtion" parameterType="orderItem" >  
111 - <![CDATA[DELETE FROM order_item]]>  
112 - <include refid="QUERY_WHERE_CLAUSE"/>  
113 - </update>  
114 -  
115 - <!-- 修改记录通过主键 -->  
116 - <update id="updateByKey" parameterType="orderItem" >  
117 - <![CDATA[UPDATE order_item]]>  
118 - <include refid="UPDATE_COLUMN_SET"/>  
119 - <![CDATA[WHERE id = #{id}]]>  
120 - <if test="versionNum!= null "><![CDATA[AND version_NUM = #{versionNum}]]></if>  
121 - </update>  
122 - <!-- 通过订单ID更新订单项为已评论 -->  
123 - <update id="updatSkuCommentedByOrderId" parameterType="long" >  
124 - <![CDATA[UPDATE order_item SET is_commented=1 WHERE order_id = #{orderId} AND is_commented<>1 ]]>  
125 - </update>  
126 - <!-- 查询,通过主键IN(array) -->  
127 - <select id="selectEntryArray" parameterType="java.lang.reflect.Array" resultType="orderItem">  
128 - <![CDATA[SELECT]]>  
129 - <include refid="QUERY_COLUMN_LIST"/>  
130 - <include refid="QUERY_FROM_TABLE"/>  
131 - <![CDATA[WHERE id IN]]>  
132 - <foreach collection="array" item="id" open="(" separator="," close=")">  
133 - <![CDATA[#{id}]]>  
134 - </foreach>  
135 - </select>  
136 -  
137 - <!-- 查询,通过条件 -->  
138 - <select id="selectEntryList" parameterType="orderItem" resultType="orderItem">  
139 - <![CDATA[SELECT]]>  
140 - <include refid="QUERY_COLUMN_LIST"/>  
141 - <include refid="QUERY_FROM_TABLE"/>  
142 - <include refid="QUERY_WHERE_CLAUSE"/>  
143 - <include refid="QUERY_ORDER_LIMIT_CONDTION"/>  
144 - </select>  
145 - <!-- 总数查询,通过条件 -->  
146 - <select id="selectEntryListCount" parameterType="orderItem" resultType="int">  
147 - <![CDATA[SELECT COUNT(id) AS dataCount]]>  
148 - <include refid="QUERY_FROM_TABLE"/>  
149 - <include refid="QUERY_WHERE_CLAUSE"/>  
150 - </select>  
151 -  
152 - <!-- 其它SQL语句 -->  
153 - <select id="getSupplierItemSum" parameterType="map" resultType="Long">  
154 - select sum(s.assign_num) from supply_order s where ( s.assign_status=10 or s.assign_status=20) and s.order_item_id=#{orderItemId} and s.order_Id=#{orderId}  
155 - </select>  
156 -  
157 - <!-- 查询用户购买单个商品的数量 -->  
158 - <select id="getProductBuyNum" parameterType="orderItem" resultType="Integer">  
159 - SELECT COUNT(1) FROM order_item item  
160 - JOIN orders o ON o.id=item.order_id  
161 - WHERE o.buyer_id=#{buyerId}  
162 - AND item.product_id=#{productId}  
163 - AND o.order_status NOT IN(60,70)  
164 - </select>  
165 -</mapper>  
166 \ No newline at end of file 0 \ No newline at end of file
b2c-orders-dao/src/main/resources/sqlmap/OrderMaxid.xml
1 <?xml version="1.0" encoding="UTF-8" ?> 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
3 "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 3 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
4 -<mapper namespace="com.diligrp.orders.dao.OrderMaxidDao"> 4 +<mapper namespace="com.b2c.orders.dao.OrderMaxidDao">
5 5
6 <!-- order_maxid 所有查询列 --> 6 <!-- order_maxid 所有查询列 -->
7 <sql id="QUERY_COLUMN_LIST"> 7 <sql id="QUERY_COLUMN_LIST">
8 - <!-- [CDATA[id,id_type AS idType,id_value AS idValue,memo,version_num AS versionNum]]--> 8 + <!-- [CDATA[id,id_type AS idType,id_value AS idValue,memo,version_num AS
  9 + versionNum]] -->
9 <![CDATA[id,id_value AS idValue,version_num AS versionNum]]> 10 <![CDATA[id,id_value AS idValue,version_num AS versionNum]]>
10 </sql> 11 </sql>
11 12
12 - <!-- order_maxid 查询列来源表--> 13 + <!-- order_maxid 查询列来源表 -->
13 <sql id="QUERY_FROM_TABLE"><![CDATA[FROM order_maxid]]></sql> 14 <sql id="QUERY_FROM_TABLE"><![CDATA[FROM order_maxid]]></sql>
14 -  
15 - <!-- 全部条件(更多功能可以通过queryData扩展实现) --> 15 +
  16 + <!-- 全部条件(更多功能可以通过queryData扩展实现) -->
16 <sql id="QUERY_WHERE_CLAUSE"> 17 <sql id="QUERY_WHERE_CLAUSE">
17 <where> 18 <where>
18 <if test="id != null and id != ''"><![CDATA[AND id = #{id}]]></if> 19 <if test="id != null and id != ''"><![CDATA[AND id = #{id}]]></if>
@@ -22,25 +23,26 @@ @@ -22,25 +23,26 @@
22 <if test="versionNum != null and versionNum != ''"><![CDATA[AND version_num = #{versionNum}]]></if> 23 <if test="versionNum != null and versionNum != ''"><![CDATA[AND version_num = #{versionNum}]]></if>
23 </where> 24 </where>
24 </sql> 25 </sql>
25 - 26 +
26 <!-- 智能排序与分页 --> 27 <!-- 智能排序与分页 -->
27 <sql id="QUERY_ORDER_LIMIT_CONDTION"> 28 <sql id="QUERY_ORDER_LIMIT_CONDTION">
28 <choose> 29 <choose>
29 - <when test="orderField != null and orderField != ''">  
30 - <choose>  
31 - <when test="orderFieldType != null and orderFieldType != ''"> 30 + <when test="orderField != null and orderField != ''">
  31 + <choose>
  32 + <when test="orderFieldType != null and orderFieldType != ''">
32 <![CDATA[ORDER BY ${orderField} ${orderFieldType}]]> 33 <![CDATA[ORDER BY ${orderField} ${orderFieldType}]]>
33 - </when>  
34 - <otherwise> 34 + </when>
  35 + <otherwise>
35 <![CDATA[ORDER BY ${orderField} desc]]> 36 <![CDATA[ORDER BY ${orderField} desc]]>
36 - </otherwise>  
37 - </choose>  
38 - </when>  
39 - <otherwise> 37 + </otherwise>
  38 + </choose>
  39 + </when>
  40 + <otherwise>
40 <![CDATA[ORDER BY id desc]]> 41 <![CDATA[ORDER BY id desc]]>
41 - </otherwise> 42 + </otherwise>
42 </choose> 43 </choose>
43 - <if test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0"><![CDATA[LIMIT #{startIndex},#{pageSize}]]></if> 44 + <if
  45 + test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0"><![CDATA[LIMIT #{startIndex},#{pageSize}]]></if>
44 </sql> 46 </sql>
45 47
46 <!-- 更新列字段,只要不为NULL则更新,除开主键列 --> 48 <!-- 更新列字段,只要不为NULL则更新,除开主键列 -->
@@ -54,65 +56,70 @@ @@ -54,65 +56,70 @@
54 </sql> 56 </sql>
55 57
56 <!-- 插入order_maxid记录 --> 58 <!-- 插入order_maxid记录 -->
57 - <insert id="insertEntry" parameterType="orderMaxid" > 59 + <insert id="insertEntry" parameterType="com.b2c.orders.domain.OrderMaxid">
58 <![CDATA[ 60 <![CDATA[
59 INSERT INTO order_maxid (id,id_type,id_value,memo,version_num) 61 INSERT INTO order_maxid (id,id_type,id_value,memo,version_num)
60 VALUES (#{id},#{idType},#{idValue},#{memo},#{versionNum}) 62 VALUES (#{id},#{idType},#{idValue},#{memo},#{versionNum})
61 ]]> 63 ]]>
62 </insert> 64 </insert>
63 - 65 +
64 <!-- 返回插入的编号,在事务开启状态下有效 --> 66 <!-- 返回插入的编号,在事务开启状态下有效 -->
65 <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select> 67 <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select>
66 68
67 <!-- 删除记录,主键IN(array) --> 69 <!-- 删除记录,主键IN(array) -->
68 - <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array" > 70 + <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array">
69 <![CDATA[DELETE FROM order_maxid WHERE id IN]]> 71 <![CDATA[DELETE FROM order_maxid WHERE id IN]]>
70 - <foreach collection="array" item="id" open="(" separator="," close=")"> 72 + <foreach collection="array" item="id" open="(" separator=","
  73 + close=")">
71 <![CDATA[#{id}]]> 74 <![CDATA[#{id}]]>
72 </foreach> 75 </foreach>
73 </delete> 76 </delete>
74 77
75 <!-- 删除,通过条件 --> 78 <!-- 删除,通过条件 -->
76 - <update id="deleteByCondtion" parameterType="orderMaxid" > 79 + <update id="deleteByCondtion" parameterType="com.b2c.orders.domain.OrderMaxid">
77 <![CDATA[DELETE FROM order_maxid]]> 80 <![CDATA[DELETE FROM order_maxid]]>
78 - <include refid="QUERY_WHERE_CLAUSE"/> 81 + <include refid="QUERY_WHERE_CLAUSE" />
79 </update> 82 </update>
80 83
81 <!-- 修改记录通过主键 --> 84 <!-- 修改记录通过主键 -->
82 - <update id="updateByKey" parameterType="orderMaxid" > 85 + <update id="updateByKey" parameterType="com.b2c.orders.domain.OrderMaxid">
83 <![CDATA[UPDATE order_maxid]]> 86 <![CDATA[UPDATE order_maxid]]>
84 - <include refid="UPDATE_COLUMN_SET"/> 87 + <include refid="UPDATE_COLUMN_SET" />
85 <![CDATA[WHERE id = #{id} AND version_num = #{versionNum}]]> 88 <![CDATA[WHERE id = #{id} AND version_num = #{versionNum}]]>
86 </update> 89 </update>
87 90
88 <!-- 查询,通过主键IN(array) --> 91 <!-- 查询,通过主键IN(array) -->
89 - <select id="selectEntryArray" parameterType="java.lang.reflect.Array" resultType="orderMaxid"> 92 + <select id="selectEntryArray" parameterType="java.lang.reflect.Array"
  93 + resultType="com.b2c.orders.domain.OrderMaxid">
90 <![CDATA[SELECT]]> 94 <![CDATA[SELECT]]>
91 - <include refid="QUERY_COLUMN_LIST"/>  
92 - <include refid="QUERY_FROM_TABLE"/> 95 + <include refid="QUERY_COLUMN_LIST" />
  96 + <include refid="QUERY_FROM_TABLE" />
93 <![CDATA[WHERE id IN]]> 97 <![CDATA[WHERE id IN]]>
94 - <foreach collection="array" item="id" open="(" separator="," close=")"> 98 + <foreach collection="array" item="id" open="(" separator=","
  99 + close=")">
95 <![CDATA[#{id}]]> 100 <![CDATA[#{id}]]>
96 </foreach> 101 </foreach>
97 </select> 102 </select>
98 103
99 <!-- 查询,通过条件 --> 104 <!-- 查询,通过条件 -->
100 - <select id="selectEntryList" parameterType="orderMaxid" resultType="orderMaxid"> 105 + <select id="selectEntryList" parameterType="com.b2c.orders.domain.OrderMaxid"
  106 + resultType="com.b2c.orders.domain.OrderMaxid">
101 <![CDATA[SELECT]]> 107 <![CDATA[SELECT]]>
102 - <include refid="QUERY_COLUMN_LIST"/>  
103 - <include refid="QUERY_FROM_TABLE"/>  
104 - <include refid="QUERY_WHERE_CLAUSE"/>  
105 - <include refid="QUERY_ORDER_LIMIT_CONDTION"/> 108 + <include refid="QUERY_COLUMN_LIST" />
  109 + <include refid="QUERY_FROM_TABLE" />
  110 + <include refid="QUERY_WHERE_CLAUSE" />
  111 + <include refid="QUERY_ORDER_LIMIT_CONDTION" />
106 </select> 112 </select>
107 113
108 <!-- 总数查询,通过条件 --> 114 <!-- 总数查询,通过条件 -->
109 - <select id="selectEntryListCount" parameterType="orderMaxid" resultType="int"> 115 + <select id="selectEntryListCount" parameterType="com.b2c.orders.domain.OrderMaxid"
  116 + resultType="int">
110 <![CDATA[SELECT COUNT(id) AS dataCount]]> 117 <![CDATA[SELECT COUNT(id) AS dataCount]]>
111 - <include refid="QUERY_FROM_TABLE"/>  
112 - <include refid="QUERY_WHERE_CLAUSE"/> 118 + <include refid="QUERY_FROM_TABLE" />
  119 + <include refid="QUERY_WHERE_CLAUSE" />
113 </select> 120 </select>
114 - 121 +
115 <!-- 其它SQL语句 --> 122 <!-- 其它SQL语句 -->
116 -  
117 - 123 +
  124 +
118 </mapper> 125 </mapper>
119 \ No newline at end of file 126 \ No newline at end of file
b2c-orders-dao/src/main/resources/sqlmap/OrderReceiver.xml deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  
3 - "http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
4 -<mapper namespace="com.diligrp.orders.dao.OrderReceiverDao">  
5 -  
6 - <!-- order_receiver 所有查询列 -->  
7 - <sql id="QUERY_COLUMN_LIST">  
8 - <![CDATA[id,order_id AS orderId,receiver_name AS receiverName,receiver_phone AS receiverPhone,  
9 - receiver_idcard AS receiverIdcard,receiver_address AS receiverAddress,  
10 - real_receiver_name AS realReceiverName,real_receiver_phone AS realReceiverPhone,  
11 - real_receiver_idcard AS realReceiverIdcard,real_receiver_address AS realReceiverAddress,  
12 - create_time AS createTime,edit_time AS editTime  
13 - ]]>  
14 - </sql>  
15 -  
16 - <!-- order_ship_info 查询列来源表-->  
17 - <sql id="QUERY_FROM_TABLE"><![CDATA[FROM order_receiver]]></sql>  
18 -  
19 - <!-- 全部条件(更多功能可以通过queryData扩展实现) -->  
20 - <sql id="QUERY_WHERE_CLAUSE">  
21 - <where>  
22 - <if test="id != null and id != ''"><![CDATA[AND id = #{id}]]></if>  
23 - <if test="orderId != null and orderId != ''"><![CDATA[AND order_id = #{orderId}]]></if>  
24 - <if test="receiverName != null and receiverName != ''"><![CDATA[AND receiver_name = #{receiverName}]]></if>  
25 - <if test="receiverPhone != null and receiverPhone != ''"><![CDATA[AND receiver_phone = #{receiverPhone}]]></if>  
26 - <if test="queryData != null">  
27 - <if test="queryData.orderIdSet!=null and queryData.orderIdSet.size()>0">  
28 - AND order_id in  
29 - <foreach collection="queryData.orderIdSet" index="index" item="orderId" open="(" separator="," close=")">  
30 - #{orderId}  
31 - </foreach>  
32 - </if>  
33 - </if>  
34 - </where>  
35 - </sql>  
36 -  
37 - <!-- 智能排序与分页 -->  
38 - <sql id="QUERY_ORDER_LIMIT_CONDTION">  
39 - <if test="orderField != null and orderField != '' and orderFieldType != null and orderFieldType != ''"><![CDATA[ORDER BY ${orderField} ${orderFieldType}]]></if>  
40 - <if test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0"><![CDATA[LIMIT #{startIndex},#{pageSize}]]></if>  
41 - </sql>  
42 -  
43 - <!-- 更新列字段,只要不为NULL则更新,除开主键列 -->  
44 - <sql id="UPDATE_COLUMN_SET">  
45 - <set>  
46 - <if test="orderId != null"><![CDATA[order_id = #{orderId},]]></if>  
47 - <if test="receiverName != null"><![CDATA[receiver_name = #{receiverName},]]></if>  
48 - <if test="receiverPhone != null"><![CDATA[receiver_phone = #{receiverPhone},]]></if>  
49 - <if test="receiverIdcard != null"><![CDATA[receiver_idcard = #{receiverIdcard},]]></if>  
50 - <if test="receiverAddress != null"><![CDATA[receiver_address = #{receiverAddress},]]></if>  
51 - <if test="realReceiverName != null"><![CDATA[real_receiver_name = #{realReceiverName},]]></if>  
52 - <if test="realReceiverPhone != null"><![CDATA[real_receiver_phone = #{realReceiverPhone},]]></if>  
53 - <if test="realReceiverIdcard != null"><![CDATA[real_receiver_idcard = #{realReceiverIdcard},]]></if>  
54 - <if test="realReceiverAddress != null"><![CDATA[real_receiver_address = #{realReceiverAddress},]]></if>  
55 - <choose>  
56 - <when test="editTime != null">  
57 - <![CDATA[edit_time = #{editTime},]]>  
58 - </when>  
59 - <otherwise>  
60 - <![CDATA[a.edit_time = NOW(),]]>  
61 - </otherwise>  
62 - </choose>  
63 - </set>  
64 - </sql>  
65 -  
66 - <!-- 插入order_ship_info记录 -->  
67 - <insert id="insertEntry" parameterType="orderReceiver" >  
68 - <![CDATA[  
69 - INSERT INTO order_receiver (order_id,receiver_name,receiver_phone,receiver_idcard,receiver_address,real_receiver_name,real_receiver_phone,real_receiver_idcard,real_receiver_address,create_time,edit_time)  
70 - VALUES (#{orderId},#{receiverName},#{receiverPhone},#{receiverIdcard},#{receiverAddress},#{realReceiverName},#{realReceiverPhone},#{realReceiverIdcard},#{realReceiverAddress},#{createTime},#{editTime})  
71 - ]]>  
72 - </insert>  
73 -  
74 - <!-- 返回插入的编号,在事务开启状态下有效 -->  
75 - <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select>  
76 -  
77 - <!-- 删除记录,主键IN(array) -->  
78 - <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array" >  
79 - <![CDATA[DELETE FROM order_receiver WHERE id IN]]>  
80 - <foreach collection="array" item="id" open="(" separator="," close=")">  
81 - <![CDATA[#{id}]]>  
82 - </foreach>  
83 - </delete>  
84 -  
85 - <!-- 删除,通过条件 -->  
86 - <update id="deleteByCondtion" parameterType="orderReceiver" >  
87 - <![CDATA[DELETE FROM order_receiver ]]>  
88 - <include refid="QUERY_WHERE_CLAUSE"/>  
89 - </update>  
90 -  
91 - <!-- 修改记录通过主键 -->  
92 - <update id="updateByKey" parameterType="orderReceiver" >  
93 - <![CDATA[UPDATE order_receiver ]]>  
94 - <include refid="UPDATE_COLUMN_SET"/>  
95 - <![CDATA[WHERE id = #{id}]]>  
96 - </update>  
97 -  
98 - <!-- 查询,通过主键IN(array) -->  
99 - <select id="selectEntryArray" parameterType="java.lang.reflect.Array" resultType="orderReceiver">  
100 - <![CDATA[SELECT]]>  
101 - <include refid="QUERY_COLUMN_LIST"/>  
102 - <include refid="QUERY_FROM_TABLE"/>  
103 - <![CDATA[WHERE id IN]]>  
104 - <foreach collection="array" item="id" open="(" separator="," close=")">  
105 - <![CDATA[#{id}]]>  
106 - </foreach>  
107 - </select>  
108 -  
109 - <!-- 查询,通过条件 -->  
110 - <select id="selectEntryList" parameterType="orderReceiver" resultType="orderReceiver">  
111 - <![CDATA[SELECT]]>  
112 - <include refid="QUERY_COLUMN_LIST"/>  
113 - <include refid="QUERY_FROM_TABLE"/>  
114 - <include refid="QUERY_WHERE_CLAUSE"/>  
115 - <include refid="QUERY_ORDER_LIMIT_CONDTION"/>  
116 - </select>  
117 -  
118 - <!-- 总数查询,通过条件 -->  
119 - <select id="selectEntryListCount" parameterType="orderReceiver" resultType="int">  
120 - <![CDATA[SELECT COUNT(id) AS dataCount]]>  
121 - <include refid="QUERY_FROM_TABLE"/>  
122 - <include refid="QUERY_WHERE_CLAUSE"/>  
123 - </select>  
124 -  
125 - <!-- 其它SQL语句 -->  
126 -  
127 -  
128 -</mapper>  
129 \ No newline at end of file 0 \ No newline at end of file
b2c-orders-dao/src/main/resources/sqlmap/Orders.xml deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  
3 - "http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
4 -<mapper namespace="com.diligrp.orders.dao.OrdersDao">  
5 - <!-- orders 所有查询列 -->  
6 - <sql id="QUERY_COLUMN_LIST">  
7 - <![CDATA[a.id,  
8 - a.parent_id AS parentId,  
9 - a.buyer_id AS buyerId,  
10 - a.buyer_name AS buyerName,  
11 - a.seller_id AS sellerId,  
12 - a.seller_name AS sellerName,  
13 - a.market_name AS marketName,  
14 - a.market_id AS marketId,  
15 - a.delivery_type AS deliveryType,  
16 - a.shiping_address AS shipingAddress,  
17 - a.order_type AS orderType,  
18 - a.order_status AS orderStatus,  
19 - a.pay_status AS payStatus,  
20 - a.buyer_memo AS buyerMemo,  
21 - a.order_status_in_time AS orderStatusInTime,  
22 - a.order_status_last_valid_time AS orderStatusLastValidTime,  
23 - a.pay_time AS payTime,  
24 - a.stocking_in_time AS stockingInTime,  
25 - a.stocking_complete_time AS stockingCompleteTime,  
26 - a.reservation_stime AS reservationStime,  
27 - a.reservation_ftime AS reservationFtime,  
28 - a.buyer_confirm_time AS buyerConfirmTime,  
29 - a.create_time AS createTime,  
30 - a.edit_time AS editTime,  
31 - a.invoice_type AS invoiceType,  
32 - a.invoice_title AS invoiceTitle,  
33 - a.invoice_content AS invoiceContent,  
34 - a.pay_type AS payType,  
35 - a.price_total AS priceTotal,  
36 - a.price_privilege AS pricePrivilege,  
37 - a.price_offset AS priceOffset,  
38 - a.price_paid AS pricePaid,  
39 - a.price_refund AS priceRefund,  
40 - a.price_postage AS pricePostage,  
41 - a.version_num AS versionNum,  
42 - a.is_delete AS isDelete,  
43 - a.shop_id AS shopId,  
44 - a.trade_no AS tradeNo,  
45 - a.shop_name AS shopName,  
46 - a.delivery_ver_code AS deliveryVerCode,  
47 - a.status_in_reason AS statusInReason,  
48 - a.is_commented AS isCommented,  
49 - a.price_total_original AS priceTotalOriginal,  
50 - a.price_postage_original AS pricePostageOriginal,  
51 - a.come_from AS comeFrom,  
52 - a.logistics_remarks as logisticsRemarks,  
53 - a.buyer_city_id as buyerCityId,  
54 - a.goods_weight goodsWeight,  
55 - a.seller_source as sellerSource,  
56 - a.print_flag AS printFlag,  
57 - a.warrant_type as warrantType,  
58 - a.market_delivery AS marketDelivery  
59 - ]]>  
60 - </sql>  
61 -  
62 - <!-- orders 查询列来源表-->  
63 - <sql id="QUERY_FROM_TABLE"><![CDATA[FROM orders a]]></sql>  
64 -  
65 - <!-- 全部条件(更多功能可以通过queryData扩展实现) -->  
66 - <sql id="QUERY_WHERE_CLAUSE">  
67 - where 1=1 AND a.is_delete = 0  
68 - <!--当id值为0时,此判断条件无法通过判断,不能生成a.id=0的查询条件,导致查询出错  
69 - <if test="id != null and id != ''"><![CDATA[AND a.id = #{id}]]></if>  
70 - -->  
71 - <choose>  
72 - <when test="id != null and id != ''">  
73 - <![CDATA[AND a.id = #{id}]]>  
74 - </when>  
75 - <otherwise>  
76 - <if test="queryData != null and queryData != ''">  
77 - <if test="queryData.orderIdList!=null and queryData.orderIdList.size()>0">  
78 - AND a.id in  
79 - <foreach collection="queryData.orderIdList" index="index" item="idList" open="(" separator="," close=")">  
80 - #{idList}  
81 - </foreach>  
82 - </if>  
83 - </if>  
84 - </otherwise>  
85 - </choose>  
86 - <if test="buyerId != null and buyerId != ''"><![CDATA[AND a.buyer_id = #{buyerId}]]></if>  
87 - <if test="sellerId != null and sellerId != ''"><![CDATA[AND a.seller_id = #{sellerId}]]></if>  
88 - <if test="buyerName != null and buyerName != ''"><![CDATA[AND a.buyer_name = #{buyerName}]]></if>  
89 - <if test="sellerName != null and sellerName != ''"><![CDATA[AND a.seller_name = #{sellerName}]]></if>  
90 - <if test="marketName != null and marketName != ''"><![CDATA[AND a.market_name = #{marketName}]]></if>  
91 - <if test="sellerSource != null and sellerSource != ''"><![CDATA[AND a.seller_source = #{sellerSource}]]></if>  
92 - <if test="printFlag != null "><![CDATA[AND a.print_flag = #{printFlag}]]></if>  
93 - <choose>  
94 - <when test="deliveryType != null and deliveryType != ''">  
95 - <![CDATA[AND a.delivery_type = #{deliveryType}]]>  
96 - </when>  
97 - <otherwise>  
98 - <if test="queryData != null and queryData != ''">  
99 - <if test="queryData.deliveryTypeList!=null and queryData.deliveryTypeList.size()>0">  
100 - AND a.delivery_type in  
101 - <foreach collection="queryData.deliveryTypeList" index="index" item="deliveryType" open="(" separator="," close=")">  
102 - #{deliveryType}  
103 - </foreach>  
104 - </if>  
105 - </if>  
106 - </otherwise>  
107 - </choose>  
108 - <if test="shipingAddress != null and shipingAddress != ''"><![CDATA[AND a.shiping_address like CONCAT('%',#{shipingAddress},'%')]]></if>  
109 - <if test="orderType != null and orderType != ''"><![CDATA[AND a.order_type = #{orderType}]]></if>  
110 - <if test="orderStatus != null and orderStatus != ''"><![CDATA[AND a.order_status = #{orderStatus}]]></if>  
111 - <if test="payStatus != null and payStatus != ''"><![CDATA[AND a.pay_status = #{payStatus}]]></if>  
112 - <if test="buyerMemo != null and buyerMemo != ''"><![CDATA[AND a.buyer_memo = #{buyerMemo}]]></if>  
113 - <if test="orderStatusInTime != null and orderStatusInTime != ''"><![CDATA[AND a.order_status_in_time = #{orderStatusInTime}]]></if>  
114 - <if test="orderStatusLastValidTime != null and orderStatusLastValidTime != ''"><![CDATA[AND a.order_status_last_valid_time = #{orderStatusLastValidTime}]]></if>  
115 - <if test="payTime != null and payTime != ''"><![CDATA[AND a.pay_time = #{payTime}]]></if>  
116 - <if test="stockingInTime != null and stockingInTime != ''"><![CDATA[AND a.stocking_in_time = #{stockingInTime}]]></if>  
117 - <if test="stockingCompleteTime != null and stockingCompleteTime != ''"><![CDATA[AND a.stocking_complete_time = #{stockingCompleteTime}]]></if>  
118 - <if test="reservationStime != null and reservationStime != '' and (reservationFtime == null or reservationFtime == '')">  
119 - <![CDATA[AND a.reservation_stime >= #{reservationStime}]]>  
120 - </if>  
121 - <if test="reservationFtime != null and reservationFtime != '' and (reservationStime == null or reservationStime == '')">  
122 - <![CDATA[AND a.reservation_ftime <= #{reservationFtime}]]>  
123 - </if>  
124 - <if test="reservationStime != null and reservationStime != '' and (reservationFtime != null and reservationFtime != '')">  
125 - <![CDATA[  
126 - AND (a.reservation_stime >= #{reservationStime} AND a.reservation_stime<=#{reservationFtime}  
127 - OR a.reservation_ftime >= #{reservationStime} AND a.reservation_ftime<=#{reservationFtime}  
128 - OR a.reservation_stime <=#{reservationStime} AND a.reservation_ftime>=#{reservationFtime})  
129 - ]]>  
130 - </if>  
131 - <if test="marketDelivery != null and marketDelivery !=''"><![CDATA[ AND a.market_delivery = #{marketDelivery} ]]> </if>  
132 - <if test="buyerConfirmTime != null and buyerConfirmTime != ''"><![CDATA[AND a.buyer_confirm_time = #{buyerConfirmTime}]]></if>  
133 - <if test="createTime != null and createTime != ''"><![CDATA[AND a.create_time = #{createTime}]]></if>  
134 - <if test="versionNum != null and versionNum != ''"><![CDATA[AND a.version_num = #{versionNum}]]></if>  
135 - <if test="shopId != null and shopId != ''"><![CDATA[AND a.shop_id = #{shopId}]]></if>  
136 - <if test="shopName != null and shopName != ''"><![CDATA[AND a.shop_name like CONCAT(#{shopName},'%')]]></if>  
137 - <!-- 商品名称like搜索 -->  
138 - <if test="productsTitle != null and productsTitle != ''"><![CDATA[AND a.products_title like CONCAT('%',#{productsTitle},'%')]]></if>  
139 - <if test="tradeNo != null and tradeNo != ''"><![CDATA[AND a.trade_no = #{tradeNo}]]></if>  
140 - <!--当id值为0时,此判断条件无法通过判断,不能生成a.id=0的查询条件,导致查询出错  
141 - <if test="isCommented != null and isCommented != ''"><![CDATA[AND a.is_commented = #{isCommented}]]></if>  
142 - -->  
143 - <if test="isCommented != null"><![CDATA[AND a.is_commented = #{isCommented}]]></if>  
144 - <if test="printFlag != null and printFlag != ''"><![CDATA[AND a.print_flag = #{printFlag}]]></if>  
145 - <!-- 可以进行出厂的:1.未出厂,2.订单状态(待提货、待发货、交易完成),3.现场交易且(赊账付款或(线下付款且待付款))-->  
146 - <choose>  
147 - <when test="orderStatus != null and orderStatus != ''">  
148 - <![CDATA[AND a.order_status = #{orderStatus}]]>  
149 - </when>  
150 - <otherwise>  
151 - <if test="queryData != null and queryData != ''  
152 - and queryData.orderStateSet != null and queryData.orderStateSet.size>0">  
153 - <![CDATA[ and a.order_status in ]]>  
154 - <foreach item="item" index="index" collection="queryData.orderStateSet" open="(" separator="," close=")">  
155 - #{item}  
156 - </foreach>  
157 - </if>  
158 - </otherwise>  
159 - </choose>  
160 - <if test="queryData != null and queryData != ''">  
161 - <if test="queryData.submitBeginTime != null and queryData.submitBeginTime != ''">  
162 - <![CDATA[AND a.create_time >= #{queryData.submitBeginTime} ]]>  
163 - </if>  
164 - <if test="queryData.submitEndTime != null and queryData.submitEndTime != ''">  
165 - <![CDATA[AND a.create_time <= #{queryData.submitEndTime} ]]>  
166 - </if>  
167 - <if test="queryData.payBeginTime != null and queryData.payBeginTime != ''">  
168 - <![CDATA[AND a.pay_time >= #{queryData.payBeginTime}]]>  
169 - </if>  
170 - <if test="queryData.payEndTime != null and queryData.payEndTime != ''">  
171 - <![CDATA[AND a.pay_time <= #{queryData.payEndTime}]]>  
172 - </if>  
173 - <if test="queryData.orderStatusLastValidTimeBegin != null and queryData.orderStatusLastValidTimeBegin != ''">  
174 - <![CDATA[AND a.order_status_last_valid_time >= #{queryData.orderStatusLastValidTimeBegin} ]]>  
175 - </if>  
176 - <if test="queryData.orderStatusLastValidTimeEnd != null and queryData.orderStatusLastValidTimeEnd != ''">  
177 - <![CDATA[AND a.order_status_last_valid_time <= #{queryData.orderStatusLastValidTimeEnd} ]]>  
178 - </if>  
179 - <!-- 根据城市id搜索 -->  
180 - <if test="queryData.cityIdList != null and queryData.cityIdList.size() > 0">  
181 - AND a.buyer_city_id in  
182 - <foreach collection="queryData.cityIdList" index="index" item="cityId" open="(" separator="," close=")">  
183 - #{cityId}  
184 - </foreach>  
185 - </if>  
186 - <!-- 根据卖家来源进行查询搜索 -->  
187 - <if test="queryData.sellerSourceList != null and queryData.sellerSourceList.size > 0">  
188 - AND a.seller_source in  
189 - <foreach collection="queryData.sellerSourceList" index="index" item="sellerSource" open="(" separator="," close=")">  
190 - #{sellerSource}  
191 - </foreach>  
192 - </if>  
193 - </if>  
194 - <choose>  
195 - <when test="payType != null and payType != ''">  
196 - <![CDATA[AND a.pay_type = #{payType}]]>  
197 - </when>  
198 - <otherwise>  
199 - <if test="queryData != null and queryData != ''">  
200 - <if test="queryData.payTypeList!=null and queryData.payTypeList.size()>0">  
201 - AND a.pay_type in  
202 - <foreach collection="queryData.payTypeList" index="index" item="payType" open="(" separator="," close=")">  
203 - #{payType}  
204 - </foreach>  
205 - </if>  
206 - </if>  
207 - </otherwise>  
208 - </choose>  
209 - <choose>  
210 - <when test="comeFrom != null and comeFrom != ''">  
211 - <![CDATA[AND a.come_from = #{comeFrom}]]>  
212 - </when>  
213 - <otherwise>  
214 - <if test="queryData != null and queryData != ''">  
215 - <if test="queryData.comeFromList!=null and queryData.comeFromList.size()>0">  
216 - AND a.come_from in  
217 - <foreach collection="queryData.comeFromList" index="index" item="comeFrom" open="(" separator="," close=")">  
218 - #{comeFrom}  
219 - </foreach>  
220 - </if>  
221 - </if>  
222 - </otherwise>  
223 - </choose>  
224 - </sql>  
225 -  
226 - <!-- 智能排序与分页 -->  
227 - <sql id="QUERY_ORDER_LIMIT_CONDTION">  
228 - <choose>  
229 - <when test="orderField != null and orderField != ''">  
230 - <choose>  
231 - <when test="orderFieldType != null and orderFieldType != ''">  
232 - <![CDATA[ORDER BY a.${orderField} ${orderFieldType}]]>  
233 - </when>  
234 - <otherwise>  
235 - <![CDATA[ORDER BY a.${orderField} desc]]>  
236 - </otherwise>  
237 - </choose>  
238 - </when>  
239 - <otherwise>  
240 - <![CDATA[ORDER BY a.create_time desc,a.id desc]]>  
241 - </otherwise>  
242 - </choose>  
243 - <if test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0">  
244 - <![CDATA[LIMIT #{startIndex},#{pageSize}]]>  
245 - </if>  
246 - </sql>  
247 -  
248 - <!-- 更新列字段,只要不为NULL则更新,除开主键列 -->  
249 - <sql id="UPDATE_COLUMN_SET">  
250 - <set>  
251 - <if test="buyerId != null"><![CDATA[a.buyer_id = #{buyerId},]]></if>  
252 - <if test="sellerId != null"><![CDATA[a.seller_id = #{sellerId},]]></if>  
253 - <if test="buyerName != null"><![CDATA[a.buyer_name = #{buyerName},]]></if>  
254 - <if test="sellerName != null"><![CDATA[a.seller_name = #{sellerName},]]></if>  
255 - <if test="marketName != null"><![CDATA[a.market_name = #{marketName},]]></if>  
256 - <if test="marketId != null"><![CDATA[a.market_id = #{marketId},]]></if>  
257 - <if test="deliveryType != null"><![CDATA[a.delivery_type = #{deliveryType},]]></if>  
258 - <if test="shipingAddress != null"><![CDATA[a.shiping_address = #{shipingAddress},]]></if>  
259 - <if test="orderType != null"><![CDATA[a.order_type = #{orderType},]]></if>  
260 - <if test="orderStatus != null"><![CDATA[a.order_status = #{orderStatus},]]></if>  
261 - <if test="payStatus != null"><![CDATA[a.pay_status = #{payStatus},]]></if>  
262 - <if test="buyerMemo != null"><![CDATA[a.buyer_memo = #{buyerMemo},]]></if>  
263 - <if test="orderStatusInTime != null"><![CDATA[a.order_status_in_time = #{orderStatusInTime},]]></if>  
264 - <if test="logisticsRemarks != null"><![CDATA[a.logistics_remarks = #{logisticsRemarks},]]></if>  
265 - <choose>  
266 - <when test="queryData != null and queryData.setOrderStatusLastValidTimeToNull=='true'">  
267 - <![CDATA[a.order_status_last_valid_time = #{orderStatusLastValidTime},]]>  
268 - </when>  
269 - <otherwise>  
270 - <if test="orderStatusLastValidTime !=null">  
271 - <![CDATA[a.order_status_last_valid_time = #{orderStatusLastValidTime},]]>  
272 - </if>  
273 - </otherwise>  
274 - </choose>  
275 - <choose>  
276 - <when test="queryData != null and queryData.setPayTimeToNull=='true'">  
277 - <![CDATA[a.pay_time = NULL ,]]>  
278 - </when>  
279 - <otherwise>  
280 - <if test="payTime != null"><![CDATA[a.pay_time = #{payTime},]]></if>  
281 - </otherwise>  
282 - </choose>  
283 - <if test="stockingInTime != null"><![CDATA[a.stocking_in_time = #{stockingInTime},]]></if>  
284 - <if test="stockingCompleteTime != null"><![CDATA[a.stocking_complete_time = #{stockingCompleteTime},]]></if>  
285 - <if test="reservationStime != null"><![CDATA[a.reservation_stime = #{reservationStime},]]></if>  
286 - <if test="reservationFtime != null"><![CDATA[a.reservation_ftime = #{reservationFtime},]]></if>  
287 - <if test="buyerConfirmTime != null"><![CDATA[a.buyer_confirm_time = #{buyerConfirmTime},]]></if>  
288 - <if test="payType != null"><![CDATA[a.pay_type = #{payType},]]></if>  
289 - <if test="priceTotal != null"><![CDATA[a.price_total = #{priceTotal},]]></if>  
290 - <if test="pricePrivilege != null"><![CDATA[a.price_privilege = #{pricePrivilege},]]></if>  
291 - <if test="priceOffset != null"><![CDATA[a.price_offset = #{priceOffset},]]></if>  
292 - <if test="pricePaid != null"><![CDATA[a.price_paid = #{pricePaid},]]></if>  
293 - <if test="priceRefund != null"><![CDATA[a.price_refund = #{priceRefund},]]></if>  
294 - <if test="pricePostage != null"><![CDATA[a.price_postage = #{pricePostage},]]></if>  
295 - <if test="isDelete != null"><![CDATA[a.is_delete = #{isDelete},]]></if>  
296 - <if test="shopId != null"><![CDATA[a.shop_id = #{shopId},]]></if>  
297 - <if test="shopName != null"><![CDATA[a.shop_name = #{shopName},]]></if>  
298 - <if test="deliveryVerCode != null"><![CDATA[a.delivery_ver_code = #{deliveryVerCode},]]></if>  
299 - <if test="tradeNo != null"><![CDATA[a.trade_no = #{tradeNo},]]></if>  
300 - <if test="productsTitle != null"><![CDATA[a.products_title = #{productsTitle},]]></if>  
301 - <if test="statusInReason != null"><![CDATA[a.status_in_reason = #{statusInReason},]]></if>  
302 - <if test="isCommented != null"><![CDATA[a.is_commented = #{isCommented},]]></if>  
303 - <if test="comeFrom != null"><![CDATA[a.come_from = #{comeFrom},]]></if>  
304 - <if test="printFlag != null"><![CDATA[a.print_flag = #{printFlag},]]></if>  
305 - <if test="marketDelivery != null"><![CDATA[ a.market_delivery = #{marketDelivery} ]]> </if>  
306 - <choose>  
307 - <when test="editTime != null">  
308 - <![CDATA[edit_time = #{editTime},]]>  
309 - </when>  
310 - <otherwise>  
311 - <![CDATA[a.edit_time = NOW(),]]>  
312 - </otherwise>  
313 - </choose>  
314 - <![CDATA[a.version_num = a.version_num + 1,]]>  
315 - </set>  
316 - </sql>  
317 -  
318 - <!-- 插入orders记录 -->  
319 - <insert id="insertEntry" parameterType="orders" >  
320 - <![CDATA[  
321 - INSERT INTO orders (id,parent_id,buyer_id,seller_id,buyer_name,seller_name,market_name,market_id,delivery_type,shiping_address,order_type,order_status,pay_status,buyer_memo,order_status_in_time,order_status_last_valid_time,pay_time,stocking_in_time,stocking_complete_time,reservation_stime,reservation_ftime,buyer_confirm_time,create_time,edit_time,pay_type,price_total,price_privilege,price_offset,price_paid,price_postage,version_num,shop_id,shop_name,delivery_ver_code,trade_no,products_title,status_in_reason,is_commented,price_total_original,price_postage_original,come_from,logistics_remarks,buyer_city_id,seller_source,goods_weight,warrant_type,market_delivery)  
322 - VALUES (#{id},#{parentId},#{buyerId},#{sellerId},#{buyerName},#{sellerName},#{marketName},#{marketId},#{deliveryType},#{shipingAddress},#{orderType},#{orderStatus},#{payStatus},#{buyerMemo},#{orderStatusInTime},#{orderStatusLastValidTime},#{payTime},#{stockingInTime},#{stockingCompleteTime},#{reservationStime},#{reservationFtime},#{buyerConfirmTime},#{createTime},#{editTime},#{payType},#{priceTotal},#{pricePrivilege},#{priceOffset},#{pricePaid},#{pricePostage},#{versionNum},#{shopId},#{shopName},#{deliveryVerCode},#{tradeNo},#{productsTitle},#{statusInReason},#{isCommented},#{priceTotalOriginal},#{pricePostageOriginal},#{comeFrom},#{logisticsRemarks},#{buyerCityId},#{sellerSource},#{goodsWeight},#{warrantType},#{marketDelivery})  
323 - ]]>  
324 - </insert>  
325 -  
326 - <!-- 返回插入的编号,在事务开启状态下有效 -->  
327 - <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select>  
328 -  
329 - <!-- 删除记录,主键IN(array) -->  
330 - <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array" >  
331 - <![CDATA[DELETE FROM orders a WHERE a.id IN]]>  
332 - <foreach collection="array" item="id" open="(" separator="," close=")">  
333 - <![CDATA[#{id}]]>  
334 - </foreach>  
335 - </delete>  
336 -  
337 - <!-- 删除,通过条件 -->  
338 - <update id="deleteByCondtion" parameterType="orders" >  
339 - <![CDATA[DELETE FROM orders a]]>  
340 - <include refid="QUERY_WHERE_CLAUSE"/>  
341 - </update>  
342 -  
343 - <!-- 修改记录通过主键 -->  
344 - <update id="updateByKey" parameterType="orders" >  
345 - <![CDATA[UPDATE orders a]]>  
346 - <include refid="UPDATE_COLUMN_SET"/>  
347 - <![CDATA[WHERE a.id = #{id} and a.version_num = #{versionNum}]]>  
348 - </update>  
349 -  
350 - <!-- 根据符合情况的订单前置状态,更新订单的状态 -->  
351 - <update id="updateOrderStatusById" parameterType="java.util.HashMap">  
352 - update orders a set a.order_status = #{nextStatus},a.edit_time = #{editTime}  
353 - where a.id = #{id} AND a.version_num = #{versionNum} AND a.order_status in  
354 - <foreach item="item" index="index" collection="preStatusIds" open="(" separator="," close=")">  
355 - #{item}  
356 - </foreach>  
357 - </update>  
358 -  
359 - <!-- 查询,通过主键IN(array) -->  
360 - <select id="selectEntryArray" parameterType="java.lang.reflect.Array" resultType="orders">  
361 - <![CDATA[SELECT]]>  
362 - <include refid="QUERY_COLUMN_LIST"/>  
363 - <include refid="QUERY_FROM_TABLE"/>  
364 - <![CDATA[WHERE a.id IN]]>  
365 - <foreach collection="array" item="id" open="(" separator="," close=")">  
366 - <![CDATA[#{id}]]>  
367 - </foreach>  
368 - </select>  
369 -  
370 - <!-- 查询,通过条件 -->  
371 - <select id="selectEntryList" parameterType="orders" resultType="orders">  
372 - <![CDATA[SELECT]]>  
373 - <include refid="QUERY_COLUMN_LIST"/>  
374 - <include refid="QUERY_FROM_TABLE"/>  
375 - <include refid="QUERY_WHERE_CLAUSE"/>  
376 - <include refid="QUERY_ORDER_LIMIT_CONDTION"/>  
377 - </select>  
378 -  
379 - <!-- 总数查询,通过条件 -->  
380 - <select id="selectEntryListCount" parameterType="orders" resultType="int">  
381 - <![CDATA[SELECT COUNT(a.id) AS dataCount]]>  
382 - <include refid="QUERY_FROM_TABLE"/>  
383 - <include refid="QUERY_WHERE_CLAUSE"/>  
384 - </select>  
385 -  
386 - <!--统计第三方订单相关数量-->  
387 - <sql id="THIRD_QUERY_SUM_COLUMN_LIST">  
388 - <![CDATA[ sum(case when a.order_status=#{queryData.dividedOrderStatus} then 1 else 0 end) as dividedOrderCount,  
389 - sum(case when a.order_status=#{queryData.takeWaitOrderStatus} then 1 else 0 end) as takeWaitCount,  
390 - sum(case when a.order_status=#{queryData.receiveWaitOrderStatus} then 1 else 0 end) as receiveWaitCount,  
391 - sum(case when a.order_status=#{queryData.deliveredOrderStatus} then 1 else 0 end) as deliveredOrderCount,  
392 - sum(case when a.order_status=#{queryData.refundAppliedOrderStatus} then 1 else 0 end) as refundAppliedCount,  
393 - sum(case when a.order_status=#{queryData.refundCompleteOrderStatus} then 1 else 0 end) as refundCompleteCount]]>  
394 - </sql>  
395 -  
396 - <!--统计自营代销订单相关数量-->  
397 - <sql id="AGENT_QUERY_SUM_COLUMN_LIST">  
398 - <![CDATA[ sum(case when a.order_status=#{queryData.divideWaitStatus} then 1 else 0 end) as divideWaitCount,  
399 - sum(case when a.order_status=#{queryData.dividedStatus} then 1 else 0 end) as dividedCount,  
400 - sum(case when a.order_status=#{queryData.completeStockUpStatus} then 1 else 0 end) as completeStockUpOrderCount,  
401 - sum(case when a.order_status=#{queryData.deliveredOutStatus} then 1 else 0 end) as deliveredOutCount,  
402 - sum(case when a.order_status=#{queryData.completeStockUpStatus} AND a.reservation_ftime<NOW() then 1 else 0 end) as deliveredOutAlertCount,  
403 - sum(case when a.order_status=#{queryData.refundAppliedStatus} then 1 else 0 end) as refundAppliedCount,  
404 - sum(case when a.order_status=#{queryData.paymentWaitStatus} then 1 else 0 end) as paymentWaitCount  
405 - ]]>  
406 - </sql>  
407 - <select id="selectThirdOrdersSum" parameterType="orders" resultType="ordersSumVO">  
408 - <![CDATA[SELECT]]>  
409 - <include refid="THIRD_QUERY_SUM_COLUMN_LIST"/>  
410 - <include refid="QUERY_FROM_TABLE"/>  
411 - <include refid="QUERY_WHERE_CLAUSE"/>  
412 - </select>  
413 - <select id="selectSelfOrdersSum" parameterType="orders" resultType="ordersSumVO">  
414 - <![CDATA[SELECT]]>  
415 - <include refid="AGENT_QUERY_SUM_COLUMN_LIST"/>  
416 - <include refid="QUERY_FROM_TABLE"/>  
417 - <include refid="QUERY_WHERE_CLAUSE"/>  
418 - </select>  
419 - <select id="getVersionNum" parameterType="long" resultType="long">  
420 - <![CDATA[SELECT a.version_num ]]>  
421 - <include refid="QUERY_FROM_TABLE"/>  
422 - <![CDATA[ WHERE a.id = #{orderId}]]>  
423 - </select>  
424 -  
425 - <!-- 统计各状态订单量 -->  
426 - <select id="statisticsOrderAmountByStatus" parameterType="orders" resultType="keyValueVO">  
427 - <![CDATA[SELECT a.order_status AS code, count(1) AS value from orders a ]]>  
428 - <include refid="QUERY_WHERE_CLAUSE"/>  
429 - <![CDATA[group by a.order_status]]>  
430 - </select>  
431 -  
432 - <!-- 获取订单交易号 -->  
433 - <select id="getOrderTradeNo" parameterType="long" resultType="keyValueVO">  
434 - <![CDATA[SELECT id as code,trade_no AS value FROM orders]]>  
435 - <![CDATA[WHERE id IN]]>  
436 - <foreach collection="array" item="id" open="(" separator="," close=")">  
437 - <![CDATA[#{id}]]>  
438 - </foreach>  
439 - </select>  
440 - <!-- 获取订单所有商品名称串 -->  
441 - <select id="getOrderProductTitle" parameterType="long" resultType="string">  
442 - <![CDATA[SELECT products_title AS productsTitle FROM orders WHERE id =#{id}]]>  
443 - </select>  
444 -  
445 - <!--获取订单, 只查询指定字段的值-->  
446 - <!--  
447 - statementType 分为:STATEMENT(非预编译,使用$符号取变量),PREPARED(预编译,使用#变量取变量,且$同时可用)或 CALLABLE(调用存储过程)  
448 - -->  
449 - <select id="getOrderBySpecFields" parameterType="orders" resultType="orders" statementType="STATEMENT">  
450 - <![CDATA[select]]>  
451 - <if test="queryData != null and queryData.fieldsMapEntryList != null and queryData.fieldsMapEntryList.size()>0">  
452 - <foreach collection="queryData.fieldsMapEntryList" index="index" item="item" separator=",">  
453 - <if test="item.dbFieldName!=null and item.dbFieldName!='' and item.domainFieldName!=null and item.domainFieldName!=''">  
454 - ${item.dbFieldName} AS ${item.domainFieldName}  
455 - </if>  
456 - </foreach>  
457 - </if>  
458 - <![CDATA[from orders where id=${id}]]>  
459 - <!--因为非预编译原因,为了提高查询效率, 暂时只支持通过id查询 ,后期需要通过其他条件来查询,则使用QUERY_WHERE_CLAUSE_STATEMENT即可-->  
460 - <!--<include refid="QUERY_WHERE_CLAUSE_STATEMENT"/>-->  
461 - </select>  
462 -  
463 -  
464 - <!-- 根据店铺id查询,未完结订单数量-->  
465 - <select id="getValidOrderNumByShop" parameterType="long" resultType="int">  
466 - <![CDATA[  
467 - SELECT count(id) FROM orders  
468 - WHERE shop_id =#{shopId}  
469 - AND order_status IN(10,15,20,30,40,45,80,85)  
470 - ]]>  
471 - </select>  
472 -  
473 -</mapper>  
474 \ No newline at end of file 0 \ No newline at end of file
b2c-orders-dao/src/main/resources/sqlmap/OrdersJob.xml deleted 100644 → 0
1 -<?xml version="1.0" encoding="UTF-8" ?>  
2 -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  
3 - "http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
4 -<mapper namespace="com.diligrp.orders.dao.OrdersJobDao">  
5 -  
6 - <!-- orders_job 所有查询列 -->  
7 - <sql id="QUERY_COLUMN_LIST">  
8 - <![CDATA[id,business_key AS businessKey,business_type AS businessType,expire_date AS expireDate,callback_type AS callbackType,callback_hander AS callbackHander]]>  
9 - </sql>  
10 -  
11 - <!-- orders_job 查询列来源表-->  
12 - <sql id="QUERY_FROM_TABLE"><![CDATA[FROM orders_job]]></sql>  
13 -  
14 - <!-- 全部条件(更多功能可以通过queryData扩展实现) -->  
15 - <sql id="QUERY_WHERE_CLAUSE">  
16 - <where>  
17 - <if test="id != null and id != ''"><![CDATA[AND id = #{id}]]></if>  
18 - <if test="businessKey != null and businessKey != ''"><![CDATA[AND business_key = #{businessKey}]]></if>  
19 - <if test="businessType != null and businessType != ''"><![CDATA[AND business_type = #{businessType}]]></if>  
20 - <if test="expireDate != null and expireDate != ''"><![CDATA[AND expire_date = #{expireDate}]]></if>  
21 - <if test="callbackType != null and callbackType != ''"><![CDATA[AND callback_type = #{callbackType}]]></if>  
22 - <if test="callbackHander != null and callbackHander != ''"><![CDATA[AND callback_hander = #{callbackHander}]]></if>  
23 - </where>  
24 - </sql>  
25 -  
26 - <!-- 智能排序与分页 -->  
27 - <sql id="QUERY_ORDER_LIMIT_CONDTION">  
28 - <if test="orderField != null and orderField != '' and orderFieldType != null and orderFieldType != ''"><![CDATA[ORDER BY ${orderField} ${orderFieldType}]]></if>  
29 - <if test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0"><![CDATA[LIMIT #{startIndex},#{pageSize}]]></if>  
30 - </sql>  
31 -  
32 - <!-- 更新列字段,只要不为NULL则更新,除开主键列 -->  
33 - <sql id="UPDATE_COLUMN_SET">  
34 - <set>  
35 - <if test="businessKey != null"><![CDATA[business_key = #{businessKey},]]></if>  
36 - <if test="businessType != null"><![CDATA[business_type = #{businessType},]]></if>  
37 - <if test="expireDate != null"><![CDATA[expire_date = #{expireDate},]]></if>  
38 - <if test="callbackType != null"><![CDATA[callback_type = #{callbackType},]]></if>  
39 - <if test="callbackHander != null"><![CDATA[callback_hander = #{callbackHander},]]></if>  
40 - </set>  
41 - </sql>  
42 -  
43 - <!-- 插入orders_job记录 -->  
44 - <insert id="insertEntry" parameterType="ordersJob" >  
45 - <![CDATA[  
46 - INSERT INTO orders_job (id,business_key,business_type,expire_date,callback_type,callback_hander)  
47 - VALUES (#{id},#{businessKey},#{businessType},#{expireDate},#{callbackType},#{callbackHander})  
48 - ]]>  
49 - </insert>  
50 -  
51 - <!-- 返回插入的编号,在事务开启状态下有效 -->  
52 - <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select>  
53 -  
54 - <!-- 删除记录,主键IN(array) -->  
55 - <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array" >  
56 - <![CDATA[DELETE FROM orders_job WHERE id IN]]>  
57 - <foreach collection="array" item="id" open="(" separator="," close=")">  
58 - <![CDATA[#{id}]]>  
59 - </foreach>  
60 - </delete>  
61 -  
62 - <!-- 删除,通过条件 -->  
63 - <update id="deleteByCondtion" parameterType="ordersJob" >  
64 - <![CDATA[DELETE FROM orders_job]]>  
65 - <include refid="QUERY_WHERE_CLAUSE"/>  
66 - </update>  
67 -  
68 - <!-- 修改记录通过主键 -->  
69 - <update id="updateByKey" parameterType="ordersJob" >  
70 - <![CDATA[UPDATE orders_job]]>  
71 - <include refid="UPDATE_COLUMN_SET"/>  
72 - <![CDATA[WHERE id = #{id}]]>  
73 - </update>  
74 -  
75 - <!-- 查询,通过主键IN(array) -->  
76 - <select id="selectEntryArray" parameterType="java.lang.reflect.Array" resultType="ordersJob">  
77 - <![CDATA[SELECT]]>  
78 - <include refid="QUERY_COLUMN_LIST"/>  
79 - <include refid="QUERY_FROM_TABLE"/>  
80 - <![CDATA[WHERE id IN]]>  
81 - <foreach collection="array" item="id" open="(" separator="," close=")">  
82 - <![CDATA[#{id}]]>  
83 - </foreach>  
84 - </select>  
85 -  
86 - <!-- 查询,通过条件 -->  
87 - <select id="selectEntryList" parameterType="ordersJob" resultType="ordersJob">  
88 - <![CDATA[SELECT]]>  
89 - <include refid="QUERY_COLUMN_LIST"/>  
90 - <include refid="QUERY_FROM_TABLE"/>  
91 - <include refid="QUERY_WHERE_CLAUSE"/>  
92 - <include refid="QUERY_ORDER_LIMIT_CONDTION"/>  
93 - </select>  
94 -  
95 - <!-- 总数查询,通过条件 -->  
96 - <select id="selectEntryListCount" parameterType="ordersJob" resultType="int">  
97 - <![CDATA[SELECT COUNT(id) AS dataCount]]>  
98 - <include refid="QUERY_FROM_TABLE"/>  
99 - <include refid="QUERY_WHERE_CLAUSE"/>  
100 - </select>  
101 -  
102 - <!-- 其它SQL语句 -->  
103 - <sql id="QUERYTASK_WHERE_CLAUSE">  
104 - <where>  
105 - <if test="businessType != null and businessType != ''"><![CDATA[AND business_type = #{businessType}]]></if>  
106 - <if test="expireDate != null and expireDate != ''"><![CDATA[AND expire_date <= #{expireDate}]]></if>  
107 - </where>  
108 - </sql>  
109 - <select id="taskList" parameterType="java.util.Map" resultType="ordersJob">  
110 - <![CDATA[SELECT]]>  
111 - <include refid="QUERY_COLUMN_LIST"/>  
112 - <include refid="QUERY_FROM_TABLE"/>  
113 - <include refid="QUERYTASK_WHERE_CLAUSE"/>  
114 - order by id limit #{startRow},#{endRow}  
115 - </select>  
116 -  
117 -</mapper>  
118 \ No newline at end of file 0 \ No newline at end of file
b2c-orders-domain/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-domain/pom.xml
@@ -3,21 +3,21 @@ @@ -3,21 +3,21 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-domain</artifactId> 9 + <artifactId>b2c-orders-domain</artifactId>
10 10
11 <dependencies> 11 <dependencies>
12 <dependency> 12 <dependency>
13 <groupId>${project.groupId}</groupId> 13 <groupId>${project.groupId}</groupId>
14 - <artifactId>orders-commons</artifactId> 14 + <artifactId>b2c-orders-commons</artifactId>
15 <version>${project.version}</version> 15 <version>${project.version}</version>
16 </dependency> 16 </dependency>
17 <dependency> 17 <dependency>
18 <groupId>${project.groupId}</groupId> 18 <groupId>${project.groupId}</groupId>
19 - <artifactId>orders-client</artifactId>  
20 - <version>1.1.0-SNAPSHOT</version> 19 + <artifactId>b2c-orders-client</artifactId>
  20 + <version>${project.version}</version>
21 </dependency> 21 </dependency>
22 <dependency> 22 <dependency>
23 <groupId>org.projectlombok</groupId> 23 <groupId>org.projectlombok</groupId>
@@ -28,17 +28,17 @@ @@ -28,17 +28,17 @@
28 <artifactId>guava</artifactId> 28 <artifactId>guava</artifactId>
29 </dependency> 29 </dependency>
30 <!-- https://mvnrepository.com/artifact/cglib/cglib --> 30 <!-- https://mvnrepository.com/artifact/cglib/cglib -->
31 - <dependency> 31 + <!-- <dependency>
32 <groupId>cglib</groupId> 32 <groupId>cglib</groupId>
33 <artifactId>cglib</artifactId> 33 <artifactId>cglib</artifactId>
34 - </dependency> 34 + </dependency> -->
35 <dependency> 35 <dependency>
36 <groupId>commons-lang</groupId> 36 <groupId>commons-lang</groupId>
37 <artifactId>commons-lang</artifactId> 37 <artifactId>commons-lang</artifactId>
38 </dependency> 38 </dependency>
39 <dependency> 39 <dependency>
40 <groupId>${project.groupId}</groupId> 40 <groupId>${project.groupId}</groupId>
41 - <artifactId>orders-rpc</artifactId> 41 + <artifactId>b2c-orders-rpc</artifactId>
42 <version>${project.parent.version}</version> 42 <version>${project.parent.version}</version>
43 </dependency> 43 </dependency>
44 </dependencies> 44 </dependencies>
b2c-orders-manager/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-manager/pom.xml
@@ -3,15 +3,15 @@ @@ -3,15 +3,15 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-manager</artifactId> 9 + <artifactId>b2c-orders-manager</artifactId>
10 10
11 <dependencies> 11 <dependencies>
12 <dependency> 12 <dependency>
13 <groupId>${project.groupId}</groupId> 13 <groupId>${project.groupId}</groupId>
14 - <artifactId>orders-dao</artifactId> 14 + <artifactId>b2c-orders-dao</artifactId>
15 <version>${project.version}</version> 15 <version>${project.version}</version>
16 </dependency> 16 </dependency>
17 </dependencies> 17 </dependencies>
b2c-orders-manager/src/main/java/com/b2c/orders/manager/impl/OrderManagerBean.java
@@ -4,6 +4,8 @@ import org.slf4j.Logger; @@ -4,6 +4,8 @@ import org.slf4j.Logger;
4 import org.slf4j.LoggerFactory; 4 import org.slf4j.LoggerFactory;
5 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Component; 6 import org.springframework.stereotype.Component;
  7 +import org.springframework.transaction.annotation.Propagation;
  8 +import org.springframework.transaction.annotation.Transactional;
7 9
8 import com.alibaba.fastjson.JSON; 10 import com.alibaba.fastjson.JSON;
9 import com.b2c.dtms.client.domain.dto.request.DtmsProduceRequestDto; 11 import com.b2c.dtms.client.domain.dto.request.DtmsProduceRequestDto;
@@ -23,6 +25,7 @@ import com.b2c.orders.manager.OrderManager; @@ -23,6 +25,7 @@ import com.b2c.orders.manager.OrderManager;
23 import com.b2c.orders.rpc.DtmsRPCService; 25 import com.b2c.orders.rpc.DtmsRPCService;
24 import com.b2c.orders.rpc.exception.DtmsRpcException; 26 import com.b2c.orders.rpc.exception.DtmsRpcException;
25 27
  28 +@Transactional(propagation = Propagation.REQUIRED)
26 @Component 29 @Component
27 public class OrderManagerBean implements OrderManager { 30 public class OrderManagerBean implements OrderManager {
28 31
b2c-orders-rpc/pom.xml
@@ -3,15 +3,15 @@ @@ -3,15 +3,15 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-rpc</artifactId> 9 + <artifactId>b2c-orders-rpc</artifactId>
10 10
11 <dependencies> 11 <dependencies>
12 <dependency> 12 <dependency>
13 <groupId>${project.groupId}</groupId> 13 <groupId>${project.groupId}</groupId>
14 - <artifactId>orders-commons</artifactId> 14 + <artifactId>b2c-orders-commons</artifactId>
15 <version>${project.parent.version}</version> 15 <version>${project.parent.version}</version>
16 </dependency> 16 </dependency>
17 <dependency> 17 <dependency>
b2c-orders-rpc/src/main/java/com/b2c/orders/rpc/DtmsRPCService.java
@@ -6,4 +6,5 @@ import com.b2c.orders.rpc.exception.DtmsRpcException; @@ -6,4 +6,5 @@ import com.b2c.orders.rpc.exception.DtmsRpcException;
6 public interface DtmsRPCService { 6 public interface DtmsRPCService {
7 7
8 void produceDtmsMessage(DtmsProduceRequestDto request) throws DtmsRpcException; 8 void produceDtmsMessage(DtmsProduceRequestDto request) throws DtmsRpcException;
  9 +
9 } 10 }
b2c-orders-service/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-service/pom.xml
@@ -3,15 +3,15 @@ @@ -3,15 +3,15 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-service</artifactId> 9 + <artifactId>b2c-orders-service</artifactId>
10 10
11 <dependencies> 11 <dependencies>
12 <dependency> 12 <dependency>
13 <groupId>${project.groupId}</groupId> 13 <groupId>${project.groupId}</groupId>
14 - <artifactId>orders-manager</artifactId> 14 + <artifactId>b2c-orders-manager</artifactId>
15 <version>${project.version}</version> 15 <version>${project.version}</version>
16 </dependency> 16 </dependency>
17 </dependencies> 17 </dependencies>
b2c-orders-service/src/main/java/com/b2c/orders/service/OrderService.java
@@ -3,6 +3,7 @@ package com.b2c.orders.service; @@ -3,6 +3,7 @@ package com.b2c.orders.service;
3 import com.b2c.orders.client.domain.dto.request.SubmitOrderRequestDto; 3 import com.b2c.orders.client.domain.dto.request.SubmitOrderRequestDto;
4 import com.b2c.orders.commons.exceptions.OrderException; 4 import com.b2c.orders.commons.exceptions.OrderException;
5 import com.b2c.orders.commons.exceptions.OrderRepositoryException; 5 import com.b2c.orders.commons.exceptions.OrderRepositoryException;
  6 +import com.b2c.orders.rpc.exception.DtmsRpcException;
6 7
7 public interface OrderService { 8 public interface OrderService {
8 9
@@ -11,8 +12,9 @@ public interface OrderService { @@ -11,8 +12,9 @@ public interface OrderService {
11 * 12 *
12 * @param order 13 * @param order
13 * 订单id 14 * 订单id
  15 + * @throws DtmsRpcException
14 */ 16 */
15 - void submit(SubmitOrderRequestDto order); 17 + void submit(SubmitOrderRequestDto order) throws DtmsRpcException;
16 18
17 /** 19 /**
18 * 商家接单 20 * 商家接单
@@ -25,8 +27,9 @@ public interface OrderService { @@ -25,8 +27,9 @@ public interface OrderService {
25 * TODO 27 * TODO
26 * @throws OrderRepositoryException 28 * @throws OrderRepositoryException
27 * @throws OrderException 29 * @throws OrderException
  30 + * @throws DtmsRpcException
28 */ 31 */
29 - void take(Long orderId, Long sellerId, Long totalPrice) throws OrderException, OrderRepositoryException; 32 + void take(Long orderId, Long sellerId, Long totalPrice) throws OrderException, OrderRepositoryException, DtmsRpcException;
30 33
31 /** 34 /**
32 * 买家支付 35 * 买家支付
b2c-orders-service/src/main/java/com/b2c/orders/service/impl/OrderServiceBean.java
@@ -10,6 +10,7 @@ import com.b2c.orders.commons.exceptions.ApplicationException; @@ -10,6 +10,7 @@ import com.b2c.orders.commons.exceptions.ApplicationException;
10 import com.b2c.orders.commons.exceptions.OrderException; 10 import com.b2c.orders.commons.exceptions.OrderException;
11 import com.b2c.orders.commons.exceptions.OrderRepositoryException; 11 import com.b2c.orders.commons.exceptions.OrderRepositoryException;
12 import com.b2c.orders.manager.OrderManager; 12 import com.b2c.orders.manager.OrderManager;
  13 +import com.b2c.orders.rpc.exception.DtmsRpcException;
13 import com.b2c.orders.service.OrderService; 14 import com.b2c.orders.service.OrderService;
14 15
15 @Service 16 @Service
@@ -20,12 +21,13 @@ public class OrderServiceBean implements OrderService { @@ -20,12 +21,13 @@ public class OrderServiceBean implements OrderService {
20 private OrderManager orderManager; 21 private OrderManager orderManager;
21 22
22 @Override 23 @Override
23 - public void submit(SubmitOrderRequestDto order) { 24 + public void submit(SubmitOrderRequestDto order) throws DtmsRpcException {
24 this.orderManager.submit(order); 25 this.orderManager.submit(order);
25 } 26 }
26 27
27 @Override 28 @Override
28 - public void take(Long orderId, Long sellerId, Long totalPrice) throws OrderException, OrderRepositoryException { 29 + public void take(Long orderId, Long sellerId, Long totalPrice)
  30 + throws OrderException, OrderRepositoryException, DtmsRpcException {
29 this.orderManager.take(orderId, sellerId, totalPrice); 31 this.orderManager.take(orderId, sellerId, totalPrice);
30 } 32 }
31 33
b2c-orders-web/.project
@@ -16,12 +16,12 @@ @@ -16,12 +16,12 @@
16 </arguments> 16 </arguments>
17 </buildCommand> 17 </buildCommand>
18 <buildCommand> 18 <buildCommand>
19 - <name>org.eclipse.m2e.core.maven2Builder</name> 19 + <name>org.eclipse.wst.validation.validationbuilder</name>
20 <arguments> 20 <arguments>
21 </arguments> 21 </arguments>
22 </buildCommand> 22 </buildCommand>
23 <buildCommand> 23 <buildCommand>
24 - <name>org.eclipse.wst.validation.validationbuilder</name> 24 + <name>org.eclipse.m2e.core.maven2Builder</name>
25 <arguments> 25 <arguments>
26 </arguments> 26 </arguments>
27 </buildCommand> 27 </buildCommand>
b2c-orders-web/.settings/.jsdtscope
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <classpath> 2 <classpath>
3 - <classpathentry kind="src" path="src/main/webapp"/>  
4 - <classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="target/m2e-wtp/web-resources"/> 3 + <classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
  4 + <classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
5 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> 5 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
6 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> 6 <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
7 <attributes> 7 <attributes>
b2c-orders-web/.settings/org.eclipse.wst.common.component
@@ -4,28 +4,25 @@ @@ -4,28 +4,25 @@
4 <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> 4 <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
5 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> 5 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
6 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> 6 <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
7 - <dependent-module archiveName="orders-service-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-service/b2c-orders-service"> 7 + <dependent-module archiveName="b2c-orders-service-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-service/b2c-orders-service">
8 <dependency-type>uses</dependency-type> 8 <dependency-type>uses</dependency-type>
9 </dependent-module> 9 </dependent-module>
10 - <dependent-module archiveName="orders-manager-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-manager/b2c-orders-manager"> 10 + <dependent-module archiveName="b2c-orders-manager-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-manager/b2c-orders-manager">
11 <dependency-type>uses</dependency-type> 11 <dependency-type>uses</dependency-type>
12 </dependent-module> 12 </dependent-module>
13 - <dependent-module archiveName="orders-dao-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-dao/b2c-orders-dao"> 13 + <dependent-module archiveName="b2c-orders-dao-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-dao/b2c-orders-dao">
14 <dependency-type>uses</dependency-type> 14 <dependency-type>uses</dependency-type>
15 </dependent-module> 15 </dependent-module>
16 - <dependent-module archiveName="orders-domain-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-domain/b2c-orders-domain"> 16 + <dependent-module archiveName="b2c-orders-domain-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-domain/b2c-orders-domain">
17 <dependency-type>uses</dependency-type> 17 <dependency-type>uses</dependency-type>
18 </dependent-module> 18 </dependent-module>
19 - <dependent-module archiveName="orders-commons-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-commons/b2c-orders-commons"> 19 + <dependent-module archiveName="b2c-orders-commons-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-commons/b2c-orders-commons">
20 <dependency-type>uses</dependency-type> 20 <dependency-type>uses</dependency-type>
21 </dependent-module> 21 </dependent-module>
22 - <dependent-module archiveName="orders-client-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-client/b2c-orders-client"> 22 + <dependent-module archiveName="b2c-orders-client-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-client/b2c-orders-client">
23 <dependency-type>uses</dependency-type> 23 <dependency-type>uses</dependency-type>
24 </dependent-module> 24 </dependent-module>
25 - <dependent-module archiveName="orders-rpc-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-rpc/b2c-orders-rpc">  
26 - <dependency-type>uses</dependency-type>  
27 - </dependent-module>  
28 - <dependent-module archiveName="dtms-client-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/dtms-client/dtms-client"> 25 + <dependent-module archiveName="b2c-orders-rpc-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/b2c-orders-rpc/b2c-orders-rpc">
29 <dependency-type>uses</dependency-type> 26 <dependency-type>uses</dependency-type>
30 </dependent-module> 27 </dependent-module>
31 <property name="context-root" value="b2c-orders-web"/> 28 <property name="context-root" value="b2c-orders-web"/>
b2c-orders-web/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -2,6 +2,6 @@ @@ -2,6 +2,6 @@
2 <faceted-project> 2 <faceted-project>
3 <fixed facet="wst.jsdt.web"/> 3 <fixed facet="wst.jsdt.web"/>
4 <installed facet="java" version="1.7"/> 4 <installed facet="java" version="1.7"/>
5 - <installed facet="jst.web" version="2.5"/> 5 + <installed facet="jst.web" version="3.0"/>
6 <installed facet="wst.jsdt.web" version="1.0"/> 6 <installed facet="wst.jsdt.web" version="1.0"/>
7 </faceted-project> 7 </faceted-project>
b2c-orders-web/pom.xml
@@ -3,28 +3,144 @@ @@ -3,28 +3,144 @@
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <parent> 4 <parent>
5 <groupId>com.b2c.orders</groupId> 5 <groupId>com.b2c.orders</groupId>
6 - <artifactId>orders-parent</artifactId> 6 + <artifactId>b2c-orders-parent</artifactId>
7 <version>0.0.1-SNAPSHOT</version> 7 <version>0.0.1-SNAPSHOT</version>
8 </parent> 8 </parent>
9 - <artifactId>orders-web</artifactId> 9 + <artifactId>b2c-orders-web</artifactId>
10 <packaging>war</packaging> 10 <packaging>war</packaging>
11 11
12 <dependencies> 12 <dependencies>
13 <dependency> 13 <dependency>
  14 + <groupId>org.aspectj</groupId>
  15 + <artifactId>aspectjweaver</artifactId>
  16 + </dependency>
  17 + <dependency>
14 <groupId>${project.groupId}</groupId> 18 <groupId>${project.groupId}</groupId>
15 - <artifactId>orders-service</artifactId> 19 + <artifactId>b2c-orders-service</artifactId>
16 <version>${project.version}</version> 20 <version>${project.version}</version>
17 </dependency> 21 </dependency>
18 - <!-- https://mvnrepository.com/artifact/com.mangofactory/swagger-springmvc -->  
19 - <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --> 22 + <!--swagger -->
20 <dependency> 23 <dependency>
21 <groupId>io.springfox</groupId> 24 <groupId>io.springfox</groupId>
22 <artifactId>springfox-swagger2</artifactId> 25 <artifactId>springfox-swagger2</artifactId>
  26 + <exclusions>
  27 + <exclusion>
  28 + <groupId>org.springframework</groupId>
  29 + <artifactId>spring-web</artifactId>
  30 + </exclusion>
  31 + <exclusion>
  32 + <groupId>org.springframework</groupId>
  33 + <artifactId>spring-beans</artifactId>
  34 + </exclusion>
  35 + <exclusion>
  36 + <groupId>org.springframework</groupId>
  37 + <artifactId>spring-webmvc</artifactId>
  38 + </exclusion>
  39 + <exclusion>
  40 + <groupId>org.springframework</groupId>
  41 + <artifactId>spring-beans</artifactId>
  42 + </exclusion>
  43 + <exclusion>
  44 + <groupId>org.springframework</groupId>
  45 + <artifactId>spring-context</artifactId>
  46 + </exclusion>
  47 + <exclusion>
  48 + <groupId>org.springframework</groupId>
  49 + <artifactId>spring-core</artifactId>
  50 + </exclusion>
  51 + <exclusion>
  52 + <groupId>org.springframework</groupId>
  53 + <artifactId>spring-aop</artifactId>
  54 + </exclusion>
  55 + <exclusion>
  56 + <groupId>org.aspectj</groupId>
  57 + <artifactId>aspectjweaver</artifactId>
  58 + </exclusion>
  59 + <exclusion>
  60 + <groupId>org.slf4j</groupId>
  61 + <artifactId>slf4j-api</artifactId>
  62 + </exclusion>
  63 + <exclusion>
  64 + <groupId>com.fasterxml.jackson.core</groupId>
  65 + <artifactId>jackson-annotations</artifactId>
  66 + </exclusion>
  67 + </exclusions>
23 </dependency> 68 </dependency>
  69 + <!-- https://mvnrepository.com/artifact/com.mangofactory/swagger-springmvc -->
  70 + <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 -->
  71 + <!-- <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId>
  72 + </dependency> -->
24 <dependency> 73 <dependency>
25 <groupId>com.b2c.dtms</groupId> 74 <groupId>com.b2c.dtms</groupId>
26 <artifactId>dtms-client</artifactId> 75 <artifactId>dtms-client</artifactId>
27 <version>0.0.1-SNAPSHOT</version> 76 <version>0.0.1-SNAPSHOT</version>
28 </dependency> 77 </dependency>
  78 + <dependency>
  79 + <groupId>org.springframework</groupId>
  80 + <artifactId>spring-context-support</artifactId>
  81 + </dependency>
  82 + <dependency>
  83 + <groupId>javax.servlet</groupId>
  84 + <artifactId>servlet-api</artifactId>
  85 + <scope>provided</scope>
  86 + </dependency>
  87 + <dependency>
  88 + <groupId>org.slf4j</groupId>
  89 + <artifactId>slf4j-api</artifactId>
  90 + </dependency>
  91 + <dependency>
  92 + <groupId>ch.qos.logback</groupId>
  93 + <artifactId>logback-classic</artifactId>
  94 + </dependency>
  95 + <dependency>
  96 + <groupId>ch.qos.logback</groupId>
  97 + <artifactId>logback-core</artifactId>
  98 + </dependency>
  99 + <dependency>
  100 + <groupId>org.slf4j</groupId>
  101 + <artifactId>slf4j-api</artifactId>
  102 + </dependency>
  103 + <!-- if you enable @AspectJ style AOP in spring. -->
  104 + <dependency>
  105 + <groupId>org.aspectj</groupId>
  106 + <artifactId>aspectjrt</artifactId>
  107 + </dependency>
  108 +
  109 + <!-- if you enable JSR303 (Bean Validation) in spring. -->
  110 + <dependency>
  111 + <groupId>org.hibernate</groupId>
  112 + <artifactId>hibernate-validator</artifactId>
  113 + </dependency>
  114 +
  115 + <!-- if you enable json support in spring mvc. -->
  116 + <dependency>
  117 + <groupId>org.codehaus.jackson</groupId>
  118 + <artifactId>jackson-mapper-asl</artifactId>
  119 + </dependency>
  120 + <!-- if you use fileupload in spring mvc -->
  121 + <dependency>
  122 + <groupId>commons-fileupload</groupId>
  123 + <artifactId>commons-fileupload</artifactId>
  124 + </dependency>
  125 + <!-- test scope -->
  126 + <dependency>
  127 + <groupId>junit</groupId>
  128 + <artifactId>junit</artifactId>
  129 + <scope>test</scope>
  130 + </dependency>
  131 + <dependency>
  132 + <groupId>javax.servlet</groupId>
  133 + <artifactId>servlet-api</artifactId>
  134 + <scope>provided</scope>
  135 + </dependency>
  136 +
  137 + <dependency>
  138 + <groupId>commons-lang</groupId>
  139 + <artifactId>commons-lang</artifactId>
  140 + </dependency>
  141 + <dependency>
  142 + <groupId>commons-codec</groupId>
  143 + <artifactId>commons-codec</artifactId>
  144 + </dependency>
29 </dependencies> 145 </dependencies>
30 </project> 146 </project>
31 \ No newline at end of file 147 \ No newline at end of file
b2c-orders-web/src/main/java/com/b2c/orders/configuration/SwaggerConfiguration.java
1 package com.b2c.orders.configuration; 1 package com.b2c.orders.configuration;
2 2
3 import org.springframework.context.annotation.Bean; 3 import org.springframework.context.annotation.Bean;
4 -import org.springframework.context.annotation.ComponentScan;  
5 import org.springframework.context.annotation.Configuration; 4 import org.springframework.context.annotation.Configuration;
6 import org.springframework.web.servlet.config.annotation.EnableWebMvc; 5 import org.springframework.web.servlet.config.annotation.EnableWebMvc;
7 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 6 import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
8 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; 7 import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
9 8
  9 +import springfox.documentation.builders.RequestHandlerSelectors;
10 import springfox.documentation.service.ApiInfo; 10 import springfox.documentation.service.ApiInfo;
11 import springfox.documentation.spi.DocumentationType; 11 import springfox.documentation.spi.DocumentationType;
12 import springfox.documentation.spring.web.plugins.Docket; 12 import springfox.documentation.spring.web.plugins.Docket;
@@ -15,9 +15,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; @@ -15,9 +15,10 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
15 @Configuration 15 @Configuration
16 @EnableWebMvc 16 @EnableWebMvc
17 @EnableSwagger2 17 @EnableSwagger2
18 -@ComponentScan(basePackages = "com.b2c.orders.web.restful")  
19 public class SwaggerConfiguration extends WebMvcConfigurerAdapter { 18 public class SwaggerConfiguration extends WebMvcConfigurerAdapter {
20 19
  20 + public static final String SWAGGER_SCAN_BASE_PACKAGE = "com.b2c.orders";
  21 +
21 @Override 22 @Override
22 public void addResourceHandlers(ResourceHandlerRegistry registry) { 23 public void addResourceHandlers(ResourceHandlerRegistry registry) {
23 registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); 24 registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
@@ -29,8 +30,9 @@ public class SwaggerConfiguration extends WebMvcConfigurerAdapter { @@ -29,8 +30,9 @@ public class SwaggerConfiguration extends WebMvcConfigurerAdapter {
29 @Bean 30 @Bean
30 public Docket swaggerSpringMvcPlugin() { 31 public Docket swaggerSpringMvcPlugin() {
31 Docket docket = new Docket(DocumentationType.SWAGGER_2); 32 Docket docket = new Docket(DocumentationType.SWAGGER_2);
32 - ApiInfo apiInfo = new ApiInfo("一体化", "网关接口", "1.1", "urn:tos", "dili", "logistics-park", "http://dili.com");  
33 - docket.apiInfo(apiInfo); 33 + docket.select().apis(RequestHandlerSelectors.basePackage(SWAGGER_SCAN_BASE_PACKAGE)).build();
  34 + ApiInfo apiInfo = new ApiInfo("咱的APP", "店铺用户接口", "1.1", "urn:tos", "b2c", "logistics-park", "http://zandeapp.com");
  35 + docket.apiInfo(apiInfo);
34 return docket; 36 return docket;
35 } 37 }
36 } 38 }
b2c-orders-web/src/main/java/com/b2c/orders/web/restful/OrderRestController.java
1 package com.b2c.orders.web.restful; 1 package com.b2c.orders.web.restful;
2 2
  3 +import javax.validation.Valid;
  4 +
3 import org.springframework.beans.factory.annotation.Autowired; 5 import org.springframework.beans.factory.annotation.Autowired;
4 import org.springframework.http.MediaType; 6 import org.springframework.http.MediaType;
  7 +import org.springframework.validation.BindingResult;
5 import org.springframework.web.bind.annotation.RequestBody; 8 import org.springframework.web.bind.annotation.RequestBody;
6 import org.springframework.web.bind.annotation.RequestMapping; 9 import org.springframework.web.bind.annotation.RequestMapping;
7 import org.springframework.web.bind.annotation.RestController; 10 import org.springframework.web.bind.annotation.RestController;
@@ -12,16 +15,22 @@ import com.b2c.orders.client.domain.dto.request.BuyerCancelRequestDto; @@ -12,16 +15,22 @@ import com.b2c.orders.client.domain.dto.request.BuyerCancelRequestDto;
12 import com.b2c.orders.client.domain.dto.request.BuyerConfirmRequestDto; 15 import com.b2c.orders.client.domain.dto.request.BuyerConfirmRequestDto;
13 import com.b2c.orders.client.domain.dto.request.DtmsConfirmRequestDto; 16 import com.b2c.orders.client.domain.dto.request.DtmsConfirmRequestDto;
14 import com.b2c.orders.client.domain.dto.request.DtmsTimeoutRequestDto; 17 import com.b2c.orders.client.domain.dto.request.DtmsTimeoutRequestDto;
  18 +import com.b2c.orders.client.domain.dto.request.OrderListRequestDto;
15 import com.b2c.orders.client.domain.dto.request.PayOrderRequestDto; 19 import com.b2c.orders.client.domain.dto.request.PayOrderRequestDto;
16 import com.b2c.orders.client.domain.dto.request.SellerConfirmRequestDto; 20 import com.b2c.orders.client.domain.dto.request.SellerConfirmRequestDto;
17 import com.b2c.orders.client.domain.dto.request.SellerRefuseRequestDto; 21 import com.b2c.orders.client.domain.dto.request.SellerRefuseRequestDto;
18 import com.b2c.orders.client.domain.dto.request.SubmitOrderRequestDto; 22 import com.b2c.orders.client.domain.dto.request.SubmitOrderRequestDto;
19 import com.b2c.orders.client.domain.dto.request.TakeOrderRequestDto; 23 import com.b2c.orders.client.domain.dto.request.TakeOrderRequestDto;
20 import com.b2c.orders.client.domain.dto.response.BaseResponseDto; 24 import com.b2c.orders.client.domain.dto.response.BaseResponseDto;
  25 +import com.b2c.orders.client.domain.dto.response.OrderListResponseDto;
21 import com.b2c.orders.client.domain.dto.response.SubmitOrderResponseDto; 26 import com.b2c.orders.client.domain.dto.response.SubmitOrderResponseDto;
22 import com.b2c.orders.commons.exceptions.ApplicationException; 27 import com.b2c.orders.commons.exceptions.ApplicationException;
  28 +import com.b2c.orders.rpc.exception.DtmsRpcException;
23 import com.b2c.orders.service.OrderService; 29 import com.b2c.orders.service.OrderService;
24 30
  31 +import io.swagger.annotations.ApiOperation;
  32 +
  33 +//@Api("订单api")
25 @RestController 34 @RestController
26 @RequestMapping("/api") 35 @RequestMapping("/api")
27 public class OrderRestController { 36 public class OrderRestController {
@@ -29,17 +38,23 @@ public class OrderRestController { @@ -29,17 +38,23 @@ public class OrderRestController {
29 @Autowired 38 @Autowired
30 private OrderService orderService; 39 private OrderService orderService;
31 40
  41 + @ApiOperation("提交订单")
32 @RequestMapping(value = "/buyer/submit", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 42 @RequestMapping(value = "/buyer/submit", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
33 - public SubmitOrderResponseDto submit(@RequestBody SubmitOrderRequestDto order) { 43 + public SubmitOrderResponseDto submit(@RequestBody @Valid SubmitOrderRequestDto order, BindingResult br) {
34 SubmitOrderResponseDto dto = new SubmitOrderResponseDto(); 44 SubmitOrderResponseDto dto = new SubmitOrderResponseDto();
35 - this.orderService.submit(order);  
36 - dto.setCode(BaseResponseDto.RESPONSE_CODE_SUCCESS);  
37 - dto.setSuccess(true); 45 + try {
  46 + this.orderService.submit(order);
  47 + dto.setCode(BaseResponseDto.RESPONSE_CODE_SUCCESS);
  48 + dto.setSuccess(true);
  49 + } catch (DtmsRpcException e) {
  50 + dto.setMessage(e.getMessage());
  51 + }
38 return dto; 52 return dto;
39 } 53 }
40 54
  55 + @ApiOperation("商家接单")
41 @RequestMapping(value = "/seller/take", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 56 @RequestMapping(value = "/seller/take", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
42 - public BaseResponseDto take(@RequestBody TakeOrderRequestDto request) { 57 + public BaseResponseDto take(@RequestBody @Valid TakeOrderRequestDto request, BindingResult br) {
43 BaseResponseDto dto = new BaseResponseDto(); 58 BaseResponseDto dto = new BaseResponseDto();
44 try { 59 try {
45 this.orderService.take(request.getOrderId(), request.getSellerId(), request.getTotalPrice()); 60 this.orderService.take(request.getOrderId(), request.getSellerId(), request.getTotalPrice());
@@ -51,8 +66,9 @@ public class OrderRestController { @@ -51,8 +66,9 @@ public class OrderRestController {
51 return dto; 66 return dto;
52 } 67 }
53 68
  69 + @ApiOperation("买家支付")
54 @RequestMapping(value = "/buyer/pay", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 70 @RequestMapping(value = "/buyer/pay", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
55 - public BaseResponseDto pay(@RequestBody PayOrderRequestDto request) { 71 + public BaseResponseDto pay(@RequestBody @Valid PayOrderRequestDto request, BindingResult br) {
56 BaseResponseDto dto = new BaseResponseDto(); 72 BaseResponseDto dto = new BaseResponseDto();
57 try { 73 try {
58 this.orderService.pay(request.getOrderId(), request.getBuyerId()); 74 this.orderService.pay(request.getOrderId(), request.getBuyerId());
@@ -64,8 +80,9 @@ public class OrderRestController { @@ -64,8 +80,9 @@ public class OrderRestController {
64 return dto; 80 return dto;
65 } 81 }
66 82
  83 + @ApiOperation("买家确认收货")
67 @RequestMapping(value = "/buyer/confirm", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 84 @RequestMapping(value = "/buyer/confirm", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
68 - public BaseResponseDto buyerConfirm(@RequestBody BuyerConfirmRequestDto request) { 85 + public BaseResponseDto buyerConfirm(@RequestBody @Valid BuyerConfirmRequestDto request, BindingResult br) {
69 BaseResponseDto response = new BaseResponseDto(); 86 BaseResponseDto response = new BaseResponseDto();
70 try { 87 try {
71 this.orderService.buyerConfirm(request.getOrderId(), request.getBuyerId()); 88 this.orderService.buyerConfirm(request.getOrderId(), request.getBuyerId());
@@ -77,8 +94,9 @@ public class OrderRestController { @@ -77,8 +94,9 @@ public class OrderRestController {
77 return response; 94 return response;
78 } 95 }
79 96
  97 + @ApiOperation("商家确认收款")
80 @RequestMapping(value = "/seller/confirm", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 98 @RequestMapping(value = "/seller/confirm", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
81 - public BaseResponseDto sellerConfirm(@RequestBody SellerConfirmRequestDto request) { 99 + public BaseResponseDto sellerConfirm(@RequestBody @Valid SellerConfirmRequestDto request, BindingResult br) {
82 BaseResponseDto response = new BaseResponseDto(); 100 BaseResponseDto response = new BaseResponseDto();
83 try { 101 try {
84 this.orderService.sellerConfirm(request.getOrderId(), request.getSellerId()); 102 this.orderService.sellerConfirm(request.getOrderId(), request.getSellerId());
@@ -91,7 +109,7 @@ public class OrderRestController { @@ -91,7 +109,7 @@ public class OrderRestController {
91 } 109 }
92 110
93 @RequestMapping(value = "/dtms/confirm", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 111 @RequestMapping(value = "/dtms/confirm", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
94 - public DtmsCallBackReturn dtmsConfirm(@RequestBody DtmsConfirmRequestDto dto) { 112 + public DtmsCallBackReturn dtmsConfirm(@RequestBody @Valid DtmsConfirmRequestDto dto, BindingResult br) {
95 DtmsCallBackReturn response = new DtmsCallBackReturn(); 113 DtmsCallBackReturn response = new DtmsCallBackReturn();
96 try { 114 try {
97 this.orderService.dtmsConfirm(dto.getOrderId()); 115 this.orderService.dtmsConfirm(dto.getOrderId());
@@ -103,8 +121,9 @@ public class OrderRestController { @@ -103,8 +121,9 @@ public class OrderRestController {
103 return response; 121 return response;
104 } 122 }
105 123
  124 + @ApiOperation("商家拒绝接单")
106 @RequestMapping(value = "/seller/refuse", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 125 @RequestMapping(value = "/seller/refuse", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
107 - public BaseResponseDto sellerRefuse(@RequestBody SellerRefuseRequestDto request) { 126 + public BaseResponseDto sellerRefuse(@RequestBody @Valid SellerRefuseRequestDto request, BindingResult br) {
108 BaseResponseDto response = new BaseResponseDto(); 127 BaseResponseDto response = new BaseResponseDto();
109 try { 128 try {
110 this.orderService.refuse(request.getOrderId(), request.getSellerId()); 129 this.orderService.refuse(request.getOrderId(), request.getSellerId());
@@ -116,8 +135,9 @@ public class OrderRestController { @@ -116,8 +135,9 @@ public class OrderRestController {
116 return response; 135 return response;
117 } 136 }
118 137
  138 + @ApiOperation("买家取消订单")
119 @RequestMapping(value = "/buyer/cancel", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 139 @RequestMapping(value = "/buyer/cancel", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
120 - public BaseResponseDto buyerCancel(@RequestBody BuyerCancelRequestDto request) { 140 + public BaseResponseDto buyerCancel(@RequestBody @Valid BuyerCancelRequestDto request, BindingResult br) {
121 BaseResponseDto response = new BaseResponseDto(); 141 BaseResponseDto response = new BaseResponseDto();
122 try { 142 try {
123 this.orderService.cancel(request.getOrderId(), request.getBuyerId()); 143 this.orderService.cancel(request.getOrderId(), request.getBuyerId());
@@ -130,7 +150,7 @@ public class OrderRestController { @@ -130,7 +150,7 @@ public class OrderRestController {
130 } 150 }
131 151
132 @RequestMapping(value = "/dtms/timeout", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 152 @RequestMapping(value = "/dtms/timeout", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
133 - public DtmsCallBackReturn dtmsTimeout(@RequestBody DtmsTimeoutRequestDto request) { 153 + public DtmsCallBackReturn dtmsTimeout(@RequestBody @Valid DtmsTimeoutRequestDto request, BindingResult br) {
134 DtmsCallBackReturn response = new DtmsCallBackReturn(); 154 DtmsCallBackReturn response = new DtmsCallBackReturn();
135 try { 155 try {
136 this.orderService.timeout(request.getOrderId()); 156 this.orderService.timeout(request.getOrderId());
@@ -142,4 +162,10 @@ public class OrderRestController { @@ -142,4 +162,10 @@ public class OrderRestController {
142 return response; 162 return response;
143 } 163 }
144 164
  165 + @ApiOperation("查询订单")
  166 + @RequestMapping(value = "/list", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
  167 + public OrderListResponseDto list(@RequestBody OrderListRequestDto request) {
  168 + throw new RuntimeException("该方法还没实现");
  169 + }
  170 +
145 } 171 }
b2c-orders-web/src/main/resources/jdbc.properties renamed to b2c-orders-web/src/main/resources/conf/important.properties
b2c-orders-web/src/main/resources/manage.properties renamed to b2c-orders-web/src/main/resources/conf/manage.properties
b2c-orders-web/src/main/resources/config.properties renamed to b2c-orders-web/src/main/resources/conf/orders-production.properties
b2c-orders-web/src/main/resources/logback.xml
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <!-- web 日志 --> 4 <!-- web 日志 -->
5 <appender name="ORDERS-WEB" 5 <appender name="ORDERS-WEB"
6 class="ch.qos.logback.core.rolling.RollingFileAppender"> 6 class="ch.qos.logback.core.rolling.RollingFileAppender">
7 - <file>${catalina.base}/logs/orders_web.log</file> 7 + <!-- <file>${catalina.base}/logs/orders_web.log</file> -->
8 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> 8 <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
9 <FileNamePattern>${catalina.base}/logs/%d{yyyy-MM-dd}/orders_web.%i.log.zip 9 <FileNamePattern>${catalina.base}/logs/%d{yyyy-MM-dd}/orders_web.%i.log.zip
10 </FileNamePattern> 10 </FileNamePattern>
@@ -38,59 +38,46 @@ @@ -38,59 +38,46 @@
38 [%file:%line] %msg%n</pattern> 38 [%file:%line] %msg%n</pattern>
39 </encoder> 39 </encoder>
40 </appender> 40 </appender>
41 - <logger name="com.diligrp.orders.web.restful" level="INFO"  
42 - additivity="false"> 41 + <logger name="com.b2c.dtms.web.restful" level="INFO" additivity="false">
43 <appender-ref ref="ORDERS-API" /> 42 <appender-ref ref="ORDERS-API" />
44 </logger> 43 </logger>
45 - <logger name="com.diligrp.orders.web.common.ApiCallMonitorAspect" 44 + <logger name="com.b2c.dtms.web.common.ApiCallMonitorAspect"
46 level="INFO" additivity="false"> 45 level="INFO" additivity="false">
47 <appender-ref ref="ORDERS-API" /> 46 <appender-ref ref="ORDERS-API" />
48 </logger> 47 </logger>
49 - <logger name="com.diligrp.orders.service.restful.impl" level="INFO" 48 + <logger name="com.b2c.dtms.service.restful.impl" level="INFO"
50 additivity="false"> 49 additivity="false">
51 <appender-ref ref="ORDERS-API" /> 50 <appender-ref ref="ORDERS-API" />
52 </logger> 51 </logger>
53 52
54 - <!-- rpc 接口日志 -->  
55 - <appender name="ORDERS-RPC"  
56 - class="ch.qos.logback.core.rolling.RollingFileAppender">  
57 - <file>${catalina.base}/logs/rpc/orders_rpc.log</file>  
58 - <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">  
59 - <FileNamePattern>${catalina.base}/logs/rpc/%d{yyyy-MM-dd}/orders_rpc_%i.log  
60 - </FileNamePattern>  
61 - <maxHistory>30</maxHistory>  
62 - <timeBasedFileNamingAndTriggeringPolicy  
63 - class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">  
64 - <maxFileSize>5MB</maxFileSize>  
65 - </timeBasedFileNamingAndTriggeringPolicy>  
66 - </rollingPolicy>  
67 - <encoder>  
68 - <pattern>[orders-rpc] %date %-5level [%thread] %logger{36}  
69 - [%file:%line] %msg%n</pattern>  
70 - </encoder>  
71 - </appender>  
72 - <logger name="com.diligrp.orders.rpc.service" level="INFO"  
73 - additivity="false">  
74 - <appender-ref ref="ORDERS-RPC" />  
75 - </logger>  
76 - <logger name="com.diligrp.orders.rpc.service.aop.RpcLoggerAspect"  
77 - level="INFO" additivity="false">  
78 - <appender-ref ref="ORDERS-RPC" />  
79 - </logger>  
80 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> 53 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
81 <encoder> 54 <encoder>
82 <pattern>[orders] %d{yyyy-MM-dd HH:mm:ss.SSS}:[%thread] %-5level 55 <pattern>[orders] %d{yyyy-MM-dd HH:mm:ss.SSS}:[%thread] %-5level
83 %logger{36} - %msg%n</pattern> 56 %logger{36} - %msg%n</pattern>
84 </encoder> 57 </encoder>
85 </appender> 58 </appender>
86 - <logger name="com.diligrp.orders.dao" level="INFO"> 59 + <logger name="com.b2c.dtms.dao" level="DEBUG">
87 <appender-ref ref="ORDERS-WEB" /> 60 <appender-ref ref="ORDERS-WEB" />
88 </logger> 61 </logger>
89 - <logger name="org.apache.ibatis" level="INFO"> 62 + <logger name="org.apache.ibatis" level="DEBUG">
90 <appender-ref ref="STDOUT" /> 63 <appender-ref ref="STDOUT" />
91 </logger> 64 </logger>
92 - <root level="INFO">  
93 - <appender-ref ref="ORDERS-WEB" /> 65 + <logger name="com.ibatis" level="DEBUG" />
  66 + <logger name="com.ibatis.common.jdbc.SimpleDataSource" level="DEBUG" />
  67 + <logger name="com.ibatis.common.jdbc.ScriptRunner" level="DEBUG" />
  68 + <logger name="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate"
  69 + level="DEBUG" />
  70 + <logger name="java.sql.Connection" level="DEBUG" />
  71 + <logger name="java.sql.Statement" level="DEBUG" />
  72 + <logger name="java.sql.PreparedStatement" level="DEBUG" />
  73 +
  74 + <root level="DEBUG">
  75 + <!-- <appender-ref ref="ORDERS-WEB" /> -->
94 <appender-ref ref="STDOUT" /> 76 <appender-ref ref="STDOUT" />
  77 + <appender-ref ref="org.apache.ibatis" />
  78 + <appender-ref ref="com.ibatis.common" />
  79 + <appender-ref ref="com.ibatis.common.jdbc.ScriptRunner" />
  80 + <appender-ref ref="com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate" />
  81 + <appender-ref ref="java.sql" />
95 </root> 82 </root>
96 </configuration> 83 </configuration>
97 \ No newline at end of file 84 \ No newline at end of file
b2c-orders-web/src/main/resources/spring-rpc.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<beans xmlns="http://www.springframework.org/schema/beans"
  3 + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
  4 + xmlns:aop="http://www.springframework.org/schema/aop" xmlns:cache="http://www.springframework.org/schema/cache"
  5 + xsi:schemaLocation="http://www.springframework.org/schema/beans
  6 + http://www.springframework.org/schema/beans/spring-beans.xsd
  7 + http://www.springframework.org/schema/context
  8 + http://www.springframework.org/schema/context/spring-context.xsd
  9 + http://www.springframework.org/schema/aop
  10 + http://www.springframework.org/schema/aop/spring-aop.xsd
  11 + http://www.springframework.org/schema/mvc
  12 + http://www.springframework.org/schema/mvc/spring-mvc.xsd
  13 + http://www.springframework.org/schema/cache
  14 + http://www.springframework.org/schema/cache/spring-cache-4.3.xsd"
  15 + default-lazy-init="true">
  16 +
  17 + <bean id="dtmsRPCService" class="com.b2c.orders.rpc.impl.DtmsRPCServiceBean" />
  18 +
  19 +</beans>
0 \ No newline at end of file 20 \ No newline at end of file
b2c-orders-web/src/main/resources/spring.xml
@@ -12,35 +12,52 @@ @@ -12,35 +12,52 @@
12 http://www.springframework.org/schema/mvc/spring-mvc.xsd 12 http://www.springframework.org/schema/mvc/spring-mvc.xsd
13 http://www.springframework.org/schema/cache 13 http://www.springframework.org/schema/cache
14 http://www.springframework.org/schema/cache/spring-cache-4.3.xsd" 14 http://www.springframework.org/schema/cache/spring-cache-4.3.xsd"
15 - default-autowire="byName" default-lazy-init="true">  
16 - <!--<context:component-scan base-package="com.diligrp.orders"> -->  
17 - <!--<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"  
18 - /> -->  
19 - <!--</context:component-scan> --> 15 + default-lazy-init="true">
  16 + <context:component-scan base-package="com.b2c.orders">
  17 + <context:exclude-filter type="annotation"
  18 + expression="org.springframework.stereotype.Controller" />
  19 + </context:component-scan>
20 <context:annotation-config /> 20 <context:annotation-config />
21 21
22 - <cache:annotation-driven cache-manager="cacheManager"  
23 - key-generator="cacheKeyGenerator" /> 22 + <!-- <cache:annotation-driven cache-manager="cacheManager" key-generator="cacheKeyGenerator"
  23 + /> -->
24 24
25 <aop:aspectj-autoproxy proxy-target-class="true" /> 25 <aop:aspectj-autoproxy proxy-target-class="true" />
26 26
27 - <bean id="diliMQConsumer" class="com.diligrp.util.rocketMQUtil.impl.DiliMQConsumerImpl"  
28 - init-method="startListener" destroy-method="stopListener">  
29 - <property name="namesrvAddr" value="${mq.namesrvAddr}"></property>  
30 - <property name="producerGroup" value="${mq.producerGroup}"></property>  
31 - </bean>  
32 <bean id="propertyConfigurer" 27 <bean id="propertyConfigurer"
33 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 28 class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  29 + <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
  30 + <property name="ignoreResourceNotFound" value="true" />
  31 + <property name="ignoreUnresolvablePlaceholders" value="true" />
34 <property name="locations"> 32 <property name="locations">
35 <list> 33 <list>
36 - <value>classpath:conf/jdbc.properties</value>  
37 - <value>classpath:conf/config.properties</value> 34 + <value>classpath:conf/important.properties</value>
  35 + <value>classpath:conf/orders-production.properties</value>
38 <value>classpath:conf/manage.properties</value> 36 <value>classpath:conf/manage.properties</value>
39 </list> 37 </list>
40 </property> 38 </property>
41 </bean> 39 </bean>
42 40
  41 + <!-- Access resource bundles with the specified basename -->
  42 + <bean id="messageSource"
  43 + class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
  44 + <!-- <property name="basenames" value="/WEB-INF/i18n/content,/WEB-INF/i18n/validation,/WEB-INF/i18n/asset,/WEB-INF/i18n/enum"
  45 + /> -->
  46 + <property name="basenames">
  47 + <list>
  48 + <value>/WEB-INF/i18n/msg-notice-template</value>
  49 + <value>/WEB-INF/i18n/msg-todoitem-template</value>
  50 + </list>
  51 + </property>
  52 + <!-- 刷新资源文件的周期,以秒为单位 -->
  53 + <property name="cacheSeconds" value="60" />
  54 + </bean>
43 55
44 - <import resource="classpath*:spring-mvc.xml" />  
45 - <import resource="classpath*:spring-dao.xml" /> 56 + <!-- <import resource="classpath*:spring-config-service.xml"/> -->
  57 + <import resource="classpath*:springmvc-config.xml" />
  58 + <import resource="classpath*:spring-dao.xml"/>
  59 + <import resource="classpath*:spring-rpc.xml"/>
  60 + <!-- <import resource="classpath*:spring-redis.xml"/> -->
  61 + <!-- <import resource="classpath*:spring-website-redis.xml"/> -->
  62 + <!-- <import resource="classpath*:spring-config-dtms-forOrdersWeb.xml"/> -->
46 </beans> 63 </beans>
47 \ No newline at end of file 64 \ No newline at end of file
b2c-orders-web/src/main/resources/spring-mvc.xml renamed to b2c-orders-web/src/main/resources/springmvc-config.xml
@@ -11,10 +11,32 @@ @@ -11,10 +11,32 @@
11 http://www.springframework.org/schema/aop/spring-aop-4.3.xsd" 11 http://www.springframework.org/schema/aop/spring-aop-4.3.xsd"
12 default-autowire="byName"> 12 default-autowire="byName">
13 13
14 - <context:component-scan base-package="com.b2c.orders.web" /> 14 + <!--对于请求返回字符串时,默认StringHttpMessageConverter,且其默认编码为ISO-8859-1,不会通过上面的MappingJacksonJsonView,因此客服端看到的中文会是乱码 -->
  15 + <!--对于请求返回对象时,下面配置的MappingJacksonJsonView来处理,返回sjon串 -->
  16 + <bean id="stringHttpMessageConverter"
  17 + class="org.springframework.http.converter.StringHttpMessageConverter">
  18 + <constructor-arg value="UTF-8" />
  19 + <property name="supportedMediaTypes">
  20 + <list>
  21 + <value>application/xml;charset=UTF-8</value>
  22 + <value>text/html;charset=UTF-8</value>
  23 + <value>text/plain;charset=UTF-8</value>
  24 + <value>application/json;charset=UTF-8</value>
  25 + </list>
  26 + </property>
  27 + </bean>
15 28
  29 + <!-- mvc:annotation-driven 使用默认的 stringHttpMessageConverter,默认的编码为ISO-8859-1,因此需要替换它 -->
  30 + <mvc:annotation-driven>
  31 + <mvc:message-converters>
  32 + <ref bean="stringHttpMessageConverter" />
  33 + </mvc:message-converters>
  34 + </mvc:annotation-driven>
  35 +
  36 + <context:component-scan base-package="com.b2c.orders.**" />
  37 +
  38 + <aop:aspectj-autoproxy proxy-target-class="true" />
16 <context:annotation-config /> 39 <context:annotation-config />
17 - <mvc:default-servlet-handler />  
18 40
19 <!-- 文件上传 --> 41 <!-- 文件上传 -->
20 <bean id="multipartResolver" 42 <bean id="multipartResolver"
@@ -38,11 +60,6 @@ @@ -38,11 +60,6 @@
38 <bean 60 <bean
39 class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> 61 class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
40 <property name="contentNegotiationManager" ref="contentNegotiationManager" /> 62 <property name="contentNegotiationManager" ref="contentNegotiationManager" />
41 - <property name="viewResolvers">  
42 - <list>  
43 - <ref bean="velocityViewResolver" />  
44 - </list>  
45 - </property>  
46 <property name="defaultViews"> 63 <property name="defaultViews">
47 <list> 64 <list>
48 <!-- for application/json MappingJacksonJsonView 默认编码为UTF-8 因此,请求返回对象时,会自动使用此view,使用UTF-8编码将对象转换为json --> 65 <!-- for application/json MappingJacksonJsonView 默认编码为UTF-8 因此,请求返回对象时,会自动使用此view,使用UTF-8编码将对象转换为json -->
@@ -60,16 +77,4 @@ @@ -60,16 +77,4 @@
60 <property name="cookieMaxAge" value="2147483647" /> 77 <property name="cookieMaxAge" value="2147483647" />
61 </bean> 78 </bean>
62 79
63 - <bean id="conversionService"  
64 - class="org.springframework.context.support.ConversionServiceFactoryBean">  
65 - <property name="converters">  
66 - <set>  
67 - <bean  
68 - class="com.diligrp.orders.common.tools.StringToReOrderStatusConverterFactory" />  
69 - </set>  
70 - </property>  
71 - </bean>  
72 -  
73 - <mvc:annotation-driven conversion-service="conversionService" />  
74 -  
75 </beans> 80 </beans>
76 \ No newline at end of file 81 \ No newline at end of file
b2c-orders-web/src/main/resources/sqlmap-config.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8" ?>
  2 +<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
  3 +
  4 +<configuration>
  5 + <settings>
  6 + <!-- 全局映射器启用缓存 -->
  7 + <setting name="cacheEnabled" value="true" />
  8 + <!-- 对于未知的SQL查询,允许返回不同的结果集以达到通用的效果 -->
  9 + <setting name="multipleResultSetsEnabled" value="true" />
  10 + <!-- 允许使用列标签代替列名 -->
  11 + <setting name="useColumnLabel" value="true" />
  12 + <!-- 数据库超过25000秒仍未响应则超时 -->
  13 + <setting name="defaultStatementTimeout" value="25000" />
  14 + <setting name="logImpl" value="STDOUT_LOGGING" />
  15 + </settings>
  16 +
  17 + <!-- 全局别名设置,在映射文件中只需写别名,而不必写出整个类路径 -->
  18 + <typeAliases>
  19 + <!-- <typeAlias type="com.diligrp.orders.domain.OrderItem" alias="orderItem"/>
  20 + <typeAlias type="com.diligrp.orders.domain.OrderStockLocker" alias="orderStockLocker"/>
  21 + <typeAlias type="com.diligrp.orders.domain.OrderTraceInfo" alias="orderTraceInfo"/>
  22 + <typeAlias type="com.diligrp.orders.domain.Orders" alias="orders"/>
  23 + <typeAlias type="com.diligrp.orders.domain.ReOrder" alias="reOrder"/>
  24 + <typeAlias type="com.diligrp.orders.domain.ClaimsOrder" alias="claimsOrder"/>
  25 + <typeAlias type="com.diligrp.orders.domain.ClaimsOrderTraceInfo" alias="claimsOrderTraceInfo"/>
  26 + <typeAlias type="com.diligrp.orders.domain.ReorderTraceInfo" alias="reorderTraceInfo"/>
  27 + <typeAlias type="com.diligrp.orders.domain.OrderMaxid" alias="orderMaxid"/>
  28 + <typeAlias type="com.diligrp.orders.domain.SettleBill" alias="settleBill"/>
  29 + <typeAlias type="com.diligrp.orders.domain.SettleCapitalFlow" alias="settleCapitalFlow"/>
  30 + <typeAlias type="com.diligrp.orders.domain.SettleRemitRecord" alias="settleRemitRecord"/>
  31 + <typeAlias type="com.diligrp.orders.domain.OrdersJob" alias="ordersJob"/>
  32 + <typeAlias type="com.diligrp.orders.domain.OrderShipInfo" alias="orderShipInfo"/>
  33 + <typeAlias type="com.diligrp.orders.domain.OrderRemindNumInfo" alias="orderRemindNumInfo"/>
  34 + <typeAlias type="com.diligrp.orders.domain.OrderPrint" alias="orderPrint"/>
  35 + <typeAlias type="com.diligrp.orders.domain.OrderReceiver" alias="orderReceiver" />
  36 + <typeAlias type="com.diligrp.orders.domain.OrderBrokerage" alias="orderBrokerage" />
  37 +
  38 + <typeAlias type="com.diligrp.orders.vo.OrdersSumVO" alias="ordersSumVO"/>
  39 + <typeAlias type="com.diligrp.orders.vo.OrderItemVO" alias="orderItemVO"/>
  40 + <typeAlias type="com.diligrp.orders.vo.SettleBillVO" alias="settleBillVO"/>
  41 + <typeAlias type="com.diligrp.orders.vo.SettleBillSumVO" alias="settleBillSumVO"/>
  42 + <typeAlias type="com.diligrp.orders.vo.SettleRemitRecordVO" alias="settleRemitRecordVO"/>
  43 + <typeAlias type="com.diligrp.orders.vo.SettleCapitalFlowVO" alias="settleCapitalFlowVO"/>
  44 + <typeAlias type="com.diligrp.orders.vo.KeyValueVO" alias="keyValueVO"/>
  45 + <typeAlias type="com.diligrp.orders.vo.OrdersVO" alias="ordersVO"/>
  46 +
  47 + <typeAlias type="com.diligrp.orders.domain.dtms.DtmsMessage" alias="dtmsMessage"/>
  48 + <typeAlias type="com.diligrp.orders.domain.dtms.DtmsMessageException" alias="dtmsMessageException"/>
  49 + <typeAlias type="com.diligrp.orders.domain.dtms.DtmsMessageConfig" alias="dtmsMessageConfig"/>
  50 + <typeAlias type="com.diligrp.orders.domain.dtms.DtmsMessageHistory" alias="dtmsMessageHistory"/> -->
  51 +
  52 +
  53 + </typeAliases>
  54 +
  55 + <typeHandlers>
  56 + <!-- <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderManStatusHandler" javaType="com.diligrp.orders.common.enums.order.OrderManStatus" />
  57 + <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderPayTypeHandler" javaType="com.diligrp.orders.publics.enums.PayType" />
  58 + <typeHandler handler="com.diligrp.orders.dao.typehandler.ReOrderStatusHandler" javaType="com.diligrp.orders.publics.enums.ReOrderStatus" />
  59 + <typeHandler handler="com.diligrp.orders.dao.typehandler.MarketDeliveryHandler" javaType="com.diligrp.orders.publics.enums.MarketDelivery" />
  60 + <typeHandler handler="com.diligrp.orders.dao.typehandler.RefundTypeHandler" javaType="com.diligrp.orders.common.enums.reorder.RefundType" />
  61 + <typeHandler handler="com.diligrp.orders.dao.typehandler.ClaimsOrderStatusHandler" javaType="com.diligrp.orders.publics.enums.ClaimsOrderStatus" />
  62 + <typeHandler handler="com.diligrp.orders.dao.typehandler.TraceTypeHandler" javaType="com.diligrp.orders.common.enums.TraceType" />
  63 + <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderPayStatusHandler" javaType="com.diligrp.orders.publics.enums.PayStatus" />
  64 + <typeHandler handler="com.diligrp.orders.dao.typehandler.ClaimsDemandHandler" javaType="com.diligrp.orders.publics.enums.ClaimsDemand" />
  65 + <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderTypeHandler" javaType="com.diligrp.orders.publics.enums.OrderType" />
  66 + <typeHandler handler="com.diligrp.orders.dao.typehandler.AuditResultHandler" javaType="com.diligrp.orders.publics.enums.AuditResult" />
  67 + <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderBrokerageStatusHandler" javaType="com.diligrp.orders.common.enums.order.OrderBrokerageStatus" />
  68 + <typeHandler handler="com.diligrp.orders.dao.typehandler.RemitAuditStatusHandler" javaType="com.diligrp.orders.publics.enums.RemitAuditStatus" />
  69 + <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderDeliveryTypeHandler" javaType="com.diligrp.orders.publics.enums.OrderDeliveryType" />
  70 + <typeHandler handler="com.diligrp.orders.dao.typehandler.OrderComeFromHandler" javaType="com.diligrp.orders.publics.enums.OrderComeFrom" />
  71 + <typeHandler handler="com.diligrp.orders.dao.typehandler.WarrantTypeHandler" javaType="com.diligrp.orders.publics.enums.WarrantType" />
  72 + <typeHandler handler="com.diligrp.orders.dao.typehandler.InvoiceTypeHandler" javaType="com.diligrp.orders.publics.enums.InvoiceType" /> -->
  73 + </typeHandlers>
  74 +
  75 + <!-- 映射文件路径 -->
  76 + <mappers>
  77 + <mapper resource="sqlmap/OrderMaxid.xml" />
  78 + </mappers>
  79 +
  80 +
  81 +</configuration>
0 \ No newline at end of file 82 \ No newline at end of file
b2c-orders-web/src/main/webapp/WEB-INF/web.xml
1 <?xml version="1.0" encoding="UTF-8"?> 1 <?xml version="1.0" encoding="UTF-8"?>
2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 - xmlns="http://java.sun.com/xml/ns/javaee"  
4 - xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"  
5 - id="WebApp_ID" version="3.0"> 3 + xmlns="http://java.sun.com/xml/ns/javaee"
  4 + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
  5 + id="WebApp_ID" version="3.0">
6 6
7 - <display-name>orders.zandeapp</display-name> 7 + <display-name>b2c-orders</display-name>
8 8
9 <context-param> 9 <context-param>
10 <param-name>webAppRootKey</param-name> 10 <param-name>webAppRootKey</param-name>
11 <param-value>orders.webapp.root</param-value> 11 <param-value>orders.webapp.root</param-value>
12 </context-param> 12 </context-param>
13 13
  14 + <!--<context-param>
  15 + <param-name>contextConfigLocation</param-name>
  16 + <param-value>classpath:spring.xml</param-value>
  17 + </context-param>
  18 +
  19 + <listener>
  20 + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  21 + </listener> -->
  22 +
14 <servlet> 23 <servlet>
15 <servlet-name>springmvc</servlet-name> 24 <servlet-name>springmvc</servlet-name>
16 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 25 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
17 <init-param> 26 <init-param>
18 - <param-name>contextConfigLocation</param-name>  
19 - <param-value>classpath:spring.xml</param-value> 27 + <param-name>contextConfigLocation</param-name>
  28 + <param-value>classpath:spring.xml</param-value>
20 </init-param> 29 </init-param>
21 - <load-on-startup>1</load-on-startup> 30 + <load-on-startup>1</load-on-startup>
22 </servlet> 31 </servlet>
23 32
24 <servlet-mapping> 33 <servlet-mapping>
25 <servlet-name>springmvc</servlet-name> 34 <servlet-name>springmvc</servlet-name>
26 - <url-pattern>/*</url-pattern> 35 + <url-pattern>/</url-pattern>
27 </servlet-mapping> 36 </servlet-mapping>
  37 +
  38 + <servlet-mapping>
  39 + <servlet-name>springmvc</servlet-name>
  40 + <url-pattern>/swagger-resources</url-pattern>
  41 + </servlet-mapping>
28 42
  43 + <!-- <filter>
  44 + <filter-name>EncodingFilter</filter-name>
  45 + <filter-class>com.diligrp.orders.web.interceptor.OrdersCharacterEncodingFilter</filter-class>
  46 + <init-param>
  47 + <param-name>encoding</param-name>
  48 + <param-value>UTF-8</param-value>
  49 + </init-param>
  50 + </filter> -->
  51 +
  52 + <filter>
  53 + <filter-name>characterEncodingFilter</filter-name>
  54 + <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
  55 + <init-param>
  56 + <param-name>encoding</param-name>
  57 + <param-value>UTF-8</param-value>
  58 + </init-param>
  59 + <init-param>
  60 + <param-name>forceEncoding</param-name>
  61 + <param-value>true</param-value>
  62 + </init-param>
  63 + </filter>
  64 + <filter-mapping>
  65 + <filter-name>characterEncodingFilter</filter-name>
  66 + <url-pattern>/*</url-pattern>
  67 + </filter-mapping>
  68 +
29 <filter> 69 <filter>
30 - <filter-name>characterEncodingFilter</filter-name>  
31 - <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>  
32 - <init-param>  
33 - <param-name>encoding</param-name>  
34 - <param-value>UTF-8</param-value>  
35 - </init-param>  
36 - <init-param>  
37 - <param-name>forceEncoding</param-name>  
38 - <param-value>true</param-value>  
39 - </init-param> 70 + <filter-name>HiddenHttpMethodFilter</filter-name>
  71 + <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
40 </filter> 72 </filter>
41 - <filter-mapping>  
42 - <filter-name>characterEncodingFilter</filter-name>  
43 - <url-pattern>/*</url-pattern>  
44 - </filter-mapping> 73 + <!-- <filter-mapping>
  74 + <filter-name>EncodingFilter</filter-name>
  75 + <servlet-name>springmvc</servlet-name>
  76 + </filter-mapping> -->
  77 + <!-- <filter-mapping>
  78 + <filter-name>HiddenHttpMethodFilter</filter-name>
  79 + <servlet-name>springmvc</servlet-name>
  80 + </filter-mapping> -->
45 81
46 <!--统一管理平台权限管理配置 --> 82 <!--统一管理平台权限管理配置 -->
47 - <filter>  
48 - <filter-name>sessionFilter</filter-name>  
49 - <filter-class>com.diligrp.manage.sdk.session.SessionFilter</filter-class>  
50 - </filter>  
51 - <filter-mapping>  
52 - <filter-name>sessionFilter</filter-name>  
53 - <url-pattern>*</url-pattern>  
54 - </filter-mapping> 83 + <!-- <filter>
  84 + <filter-name>sessionFilter</filter-name>
  85 + <filter-class>com.diligrp.manage.sdk.session.SessionFilter</filter-class>
  86 + </filter>
  87 + <filter-mapping>
  88 + <filter-name>sessionFilter</filter-name>
  89 + <url-pattern>*</url-pattern>
  90 + </filter-mapping> -->
55 91
56 </web-app> 92 </web-app>
57 \ No newline at end of file 93 \ No newline at end of file
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 2 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3 <modelVersion>4.0.0</modelVersion> 3 <modelVersion>4.0.0</modelVersion>
4 <groupId>com.b2c.orders</groupId> 4 <groupId>com.b2c.orders</groupId>
5 - <artifactId>orders-parent</artifactId> 5 + <artifactId>b2c-orders-parent</artifactId>
6 <version>0.0.1-SNAPSHOT</version> 6 <version>0.0.1-SNAPSHOT</version>
7 <packaging>pom</packaging> 7 <packaging>pom</packaging>
8 8
@@ -12,18 +12,18 @@ @@ -12,18 +12,18 @@
12 <maven.compiler.encoding>UTF-8</maven.compiler.encoding> 12 <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
13 <spring.version>4.3.2.RELEASE</spring.version> 13 <spring.version>4.3.2.RELEASE</spring.version>
14 <aspectj.version>1.6.11</aspectj.version> 14 <aspectj.version>1.6.11</aspectj.version>
15 - <jackson.version>2.8.1</jackson.version> 15 + <jackson.version>1.9.2</jackson.version>
16 <slf4j.version>1.7.21</slf4j.version> 16 <slf4j.version>1.7.21</slf4j.version>
17 <logback.version>1.1.3</logback.version> 17 <logback.version>1.1.3</logback.version>
18 - <titan.devlop.version>0.0.2-SNAPSHOT</titan.devlop.version>  
19 - <titan.product.version>0.0.2-SNAPSHOT</titan.product.version> 18 + <titan.devlop.version>0.0.3-SNAPSHOT</titan.devlop.version>
  19 + <titan.product.version>0.0.3-SNAPSHOT</titan.product.version>
20 <orders.client.sdk.version>1.1.0-SNAPSHOT</orders.client.sdk.version> 20 <orders.client.sdk.version>1.1.0-SNAPSHOT</orders.client.sdk.version>
21 <srvce.client.sdk.version>1.4-SNAPSHOT</srvce.client.sdk.version> 21 <srvce.client.sdk.version>1.4-SNAPSHOT</srvce.client.sdk.version>
22 <user.client.devlop.version>0.0.1-SNAPSHOT</user.client.devlop.version> 22 <user.client.devlop.version>0.0.1-SNAPSHOT</user.client.devlop.version>
23 <user.client.product.version>0.0.3-SNAPSHOT</user.client.product.version> 23 <user.client.product.version>0.0.3-SNAPSHOT</user.client.product.version>
24 <fastjson.version>1.2.7</fastjson.version> 24 <fastjson.version>1.2.7</fastjson.version>
25 <mybatis.version>3.2.5</mybatis.version> 25 <mybatis.version>3.2.5</mybatis.version>
26 - <guava.version>14.0.1</guava.version> 26 + <guava.version>20.0</guava.version>
27 <pnr-shop-develop.version>0.0.1-SNAPSHOT</pnr-shop-develop.version> 27 <pnr-shop-develop.version>0.0.1-SNAPSHOT</pnr-shop-develop.version>
28 <pnr-shop-product.version>0.0.1-SNAPSHOT</pnr-shop-product.version> 28 <pnr-shop-product.version>0.0.1-SNAPSHOT</pnr-shop-product.version>
29 <lombox.version>1.16.10</lombox.version> 29 <lombox.version>1.16.10</lombox.version>
@@ -48,29 +48,79 @@ @@ -48,29 +48,79 @@
48 <project.static.path>http://static.1n4j.com/static</project.static.path> 48 <project.static.path>http://static.1n4j.com/static</project.static.path>
49 <!-- 订单请求和响应参数 --> 49 <!-- 订单请求和响应参数 -->
50 <orders.paramLog.enabled>true</orders.paramLog.enabled> 50 <orders.paramLog.enabled>true</orders.paramLog.enabled>
51 - <pring.data.redis.version>1.6.2.RELEASE</pring.data.redis.version>  
52 - <commons-lang.vaersion>2.5</commons-lang.vaersion>  
53 - <commons-codec.version>1.6</commons-codec.version>  
54 - <servlet-api.version>2.5</servlet-api.version>  
55 - <mybatis-spring.version>1.2.0</mybatis-spring.version>  
56 - <druid.version>1.0.14</druid.version> 51 + <mariadb-java-client.version>1.5.5</mariadb-java-client.version>
57 <aspectjweaver.version>1.7.2</aspectjweaver.version> 52 <aspectjweaver.version>1.7.2</aspectjweaver.version>
58 - <woodstox.version>4.4.1</woodstox.version>  
59 </properties> 53 </properties>
60 54
61 <dependencyManagement> 55 <dependencyManagement>
62 <dependencies> 56 <dependencies>
63 - <!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger2 --> 57 + <!--swagger -->
64 <dependency> 58 <dependency>
65 <groupId>io.springfox</groupId> 59 <groupId>io.springfox</groupId>
66 <artifactId>springfox-swagger2</artifactId> 60 <artifactId>springfox-swagger2</artifactId>
67 - <version>2.6.1</version> 61 + <version>2.2.2</version>
  62 + <exclusions>
  63 + <exclusion>
  64 + <groupId>org.springframework</groupId>
  65 + <artifactId>spring-web</artifactId>
  66 + </exclusion>
  67 + <exclusion>
  68 + <groupId>org.springframework</groupId>
  69 + <artifactId>spring-beans</artifactId>
  70 + </exclusion>
  71 + <exclusion>
  72 + <groupId>org.springframework</groupId>
  73 + <artifactId>spring-webmvc</artifactId>
  74 + </exclusion>
  75 + <exclusion>
  76 + <groupId>org.springframework</groupId>
  77 + <artifactId>spring-beans</artifactId>
  78 + </exclusion>
  79 + <exclusion>
  80 + <groupId>org.springframework</groupId>
  81 + <artifactId>spring-context</artifactId>
  82 + </exclusion>
  83 + <exclusion>
  84 + <groupId>org.springframework</groupId>
  85 + <artifactId>spring-core</artifactId>
  86 + </exclusion>
  87 + <exclusion>
  88 + <groupId>org.springframework</groupId>
  89 + <artifactId>spring-aop</artifactId>
  90 + </exclusion>
  91 + <exclusion>
  92 + <groupId>org.aspectj</groupId>
  93 + <artifactId>aspectjweaver</artifactId>
  94 + </exclusion>
  95 + <exclusion>
  96 + <groupId>org.slf4j</groupId>
  97 + <artifactId>slf4j-api</artifactId>
  98 + </exclusion>
  99 + <exclusion>
  100 + <groupId>com.fasterxml.jackson.core</groupId>
  101 + <artifactId>jackson-annotations</artifactId>
  102 + </exclusion>
  103 + </exclusions>
68 </dependency> 104 </dependency>
69 - <!-- https://mvnrepository.com/artifact/cglib/cglib -->  
70 <dependency> 105 <dependency>
71 - <groupId>cglib</groupId>  
72 - <artifactId>cglib</artifactId>  
73 - <version>3.2.4</version> 106 + <groupId>com.b2c.website</groupId>
  107 + <artifactId>diligrp-website-util</artifactId>
  108 + <version>0.0.2-SNAPSHOT</version>
  109 + <exclusions>
  110 + <exclusion>
  111 + <groupId>velocity</groupId>
  112 + <artifactId>velocity-dep</artifactId>
  113 + </exclusion>
  114 + <exclusion>
  115 + <groupId>org.apache.hbase</groupId>
  116 + <artifactId>hbase-client</artifactId>
  117 + </exclusion>
  118 + </exclusions>
  119 + </dependency>
  120 + <dependency>
  121 + <groupId>com.yqyw</groupId>
  122 + <artifactId>orders-client</artifactId>
  123 + <version>${orders.client.sdk.version}</version>
74 </dependency> 124 </dependency>
75 <!-- 需求中心SDK --> 125 <!-- 需求中心SDK -->
76 <dependency> 126 <dependency>
@@ -80,32 +130,26 @@ @@ -80,32 +130,26 @@
80 </dependency> 130 </dependency>
81 <!-- 商品库 --> 131 <!-- 商品库 -->
82 <dependency> 132 <dependency>
83 - <groupId>com.yqyq.titan</groupId> 133 + <groupId>com.yqyw.titan</groupId>
84 <artifactId>titan-sdk</artifactId> 134 <artifactId>titan-sdk</artifactId>
85 <version>${titan.devlop.version}</version> 135 <version>${titan.devlop.version}</version>
86 </dependency> 136 </dependency>
  137 + <!-- 供应商 -->
  138 + <dependency>
  139 + <groupId>com.diligrp</groupId>
  140 + <artifactId>diligrp-crm-api</artifactId>
  141 + <version>0.0.1-SNAPSHOT</version>
  142 + </dependency>
  143 + <!-- 客户信息 -->
  144 + <!-- <dependency> <groupId>com.yqyw.website.user</groupId> <artifactId>diligrp-user-client</artifactId>
  145 + <version>${user.client.devlop.version}</version> </dependency> -->
87 <!-- 数据字典 --> 146 <!-- 数据字典 -->
88 <dependency> 147 <dependency>
89 <groupId>com.b2c.website.web</groupId> 148 <groupId>com.b2c.website.web</groupId>
90 <artifactId>diligrp-website-api</artifactId> 149 <artifactId>diligrp-website-api</artifactId>
91 - <version>1.0.5-SNAPSHOT</version>  
92 - <exclusions>  
93 - <exclusion>  
94 - <groupId>org.apache.hbase</groupId>  
95 - <artifactId>hbase-client</artifactId>  
96 - </exclusion>  
97 - </exclusions>  
98 - </dependency>  
99 - <dependency>  
100 - <groupId>com.b2c.website</groupId>  
101 - <artifactId>diligrp-website-util</artifactId>  
102 - <version>0.0.2-SNAPSHOT</version> 150 + <version>1.0.3-SNAPSHOT</version>
103 <exclusions> 151 <exclusions>
104 <exclusion> 152 <exclusion>
105 - <groupId>velocity</groupId>  
106 - <artifactId>velocity-dep</artifactId>  
107 - </exclusion>  
108 - <exclusion>  
109 <groupId>org.apache.hbase</groupId> 153 <groupId>org.apache.hbase</groupId>
110 <artifactId>hbase-client</artifactId> 154 <artifactId>hbase-client</artifactId>
111 </exclusion> 155 </exclusion>
@@ -113,7 +157,7 @@ @@ -113,7 +157,7 @@
113 </dependency> 157 </dependency>
114 <!--后台user --> 158 <!--后台user -->
115 <dependency> 159 <dependency>
116 - <groupId>com.b2c.manage</groupId> 160 + <groupId>com.yqyw.manage</groupId>
117 <artifactId>diligrp-manage-sdk</artifactId> 161 <artifactId>diligrp-manage-sdk</artifactId>
118 <version>0.0.3-SNAPSHOT</version> 162 <version>0.0.3-SNAPSHOT</version>
119 <exclusions> 163 <exclusions>
@@ -131,7 +175,7 @@ @@ -131,7 +175,7 @@
131 </dependency> 175 </dependency>
132 <!-- 消息中心/待办事项 --> 176 <!-- 消息中心/待办事项 -->
133 <dependency> 177 <dependency>
134 - <groupId>com.b2c.messageCenter.sdk</groupId> 178 + <groupId>com.yqyw.messageCenter.sdk</groupId>
135 <artifactId>diligrp-messageCenter-sdk</artifactId> 179 <artifactId>diligrp-messageCenter-sdk</artifactId>
136 <version>0.0.4-SNAPSHOT</version> 180 <version>0.0.4-SNAPSHOT</version>
137 <exclusions> 181 <exclusions>
@@ -143,7 +187,7 @@ @@ -143,7 +187,7 @@
143 </dependency> 187 </dependency>
144 <!-- 店铺API --> 188 <!-- 店铺API -->
145 <dependency> 189 <dependency>
146 - <groupId>com.b2c.shop</groupId> 190 + <groupId>com.yqyw.shop</groupId>
147 <artifactId>shop-sdk</artifactId> 191 <artifactId>shop-sdk</artifactId>
148 <version>${pnr-shop-develop.version}</version> 192 <version>${pnr-shop-develop.version}</version>
149 </dependency> 193 </dependency>
@@ -242,12 +286,6 @@ @@ -242,12 +286,6 @@
242 <version>2.5</version> 286 <version>2.5</version>
243 <scope>provided</scope> 287 <scope>provided</scope>
244 </dependency> 288 </dependency>
245 - <!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->  
246 - <dependency>  
247 - <groupId>org.mariadb.jdbc</groupId>  
248 - <artifactId>mariadb-java-client</artifactId>  
249 - <version>1.5.5</version>  
250 - </dependency>  
251 <dependency> 289 <dependency>
252 <groupId>org.mybatis</groupId> 290 <groupId>org.mybatis</groupId>
253 <artifactId>mybatis</artifactId> 291 <artifactId>mybatis</artifactId>
@@ -263,10 +301,13 @@ @@ -263,10 +301,13 @@
263 <artifactId>druid</artifactId> 301 <artifactId>druid</artifactId>
264 <version>1.0.14</version> 302 <version>1.0.14</version>
265 </dependency> 303 </dependency>
  304 + <!-- <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId>
  305 + <version>5.1.25</version> </dependency> -->
  306 + <!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
266 <dependency> 307 <dependency>
267 - <groupId>mysql</groupId>  
268 - <artifactId>mysql-connector-java</artifactId>  
269 - <version>5.1.25</version> 308 + <groupId>org.mariadb.jdbc</groupId>
  309 + <artifactId>mariadb-java-client</artifactId>
  310 + <version>${mariadb-java-client.version}</version>
270 </dependency> 311 </dependency>
271 <!-- 工具类 --> 312 <!-- 工具类 -->
272 <!-- google sets,maps --> 313 <!-- google sets,maps -->
@@ -284,7 +325,12 @@ @@ -284,7 +325,12 @@
284 <dependency> 325 <dependency>
285 <groupId>org.aspectj</groupId> 326 <groupId>org.aspectj</groupId>
286 <artifactId>aspectjweaver</artifactId> 327 <artifactId>aspectjweaver</artifactId>
287 - <version>1.7.2</version> 328 + <version>${aspectjweaver.version}</version>
  329 + </dependency>
  330 + <dependency>
  331 + <groupId>cglib</groupId>
  332 + <artifactId>cglib-nodep</artifactId>
  333 + <version>2.1_3</version>
288 </dependency> 334 </dependency>
289 <dependency> 335 <dependency>
290 <groupId>org.apache.commons</groupId> 336 <groupId>org.apache.commons</groupId>
@@ -295,7 +341,7 @@ @@ -295,7 +341,7 @@
295 <dependency> 341 <dependency>
296 <groupId>junit</groupId> 342 <groupId>junit</groupId>
297 <artifactId>junit</artifactId> 343 <artifactId>junit</artifactId>
298 - <version>4.11</version> 344 + <version>4.5</version>
299 <scope>test</scope> 345 <scope>test</scope>
300 </dependency> 346 </dependency>
301 <!-- if you enable @AspectJ style AOP in spring. --> 347 <!-- if you enable @AspectJ style AOP in spring. -->
@@ -310,82 +356,10 @@ @@ -310,82 +356,10 @@
310 <artifactId>hibernate-validator</artifactId> 356 <artifactId>hibernate-validator</artifactId>
311 <version>5.1.3.Final</version> 357 <version>5.1.3.Final</version>
312 </dependency> 358 </dependency>
313 - <!-- if you use velocity view in springmvc -->  
314 - <dependency>  
315 - <groupId>org.apache.velocity</groupId>  
316 - <artifactId>velocity</artifactId>  
317 - <version>1.7</version>  
318 - </dependency>  
319 - <!-- if you use velocity layout view in springmvc -->  
320 - <dependency>  
321 - <groupId>org.apache.velocity</groupId>  
322 - <artifactId>velocity-tools</artifactId>  
323 - <version>2.0</version>  
324 - <exclusions>  
325 - <exclusion>  
326 - <groupId>org.apache.struts</groupId>  
327 - <artifactId>struts-core</artifactId>  
328 - </exclusion>  
329 - <exclusion>  
330 - <groupId>org.apache.struts</groupId>  
331 - <artifactId>struts-taglib</artifactId>  
332 - </exclusion>  
333 - <exclusion>  
334 - <groupId>org.apache.struts</groupId>  
335 - <artifactId>struts-tiles</artifactId>  
336 - </exclusion>  
337 - <exclusion>  
338 - <groupId>sslext</groupId>  
339 - <artifactId>sslext</artifactId>  
340 - </exclusion>  
341 - </exclusions>  
342 - </dependency>  
343 - <dependency>  
344 - <groupId>com.fasterxml.jackson.core</groupId>  
345 - <artifactId>jackson-core</artifactId>  
346 - <version>${jackson.version}</version>  
347 - </dependency>  
348 -  
349 - <!-- Just the annotations; use this dependency if you want to attach annotations  
350 - to classes without connecting them to the code. -->  
351 - <dependency>  
352 - <groupId>com.fasterxml.jackson.core</groupId>  
353 - <artifactId>jackson-annotations</artifactId>  
354 - <version>${jackson.version}</version>  
355 - </dependency>  
356 -  
357 - <!-- databinding; ObjectMapper, JsonNode and related classes are here -->  
358 - <dependency>  
359 - <groupId>com.fasterxml.jackson.core</groupId>  
360 - <artifactId>jackson-databind</artifactId>  
361 - <version>${jackson.version}</version>  
362 - </dependency>  
363 - <!-- smile (binary JSON). Other artifacts in this group do other formats. -->  
364 - <dependency>  
365 - <groupId>com.fasterxml.jackson.dataformat</groupId>  
366 - <artifactId>jackson-dataformat-smile</artifactId>  
367 - <version>${jackson.version}</version>  
368 - </dependency>  
369 - <dependency>  
370 - <groupId>com.fasterxml.jackson.dataformat</groupId>  
371 - <artifactId>jackson-dataformat-xml</artifactId>  
372 - <version>${jackson.version}</version>  
373 - </dependency>  
374 - <dependency>  
375 - <groupId>org.codehaus.woodstox</groupId>  
376 - <artifactId>woodstox-core-asl</artifactId>  
377 - <version>${woodstox.version}</version>  
378 - </dependency>  
379 - <!-- JAX-RS provider -->  
380 - <dependency>  
381 - <groupId>com.fasterxml.jackson.jaxrs</groupId>  
382 - <artifactId>jackson-jaxrs-json-provider</artifactId>  
383 - <version>${jackson.version}</version>  
384 - </dependency>  
385 - <!-- Support for JAX-B annotations as additional configuration --> 359 + <!-- if you enable json support in spring mvc. -->
386 <dependency> 360 <dependency>
387 - <groupId>com.fasterxml.jackson.module</groupId>  
388 - <artifactId>jackson-module-jaxb-annotations</artifactId> 361 + <groupId>org.codehaus.jackson</groupId>
  362 + <artifactId>jackson-mapper-asl</artifactId>
389 <version>${jackson.version}</version> 363 <version>${jackson.version}</version>
390 </dependency> 364 </dependency>
391 <!-- if you use fileupload in spring mvc --> 365 <!-- if you use fileupload in spring mvc -->
@@ -438,8 +412,8 @@ @@ -438,8 +412,8 @@
438 </activation> 412 </activation>
439 <properties> 413 <properties>
440 <!-- 数据库 --> 414 <!-- 数据库 -->
441 - <orders.jdbc.driver>com.mysql.jdbc.Driver</orders.jdbc.driver>  
442 - <orders.jdbc.url>jdbc:MySql://10.28.10.188:3306/1n4j_orders?characterEncoding=UTF-8</orders.jdbc.url> 415 + <orders.jdbc.driver>org.mariadb.jdbc.Driver</orders.jdbc.driver>
  416 + <orders.jdbc.url>jdbc:mariadb://127.0.0.1:3306/b2c_orders?characterEncoding=UTF-8</orders.jdbc.url>
443 <orders.jdbc.username>root</orders.jdbc.username> 417 <orders.jdbc.username>root</orders.jdbc.username>
444 <orders.jdbc.password>123456</orders.jdbc.password> 418 <orders.jdbc.password>123456</orders.jdbc.password>
445 <!-- 日志 --> 419 <!-- 日志 -->
@@ -534,15 +508,21 @@ @@ -534,15 +508,21 @@
534 </plugins> 508 </plugins>
535 </pluginManagement> 509 </pluginManagement>
536 <defaultGoal>compile</defaultGoal> 510 <defaultGoal>compile</defaultGoal>
  511 + <resources>
  512 + <resource>
  513 + <directory>${project.basedir}/src/main/resources</directory>
  514 + <filtering>true</filtering>
  515 + </resource>
  516 + </resources>
537 </build> 517 </build>
538 <modules> 518 <modules>
539 - <module>orders-domain</module>  
540 - <module>orders-commons</module>  
541 - <module>orders-dao</module>  
542 - <module>orders-manager</module>  
543 - <module>orders-client</module>  
544 - <module>orders-service</module>  
545 - <module>orders-web</module>  
546 - <module>orders-rpc</module> 519 + <module>b2c-orders-domain</module>
  520 + <module>b2c-orders-commons</module>
  521 + <module>b2c-orders-manager</module>
  522 + <module>b2c-orders-client</module>
  523 + <module>b2c-orders-service</module>
  524 + <module>b2c-orders-web</module>
  525 + <module>b2c-orders-rpc</module>
  526 + <module>b2c-orders-dao</module>
547 </modules> 527 </modules>
548 </project> 528 </project>
549 \ No newline at end of file 529 \ No newline at end of file