Commit b8993ee35e4545e60c9c62dd4436a25de5e95061

Authored by Jiang
1 parent 06cb9858

删除不需要的组件

Showing 100 changed files with 3393 additions and 514 deletions

Too many changes to show.

To preserve performance only 100 of 957 files are displayed.

.gitignore deleted 100644 → 0
1   -*.iml
2   -.idea
3   -.classpath
4   -*/target/
5   -*/webapp/WEB-INF/classes
6   -*/webapp/WEB-INF/lib
7   -*.MF
8   -**/WEB-INF/classes/
9   -**/WEB-INF/lib
10   -**/.settings/
11   -**/.classpath
12   -**/.project
13   -**/catalina.base_IS_UNDEFINED
14 0 \ No newline at end of file
.project 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>orders-parent</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.eclipse.m2e.core.maven2Builder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + </buildSpec>
  14 + <natures>
  15 + <nature>org.eclipse.m2e.core.maven2Nature</nature>
  16 + </natures>
  17 +</projectDescription>
... ...
.settings/org.eclipse.core.resources.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +encoding/<project>=UTF-8
... ...
.settings/org.eclipse.m2e.core.prefs 0 → 100644
  1 +activeProfiles=
  2 +eclipse.preferences.version=1
  3 +resolveWorkspaceProjects=true
  4 +version=1
... ...
README.md deleted 100644 → 0
1   -orders
2 0 \ No newline at end of file
b2c-orders-client/.classpath 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry kind="src" output="target/classes" path="src/main/java">
  4 + <attributes>
  5 + <attribute name="optional" value="true"/>
  6 + <attribute name="maven.pomderived" value="true"/>
  7 + </attributes>
  8 + </classpathentry>
  9 + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10 + <attributes>
  11 + <attribute name="maven.pomderived" value="true"/>
  12 + </attributes>
  13 + </classpathentry>
  14 + <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15 + <attributes>
  16 + <attribute name="optional" value="true"/>
  17 + <attribute name="maven.pomderived" value="true"/>
  18 + </attributes>
  19 + </classpathentry>
  20 + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  21 + <attributes>
  22 + <attribute name="maven.pomderived" value="true"/>
  23 + </attributes>
  24 + </classpathentry>
  25 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  26 + <attributes>
  27 + <attribute name="maven.pomderived" value="true"/>
  28 + </attributes>
  29 + </classpathentry>
  30 + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  31 + <attributes>
  32 + <attribute name="maven.pomderived" value="true"/>
  33 + <attribute name="org.eclipse.jst.component.nondependency" value=""/>
  34 + </attributes>
  35 + </classpathentry>
  36 + <classpathentry kind="output" path="target/classes"/>
  37 +</classpath>
... ...
b2c-orders-client/.gitignore 0 → 100644
  1 +/target/
... ...
b2c-orders-client/.project 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>b2c-orders-client</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.eclipse.wst.common.project.facet.core.builder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + <buildCommand>
  14 + <name>org.eclipse.jdt.core.javabuilder</name>
  15 + <arguments>
  16 + </arguments>
  17 + </buildCommand>
  18 + <buildCommand>
  19 + <name>org.eclipse.m2e.core.maven2Builder</name>
  20 + <arguments>
  21 + </arguments>
  22 + </buildCommand>
  23 + <buildCommand>
  24 + <name>org.eclipse.wst.validation.validationbuilder</name>
  25 + <arguments>
  26 + </arguments>
  27 + </buildCommand>
  28 + </buildSpec>
  29 + <natures>
  30 + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  31 + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  32 + <nature>org.eclipse.jdt.core.javanature</nature>
  33 + <nature>org.eclipse.m2e.core.maven2Nature</nature>
  34 + <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  35 + </natures>
  36 +</projectDescription>
... ...
b2c-orders-client/.settings/org.eclipse.core.resources.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +encoding//src/main/java=UTF-8
  3 +encoding//src/main/resources=UTF-8
  4 +encoding//src/test/java=UTF-8
  5 +encoding//src/test/resources=UTF-8
  6 +encoding/<project>=UTF-8
... ...
b2c-orders-client/.settings/org.eclipse.jdt.core.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
  3 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  4 +org.eclipse.jdt.core.compiler.compliance=1.7
  5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
  6 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
  7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
  8 +org.eclipse.jdt.core.compiler.source=1.7
... ...
b2c-orders-client/.settings/org.eclipse.m2e.core.prefs 0 → 100644
  1 +activeProfiles=
  2 +eclipse.preferences.version=1
  3 +resolveWorkspaceProjects=true
  4 +version=1
... ...
b2c-orders-client/.settings/org.eclipse.wst.common.component 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
  2 + <wb-module deploy-name="b2c-orders-client">
  3 + <wb-resource deploy-path="/" source-path="/src/main/java"/>
  4 + <wb-resource deploy-path="/" source-path="/src/main/resources"/>
  5 + </wb-module>
  6 +</project-modules>
... ...
b2c-orders-client/.settings/org.eclipse.wst.common.project.facet.core.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<faceted-project>
  3 + <installed facet="java" version="1.7"/>
  4 + <installed facet="jst.utility" version="1.0"/>
  5 +</faceted-project>
... ...
orders-common/pom.xml renamed to b2c-orders-client/pom.xml
1   -<?xml version="1.0" encoding="UTF-8"?>
2 1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3   - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
4   - <modelVersion>4.0.0</modelVersion>
5   - <parent>
6   - <groupId>com.b2c.orders</groupId>
7   - <artifactId>orders</artifactId>
8   - <version>1.1-SNAPSHOT</version>
9   - </parent>
10   -
11   - <artifactId>orders-common</artifactId>
12   - <packaging>jar</packaging>
13   - <name>orders-common</name>
14   -
15   - <dependencies>
16   - <dependency>
17   - <groupId>org.springframework</groupId>
18   - <artifactId>spring-webmvc</artifactId>
19   - </dependency>
20   - <dependency>
21   - <groupId>org.springframework</groupId>
22   - <artifactId>spring-tx</artifactId>
23   - </dependency>
24   -
25   - <!-- favor logger -->
26   - <dependency>
27   - <groupId>org.slf4j</groupId>
28   - <artifactId>slf4j-api</artifactId>
  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>
  4 + <parent>
  5 + <groupId>com.b2c.orders</groupId>
  6 + <artifactId>orders-parent</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + </parent>
  9 + <artifactId>orders-client</artifactId>
  10 + <version>1.1.0-SNAPSHOT</version>
  11 +
  12 + <dependencies>
  13 + <dependency>
  14 + <groupId>org.hibernate</groupId>
  15 + <artifactId>hibernate-validator</artifactId>
  16 + </dependency>
  17 + <dependency>
  18 + <groupId>org.projectlombok</groupId>
  19 + <artifactId>lombok</artifactId>
29 20 </dependency>
30   - <!--yuehongbo-->
31   - <dependency>
32   - <groupId>ch.qos.logback</groupId>
33   - <artifactId>logback-classic</artifactId>
34   - </dependency>
35   - <dependency>
36   - <groupId>ch.qos.logback</groupId>
37   - <artifactId>logback-core</artifactId>
38   - </dependency>
39   - <dependency>
40   - <groupId>commons-lang</groupId>
41   - <artifactId>commons-lang</artifactId>
42   - </dependency>
43   - <dependency>
44   - <groupId>commons-codec</groupId>
45   - <artifactId>commons-codec</artifactId>
46   - </dependency>
47   -
48   - <!-- 工具类 -->
49   - <!-- google sets,maps -->
50 21 <dependency>
51 22 <groupId>com.google.guava</groupId>
52 23 <artifactId>guava</artifactId>
53 24 </dependency>
54   - <!-- JSON -->
55 25 <dependency>
56 26 <groupId>com.alibaba</groupId>
57 27 <artifactId>fastjson</artifactId>
58 28 </dependency>
59 29 <dependency>
60   - <groupId>org.aspectj</groupId>
61   - <artifactId>aspectjweaver</artifactId>
  30 + <groupId>com.github.kevinsawicki</groupId>
  31 + <artifactId>http-request</artifactId>
  32 + </dependency>
  33 + <dependency>
  34 + <groupId>org.slf4j</groupId>
  35 + <artifactId>slf4j-api</artifactId>
  36 + </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>
62 66 </dependency>
  67 + <!-- JAX-RS provider -->
63 68 <dependency>
64   - <groupId>cglib</groupId>
65   - <artifactId>cglib-nodep</artifactId>
66   - </dependency>
67   - <dependency>
68   - <groupId>org.apache.httpcomponents</groupId>
69   - <artifactId>httpclient</artifactId>
70   - </dependency>
71   - <dependency>
72   - <groupId>redis.clients</groupId>
73   - <artifactId>jedis</artifactId>
74   - <version>2.4.2</version>
75   - </dependency>
76   - <dependency>
77   - <groupId>org.springframework.data</groupId>
78   - <artifactId>spring-data-redis</artifactId>
79   - </dependency>
80   - <dependency>
81   - <groupId>com.b2c.orders</groupId>
82   - <artifactId>orders-public</artifactId>
83   - <version>${project.parent.version}</version>
84   - </dependency>
85   - </dependencies>
  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>
  77 + </dependencies>
86 78 </project>
87 79 \ No newline at end of file
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/BaseRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class BaseRequestDto implements Serializable {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = -379042252579275804L;
  11 +
  12 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/BuyerCancelRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class BuyerCancelRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = -5338664730613120833L;
  9 +
  10 + private Long orderId;
  11 + private Long buyerId;
  12 +
  13 + public Long getOrderId() {
  14 + return orderId;
  15 + }
  16 +
  17 + public void setOrderId(Long orderId) {
  18 + this.orderId = orderId;
  19 + }
  20 +
  21 + public Long getBuyerId() {
  22 + return buyerId;
  23 + }
  24 +
  25 + public void setBuyerId(Long buyerId) {
  26 + this.buyerId = buyerId;
  27 + }
  28 +
  29 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/BuyerConfirmRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class BuyerConfirmRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 5323840474125840652L;
  9 +
  10 + private Long orderId;
  11 + private Long buyerId;
  12 +
  13 + public Long getOrderId() {
  14 + return orderId;
  15 + }
  16 +
  17 + public void setOrderId(Long orderId) {
  18 + this.orderId = orderId;
  19 + }
  20 +
  21 + public Long getBuyerId() {
  22 + return buyerId;
  23 + }
  24 +
  25 + public void setBuyerId(Long buyerId) {
  26 + this.buyerId = buyerId;
  27 + }
  28 +
  29 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/DtmsConfirmRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class DtmsConfirmRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 7519820743736468349L;
  9 +
  10 + private Long orderId;
  11 +
  12 + public Long getOrderId() {
  13 + return orderId;
  14 + }
  15 +
  16 + public void setOrderId(Long orderId) {
  17 + this.orderId = orderId;
  18 + }
  19 +
  20 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/DtmsTimeoutRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class DtmsTimeoutRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 8454009010057359942L;
  9 +
  10 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/OrderItemDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class OrderItemDto implements Serializable {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 2876508071333281636L;
  11 +
  12 + private ProductDto product;
  13 + private Long buyerId;
  14 +
  15 + public ProductDto getProduct() {
  16 + return product;
  17 + }
  18 +
  19 + public void setProduct(ProductDto product) {
  20 + this.product = product;
  21 + }
  22 +
  23 + public Long getBuyerId() {
  24 + return buyerId;
  25 + }
  26 +
  27 + public void setBuyerId(Long buyerId) {
  28 + this.buyerId = buyerId;
  29 + }
  30 +
  31 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/PayOrderRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class PayOrderRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 7438455154625322536L;
  9 +
  10 + private Long orderId;
  11 + private Long buyerId;
  12 +
  13 + public Long getOrderId() {
  14 + return orderId;
  15 + }
  16 +
  17 + public void setOrderId(Long orderId) {
  18 + this.orderId = orderId;
  19 + }
  20 +
  21 + public Long getBuyerId() {
  22 + return buyerId;
  23 + }
  24 +
  25 + public void setBuyerId(Long buyerId) {
  26 + this.buyerId = buyerId;
  27 + }
  28 +
  29 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/ProductDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class ProductDto {
  4 +
  5 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/SellerConfirmRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class SellerConfirmRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = -6873506335794369709L;
  9 +
  10 + private Long orderId;
  11 + private Long sellerId;
  12 +
  13 + public Long getOrderId() {
  14 + return orderId;
  15 + }
  16 +
  17 + public void setOrderId(Long orderId) {
  18 + this.orderId = orderId;
  19 + }
  20 +
  21 + public Long getSellerId() {
  22 + return sellerId;
  23 + }
  24 +
  25 + public void setSellerId(Long sellerId) {
  26 + this.sellerId = sellerId;
  27 + }
  28 +
  29 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/SellerRefuseRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +public class SellerRefuseRequestDto extends BaseRequestDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 1563792094069115492L;
  9 +
  10 + private Long orderId;
  11 + private Long sellerId;
  12 +
  13 + public Long getOrderId() {
  14 + return orderId;
  15 + }
  16 +
  17 + public void setOrderId(Long orderId) {
  18 + this.orderId = orderId;
  19 + }
  20 +
  21 + public Long getSellerId() {
  22 + return sellerId;
  23 + }
  24 +
  25 + public void setSellerId(Long sellerId) {
  26 + this.sellerId = sellerId;
  27 + }
  28 +
  29 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/SubmitOrderRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +import java.io.Serializable;
  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.PayType;
  9 +
  10 +public class SubmitOrderRequestDto implements Serializable {
  11 +
  12 + /**
  13 + *
  14 + */
  15 + private static final long serialVersionUID = 5060629945327592074L;
  16 +
  17 + /** 买家ID与姓名 */
  18 + private Long buyerId;
  19 + private String buyerName;
  20 + /** 卖家ID与姓名 */
  21 + private Long sellerId;
  22 + private String sellerName;
  23 + /** 配送类型 */
  24 + private OrderDeliveryType deliveryType;
  25 + /** 订单状态 */
  26 + private OrderStatus orderStatus;
  27 + /** 买家备注说明 */
  28 + private String buyerMemo;
  29 + /** 支付类型 */
  30 + private PayType payType;
  31 + /** 最新商品总金额 */
  32 + private Long priceTotal;
  33 + /** 店铺ID */
  34 + private Long shopId;
  35 + private Long userId;
  36 + /**
  37 + * 订单项
  38 + */
  39 + private List<OrderItemDto> orderItems;
  40 +
  41 + public Long getBuyerId() {
  42 + return buyerId;
  43 + }
  44 +
  45 + public void setBuyerId(Long buyerId) {
  46 + this.buyerId = buyerId;
  47 + }
  48 +
  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() {
  58 + return sellerId;
  59 + }
  60 +
  61 + public void setSellerId(Long sellerId) {
  62 + this.sellerId = sellerId;
  63 + }
  64 +
  65 + public String getSellerName() {
  66 + return sellerName;
  67 + }
  68 +
  69 + public void setSellerName(String sellerName) {
  70 + this.sellerName = sellerName;
  71 + }
  72 +
  73 + public OrderDeliveryType getDeliveryType() {
  74 + return deliveryType;
  75 + }
  76 +
  77 + public void setDeliveryType(OrderDeliveryType deliveryType) {
  78 + this.deliveryType = deliveryType;
  79 + }
  80 +
  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() {
  90 + return buyerMemo;
  91 + }
  92 +
  93 + public void setBuyerMemo(String buyerMemo) {
  94 + this.buyerMemo = buyerMemo;
  95 + }
  96 +
  97 + public PayType getPayType() {
  98 + return payType;
  99 + }
  100 +
  101 + public void setPayType(PayType payType) {
  102 + this.payType = payType;
  103 + }
  104 +
  105 + public Long getPriceTotal() {
  106 + return priceTotal;
  107 + }
  108 +
  109 + public void setPriceTotal(Long priceTotal) {
  110 + this.priceTotal = priceTotal;
  111 + }
  112 +
  113 + public Long getShopId() {
  114 + return shopId;
  115 + }
  116 +
  117 + public void setShopId(Long shopId) {
  118 + this.shopId = shopId;
  119 + }
  120 +
  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() {
  130 + return orderItems;
  131 + }
  132 +
  133 + public void setOrderItems(List<OrderItemDto> orderItems) {
  134 + this.orderItems = orderItems;
  135 + }
  136 +
  137 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/request/TakeOrderRequestDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.request;
  2 +
  3 +import javax.validation.constraints.NotNull;
  4 +
  5 +public class TakeOrderRequestDto extends BaseRequestDto {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = -1409059930851556435L;
  11 +
  12 + @NotNull(message = "订单id不能为空")
  13 + private Long orderId;
  14 + @NotNull(message = "商家id不能为空")
  15 + private Long sellerId;
  16 + /**
  17 + * 订单总价
  18 + */
  19 + @NotNull(message = "订单总价不能为空")
  20 + private Long totalPrice;
  21 +
  22 + public Long getOrderId() {
  23 + return orderId;
  24 + }
  25 +
  26 + public void setOrderId(Long orderId) {
  27 + this.orderId = orderId;
  28 + }
  29 +
  30 + public Long getSellerId() {
  31 + return sellerId;
  32 + }
  33 +
  34 + public void setSellerId(Long sellerId) {
  35 + this.sellerId = sellerId;
  36 + }
  37 +
  38 + public Long getTotalPrice() {
  39 + return totalPrice;
  40 + }
  41 +
  42 + public void setTotalPrice(Long totalPrice) {
  43 + this.totalPrice = totalPrice;
  44 + }
  45 +
  46 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/response/BaseResponseDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.response;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class BaseResponseDto implements Serializable {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = -5470014723504375260L;
  11 +
  12 + public static final int RESPONSE_CODE_SUCCESS = 1;
  13 + public static final int RESPONSE_CODE_FAILURE = -1;
  14 +
  15 + private int code = RESPONSE_CODE_FAILURE;
  16 + private boolean success = false;
  17 + private String message;
  18 +
  19 + public int getCode() {
  20 + return code;
  21 + }
  22 +
  23 + public void setCode(int code) {
  24 + this.code = code;
  25 + }
  26 +
  27 + public boolean isSuccess() {
  28 + return success;
  29 + }
  30 +
  31 + public void setSuccess(boolean success) {
  32 + this.success = success;
  33 + }
  34 +
  35 + public String getMessage() {
  36 + return message;
  37 + }
  38 +
  39 + public void setMessage(String message) {
  40 + this.message = message;
  41 + }
  42 +
  43 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/client/domain/dto/response/SubmitOrderResponseDto.java 0 → 100644
  1 +package com.b2c.orders.client.domain.dto.response;
  2 +
  3 +public class SubmitOrderResponseDto extends BaseResponseDto {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = -4864269728498529668L;
  9 +
  10 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/MarketDelivery.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +import com.google.common.collect.Maps;
  4 +import lombok.Getter;
  5 +
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * <B>是否市场内交割</B> <B>Copyright</B> 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  10 + * <B>地利集团</B>
  11 + *
  12 + * @author yuehongbo
  13 + * @createTime 2016/9/10 10:43
  14 + */
  15 +public enum MarketDelivery {
  16 + /** 市场内交割 */
  17 + YES(1, "是"),
  18 + /** 市场外交割 */
  19 + NO(2, "否"),;
  20 + @Getter
  21 + private int index;
  22 + @Getter
  23 + private String value;
  24 +
  25 + private static Map<Integer, MarketDelivery> initMaps = Maps.newHashMap();
  26 +
  27 + static {
  28 + for (MarketDelivery m : MarketDelivery.values()) {
  29 + initMaps.put(m.getIndex(), m);
  30 + }
  31 + }
  32 +
  33 + MarketDelivery(int index, String value) {
  34 + this.index = index;
  35 + this.value = value;
  36 + }
  37 +
  38 + public static MarketDelivery get(Integer index) {
  39 + return initMaps.get(index);
  40 + }
  41 +}
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/OpUserRole.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +
  4 +/**
  5 + * 操作人员类型(角色) <br />
  6 + * <B>Copyright</B> Copyright (c) 2015 www.diligrp.com All rights reserved. <br />
  7 + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  8 + * <B>Company</B> 地利集团
  9 + */
  10 +public enum OpUserRole {
  11 +
  12 + /**地利买家*/
  13 + DILI_BUYER(10,"买家","【买家】"),
  14 +
  15 + /**地利卖家*/
  16 + DILI_SELLER(20,"卖家","【卖家】"),
  17 +
  18 + /**地利网站用户(买家or卖家)*/
  19 + DILI_WEB_USER(30,"客户","【客户】"),
  20 +
  21 + /**地利网站匿名用户(id=999L)*/
  22 + DILI_WEB_ANONYMOUS_USEER(999L,"匿名用户","【匿名用户】"),
  23 +
  24 + /**地利后台管理人员*/
  25 + DILI_BACKEND_MANAGER(1000,"后台","【后台】"),
  26 +
  27 + /**地利支付*/
  28 + DILI_PAY(50,"支付","【支付】"),
  29 +
  30 + /**地利后台系统用户(id=9999999999999L)*/
  31 + DILI_BACKEND_SYSTEM(9999999999999L,"系统","【系统】");
  32 +
  33 + private long index;
  34 + private String name;
  35 + private String prefix;
  36 + public static OpUserRole get(long index) {
  37 + for (OpUserRole c : OpUserRole.values()) {
  38 + if (c.getIndex() == index) {
  39 + return c;
  40 + }
  41 + }
  42 + return null;
  43 + }
  44 +
  45 + private OpUserRole(long index,String name,String prefix) {
  46 + this.index = index;
  47 + this.name=name;
  48 + this.prefix= prefix;
  49 + }
  50 +
  51 + public long getIndex() {
  52 + return index;
  53 + }
  54 +
  55 + public void setIndex(long index) {
  56 + this.index = index;
  57 + }
  58 +
  59 +
  60 + public String getPrefix() {
  61 + return prefix;
  62 + }
  63 +
  64 + public void setPrefix(String prefix) {
  65 + this.prefix = prefix;
  66 + }
  67 +
  68 + public String getName(){
  69 + return this.name;
  70 + }
  71 +}
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/OrderBrokerageStatus.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderBrokerageStatus.java
1   -package com.diligrp.orders.common.enums.order;
  1 +package com.b2c.orders.enums;
2 2  
3 3 import com.google.common.collect.Maps;
4 4 import lombok.Getter;
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/VisibleLevel.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderComeFrom.java
1   -package com.diligrp.orders.common.enums;
  1 +package com.b2c.orders.enums;
2 2  
3   -import java.util.ArrayList;
  3 +import com.google.common.collect.Maps;
  4 +import lombok.Getter;
  5 +
  6 +import java.util.Arrays;
4 7 import java.util.List;
  8 +import java.util.Map;
5 9  
6 10 /**
7   - * 日志可见性级别
  11 + * 订单的来源终端
8 12 */
9   -public enum VisibleLevel {
10   - /** 10 对外可见 */
11   - ExternalVisible("是", 10),
12   - /** 20 对外不可见 */
13   - ExternalInvisible("否", 20);
  13 +public enum OrderComeFrom {
  14 +
  15 + PC("PC", 10),
  16 + iOS("iOS", 20),
  17 + Android("Android", 30),
  18 + Wap("Wap", 40);
14 19  
15   - // 成员变量
  20 + @Getter
16 21 private String name;
  22 + @Getter
17 23 private int index;
18 24  
19   - // 构造方法
20   - private VisibleLevel(String name, int index) {
21   - this.name = name;
22   - this.index = index;
23   - }
24   -
25   - public static VisibleLevel getVisibleLevel(int index) {
26   - for (VisibleLevel c : VisibleLevel.values()) {
27   - if (c.getIndex() == index) {
28   - return c;
29   - }
30   - }
31   - return null;
32   - }
  25 + private static Map<Integer,OrderComeFrom> initMaps = Maps.newHashMap();
33 26  
34   - // 普通方法
35   - public static String getName(int index) {
36   - for (VisibleLevel c : VisibleLevel.values()) {
37   - if (c.getIndex() == index) {
38   - return c.name;
39   - }
  27 + static {
  28 + for (OrderComeFrom c : OrderComeFrom.values()) {
  29 + initMaps.put(c.getIndex(),c);
40 30 }
41   - return null;
42 31 }
43 32  
44   - public static List<VisibleLevel> getEnumItemList() {
45   - VisibleLevel[] itemList = VisibleLevel.values();
46   - List<VisibleLevel> filteredItemList = new ArrayList<VisibleLevel>();
47   - for (VisibleLevel status : itemList) {
48   - filteredItemList.add(status);
49   - }
50   - return filteredItemList;
  33 + OrderComeFrom(String name, int index) {
  34 + this.name = name;
  35 + this.index = index;
51 36 }
52 37  
53   - // get set 方法
54 38 public String getName() {
55 39 return name;
56 40 }
... ... @@ -66,4 +50,20 @@ public enum VisibleLevel {
66 50 public void setIndex(int index) {
67 51 this.index = index;
68 52 }
  53 +
  54 + public static OrderComeFrom get(Integer index){
  55 + return initMaps.get(index);
  56 + }
  57 +
  58 + public static String getComeFromName(Integer index) {
  59 + if (initMaps.containsKey(index)){
  60 + return initMaps.get(index).getName();
  61 + }
  62 + return null;
  63 + }
  64 +
  65 + public static List<OrderComeFrom> getEnumItemList() {
  66 + OrderComeFrom[] itemList = OrderComeFrom.values();
  67 + return Arrays.asList(itemList);
  68 + }
69 69 }
70 70 \ No newline at end of file
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderDeliveryType.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import com.google.common.collect.Maps;
  6 +
  7 +import lombok.Getter;
  8 +
  9 +/**
  10 + * 订单配送方式:上门自提 10、送货上门 20、现场交易 30、物流配送40
  11 + */
  12 +public enum OrderDeliveryType {
  13 + /** 上门自提 10 */
  14 + Self(10, "上门自提"),
  15 + /** 送货上门 20 */
  16 + Delivery(20, "送货上门");
  17 +
  18 + // 成员变量
  19 + @Getter
  20 + private int index;
  21 + @Getter
  22 + private String desc;
  23 +
  24 + /**
  25 + * 内部静态map对象
  26 + */
  27 + private static Map<Integer, OrderDeliveryType> initMaps = Maps.newHashMap();
  28 +
  29 + /**
  30 + * 静态初始化到map中
  31 + */
  32 + static {
  33 + for (OrderDeliveryType c : OrderDeliveryType.values()) {
  34 + initMaps.put(c.getIndex(), c);
  35 + }
  36 + }
  37 +
  38 + OrderDeliveryType(int index, String desc) {
  39 + this.index = index;
  40 + this.desc = desc;
  41 + }
  42 +
  43 + public int getIndex() {
  44 + return index;
  45 + }
  46 +
  47 + public void setIndex(int index) {
  48 + this.index = index;
  49 + }
  50 +
  51 + public String getDesc() {
  52 + return desc;
  53 + }
  54 +
  55 + public void setDesc(String desc) {
  56 + this.desc = desc;
  57 + }
  58 +
  59 + public static OrderDeliveryType getDeliveryType(Integer index) {
  60 + return initMaps.get(index);
  61 + }
  62 +
  63 + /**
  64 + * 是否上门自提
  65 + *
  66 + * @param deliveryType
  67 + * @return
  68 + */
  69 + public static boolean isSelf(Integer deliveryType) {
  70 + return getDeliveryType(deliveryType) == Self ? true : false;
  71 + }
  72 +
  73 + /**
  74 + * 是否上门自提
  75 + *
  76 + * @param deliveryType
  77 + * @return
  78 + */
  79 + public static boolean isSelf(OrderDeliveryType deliveryType) {
  80 + return deliveryType == Self ? true : false;
  81 + }
  82 +
  83 +}
0 84 \ No newline at end of file
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/OrderRemindKey.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderRemindKey.java
1   -package com.diligrp.orders.common.enums.order;
  1 +package com.b2c.orders.enums;
2 2  
3 3  
4 4 /**
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/OrderManStatus.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderStatus.java
1   -package com.diligrp.orders.common.enums.order;
2   -
3   -import com.diligrp.orders.common.DataDictionaryCode;
4   -import com.diligrp.orders.publics.annotation.DataDictionary;
5   -import com.google.common.collect.Maps;
  1 +package com.b2c.orders.enums;
6 2  
7 3 import java.util.Map;
8 4  
  5 +import com.google.common.collect.Maps;
  6 +
9 7 /**
10   - * 订单状态(管理端)
  8 + * 订单状态
11 9 */
12   -@DataDictionary(code = { DataDictionaryCode.DIC_SELF_AGENT_SALE_ORDER_BACKEND_STATUS })
13   -public enum OrderManStatus {
  10 +public enum OrderStatus {
14 11 /**
15 12 * 待接单
16 13 */
17   - PendingOrder(10),
  14 + PendingTake(10),
18 15 /**
19   - * 待付款
  16 + * 已接单待付款
20 17 */
21 18 PendingPayment(15),
22 19 /**
23 20 * 待自提
24 21 */
25   - PendingSelfTaken(20),
  22 + PendingStoreMention(20),
26 23 /**
27 24 * 待送货
28 25 */
29 26 PendingDelivery(25),
30 27 /**
31   - * 已完成
  28 + * 已过期
32 29 */
33   - Completed(30, false),
  30 + Timeout(30, false),
34 31 /**
35   - * 已拒绝接单
  32 + * 已拒绝
36 33 */
37 34 Refused(35, false),
38 35 /**
39   - * 已过期
  36 + * 已取消
40 37 */
41   - Timeout(40, false),
  38 + Canceled(40, false),
42 39 /**
43   - * 已取消
  40 + * 已完成
44 41 */
45   - Canceled(45, false);
46   -
47   - private int index;
  42 + Completed(45, false);
48 43  
49 44 /** 是否活动(运行中)状态 */
50 45 private boolean isRuningStatus = true;
  46 + private int index;
51 47  
52 48 // 构造方法
53   - private OrderManStatus(int index) {
  49 + private OrderStatus(int index) {
54 50 this.index = index;
55 51 }
56 52  
57 53 // 构造方法
58   - private OrderManStatus(int index, boolean isRuningStatus) {
  54 + private OrderStatus(int index, boolean isRuningStatus) {
59 55 this.index = index;
60 56 this.isRuningStatus = isRuningStatus;
61 57 }
62 58  
63   - private static Map<Integer, OrderManStatus> initMaps = Maps.newHashMap();
  59 + private static Map<Integer, OrderStatus> initMaps = Maps.newHashMap();
64 60  
65 61 /**
66 62 * 初始化到map中
67 63 */
68 64 static {
69   - for (OrderManStatus orderManStatus : OrderManStatus.values()) {
  65 + for (OrderStatus orderManStatus : OrderStatus.values()) {
70 66 initMaps.put(orderManStatus.getIndex(), orderManStatus);
71 67 }
72 68 }
... ... @@ -74,7 +70,7 @@ public enum OrderManStatus {
74 70 /**
75 71 * 获取所有订单类型的状态
76 72 */
77   - public static OrderManStatus getOrderManStatus(int index) {
  73 + public static OrderStatus getOrderManStatus(int index) {
78 74 return initMaps.get(index);
79 75 }
80 76  
... ... @@ -84,7 +80,7 @@ public enum OrderManStatus {
84 80 * @param orderStatus
85 81 * @return true是,false否
86 82 */
87   - public static boolean isRuningStatus(OrderManStatus orderStatus) {
  83 + public static boolean isRuningStatus(OrderStatus orderStatus) {
88 84 return orderStatus.isRuningStatus;
89 85 }
90 86  
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderType.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +import com.google.common.collect.Maps;
  4 +import lombok.Getter;
  5 +
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * 订单类型(后台使用)
  10 + */
  11 +public enum OrderType {
  12 + /** 普通订单 */
  13 + COMMON(10,"普通订单"),
  14 + /** 样品订单 */
  15 + SAMPLE(20,"样品订单"),
  16 + /** 甩货订单 */
  17 + CLEARANCE(30,"甩货订单"),
  18 + /** 赊账订单 */
  19 + CREDIT(40,"赊账订单"),
  20 + /** 拼购订单 */
  21 + SHARING(50,"拼购订单");
  22 +
  23 + // 成员变量
  24 + @Getter
  25 + private Integer index;
  26 + @Getter
  27 + private String name;
  28 +
  29 +
  30 + private static Map<Integer,OrderType> initMaps = Maps.newHashMap();
  31 +
  32 + /**
  33 + * 初始化到静态变量里
  34 + */
  35 + static {
  36 + for (OrderType ot : OrderType.values()){
  37 + initMaps.put(ot.getIndex(),ot);
  38 + }
  39 + }
  40 +
  41 + OrderType(Integer index, String name) {
  42 + this.index = index;
  43 + this.name = name;
  44 + }
  45 +
  46 + public Integer getIndex() {
  47 + return index;
  48 + }
  49 +
  50 + public void setIndex(Integer index) {
  51 + this.index = index;
  52 + }
  53 +
  54 + public String getName() {
  55 + return name;
  56 + }
  57 +
  58 + public void setName(String name) {
  59 + this.name = name;
  60 + }
  61 +
  62 + public static OrderType getOrderType(Integer code) {
  63 + return initMaps.get(code);
  64 + }
  65 +
  66 +}
0 67 \ No newline at end of file
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/OrderWebStatus.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/OrderWebStatus.java
1   -package com.diligrp.orders.common.enums.order;
  1 +package com.b2c.orders.enums;
2 2  
3 3 import java.util.ArrayList;
4 4 import java.util.List;
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/PayStatus.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +/**
  4 + * 订单支付状态:未付款10、已付款20
  5 + */
  6 +public enum PayStatus {
  7 + /**
  8 + * 未付款10
  9 + */
  10 + PayWait(10),
  11 + /**
  12 + * 已付款20
  13 + */
  14 + Paid(20);
  15 +
  16 + // 成员变量
  17 + private int index;
  18 +
  19 + // 构造方法
  20 + private PayStatus(int index) {
  21 + this.index = index;
  22 + }
  23 +
  24 + public int getIndex() {
  25 + return index;
  26 + }
  27 +
  28 + public void setIndex(int index) {
  29 + this.index = index;
  30 + }
  31 +
  32 + public static PayStatus getPayStatus(Integer index) {
  33 + for (PayStatus c : PayStatus.values()) {
  34 + if (c.getIndex() == index) {
  35 + return c;
  36 + }
  37 + }
  38 + return null;
  39 + }
  40 +
  41 + /**
  42 + * 是否未付款
  43 + *
  44 + * @param payStatus
  45 + * @return
  46 + */
  47 + public static boolean isPayWait(Integer payStatus) {
  48 + return getPayStatus(payStatus) == PayWait;
  49 + }
  50 +
  51 + /**
  52 + * 是否已付款
  53 + *
  54 + * @param payStatus
  55 + * @return
  56 + */
  57 + public static boolean isPaid(Integer payStatus) {
  58 + return getPayStatus(payStatus) == Paid;
  59 + }
  60 +}
0 61 \ No newline at end of file
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/PayType.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +import java.util.Map;
  4 +
  5 +import com.fasterxml.jackson.annotation.JsonValue;
  6 +import com.google.common.collect.Maps;
  7 +
  8 +/**
  9 + * 付款方式
  10 + */
  11 +public enum PayType {
  12 + /** 线上付款10 */
  13 + Online(10, "线上付款"),
  14 + /** 线下汇款20 */
  15 + Offline(20, "线下汇款");
  16 +
  17 + // 成员变量
  18 + private int index;
  19 + private String value;
  20 +
  21 + private static Map<Integer, PayType> initMaps = Maps.newHashMap();
  22 +
  23 + static {
  24 + for (PayType c : PayType.values()) {
  25 + initMaps.put(c.getIndex(), c);
  26 + }
  27 + }
  28 +
  29 + public static PayType getPayType(Integer index) {
  30 + if (initMaps.containsKey(index)) {
  31 + return initMaps.get(index);
  32 + }
  33 + return null;
  34 + }
  35 +
  36 + PayType(int index, String value) {
  37 + this.index = index;
  38 + this.value = value;
  39 + }
  40 +
  41 + public int getIndex() {
  42 + return index;
  43 + }
  44 +
  45 + public void setIndex(int index) {
  46 + this.index = index;
  47 + }
  48 +
  49 + @JsonValue
  50 + public String getValue() {
  51 + return value;
  52 + }
  53 +
  54 + public void setValue(String value) {
  55 + this.value = value;
  56 + }
  57 +
  58 + /**
  59 + * 是否线上支付类型
  60 + *
  61 + * @param payType
  62 + * PayType类型
  63 + * @return true - 是
  64 + */
  65 + public static boolean isOnline(PayType payType) {
  66 + return payType == Online ? true : false;
  67 + }
  68 +
  69 + /**
  70 + * 是否线上支付类型
  71 + *
  72 + * @param payType
  73 + * @return true - 是
  74 + */
  75 + public static boolean isOnline(Integer payType) {
  76 + return getPayType(payType) == Online ? true : false;
  77 + }
  78 +
  79 + /**
  80 + * 是否线下付款类型
  81 + *
  82 + * @param payType
  83 + * @return true-是
  84 + */
  85 + public static boolean isOffline(PayType payType) {
  86 + return payType == Offline ? true : false;
  87 + }
  88 +
  89 + /**
  90 + * 是否线下付款类型
  91 + *
  92 + * @param payType
  93 + * @return true-是
  94 + */
  95 + public static boolean isOffline(Integer payType) {
  96 + return getPayType(payType) == Offline ? true : false;
  97 + }
  98 +
  99 +}
0 100 \ No newline at end of file
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/ReOrderStatus.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +/**
  4 + * 退款状态(管理端)
  5 + */
  6 +public enum ReOrderStatus {
  7 + /** 10卖家待审核 */
  8 + CheckWait(10),
  9 + /** 20卖家审核通过 */
  10 + CheckPass(20),
  11 + /** 90卖家审核通过等待打款 */
  12 + WaitRepayment(90),
  13 + /** 30卖家审核拒绝 */
  14 + CheckNotPass(30),
  15 + /** 40退款申请取消 */
  16 + CheckCancel(40),
  17 +
  18 + /** 50退款申诉处理中 */
  19 + Appealing(50),
  20 + /** 60退款申诉成功 */
  21 + AppealPass(60),
  22 + /** 70退款申诉失败 */
  23 + AppealNotPass(70),
  24 + /** 80退款申诉取消 */
  25 + AppealCancel(80), ;
  26 +
  27 + // 成员变量
  28 + private int index;
  29 +
  30 + // 构造方法
  31 + ReOrderStatus(int index) {
  32 + this.index = index;
  33 + }
  34 +
  35 + public static ReOrderStatus getReOrderStatus(Integer index) {
  36 + for (ReOrderStatus c : ReOrderStatus.values()) {
  37 + if (c.getIndex() == index) {
  38 + return c;
  39 + }
  40 + }
  41 + return null;
  42 + }
  43 +
  44 + public int getIndex() {
  45 + return index;
  46 + }
  47 +
  48 + public void setIndex(int index) {
  49 + this.index = index;
  50 + }
  51 +}
0 52 \ No newline at end of file
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/RemitAuditStatus.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +import com.google.common.collect.Maps;
  4 +import lombok.Getter;
  5 +
  6 +import java.util.Map;
  7 +
  8 +/**
  9 + * 订单的汇款信息的审核状态
  10 + * Created by yuehongbo on 2016/9/2.
  11 + */
  12 +public enum RemitAuditStatus {
  13 + UNAUDITED(10,"未审核",false),
  14 + PASS(20,"通过",true),
  15 + UNPASS(30,"未通过",true),
  16 + ;
  17 + @Getter
  18 + private Integer index;
  19 + @Getter
  20 + private String value;
  21 + @Getter
  22 + private boolean viewAudit;
  23 +
  24 + private static Map<Integer,RemitAuditStatus> initMaps = Maps.newHashMap();
  25 +
  26 + static {
  27 + for (RemitAuditStatus status : RemitAuditStatus.values()){
  28 + initMaps.put(status.getIndex(),status);
  29 + }
  30 + }
  31 +
  32 + RemitAuditStatus(Integer index, String value, boolean viewAudit) {
  33 + this.index = index;
  34 + this.value = value;
  35 + this.viewAudit = viewAudit;
  36 + }
  37 +
  38 + public Integer getIndex() {
  39 + return index;
  40 + }
  41 +
  42 + public void setIndex(Integer index) {
  43 + this.index = index;
  44 + }
  45 +
  46 + public String getValue() {
  47 + return value;
  48 + }
  49 +
  50 + public void setValue(String value) {
  51 + this.value = value;
  52 + }
  53 +
  54 + public boolean isViewAudit() {
  55 + return viewAudit;
  56 + }
  57 +
  58 + public void setViewAudit(boolean viewAudit) {
  59 + this.viewAudit = viewAudit;
  60 + }
  61 +
  62 + public static RemitAuditStatus get(Integer index){
  63 + return initMaps.get(index);
  64 + }
  65 +
  66 + /**
  67 + * 是否审核不通过
  68 + * @param index
  69 + * @return true - 是
  70 + */
  71 + public static boolean isUnpass(int index){
  72 + return UNPASS == get(index);
  73 + }
  74 +
  75 + /**
  76 + * 是否审核通过
  77 + * @param index
  78 + * @return true - 是
  79 + */
  80 + public static boolean isPass(int index){
  81 + return PASS == get(index);
  82 + }
  83 +}
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/SaleType.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/SaleType.java
1   -package com.diligrp.orders.common.enums.order;
  1 +package com.b2c.orders.enums;
2 2  
3 3 import com.google.common.collect.Maps;
4 4 import lombok.Getter;
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/ShopType.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/ShopType.java
1   -package com.diligrp.orders.common.enums.order;
  1 +package com.b2c.orders.enums;
2 2  
3 3  
4 4 /**
... ...
orders-common/src/main/java/com/diligrp/orders/common/enums/order/StockLockType.java renamed to b2c-orders-client/src/main/java/com/b2c/orders/enums/StockLockType.java
1   -package com.diligrp.orders.common.enums.order;
  1 +package com.b2c.orders.enums;
2 2  
3 3 /**
4 4 * 库存锁类型:10扣量,20返量
... ...
b2c-orders-client/src/main/java/com/b2c/orders/enums/WarrantType.java 0 → 100644
  1 +package com.b2c.orders.enums;
  2 +
  3 +
  4 +import com.google.common.collect.Maps;
  5 +import lombok.Getter;
  6 +
  7 +import java.util.Map;
  8 +
  9 +/**
  10 + * 交易担保,交割保:10,不需要担保:20,其他:30
  11 + */
  12 +public enum WarrantType {
  13 +
  14 + Warran("Warran", 10,"交割保"),
  15 + Not_Warran("Not_Warran", 20,"不需要担保"),
  16 + Other("Other", 30,"其他");
  17 +
  18 + //成员变量
  19 + @Getter
  20 + private String name;
  21 + @Getter
  22 + private int index;
  23 + @Getter
  24 + private String desc;
  25 +
  26 + private static Map<Integer,WarrantType> initMaps = Maps.newHashMap();
  27 +
  28 + static {
  29 + for (WarrantType c : WarrantType.values()) {
  30 + initMaps.put(c.getIndex(),c);
  31 + }
  32 + }
  33 +
  34 + WarrantType(String name, int index, String desc) {
  35 + this.name = name;
  36 + this.index = index;
  37 + this.desc = desc;
  38 + }
  39 +
  40 + public String getName() {
  41 + return name;
  42 + }
  43 +
  44 + public void setName(String name) {
  45 + this.name = name;
  46 + }
  47 +
  48 + public int getIndex() {
  49 + return index;
  50 + }
  51 +
  52 + public void setIndex(int index) {
  53 + this.index = index;
  54 + }
  55 +
  56 + public String getDesc() {
  57 + return desc;
  58 + }
  59 +
  60 + public void setDesc(String desc) {
  61 + this.desc = desc;
  62 + }
  63 +
  64 + public static WarrantType getWarrantType(Integer index) {
  65 + return initMaps.get(index);
  66 + }
  67 +}
0 68 \ No newline at end of file
... ...
b2c-orders-commons/.classpath 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry kind="src" output="target/classes" path="src/main/java">
  4 + <attributes>
  5 + <attribute name="optional" value="true"/>
  6 + <attribute name="maven.pomderived" value="true"/>
  7 + </attributes>
  8 + </classpathentry>
  9 + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10 + <attributes>
  11 + <attribute name="maven.pomderived" value="true"/>
  12 + </attributes>
  13 + </classpathentry>
  14 + <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15 + <attributes>
  16 + <attribute name="optional" value="true"/>
  17 + <attribute name="maven.pomderived" value="true"/>
  18 + </attributes>
  19 + </classpathentry>
  20 + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  21 + <attributes>
  22 + <attribute name="maven.pomderived" value="true"/>
  23 + </attributes>
  24 + </classpathentry>
  25 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  26 + <attributes>
  27 + <attribute name="maven.pomderived" value="true"/>
  28 + </attributes>
  29 + </classpathentry>
  30 + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  31 + <attributes>
  32 + <attribute name="maven.pomderived" value="true"/>
  33 + <attribute name="org.eclipse.jst.component.nondependency" value=""/>
  34 + </attributes>
  35 + </classpathentry>
  36 + <classpathentry kind="output" path="target/classes"/>
  37 +</classpath>
... ...
b2c-orders-commons/.gitignore 0 → 100644
  1 +/target/
... ...
b2c-orders-commons/.project 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>b2c-orders-commons</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.eclipse.wst.common.project.facet.core.builder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + <buildCommand>
  14 + <name>org.eclipse.jdt.core.javabuilder</name>
  15 + <arguments>
  16 + </arguments>
  17 + </buildCommand>
  18 + <buildCommand>
  19 + <name>org.eclipse.m2e.core.maven2Builder</name>
  20 + <arguments>
  21 + </arguments>
  22 + </buildCommand>
  23 + <buildCommand>
  24 + <name>org.eclipse.wst.validation.validationbuilder</name>
  25 + <arguments>
  26 + </arguments>
  27 + </buildCommand>
  28 + </buildSpec>
  29 + <natures>
  30 + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  31 + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  32 + <nature>org.eclipse.jdt.core.javanature</nature>
  33 + <nature>org.eclipse.m2e.core.maven2Nature</nature>
  34 + <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  35 + </natures>
  36 +</projectDescription>
... ...
b2c-orders-commons/.settings/org.eclipse.core.resources.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +encoding//src/main/java=UTF-8
  3 +encoding//src/main/resources=UTF-8
  4 +encoding//src/test/java=UTF-8
  5 +encoding//src/test/resources=UTF-8
  6 +encoding/<project>=UTF-8
... ...
b2c-orders-commons/.settings/org.eclipse.jdt.core.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
  3 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  4 +org.eclipse.jdt.core.compiler.compliance=1.7
  5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
  6 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
  7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
  8 +org.eclipse.jdt.core.compiler.source=1.7
... ...
b2c-orders-commons/.settings/org.eclipse.m2e.core.prefs 0 → 100644
  1 +activeProfiles=
  2 +eclipse.preferences.version=1
  3 +resolveWorkspaceProjects=true
  4 +version=1
... ...
b2c-orders-commons/.settings/org.eclipse.wst.common.component 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
  2 + <wb-module deploy-name="b2c-orders-commons">
  3 + <wb-resource deploy-path="/" source-path="/src/main/java"/>
  4 + <wb-resource deploy-path="/" source-path="/src/main/resources"/>
  5 + </wb-module>
  6 +</project-modules>
... ...
b2c-orders-commons/.settings/org.eclipse.wst.common.project.facet.core.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<faceted-project>
  3 + <installed facet="java" version="1.7"/>
  4 + <installed facet="jst.utility" version="1.0"/>
  5 +</faceted-project>
... ...
b2c-orders-commons/pom.xml 0 → 100644
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  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>
  4 + <parent>
  5 + <groupId>com.b2c.orders</groupId>
  6 + <artifactId>orders-parent</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + </parent>
  9 + <artifactId>orders-commons</artifactId>
  10 +
  11 + <dependencies>
  12 + <dependency>
  13 + <groupId>commons-lang</groupId>
  14 + <artifactId>commons-lang</artifactId>
  15 + </dependency>
  16 + </dependencies>
  17 +</project>
0 18 \ No newline at end of file
... ...
b2c-orders-commons/src/main/java/com/b2c/orders/commons/exceptions/ApplicationException.java 0 → 100644
  1 +package com.b2c.orders.commons.exceptions;
  2 +
  3 +public class ApplicationException extends Exception {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 4338719908145107001L;
  9 +
  10 + public static final int DATA_EXCEPTION = -0x1;
  11 +
  12 + private int code;
  13 +
  14 + public ApplicationException(int code) {
  15 + super();
  16 + this.code = code;
  17 + }
  18 +
  19 + public ApplicationException(int code, String message, Throwable cause, boolean enableSuppression,
  20 + boolean writableStackTrace) {
  21 + super(message, cause, enableSuppression, writableStackTrace);
  22 + this.code = code;
  23 + }
  24 +
  25 + public ApplicationException(int code, String message, Throwable cause) {
  26 + super(message, cause);
  27 + this.code = code;
  28 + }
  29 +
  30 + public ApplicationException(int code, String message) {
  31 + super(message);
  32 + this.code = code;
  33 + }
  34 +
  35 + public ApplicationException(int code, Throwable cause) {
  36 + super(cause);
  37 + this.code = code;
  38 + }
  39 +
  40 + public int getCode() {
  41 + return code;
  42 + }
  43 +
  44 +}
... ...
b2c-orders-commons/src/main/java/com/b2c/orders/commons/exceptions/DataErrorException.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.commons.exceptions;
  6 +
  7 +/**
  8 + * AppException
  9 + *
  10 + * @author dev-center
  11 + * @since 2014-05-15
  12 + */
  13 +public class DataErrorException extends ApplicationException {
  14 +
  15 + /**
  16 + *
  17 + */
  18 + private static final long serialVersionUID = 4777410636210254432L;
  19 +
  20 + public DataErrorException(int code, String message, Throwable cause, boolean enableSuppression,
  21 + boolean writableStackTrace) {
  22 + super(code, message, cause, enableSuppression, writableStackTrace);
  23 + // TODO Auto-generated constructor stub
  24 + }
  25 +
  26 + public DataErrorException(int code, String message, Throwable cause) {
  27 + super(code, message, cause);
  28 + // TODO Auto-generated constructor stub
  29 + }
  30 +
  31 + public DataErrorException(int code, String message) {
  32 + super(code, message);
  33 + // TODO Auto-generated constructor stub
  34 + }
  35 +
  36 + public DataErrorException(int code, Throwable cause) {
  37 + super(code, cause);
  38 + // TODO Auto-generated constructor stub
  39 + }
  40 +
  41 + public DataErrorException(int code) {
  42 + super(code);
  43 + // TODO Auto-generated constructor stub
  44 + }
  45 +
  46 +}
... ...
b2c-orders-commons/src/main/java/com/b2c/orders/commons/exceptions/OrderException.java 0 → 100644
  1 +package com.b2c.orders.commons.exceptions;
  2 +
  3 +public class OrderException extends ApplicationException {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = -4961103829842964051L;
  9 +
  10 + public static final int ORDER_STATUS_FLOW_EXCEPTION = -0x1001;
  11 +
  12 + public OrderException(int code) {
  13 + super(code);
  14 + // TODO Auto-generated constructor stub
  15 + }
  16 +
  17 + public OrderException(int code, String message, Throwable cause, boolean enableSuppression,
  18 + boolean writableStackTrace) {
  19 + super(code, message, cause, enableSuppression, writableStackTrace);
  20 + // TODO Auto-generated constructor stub
  21 + }
  22 +
  23 + public OrderException(int code, String message, Throwable cause) {
  24 + super(code, message, cause);
  25 + // TODO Auto-generated constructor stub
  26 + }
  27 +
  28 + public OrderException(int code, String message) {
  29 + super(code, message);
  30 + // TODO Auto-generated constructor stub
  31 + }
  32 +
  33 + public OrderException(int code, Throwable cause) {
  34 + super(code, cause);
  35 + // TODO Auto-generated constructor stub
  36 + }
  37 +
  38 +}
... ...
b2c-orders-commons/src/main/java/com/b2c/orders/commons/exceptions/OrderRepositoryException.java 0 → 100644
  1 +package com.b2c.orders.commons.exceptions;
  2 +
  3 +public class OrderRepositoryException extends ApplicationException {
  4 +
  5 + /**
  6 + *
  7 + */
  8 + private static final long serialVersionUID = 4183718306182285503L;
  9 +
  10 + public static final int ENTITY_NOT_FOUND = -0x2001;
  11 +
  12 + public OrderRepositoryException(int code) {
  13 + super(code);
  14 + // TODO Auto-generated constructor stub
  15 + }
  16 +
  17 + public OrderRepositoryException(int code, String message, Throwable cause, boolean enableSuppression,
  18 + boolean writableStackTrace) {
  19 + super(code, message, cause, enableSuppression, writableStackTrace);
  20 + // TODO Auto-generated constructor stub
  21 + }
  22 +
  23 + public OrderRepositoryException(int code, String message, Throwable cause) {
  24 + super(code, message, cause);
  25 + // TODO Auto-generated constructor stub
  26 + }
  27 +
  28 + public OrderRepositoryException(int code, String message) {
  29 + super(code, message);
  30 + // TODO Auto-generated constructor stub
  31 + }
  32 +
  33 + public OrderRepositoryException(int code, Throwable cause) {
  34 + super(code, cause);
  35 + // TODO Auto-generated constructor stub
  36 + }
  37 +
  38 +}
... ...
b2c-orders-commons/src/main/java/com/b2c/orders/commons/utils/CollectionUtils.java 0 → 100644
  1 +package com.b2c.orders.commons.utils;
  2 +
  3 +import java.util.Collection;
  4 +
  5 +public class CollectionUtils {
  6 +
  7 + public static boolean isEmpty(Collection<?> collection) {
  8 + return collection == null || collection.size() <= 0;
  9 + }
  10 +}
... ...
orders-client/src/main/java/com/diligrp/orders/client/utils/DateFormat.java renamed to b2c-orders-commons/src/main/java/com/b2c/orders/commons/utils/DateFormat.java
1   -package com.diligrp.orders.client.utils;
  1 +package com.b2c.orders.commons.utils;
2 2  
3 3  
4 4 public class DateFormat {
... ...
orders-common/src/main/java/com/diligrp/orders/common/tools/DateUtils.java renamed to b2c-orders-commons/src/main/java/com/b2c/orders/commons/utils/DateUtils.java
... ... @@ -2,17 +2,16 @@
2 2 * Copyright (c) 2014 www.diligrp.com All rights reserved.
3 3 * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
4 4 */
5   -package com.diligrp.orders.common.tools;
6   -
7   -import com.diligrp.orders.common.DateFormat;
8   -import com.diligrp.orders.common.exception.DataErrorException;
9   -import org.apache.commons.lang.StringUtils;
  5 +package com.b2c.orders.commons.utils;
10 6  
  7 +import java.text.ParseException;
11 8 import java.text.SimpleDateFormat;
12 9 import java.util.Calendar;
13 10 import java.util.Date;
14 11 import java.util.GregorianCalendar;
15 12  
  13 +import org.apache.commons.lang.StringUtils;
  14 +
16 15 /**
17 16 * 日期工具类.
18 17 *
... ... @@ -21,325 +20,347 @@ import java.util.GregorianCalendar;
21 20 */
22 21 public class DateUtils {
23 22  
24   - /**
25   - * Gets the server time.
26   - *
27   - * @return the server time
28   - */
29   - public static long getServerTime() {
30   - return System.currentTimeMillis();
31   - }
32   -
33   - /**
34   - * 格式化日期,默认返回yyyy-MM-dd HH:mm:ss.
35   - *
36   - * @param date the date
37   - * @return the string
38   - */
39   - public static String format(Date date) {
40   - return format(date, DateFormat.YYYY_MM_DD_HH_mm_ss);
41   - }
42   -
43   - /**
44   - * 格式化显示当前日期.
45   - *
46   - * @param format the format
47   - * @return the string
48   - */
49   - public static String format(String format) {
50   - return format(new Date(), format);
51   - }
52   -
53   - /**
54   - * 日期格式化.
55   - *
56   - * @param date the date
57   - * @param format the format
58   - * @return the string
59   - */
60   - public static String format(Date date, String format) {
61   - if(date==null) return null;
62   - try {
63   - SimpleDateFormat sdf = new SimpleDateFormat(format);
64   - return sdf.format(date);
65   - } catch (Exception e) {
66   - throw new DataErrorException("日期格式化转换失败",e);
67   - }
68   - }
69   -
70   - /**
71   - * 时间格式化, 传入毫秒.
72   - *
73   - * @param time the time
74   - * @return the string
75   - */
76   - public static String dateFormat(long time) {
77   - return format(new Date(time), DateFormat.YYYY_MM_DD_HH_mm_ss);
78   - }
79   -
80   - /**
81   - * 日期字符串从旧格式转换为新格式.
82   - *
83   - * @param dateStr the date str
84   - * @param oldFromat the old fromat
85   - * @param newFormat the new format
86   - * @return the string
87   - */
88   - public static String format(String dateStr, String oldFromat,
89   - String newFormat) {
90   - try {
91   - if (StringUtils.isBlank(dateStr)) {
92   - return null;
93   - }
94   -
95   - SimpleDateFormat sdf1 = new SimpleDateFormat(oldFromat);
96   - Date date = sdf1.parse(dateStr);
97   -
98   - return format(date, newFormat);
99   -
100   - } catch (Exception e) {
101   - throw new DataErrorException("日期格式化转换失败",e);
102   - }
103   - }
104   -
105   - /**
106   - * 日期字符串转换为Calendar对象.
107   - *
108   - * @param dateStr the date str
109   - * @param dateStrFormat the date str format
110   - * @return the calendar
111   - */
112   - public static Calendar format(String dateStr, String dateStrFormat) {
113   - try {
114   - if (StringUtils.isBlank(dateStr)) {
115   - return null;
116   - }
117   - SimpleDateFormat sdf = new SimpleDateFormat(dateStrFormat);
118   - Date date = sdf.parse(dateStr);
119   - Calendar ca = GregorianCalendar.getInstance();
120   - ca.setTime(date);
121   - return ca;
122   - } catch (Exception e) {
123   - throw new DataErrorException("日期格式化转换失败",e);
124   - }
125   - }
126   -
127   - /**
128   - * 日期字符串转换为Date对象.
129   - *
130   - * @param dateStr the date str
131   - * @param dateStrFormat the date str format
132   - * @return the date
133   - */
134   - public static Date dateStr2Date(String dateStr, String dateStrFormat) {
135   - try {
136   - if (StringUtils.isBlank(dateStr)) {
137   - return null;
138   - }
139   - SimpleDateFormat sdf = new SimpleDateFormat(dateStrFormat);
140   - return sdf.parse(dateStr);
141   - } catch (Exception e) {
142   - throw new DataErrorException("日期格式化转换失败",e);
143   - }
144   - }
145   -
146   - /**
147   - * 增加日期的天数:Calendar.DAY_OF_MONTH
148   - *
149   - * @param date the date
150   - * @param amount the amount
151   - * @return the date
152   - * @createTime 2014-5-22 下午11:49:56
153   - */
154   - public static Date addDays(Date date, int amount) {
155   - return add(date, Calendar.DAY_OF_MONTH, amount);
156   - }
157   -
158   - /**
159   - * Adds the hours: Calendar.HOUR_OF_DAY
160   - *
161   - * @param date the date
162   - * @param amount the amount
163   - * @return the date
164   - */
165   - public static Date addHours(Date date, int amount) {
166   - return add(date, Calendar.HOUR_OF_DAY, amount);
167   - }
168   -
169   - /**
170   - * 减少小时
171   - * @param date
172   - * @param amount
173   - * @return
174   - */
175   - public static Date reduceHours(Date date,int amount){
176   - if (null == date) {
177   - return null;
178   - }
179   - Calendar cal = Calendar.getInstance();
180   - cal.setTime(date);
181   - if(amount<0){
182   - cal.add(Calendar.HOUR_OF_DAY, amount);
183   - }else{
184   - cal.add(Calendar.HOUR_OF_DAY, -amount);
185   - }
186   - return cal.getTime();
187   - }
188   -
189   - /**
190   - * Adds the seconds:Calendar.SECOND
191   - *
192   - * @param date the date
193   - * @param amount the amount
194   - * @return the date
195   - */
196   - public static Date addSeconds(Date date, int amount) {
197   - return add(date, Calendar.SECOND, amount);
198   - }
199   -
200   - public static Date addMilliSeconds(Date date,int amount){
201   - return add(date, Calendar.MILLISECOND, amount);
202   - }
203   - /**
204   - * current date Adds the seconds:Calendar.SECOND
205   - *
206   - * @param date the date
207   - * @param amount the amount
208   - * @return the date
209   - */
210   - public static Date addSeconds(int amount) {
211   - return add(new Date(), Calendar.SECOND, amount);
212   - }
213   -
214   - /**
215   - * Adds the field
216   - *
217   - * @param date the date
218   - * @param field the field
219   - * @param amount the amount
220   - * @return the date
221   - */
222   - private static Date add(Date date, int field, int amount) {
223   -
224   - if (null == date) {
225   - return null;
226   - }
227   - Calendar cal = Calendar.getInstance();
228   - cal.setTime(date);
229   - cal.add(field, amount);
230   - return cal.getTime();
231   -
232   - }
233   -
234   - /**
235   - * 格式化日期字符串为日期时间字符串,以0点0时0分开始。例如:2012-04-14 格式化为2012-04-14 00:00:00
236   - *
237   - * @param dateStr the date str
238   - * @return the string
239   - */
240   - public static String formatDate2DateTimeStart(String dateStr) {
241   - Calendar calendar = DateUtils.format(dateStr, DateFormat.YYYY_MM_DD);
242   - calendar.set(Calendar.HOUR_OF_DAY, 0);
243   - calendar.set(Calendar.MINUTE, 0);
244   - calendar.set(Calendar.SECOND, 0);
245   - return format(calendar.getTime());
246   - }
247   -
248   - /**
249   - * 格式化日期字符串为日期时间字符串,以23点59时59分结束。例如:2012-04-14 格式化为2012-04-14 23:59:59
250   - *
251   - * @param dateStr the date str
252   - * @return the string
253   - */
254   - public static String formatDate2DateTimeEnd(String dateStr) {
255   - Calendar calendar = DateUtils.format(dateStr, DateFormat.YYYY_MM_DD);
256   - calendar.set(Calendar.HOUR_OF_DAY, 23);
257   - calendar.set(Calendar.MINUTE, 59);
258   - calendar.set(Calendar.SECOND, 59);
259   - return format(calendar.getTime());
260   - }
261   - /**
262   - * 格式化日期字符串为日期时间字符串,以0点0时0分开始。例如:2012-04-14 格式化为2012-04-14 00:00:00
263   - *
264   - * @param dateStr the date str
265   - * @return the string
266   - */
267   - public static Date formatDate2DateTimeStart(Date date) {
268   - if(date==null){
269   - return null;
270   - }
271   - Calendar calendar = Calendar.getInstance();
272   - calendar.setTime(date);
273   - calendar.set(Calendar.HOUR_OF_DAY, 0);
274   - calendar.set(Calendar.MINUTE, 0);
275   - calendar.set(Calendar.SECOND, 0);
276   - return calendar.getTime();
277   - }
278   -
279   - /**
280   - * 格式化日期字符串为日期时间字符串,以23点59时59分结束。例如:2012-04-14 格式化为2012-04-14 23:59:59
281   - *
282   - * @param dateStr the date str
283   - * @return the string
284   - */
285   - public static Date formatDate2DateTimeEnd(Date date) {
286   - if(date==null){
287   - return null;
288   - }
289   - Calendar calendar = Calendar.getInstance();
290   - calendar.setTime(date);
291   - calendar.set(Calendar.HOUR_OF_DAY, 23);
292   - calendar.set(Calendar.MINUTE, 59);
293   - calendar.set(Calendar.SECOND, 59);
294   - return calendar.getTime();
295   - }
296   - /**
297   - * 日期格式化 返回格式 yyyy-MM-dd HH:mm:ss
298   - * @param date
299   - * @return
300   - */
301   - public static Date formatDateStr2Date(String date)
302   - {
303   - return DateUtils.dateStr2Date(date, DateFormat.YYYY_MM_DD_HH_mm_ss);
304   - }
305   -
306   - public static Date getCurrentDate(){
307   - return new Date();
308   - }
309   -
310   - public static Date addMinutes(Date nextDate, int amount) {
311   - return add(new Date(), Calendar.MINUTE, amount);
312   - }
313   -
314   - /**
315   - * 比较时间1和时间2 是否一致,精确到秒
316   - * @param time1
317   - * @param time2
318   - * @return
319   - */
320   - public static boolean equals(Date time1,Date time2){
321   - /**
322   - * 比较方式 1 直接比较数值 xxxxxL==xxxx.getDate().getTime()
323   - * 2 比较毫秒数time1.compareTo(time2)==0
324   - * 皆有误差,导致判断不准,如下面的例子,都会打印出false
325   - * System.out.println(DateUtils.format(new Date(1431085157467L)));
326   - *
327   - * Calendar carender=GregorianCalendar.getInstance();
328   - * carender.set(2015, 5, 8, 19, 39, 17);
329   - * System.out.println(DateUtils.format(carender.getTime()));
330   - *
331   - * System.out.println(1431085157467L==carender.getTime().getTime());
332   - * System.out.println(new Date(1431085157467L).compareTo(carender.getTime())==0);
333   - *
334   - */
335   -
336   - //在有误差的情况下,换算成字符串,精确到秒
337   - if((time1==null && time2!=null) || (time1!=null && time2==null) ){
338   - return false;
339   - }
340   - if(time1==null && time2==null) {
341   - return true;
342   - }
343   - return StringUtils.equals(DateUtils.format(time1),DateUtils.format(time2));
344   - }
  23 + /**
  24 + * Gets the server time.
  25 + *
  26 + * @return the server time
  27 + */
  28 + public static long getServerTime() {
  29 + return System.currentTimeMillis();
  30 + }
  31 +
  32 + /**
  33 + * 格式化日期,默认返回yyyy-MM-dd HH:mm:ss.
  34 + *
  35 + * @param date
  36 + * the date
  37 + * @return the string
  38 + */
  39 + public static String format(Date date) {
  40 + return format(date, DateFormat.YYYY_MM_DD_HH_mm_ss);
  41 + }
  42 +
  43 + /**
  44 + * 格式化显示当前日期.
  45 + *
  46 + * @param format
  47 + * the format
  48 + * @return the string
  49 + */
  50 + public static String format(String format) {
  51 + return format(new Date(), format);
  52 + }
  53 +
  54 + /**
  55 + * 日期格式化.
  56 + *
  57 + * @param date
  58 + * the date
  59 + * @param format
  60 + * the format
  61 + * @return the string
  62 + */
  63 + public static String format(Date date, String format) {
  64 + if (date == null)
  65 + return null;
  66 + SimpleDateFormat sdf = new SimpleDateFormat(format);
  67 + return sdf.format(date);
  68 + }
  69 +
  70 + /**
  71 + * 时间格式化, 传入毫秒.
  72 + *
  73 + * @param time
  74 + * the time
  75 + * @return the string
  76 + */
  77 + public static String dateFormat(long time) {
  78 + return format(new Date(time), DateFormat.YYYY_MM_DD_HH_mm_ss);
  79 + }
  80 +
  81 + /**
  82 + * 日期字符串从旧格式转换为新格式.
  83 + *
  84 + * @param dateStr
  85 + * the date str
  86 + * @param oldFromat
  87 + * the old fromat
  88 + * @param newFormat
  89 + * the new format
  90 + * @return the string
  91 + * @throws ParseException
  92 + */
  93 + public static String format(String dateStr, String oldFromat, String newFormat) throws ParseException {
  94 + if (StringUtils.isBlank(dateStr)) {
  95 + return null;
  96 + }
  97 +
  98 + SimpleDateFormat sdf1 = new SimpleDateFormat(oldFromat);
  99 + Date date = sdf1.parse(dateStr);
  100 +
  101 + return format(date, newFormat);
  102 +
  103 + }
  104 +
  105 + /**
  106 + * 日期字符串转换为Calendar对象.
  107 + *
  108 + * @param dateStr
  109 + * the date str
  110 + * @param dateStrFormat
  111 + * the date str format
  112 + * @return the calendar
  113 + * @throws ParseException
  114 + */
  115 + public static Calendar format(String dateStr, String dateStrFormat) throws ParseException {
  116 + if (StringUtils.isBlank(dateStr)) {
  117 + return null;
  118 + }
  119 + SimpleDateFormat sdf = new SimpleDateFormat(dateStrFormat);
  120 + Date date = sdf.parse(dateStr);
  121 + Calendar ca = GregorianCalendar.getInstance();
  122 + ca.setTime(date);
  123 + return ca;
  124 + }
  125 +
  126 + /**
  127 + * 日期字符串转换为Date对象.
  128 + *
  129 + * @param dateStr
  130 + * the date str
  131 + * @param dateStrFormat
  132 + * the date str format
  133 + * @return the date
  134 + * @throws ParseException
  135 + */
  136 + public static Date dateStr2Date(String dateStr, String dateStrFormat) throws ParseException {
  137 + if (StringUtils.isBlank(dateStr)) {
  138 + return null;
  139 + }
  140 + SimpleDateFormat sdf = new SimpleDateFormat(dateStrFormat);
  141 + return sdf.parse(dateStr);
  142 + }
  143 +
  144 + /**
  145 + * 增加日期的天数:Calendar.DAY_OF_MONTH
  146 + *
  147 + * @param date
  148 + * the date
  149 + * @param amount
  150 + * the amount
  151 + * @return the date
  152 + * @createTime 2014-5-22 下午11:49:56
  153 + */
  154 + public static Date addDays(Date date, int amount) {
  155 + return add(date, Calendar.DAY_OF_MONTH, amount);
  156 + }
  157 +
  158 + /**
  159 + * Adds the hours: Calendar.HOUR_OF_DAY
  160 + *
  161 + * @param date
  162 + * the date
  163 + * @param amount
  164 + * the amount
  165 + * @return the date
  166 + */
  167 + public static Date addHours(Date date, int amount) {
  168 + return add(date, Calendar.HOUR_OF_DAY, amount);
  169 + }
  170 +
  171 + /**
  172 + * 减少小时
  173 + *
  174 + * @param date
  175 + * @param amount
  176 + * @return
  177 + */
  178 + public static Date reduceHours(Date date, int amount) {
  179 + if (null == date) {
  180 + return null;
  181 + }
  182 + Calendar cal = Calendar.getInstance();
  183 + cal.setTime(date);
  184 + if (amount < 0) {
  185 + cal.add(Calendar.HOUR_OF_DAY, amount);
  186 + } else {
  187 + cal.add(Calendar.HOUR_OF_DAY, -amount);
  188 + }
  189 + return cal.getTime();
  190 + }
  191 +
  192 + /**
  193 + * Adds the seconds:Calendar.SECOND
  194 + *
  195 + * @param date
  196 + * the date
  197 + * @param amount
  198 + * the amount
  199 + * @return the date
  200 + */
  201 + public static Date addSeconds(Date date, int amount) {
  202 + return add(date, Calendar.SECOND, amount);
  203 + }
  204 +
  205 + public static Date addMilliSeconds(Date date, int amount) {
  206 + return add(date, Calendar.MILLISECOND, amount);
  207 + }
  208 +
  209 + /**
  210 + * current date Adds the seconds:Calendar.SECOND
  211 + *
  212 + * @param date
  213 + * the date
  214 + * @param amount
  215 + * the amount
  216 + * @return the date
  217 + */
  218 + public static Date addSeconds(int amount) {
  219 + return add(new Date(), Calendar.SECOND, amount);
  220 + }
  221 +
  222 + /**
  223 + * Adds the field
  224 + *
  225 + * @param date
  226 + * the date
  227 + * @param field
  228 + * the field
  229 + * @param amount
  230 + * the amount
  231 + * @return the date
  232 + */
  233 + private static Date add(Date date, int field, int amount) {
  234 +
  235 + if (null == date) {
  236 + return null;
  237 + }
  238 + Calendar cal = Calendar.getInstance();
  239 + cal.setTime(date);
  240 + cal.add(field, amount);
  241 + return cal.getTime();
  242 +
  243 + }
  244 +
  245 + /**
  246 + * 格式化日期字符串为日期时间字符串,以0点0时0分开始。例如:2012-04-14 格式化为2012-04-14 00:00:00
  247 + *
  248 + * @param dateStr
  249 + * the date str
  250 + * @return the string
  251 + * @throws ParseException
  252 + */
  253 + public static String formatDate2DateTimeStart(String dateStr) throws ParseException {
  254 + Calendar calendar = DateUtils.format(dateStr, DateFormat.YYYY_MM_DD);
  255 + calendar.set(Calendar.HOUR_OF_DAY, 0);
  256 + calendar.set(Calendar.MINUTE, 0);
  257 + calendar.set(Calendar.SECOND, 0);
  258 + return format(calendar.getTime());
  259 + }
  260 +
  261 + /**
  262 + * 格式化日期字符串为日期时间字符串,以23点59时59分结束。例如:2012-04-14 格式化为2012-04-14 23:59:59
  263 + *
  264 + * @param dateStr
  265 + * the date str
  266 + * @return the string
  267 + * @throws ParseException
  268 + */
  269 + public static String formatDate2DateTimeEnd(String dateStr) throws ParseException {
  270 + Calendar calendar = DateUtils.format(dateStr, DateFormat.YYYY_MM_DD);
  271 + calendar.set(Calendar.HOUR_OF_DAY, 23);
  272 + calendar.set(Calendar.MINUTE, 59);
  273 + calendar.set(Calendar.SECOND, 59);
  274 + return format(calendar.getTime());
  275 + }
  276 +
  277 + /**
  278 + * 格式化日期字符串为日期时间字符串,以0点0时0分开始。例如:2012-04-14 格式化为2012-04-14 00:00:00
  279 + *
  280 + * @param dateStr
  281 + * the date str
  282 + * @return the string
  283 + */
  284 + public static Date formatDate2DateTimeStart(Date date) {
  285 + if (date == null) {
  286 + return null;
  287 + }
  288 + Calendar calendar = Calendar.getInstance();
  289 + calendar.setTime(date);
  290 + calendar.set(Calendar.HOUR_OF_DAY, 0);
  291 + calendar.set(Calendar.MINUTE, 0);
  292 + calendar.set(Calendar.SECOND, 0);
  293 + return calendar.getTime();
  294 + }
  295 +
  296 + /**
  297 + * 格式化日期字符串为日期时间字符串,以23点59时59分结束。例如:2012-04-14 格式化为2012-04-14 23:59:59
  298 + *
  299 + * @param dateStr
  300 + * the date str
  301 + * @return the string
  302 + */
  303 + public static Date formatDate2DateTimeEnd(Date date) {
  304 + if (date == null) {
  305 + return null;
  306 + }
  307 + Calendar calendar = Calendar.getInstance();
  308 + calendar.setTime(date);
  309 + calendar.set(Calendar.HOUR_OF_DAY, 23);
  310 + calendar.set(Calendar.MINUTE, 59);
  311 + calendar.set(Calendar.SECOND, 59);
  312 + return calendar.getTime();
  313 + }
  314 +
  315 + /**
  316 + * 日期格式化 返回格式 yyyy-MM-dd HH:mm:ss
  317 + *
  318 + * @param date
  319 + * @return
  320 + * @throws ParseException
  321 + */
  322 + public static Date formatDateStr2Date(String date) throws ParseException {
  323 + return DateUtils.dateStr2Date(date, DateFormat.YYYY_MM_DD_HH_mm_ss);
  324 + }
  325 +
  326 + public static Date getCurrentDate() {
  327 + return new Date();
  328 + }
  329 +
  330 + public static Date addMinutes(Date nextDate, int amount) {
  331 + return add(new Date(), Calendar.MINUTE, amount);
  332 + }
  333 +
  334 + /**
  335 + * 比较时间1和时间2 是否一致,精确到秒
  336 + *
  337 + * @param time1
  338 + * @param time2
  339 + * @return
  340 + */
  341 + public static boolean equals(Date time1, Date time2) {
  342 + /**
  343 + * 比较方式 1 直接比较数值 xxxxxL==xxxx.getDate().getTime() 2
  344 + * 比较毫秒数time1.compareTo(time2)==0 皆有误差,导致判断不准,如下面的例子,都会打印出false
  345 + * System.out.println(DateUtils.format(new Date(1431085157467L)));
  346 + *
  347 + * Calendar carender=GregorianCalendar.getInstance(); carender.set(2015,
  348 + * 5, 8, 19, 39, 17);
  349 + * System.out.println(DateUtils.format(carender.getTime()));
  350 + *
  351 + * System.out.println(1431085157467L==carender.getTime().getTime());
  352 + * System.out.println(new
  353 + * Date(1431085157467L).compareTo(carender.getTime())==0);
  354 + *
  355 + */
  356 +
  357 + // 在有误差的情况下,换算成字符串,精确到秒
  358 + if ((time1 == null && time2 != null) || (time1 != null && time2 == null)) {
  359 + return false;
  360 + }
  361 + if (time1 == null && time2 == null) {
  362 + return true;
  363 + }
  364 + return StringUtils.equals(DateUtils.format(time1), DateUtils.format(time2));
  365 + }
345 366 }
... ...
b2c-orders-commons/src/main/java/com/b2c/orders/commons/utils/OrderIdGenerator.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.commons.utils;
  6 +
  7 +/**
  8 + * OrderMaxidService接口
  9 + *
  10 + * @author dev-center
  11 + * @since 2014-05-19
  12 + */
  13 +public interface OrderIdGenerator {
  14 + /**
  15 + * 获取-订单主表ID 生成规则:yyyyMMdd+7位顺序编码(共13位),如:2014061600000001
  16 + *
  17 + * @return
  18 + */
  19 + public Long getOrdersNewSeqNo();
  20 +
  21 + /**
  22 + * 获取订单号长度
  23 + *
  24 + * @return
  25 + */
  26 + public int getOrdersSeqNoLength();
  27 +
  28 + /**
  29 + * 获取-订单商品项表主键ID <br/>
  30 + * 生成规则:orderId * 100 + itemIdx
  31 + *
  32 + * @return
  33 + */
  34 + Long getOrdersItemNewSeqNo(Long orderId, int itemIdx);
  35 +
  36 +}
0 37 \ No newline at end of file
... ...
b2c-orders-dao/.classpath 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry kind="src" output="target/classes" path="src/main/java">
  4 + <attributes>
  5 + <attribute name="optional" value="true"/>
  6 + <attribute name="maven.pomderived" value="true"/>
  7 + </attributes>
  8 + </classpathentry>
  9 + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10 + <attributes>
  11 + <attribute name="maven.pomderived" value="true"/>
  12 + </attributes>
  13 + </classpathentry>
  14 + <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15 + <attributes>
  16 + <attribute name="optional" value="true"/>
  17 + <attribute name="maven.pomderived" value="true"/>
  18 + </attributes>
  19 + </classpathentry>
  20 + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  21 + <attributes>
  22 + <attribute name="maven.pomderived" value="true"/>
  23 + </attributes>
  24 + </classpathentry>
  25 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  26 + <attributes>
  27 + <attribute name="maven.pomderived" value="true"/>
  28 + </attributes>
  29 + </classpathentry>
  30 + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  31 + <attributes>
  32 + <attribute name="maven.pomderived" value="true"/>
  33 + <attribute name="org.eclipse.jst.component.nondependency" value=""/>
  34 + </attributes>
  35 + </classpathentry>
  36 + <classpathentry kind="output" path="target/classes"/>
  37 +</classpath>
... ...
b2c-orders-dao/.gitignore 0 → 100644
  1 +/target/
... ...
b2c-orders-dao/.project 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>b2c-orders-dao</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.eclipse.wst.common.project.facet.core.builder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + <buildCommand>
  14 + <name>org.eclipse.jdt.core.javabuilder</name>
  15 + <arguments>
  16 + </arguments>
  17 + </buildCommand>
  18 + <buildCommand>
  19 + <name>org.eclipse.m2e.core.maven2Builder</name>
  20 + <arguments>
  21 + </arguments>
  22 + </buildCommand>
  23 + <buildCommand>
  24 + <name>org.eclipse.wst.validation.validationbuilder</name>
  25 + <arguments>
  26 + </arguments>
  27 + </buildCommand>
  28 + </buildSpec>
  29 + <natures>
  30 + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  31 + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  32 + <nature>org.eclipse.jdt.core.javanature</nature>
  33 + <nature>org.eclipse.m2e.core.maven2Nature</nature>
  34 + <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  35 + </natures>
  36 +</projectDescription>
... ...
b2c-orders-dao/.settings/org.eclipse.core.resources.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +encoding//src/main/java=UTF-8
  3 +encoding//src/main/resources=UTF-8
  4 +encoding//src/test/java=UTF-8
  5 +encoding//src/test/resources=UTF-8
  6 +encoding/<project>=UTF-8
... ...
b2c-orders-dao/.settings/org.eclipse.jdt.core.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
  3 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  4 +org.eclipse.jdt.core.compiler.compliance=1.7
  5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
  6 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
  7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
  8 +org.eclipse.jdt.core.compiler.source=1.7
... ...
b2c-orders-dao/.settings/org.eclipse.m2e.core.prefs 0 → 100644
  1 +activeProfiles=
  2 +eclipse.preferences.version=1
  3 +resolveWorkspaceProjects=true
  4 +version=1
... ...
b2c-orders-dao/.settings/org.eclipse.wst.common.component 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
  2 + <wb-module deploy-name="b2c-orders-dao">
  3 + <wb-resource deploy-path="/" source-path="/src/main/java"/>
  4 + <wb-resource deploy-path="/" source-path="/src/main/resources"/>
  5 + </wb-module>
  6 +</project-modules>
... ...
b2c-orders-dao/.settings/org.eclipse.wst.common.project.facet.core.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<faceted-project>
  3 + <installed facet="java" version="1.7"/>
  4 + <installed facet="jst.utility" version="1.0"/>
  5 +</faceted-project>
... ...
orders-dao/pom.xml renamed to b2c-orders-dao/pom.xml
1   -<?xml version="1.0" encoding="UTF-8"?>
2   -<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
3   - xmlns="http://maven.apache.org/POM/4.0.0"
4   - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5   - <modelVersion>4.0.0</modelVersion>
6   - <parent>
7   - <groupId>com.b2c.orders</groupId>
8   - <artifactId>orders</artifactId>
9   - <version>1.1-SNAPSHOT</version>
10   - </parent>
11   -
12   - <artifactId>orders-dao</artifactId>
13   - <packaging>jar</packaging>
14   - <name>orders-dao</name>
15   -
16   - <dependencies>
17   - <!-- MyBatis&JDBC -->
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  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>
  4 + <parent>
  5 + <groupId>com.b2c.orders</groupId>
  6 + <artifactId>orders-parent</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + </parent>
  9 + <artifactId>orders-dao</artifactId>
  10 + <dependencies>
  11 + <dependency>
  12 + <groupId>${project.groupId}</groupId>
  13 + <artifactId>orders-domain</artifactId>
  14 + <version>${project.version}</version>
  15 + </dependency>
  16 + <dependency>
  17 + <groupId>org.mariadb.jdbc</groupId>
  18 + <artifactId>mariadb-java-client</artifactId>
  19 + </dependency>
18 20 <dependency>
19 21 <groupId>org.mybatis</groupId>
20 22 <artifactId>mybatis</artifactId>
... ... @@ -24,22 +26,26 @@
24 26 <artifactId>mybatis-spring</artifactId>
25 27 </dependency>
26 28 <dependency>
27   - <groupId>com.alibaba</groupId>
28   - <artifactId>druid</artifactId>
29   - </dependency>
30   - <dependency>
31   - <groupId>mysql</groupId>
32   - <artifactId>mysql-connector-java</artifactId>
  29 + <groupId>com.alibaba</groupId>
  30 + <artifactId>druid</artifactId>
33 31 </dependency>
34 32 <dependency>
35 33 <groupId>org.springframework</groupId>
36 34 <artifactId>spring-jdbc</artifactId>
37 35 </dependency>
38   - <dependency>
39   - <groupId>com.b2c.orders</groupId>
40   - <artifactId>orders-domain</artifactId>
41   - <version>${project.parent.version}</version>
42   - </dependency>
43   - </dependencies>
44   -
45   -</project>
  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>
  51 +</project>
46 52 \ No newline at end of file
... ...
b2c-orders-dao/src/main/java/com/b2c/orders/dao/OrderDao.java 0 → 100644
  1 +package com.b2c.orders.dao;
  2 +
  3 +import com.b2c.orders.domain.Order;
  4 +import com.diligrp.website.util.dao.IBaseDao;
  5 +
  6 +public interface OrderDao extends IBaseDao<Order> {
  7 +
  8 +}
... ...
b2c-orders-dao/src/main/java/com/b2c/orders/dao/OrderDaoBean.java 0 → 100644
  1 +package com.b2c.orders.dao;
  2 +
  3 +import org.springframework.stereotype.Repository;
  4 +
  5 +import com.b2c.orders.domain.Order;
  6 +import com.diligrp.website.util.dao.impl.BaseDaoImpl;
  7 +
  8 +@Repository
  9 +public class OrderDaoBean extends BaseDaoImpl<Order> implements OrderDao {
  10 +
  11 +}
... ...
b2c-orders-dao/src/main/java/com/b2c/orders/dao/OrderMaxidDao.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.concurrent.atomic.AtomicLong;
  8 +
  9 +import com.b2c.orders.domain.OrderMaxid;
  10 +import com.diligrp.website.util.dao.IBaseDao;
  11 +
  12 +/**
  13 + * OrderMaxidDao 接口
  14 + *
  15 + * @author dev-center
  16 + * @since 2014-05-19
  17 + */
  18 +public interface OrderMaxidDao extends IBaseDao<OrderMaxid> {
  19 + // 自定义扩展
  20 + public OrderMaxid getOrderMaxIdByIdType(String idType);
  21 +
  22 + /**
  23 + * 在一个独立新事务中更新
  24 + *
  25 + * @param t
  26 + * @return
  27 + */
  28 + public SequenceNo getSeqNoByNewTransactional(SequenceNo idSequence, String seqIdKey, Long startSeq);
  29 +
  30 + /**
  31 + * Sequence本地缓存对象 <br />
  32 + * <B>Copyright</B> Copyright (c) 2014 www.diligrp.com All rights reserved.
  33 + * <br />
  34 + * 本软件源代码版权归地利集团,未经许可不得任意复制与传播.<br />
  35 + * <B>Company</B> 地利集团
  36 + */
  37 + public class SequenceNo {
  38 + private Long step = 50L;// 步长
  39 + private AtomicLong startSeq = new AtomicLong(1);// 开始ID
  40 + private Long finishSeq = 0L;// 结束ID
  41 +
  42 + public Long next() {
  43 + return startSeq.getAndIncrement();
  44 + }
  45 +
  46 + public Long getStep() {
  47 + return step;
  48 + }
  49 +
  50 + public Long getStartSeq() {
  51 + return startSeq.get();
  52 + }
  53 +
  54 + public void setStartSeq(Long startSeq) {
  55 + this.startSeq = new AtomicLong(startSeq);
  56 + }
  57 +
  58 + public Long getFinishSeq() {
  59 + return finishSeq;
  60 + }
  61 +
  62 + public void setFinishSeq(Long finishSeq) {
  63 + this.finishSeq = finishSeq;
  64 + }
  65 + }
  66 +}
0 67 \ No newline at end of file
... ...
b2c-orders-dao/src/main/resources/spring-dao.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"
  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 + default-autowire="byName">
  12 +
  13 + <context:component-scan base-package="com.diligrp.orders.dao" />
  14 +
  15 + <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource"
  16 + init-method="init" destroy-method="close">
  17 + <property name="driverClassName" value="${jdbc.driverClass}" />
  18 + <property name="url" value="${jdbc.jdbcUrl}" />
  19 + <property name="username" value="${jdbc.username}" />
  20 + <property name="password" value="${jdbc.password}" />
  21 + <!-- 添加监控,SQL注入防火墙 -->
  22 + <property name="filters" value="stat,logback" />
  23 + <!-- 慢查询 -->
  24 + <property name="connectionProperties" value="druid.stat.slowSqlMillis=1000" />
  25 + <property name="maxActive" value="100" />
  26 + <property name="initialSize" value="1" />
  27 + <property name="maxWait" value="60000" />
  28 + <property name="minIdle" value="1" />
  29 + <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
  30 + <property name="timeBetweenEvictionRunsMillis" value="60000" />
  31 + <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
  32 + <property name="minEvictableIdleTimeMillis" value="300000" />
  33 + <property name="validationQuery" value="SELECT now()" />
  34 + <property name="testWhileIdle" value="true" />
  35 + <property name="testOnBorrow" value="false" />
  36 + <property name="testOnReturn" value="false" />
  37 + <!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
  38 + <property name="poolPreparedStatements" value="true" />
  39 + <property name="maxOpenPreparedStatements" value="20" />
  40 +
  41 + <!-- 超过时间限制是否回收 -->
  42 + <property name="removeAbandoned" value="true" />
  43 + <!-- 超时时间;单位为秒。180秒=3分钟 -->
  44 + <property name="removeAbandonedTimeout" value="180" />
  45 + <!-- 关闭abanded连接时输出错误日志 -->
  46 + <property name="logAbandoned" value="true" />
  47 +
  48 + <!-- 配置公用监控数据 -->
  49 + <property name="useGlobalDataSourceStat" value="true" />
  50 + </bean>
  51 +
  52 + <!-- 配置事务管理器 -->
  53 + <bean id="transactionManager"
  54 + class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  55 + <property name="dataSource" ref="dataSource" />
  56 + </bean>
  57 +
  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" />
  62 + </bean>
  63 +
  64 + <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
  65 + <constructor-arg index="0" ref="sqlSessionFactory" />
  66 + </bean>
  67 +
  68 +</beans>
0 69 \ No newline at end of file
... ...
b2c-orders-dao/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 +
  20 +
  21 + </typeAliases>
  22 +
  23 + <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" />
  37 + </typeHandlers>
  38 +
  39 + <!-- 映射文件路径 -->
  40 + <mappers>
  41 + <mapper resource="sqlmap/OrderItem.xml" />
  42 + <mapper resource="sqlmap/Orders.xml" />
  43 + <mapper resource="sqlmap/OrderMaxid.xml" />
  44 + <mapper resource="sqlmap/OrdersJob.xml" />
  45 + </mappers>
  46 +
  47 +
  48 +</configuration>
0 49 \ No newline at end of file
... ...
orders-dao/src/main/resources/sqlmap/OrderItem.xml renamed to b2c-orders-dao/src/main/resources/sqlmap/OrderItem.xml
b2c-orders-dao/src/main/resources/sqlmap/OrderMaxid.xml 0 → 100644
  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.OrderMaxidDao">
  5 +
  6 + <!-- order_maxid 所有查询列 -->
  7 + <sql id="QUERY_COLUMN_LIST">
  8 + <!-- [CDATA[id,id_type AS idType,id_value AS idValue,memo,version_num AS versionNum]]-->
  9 + <![CDATA[id,id_value AS idValue,version_num AS versionNum]]>
  10 + </sql>
  11 +
  12 + <!-- order_maxid 查询列来源表-->
  13 + <sql id="QUERY_FROM_TABLE"><![CDATA[FROM order_maxid]]></sql>
  14 +
  15 + <!-- 全部条件(更多功能可以通过queryData扩展实现) -->
  16 + <sql id="QUERY_WHERE_CLAUSE">
  17 + <where>
  18 + <if test="id != null and id != ''"><![CDATA[AND id = #{id}]]></if>
  19 + <if test="idType != null and idType != ''"><![CDATA[AND id_type = #{idType}]]></if>
  20 + <if test="idValue != null and idValue != ''"><![CDATA[AND id_value = #{idValue}]]></if>
  21 + <if test="memo != null and memo != ''"><![CDATA[AND memo = #{memo}]]></if>
  22 + <if test="versionNum != null and versionNum != ''"><![CDATA[AND version_num = #{versionNum}]]></if>
  23 + </where>
  24 + </sql>
  25 +
  26 + <!-- 智能排序与分页 -->
  27 + <sql id="QUERY_ORDER_LIMIT_CONDTION">
  28 + <choose>
  29 + <when test="orderField != null and orderField != ''">
  30 + <choose>
  31 + <when test="orderFieldType != null and orderFieldType != ''">
  32 + <![CDATA[ORDER BY ${orderField} ${orderFieldType}]]>
  33 + </when>
  34 + <otherwise>
  35 + <![CDATA[ORDER BY ${orderField} desc]]>
  36 + </otherwise>
  37 + </choose>
  38 + </when>
  39 + <otherwise>
  40 + <![CDATA[ORDER BY id desc]]>
  41 + </otherwise>
  42 + </choose>
  43 + <if test="startIndex != null and startIndex &gt;= 0 and pageSize != null and pageSize &gt; 0"><![CDATA[LIMIT #{startIndex},#{pageSize}]]></if>
  44 + </sql>
  45 +
  46 + <!-- 更新列字段,只要不为NULL则更新,除开主键列 -->
  47 + <sql id="UPDATE_COLUMN_SET">
  48 + <set>
  49 + <if test="idType != null"><![CDATA[id_type = #{idType},]]></if>
  50 + <if test="idValue != null"><![CDATA[id_value = #{idValue},]]></if>
  51 + <if test="memo != null"><![CDATA[memo = #{memo},]]></if>
  52 + <![CDATA[version_num = version_num + 1,]]>
  53 + </set>
  54 + </sql>
  55 +
  56 + <!-- 插入order_maxid记录 -->
  57 + <insert id="insertEntry" parameterType="orderMaxid" >
  58 + <![CDATA[
  59 + INSERT INTO order_maxid (id,id_type,id_value,memo,version_num)
  60 + VALUES (#{id},#{idType},#{idValue},#{memo},#{versionNum})
  61 + ]]>
  62 + </insert>
  63 +
  64 + <!-- 返回插入的编号,在事务开启状态下有效 -->
  65 + <select id="lastSequence" resultType="int"><![CDATA[SELECT LAST_INSERT_ID() AS id]]></select>
  66 +
  67 + <!-- 删除记录,主键IN(array) -->
  68 + <delete id="deleteByArrayKey" parameterType="java.lang.reflect.Array" >
  69 + <![CDATA[DELETE FROM order_maxid WHERE id IN]]>
  70 + <foreach collection="array" item="id" open="(" separator="," close=")">
  71 + <![CDATA[#{id}]]>
  72 + </foreach>
  73 + </delete>
  74 +
  75 + <!-- 删除,通过条件 -->
  76 + <update id="deleteByCondtion" parameterType="orderMaxid" >
  77 + <![CDATA[DELETE FROM order_maxid]]>
  78 + <include refid="QUERY_WHERE_CLAUSE"/>
  79 + </update>
  80 +
  81 + <!-- 修改记录通过主键 -->
  82 + <update id="updateByKey" parameterType="orderMaxid" >
  83 + <![CDATA[UPDATE order_maxid]]>
  84 + <include refid="UPDATE_COLUMN_SET"/>
  85 + <![CDATA[WHERE id = #{id} AND version_num = #{versionNum}]]>
  86 + </update>
  87 +
  88 + <!-- 查询,通过主键IN(array) -->
  89 + <select id="selectEntryArray" parameterType="java.lang.reflect.Array" resultType="orderMaxid">
  90 + <![CDATA[SELECT]]>
  91 + <include refid="QUERY_COLUMN_LIST"/>
  92 + <include refid="QUERY_FROM_TABLE"/>
  93 + <![CDATA[WHERE id IN]]>
  94 + <foreach collection="array" item="id" open="(" separator="," close=")">
  95 + <![CDATA[#{id}]]>
  96 + </foreach>
  97 + </select>
  98 +
  99 + <!-- 查询,通过条件 -->
  100 + <select id="selectEntryList" parameterType="orderMaxid" resultType="orderMaxid">
  101 + <![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"/>
  106 + </select>
  107 +
  108 + <!-- 总数查询,通过条件 -->
  109 + <select id="selectEntryListCount" parameterType="orderMaxid" resultType="int">
  110 + <![CDATA[SELECT COUNT(id) AS dataCount]]>
  111 + <include refid="QUERY_FROM_TABLE"/>
  112 + <include refid="QUERY_WHERE_CLAUSE"/>
  113 + </select>
  114 +
  115 + <!-- 其它SQL语句 -->
  116 +
  117 +
  118 +</mapper>
0 119 \ No newline at end of file
... ...
b2c-orders-dao/src/main/resources/sqlmap/OrderReceiver.xml 0 → 100644
  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>
0 129 \ No newline at end of file
... ...
orders-dao/src/main/resources/sqlmap/Orders.xml renamed to b2c-orders-dao/src/main/resources/sqlmap/Orders.xml
b2c-orders-dao/src/main/resources/sqlmap/OrdersJob.xml 0 → 100644
  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>
0 118 \ No newline at end of file
... ...
b2c-orders-domain/.classpath 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry kind="src" output="target/classes" path="src/main/java">
  4 + <attributes>
  5 + <attribute name="optional" value="true"/>
  6 + <attribute name="maven.pomderived" value="true"/>
  7 + </attributes>
  8 + </classpathentry>
  9 + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10 + <attributes>
  11 + <attribute name="maven.pomderived" value="true"/>
  12 + </attributes>
  13 + </classpathentry>
  14 + <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15 + <attributes>
  16 + <attribute name="optional" value="true"/>
  17 + <attribute name="maven.pomderived" value="true"/>
  18 + </attributes>
  19 + </classpathentry>
  20 + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  21 + <attributes>
  22 + <attribute name="maven.pomderived" value="true"/>
  23 + </attributes>
  24 + </classpathentry>
  25 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  26 + <attributes>
  27 + <attribute name="maven.pomderived" value="true"/>
  28 + </attributes>
  29 + </classpathentry>
  30 + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  31 + <attributes>
  32 + <attribute name="maven.pomderived" value="true"/>
  33 + <attribute name="org.eclipse.jst.component.nondependency" value=""/>
  34 + </attributes>
  35 + </classpathentry>
  36 + <classpathentry kind="output" path="target/classes"/>
  37 +</classpath>
... ...
b2c-orders-domain/.gitignore 0 → 100644
  1 +/target/
... ...
b2c-orders-domain/.project 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<projectDescription>
  3 + <name>b2c-orders-domain</name>
  4 + <comment></comment>
  5 + <projects>
  6 + </projects>
  7 + <buildSpec>
  8 + <buildCommand>
  9 + <name>org.eclipse.wst.common.project.facet.core.builder</name>
  10 + <arguments>
  11 + </arguments>
  12 + </buildCommand>
  13 + <buildCommand>
  14 + <name>org.eclipse.jdt.core.javabuilder</name>
  15 + <arguments>
  16 + </arguments>
  17 + </buildCommand>
  18 + <buildCommand>
  19 + <name>org.eclipse.m2e.core.maven2Builder</name>
  20 + <arguments>
  21 + </arguments>
  22 + </buildCommand>
  23 + <buildCommand>
  24 + <name>org.eclipse.wst.validation.validationbuilder</name>
  25 + <arguments>
  26 + </arguments>
  27 + </buildCommand>
  28 + </buildSpec>
  29 + <natures>
  30 + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
  31 + <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
  32 + <nature>org.eclipse.jdt.core.javanature</nature>
  33 + <nature>org.eclipse.m2e.core.maven2Nature</nature>
  34 + <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
  35 + </natures>
  36 +</projectDescription>
... ...
b2c-orders-domain/.settings/org.eclipse.core.resources.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +encoding//src/main/java=UTF-8
  3 +encoding//src/main/resources=UTF-8
  4 +encoding//src/test/java=UTF-8
  5 +encoding//src/test/resources=UTF-8
  6 +encoding/<project>=UTF-8
... ...
b2c-orders-domain/.settings/org.eclipse.jdt.core.prefs 0 → 100644
  1 +eclipse.preferences.version=1
  2 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
  3 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
  4 +org.eclipse.jdt.core.compiler.compliance=1.7
  5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
  6 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
  7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
  8 +org.eclipse.jdt.core.compiler.source=1.7
... ...
b2c-orders-domain/.settings/org.eclipse.m2e.core.prefs 0 → 100644
  1 +activeProfiles=
  2 +eclipse.preferences.version=1
  3 +resolveWorkspaceProjects=true
  4 +version=1
... ...
b2c-orders-domain/.settings/org.eclipse.wst.common.component 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
  2 + <wb-module deploy-name="b2c-orders-domain">
  3 + <wb-resource deploy-path="/" source-path="/src/main/java"/>
  4 + <wb-resource deploy-path="/" source-path="/src/main/resources"/>
  5 + </wb-module>
  6 +</project-modules>
... ...
b2c-orders-domain/.settings/org.eclipse.wst.common.project.facet.core.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<faceted-project>
  3 + <installed facet="java" version="1.7"/>
  4 + <installed facet="jst.utility" version="1.0"/>
  5 +</faceted-project>
... ...
b2c-orders-domain/pom.xml 0 → 100644
  1 +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  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>
  4 + <parent>
  5 + <groupId>com.b2c.orders</groupId>
  6 + <artifactId>orders-parent</artifactId>
  7 + <version>0.0.1-SNAPSHOT</version>
  8 + </parent>
  9 + <artifactId>orders-domain</artifactId>
  10 +
  11 + <dependencies>
  12 + <dependency>
  13 + <groupId>${project.groupId}</groupId>
  14 + <artifactId>orders-commons</artifactId>
  15 + <version>${project.version}</version>
  16 + </dependency>
  17 + <dependency>
  18 + <groupId>${project.groupId}</groupId>
  19 + <artifactId>orders-client</artifactId>
  20 + <version>1.1.0-SNAPSHOT</version>
  21 + </dependency>
  22 + <dependency>
  23 + <groupId>org.projectlombok</groupId>
  24 + <artifactId>lombok</artifactId>
  25 + </dependency>
  26 + <dependency>
  27 + <groupId>com.google.guava</groupId>
  28 + <artifactId>guava</artifactId>
  29 + </dependency>
  30 + <!-- https://mvnrepository.com/artifact/cglib/cglib -->
  31 + <dependency>
  32 + <groupId>cglib</groupId>
  33 + <artifactId>cglib</artifactId>
  34 + </dependency>
  35 + <dependency>
  36 + <groupId>commons-lang</groupId>
  37 + <artifactId>commons-lang</artifactId>
  38 + </dependency>
  39 + </dependencies>
  40 +</project>
0 41 \ No newline at end of file
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/BaseDomain.java 0 → 100644
  1 +package com.b2c.orders.domain;
  2 +
  3 +import java.io.Serializable;
  4 +
  5 +public class BaseDomain implements Serializable {
  6 +
  7 + /**
  8 + *
  9 + */
  10 + private static final long serialVersionUID = 5183735331878398606L;
  11 +
  12 + private Long id;
  13 +
  14 + public Long getId() {
  15 + return id;
  16 + }
  17 +
  18 + public void setId(Long id) {
  19 + this.id = id;
  20 + }
  21 +
  22 + @Override
  23 + public int hashCode() {
  24 + final int prime = 31;
  25 + int result = 1;
  26 + result = prime * result + ((id == null) ? 0 : id.hashCode());
  27 + return result;
  28 + }
  29 +
  30 + @Override
  31 + public boolean equals(Object obj) {
  32 + if (this == obj)
  33 + return true;
  34 + if (obj == null)
  35 + return false;
  36 + if (getClass() != obj.getClass())
  37 + return false;
  38 + BaseDomain other = (BaseDomain) obj;
  39 + if (id == null) {
  40 + if (other.id != null)
  41 + return false;
  42 + } else if (!id.equals(other.id))
  43 + return false;
  44 + return true;
  45 + }
  46 +
  47 +
  48 +
  49 +}
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/Buyer.java 0 → 100644
  1 +package com.b2c.orders.domain;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class Buyer {
  7 +
  8 + private Long id;
  9 + private String name;
  10 + private CapitalAccount account;
  11 +
  12 + public CapitalAccount getAccount() {
  13 + return this.account;
  14 + }
  15 +}
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/CapitalAccount.java 0 → 100644
  1 +package com.b2c.orders.domain;
  2 +
  3 +public class CapitalAccount {
  4 +
  5 + public void deduct(Long amount) {
  6 + }
  7 +}
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/Order.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.domain;
  6 +
  7 +import java.util.Date;
  8 +import java.util.List;
  9 +
  10 +import com.b2c.orders.client.domain.dto.request.SubmitOrderRequestDto;
  11 +import com.b2c.orders.commons.exceptions.ApplicationException;
  12 +import com.b2c.orders.commons.exceptions.OrderException;
  13 +import com.b2c.orders.commons.utils.OrderIdGenerator;
  14 +import com.b2c.orders.enums.OrderDeliveryType;
  15 +import com.b2c.orders.enums.OrderStatus;
  16 +import com.b2c.orders.enums.PayStatus;
  17 +import com.b2c.orders.enums.PayType;
  18 +
  19 +import lombok.Data;
  20 +import lombok.EqualsAndHashCode;
  21 +import lombok.NoArgsConstructor;
  22 +
  23 +/**
  24 + * orders
  25 + *
  26 + * @author dev-center
  27 + * @since 2014-05-19
  28 + */
  29 +@Data
  30 +@EqualsAndHashCode(callSuper = true)
  31 +@NoArgsConstructor
  32 +public class Order extends BaseDomain {
  33 +
  34 + /**
  35 + *
  36 + */
  37 + private static final long serialVersionUID = -937763798357277615L;
  38 +
  39 + /**
  40 + * 买家
  41 + */
  42 + private Buyer buyer;
  43 + /**
  44 + * 卖家
  45 + */
  46 + private Seller seller;
  47 + /** 配送类型 */
  48 + private OrderDeliveryType deliveryType;
  49 + /** 订单状态 */
  50 + private OrderStatus orderStatus;
  51 + /** 支付状态 */
  52 + private PayStatus payStatus;
  53 + /** 买家备注说明 */
  54 + private String buyerMemo;
  55 + /** 订单当前状态最后有效时间(计划流出时间) */
  56 + private Date orderStatusLastValidTime;
  57 + /** 订单当前状态最近一次流入时间 */
  58 + private Date orderStatusInTime;
  59 + /** 支付时间 */
  60 + private Date payTime;
  61 + /**
  62 + * 送货时间
  63 + */
  64 + private Date deliveryTime;
  65 + /** 提货时间 */
  66 + private Date reservationTime;
  67 + /** 买家确认收货时间 */
  68 + private Date buyerConfirmTime;
  69 + /** 订单提交时间 */
  70 + private Date submitTime;
  71 + /** 支付类型 */
  72 + private PayType payType;
  73 + /** 总金额 */
  74 + private Long totalPrice;
  75 + /** 乐观锁(版本号) */
  76 + private Long versionNum;
  77 + /** 删除标志 */
  78 + private Integer isDelete;
  79 + /**
  80 + * 店铺
  81 + */
  82 + private Shop shop;
  83 + /** 进入当前状态说明或原因,如取消原因,退款审批通过原因等 */
  84 + private String statusInReason;
  85 + /**
  86 + * 订单项
  87 + */
  88 + private List<OrderItem> orderItems;
  89 +
  90 + /**
  91 + * 提交订单
  92 + *
  93 + * @param vo
  94 + * 订单属性
  95 + */
  96 + public void submit(SubmitOrderRequestDto vo, OrderIdGenerator idGenerator) {
  97 + this.payStatus = PayStatus.PayWait;
  98 + this.orderStatus = OrderStatus.PendingTake;
  99 + }
  100 +
  101 + /**
  102 + * 商家接单
  103 + *
  104 + * @param totalPrice
  105 + * TODO
  106 + *
  107 + * @throws OrderException
  108 + */
  109 + public void take(Long totalPrice) throws OrderException {
  110 + if (!this.orderStatus.equals(OrderStatus.PendingTake)) {
  111 + throw new OrderException(OrderException.ORDER_STATUS_FLOW_EXCEPTION, "订单状态流转顺序异常");
  112 + }
  113 + if (this.payType.equals(PayType.Online)) {
  114 + this.orderStatus = OrderStatus.PendingPayment;
  115 + } else if (this.payType.equals(PayType.Offline)) {
  116 + if (this.deliveryType.equals(OrderDeliveryType.Delivery)) {
  117 + this.orderStatus = OrderStatus.PendingDelivery;
  118 + } else if (this.deliveryType.equals(OrderDeliveryType.Self)) {
  119 + this.orderStatus = OrderStatus.PendingStoreMention;
  120 + } else {
  121 + throw new OrderException(ApplicationException.DATA_EXCEPTION, "未知的配送类型");
  122 + }
  123 + } else {
  124 + throw new OrderException(ApplicationException.DATA_EXCEPTION, "未知的支付类型");
  125 + }
  126 + this.totalPrice = totalPrice;
  127 + }
  128 +
  129 + /**
  130 + * 买家支付
  131 + *
  132 + * @throws OrderException
  133 + */
  134 + public void pay() throws OrderException {
  135 + if (!this.orderStatus.equals(OrderStatus.PendingPayment)) {
  136 + throw new OrderException(ApplicationException.DATA_EXCEPTION, "当前订单状态不允许支付");
  137 + }
  138 + if (!this.payType.equals(PayType.Online)) {
  139 + throw new OrderException(ApplicationException.DATA_EXCEPTION, "订单支付类型不是线上付款");
  140 + }
  141 + this.payStatus = PayStatus.Paid;
  142 + this.payTime = new Date();
  143 + if (this.deliveryType.equals(OrderDeliveryType.Delivery)) {
  144 + this.orderStatus = OrderStatus.PendingDelivery;
  145 + } else if (this.deliveryType.equals(OrderDeliveryType.Self)) {
  146 + this.orderStatus = OrderStatus.PendingStoreMention;
  147 + } else {
  148 + throw new OrderException(ApplicationException.DATA_EXCEPTION, "未知的支付类型");
  149 + }
  150 + }
  151 +
  152 + /**
  153 + * 商家确认收款或买家确认收货
  154 + *
  155 + * @throws OrderException
  156 + */
  157 + public void confirm() throws OrderException {
  158 + if (!this.orderStatus.equals(OrderStatus.PendingDelivery)
  159 + && !this.orderStatus.equals(OrderStatus.PendingStoreMention)) {
  160 + throw new OrderException(OrderException.ORDER_STATUS_FLOW_EXCEPTION, "当前订单状态不能确认收货");
  161 + }
  162 + this.orderStatus = OrderStatus.Completed;
  163 + }
  164 +
  165 + public void refuse() throws OrderException {
  166 + if (!this.orderStatus.equals(OrderStatus.PendingTake)) {
  167 + throw new OrderException(OrderException.ORDER_STATUS_FLOW_EXCEPTION, "当前订单状态不能拒绝接单");
  168 + }
  169 + this.orderStatus = OrderStatus.Refused;
  170 + }
  171 +
  172 + public void cancel() throws OrderException {
  173 + if (!this.isCanCancel()) {
  174 + throw new OrderException(OrderException.ORDER_STATUS_FLOW_EXCEPTION, "当前状态不能被取消");
  175 + }
  176 + this.orderStatus = OrderStatus.Canceled;
  177 + }
  178 +
  179 + public void timeout() throws OrderException {
  180 + if (!this.orderStatus.equals(OrderStatus.PendingTake) && !this.orderStatus.equals(OrderStatus.PendingPayment)) {
  181 + throw new OrderException(OrderException.ORDER_STATUS_FLOW_EXCEPTION, "当前状态不能设置订单超时");
  182 + }
  183 + this.orderStatus = OrderStatus.Timeout;
  184 + }
  185 +
  186 + public boolean isCanCancel() {
  187 + if (this.orderStatus.equals(OrderStatus.PendingTake)) {
  188 + return true;
  189 + }
  190 + if (this.orderStatus.equals(OrderStatus.PendingPayment)) {
  191 + return true;
  192 + }
  193 + if (this.orderStatus.equals(OrderStatus.PendingStoreMention)) {
  194 + return true;
  195 + }
  196 + if (this.orderStatus.equals(OrderStatus.PendingDelivery) && this.payType.equals(PayType.Offline)) {
  197 + return true;
  198 + }
  199 + return false;
  200 + }
  201 +
  202 +}
0 203 \ No newline at end of file
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/OrderItem.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.domain;
  6 +
  7 +import java.util.Date;
  8 +
  9 +import lombok.Data;
  10 +import lombok.EqualsAndHashCode;
  11 +import lombok.NoArgsConstructor;
  12 +
  13 +/**
  14 + * orderItem
  15 + *
  16 + * @author dev-center
  17 + * @since 2014-05-19
  18 + */
  19 +@Data
  20 +@EqualsAndHashCode(callSuper = true)
  21 +@NoArgsConstructor
  22 +public class OrderItem extends BaseDomain {
  23 +
  24 + /**
  25 + *
  26 + */
  27 + private static final long serialVersionUID = -8414343606604984981L;
  28 +
  29 + private Long orderId;
  30 + private Order order;
  31 + private Long productId;
  32 + private Long buyerId;
  33 + private Long sellerId;
  34 + private String sku;
  35 + private String skuTitle;
  36 + private String skuAttributes;
  37 + private Integer skuNum;
  38 + private Long skuPrice;
  39 + private Long realPrice;
  40 + private Date createTime;
  41 + private Date editTime;
  42 + private Integer isCommented;
  43 + private Long versionNum;
  44 + private String skuPicture;
  45 + private String priceUnit;
  46 + /** 店铺ID */
  47 + private Long shopId;
  48 +
  49 +}
0 50 \ No newline at end of file
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/OrderMaxid.java 0 → 100644
  1 +/*
  2 + * Copyright (c) 2014 www.diligrp.com All rights reserved.
  3 + * 本软件源代码版权归----所有,未经许可不得任意复制与传播.
  4 + */
  5 +package com.b2c.orders.domain;
  6 +
  7 +/**
  8 + * orderMaxid
  9 + *
  10 + * @author dev-center
  11 + * @since 2014-05-19
  12 + */
  13 +public class OrderMaxid extends BaseDomain {
  14 + private static final long serialVersionUID = 1L;
  15 + private String idType;
  16 + private Long idValue;
  17 + private String memo;
  18 + private Long versionNum;
  19 +
  20 + public OrderMaxid() {
  21 + // 默认无参构造方法
  22 + }
  23 +
  24 + /**
  25 + * 获取 idType
  26 + *
  27 + * @return
  28 + */
  29 + public String getIdType() {
  30 + return idType;
  31 + }
  32 +
  33 + /**
  34 + * 设置 idType
  35 + *
  36 + * @param idType
  37 + */
  38 + public void setIdType(String idType) {
  39 + this.idType = idType;
  40 + }
  41 +
  42 + /**
  43 + * 获取 idValue
  44 + *
  45 + * @return
  46 + */
  47 + public Long getIdValue() {
  48 + return idValue;
  49 + }
  50 +
  51 + /**
  52 + * 设置 idValue
  53 + *
  54 + * @param idValue
  55 + */
  56 + public void setIdValue(Long idValue) {
  57 + this.idValue = idValue;
  58 + }
  59 +
  60 + /**
  61 + * 获取 memo
  62 + *
  63 + * @return
  64 + */
  65 + public String getMemo() {
  66 + return memo;
  67 + }
  68 +
  69 + /**
  70 + * 设置 memo
  71 + *
  72 + * @param memo
  73 + */
  74 + public void setMemo(String memo) {
  75 + this.memo = memo;
  76 + }
  77 +
  78 + /**
  79 + * 获取 versionNum
  80 + *
  81 + * @return
  82 + */
  83 + public Long getVersionNum() {
  84 + return versionNum;
  85 + }
  86 +
  87 + /**
  88 + * 设置 versionNum
  89 + *
  90 + * @param versionNum
  91 + */
  92 + public void setVersionNum(Long versionNum) {
  93 + this.versionNum = versionNum;
  94 + }
  95 +}
0 96 \ No newline at end of file
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/OrderReceiver.java 0 → 100644
  1 +package com.b2c.orders.domain;
  2 +
  3 +import lombok.Data;
  4 +import lombok.EqualsAndHashCode;
  5 +import lombok.NoArgsConstructor;
  6 +
  7 +/**
  8 + * 订单的收货人 Created by yuehongbo on 2016/8/5.
  9 + */
  10 +@Data
  11 +@EqualsAndHashCode(callSuper = true)
  12 +@NoArgsConstructor
  13 +public class OrderReceiver extends BaseDomain {
  14 + private static final long serialVersionUID = 1L;
  15 + /* 订单ID */
  16 + private Long orderId;
  17 + /* 收货人姓名 */
  18 + private String receiverName;
  19 + /* 收货人电话 */
  20 + private String receiverPhone;
  21 + /* 收货人地址 */
  22 + private String receiverAddress;
  23 +
  24 + public Long getOrderId() {
  25 + return orderId;
  26 + }
  27 +
  28 + public void setOrderId(Long orderId) {
  29 + this.orderId = orderId;
  30 + }
  31 +
  32 + public String getReceiverName() {
  33 + return receiverName;
  34 + }
  35 +
  36 + public void setReceiverName(String receiverName) {
  37 + this.receiverName = receiverName;
  38 + }
  39 +
  40 + public String getReceiverPhone() {
  41 + return receiverPhone;
  42 + }
  43 +
  44 + public void setReceiverPhone(String receiverPhone) {
  45 + this.receiverPhone = receiverPhone;
  46 + }
  47 +
  48 + public String getReceiverAddress() {
  49 + return receiverAddress;
  50 + }
  51 +
  52 + public void setReceiverAddress(String receiverAddress) {
  53 + this.receiverAddress = receiverAddress;
  54 + }
  55 +
  56 +}
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/Seller.java 0 → 100644
  1 +package com.b2c.orders.domain;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class Seller {
  7 +
  8 + private Long id;
  9 + private String name;
  10 +}
... ...
b2c-orders-domain/src/main/java/com/b2c/orders/domain/Shop.java 0 → 100644
  1 +package com.b2c.orders.domain;
  2 +
  3 +import lombok.Data;
  4 +
  5 +@Data
  6 +public class Shop {
  7 +
  8 + private Long id;
  9 + private String name;
  10 +}
... ...
b2c-orders-manager/.classpath 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<classpath>
  3 + <classpathentry kind="src" output="target/classes" path="src/main/java">
  4 + <attributes>
  5 + <attribute name="optional" value="true"/>
  6 + <attribute name="maven.pomderived" value="true"/>
  7 + </attributes>
  8 + </classpathentry>
  9 + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
  10 + <attributes>
  11 + <attribute name="maven.pomderived" value="true"/>
  12 + </attributes>
  13 + </classpathentry>
  14 + <classpathentry kind="src" output="target/test-classes" path="src/test/java">
  15 + <attributes>
  16 + <attribute name="optional" value="true"/>
  17 + <attribute name="maven.pomderived" value="true"/>
  18 + </attributes>
  19 + </classpathentry>
  20 + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
  21 + <attributes>
  22 + <attribute name="maven.pomderived" value="true"/>
  23 + </attributes>
  24 + </classpathentry>
  25 + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
  26 + <attributes>
  27 + <attribute name="maven.pomderived" value="true"/>
  28 + </attributes>
  29 + </classpathentry>
  30 + <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
  31 + <attributes>
  32 + <attribute name="maven.pomderived" value="true"/>
  33 + <attribute name="org.eclipse.jst.component.nondependency" value=""/>
  34 + </attributes>
  35 + </classpathentry>
  36 + <classpathentry kind="output" path="target/classes"/>
  37 +</classpath>
... ...