wangxiaoming 7 سال پیش
والد
کامیت
4d4ceb755b
44فایلهای تغییر یافته به همراه3458 افزوده شده و 78 حذف شده
  1. 29 2
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/ResultMsg.java
  2. 10 5
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/cart/OrderPayDto.java
  3. 11 1
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/cart/TempOrderDto.java
  4. 81 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedColor.java
  5. 52 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedExternalUrl.java
  6. 82 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedPattern.java
  7. 132 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedPosition.java
  8. 142 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedTooth.java
  9. 285 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/OrderCustomized.java
  10. 12 0
      tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/order/Order.java
  11. 1 1
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/cart/CartService.java
  12. 37 0
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedColorService.java
  13. 37 0
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedExternalUrlService.java
  14. 45 0
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedPatternService.java
  15. 69 0
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedPositionService.java
  16. 37 0
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedToothService.java
  17. 42 0
      tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/OrderCustomizedService.java
  18. 63 5
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/cart/CartServiceImpl.java
  19. 56 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedColorServiceImpl.java
  20. 56 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedExternalUrlServiceImpl.java
  21. 56 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedPatternServiceImpl.java
  22. 83 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedPositionServiceImpl.java
  23. 56 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedToothServiceImpl.java
  24. 74 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/OrderCustomizedServiceImpl.java
  25. 37 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedColorMapper.java
  26. 37 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedExternalUrlMapper.java
  27. 37 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedPatternMapper.java
  28. 55 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedPositionMapper.java
  29. 37 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedToothMapper.java
  30. 44 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/OrderCustomizedMapper.java
  31. 82 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedColorMapper.xml
  32. 58 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedExternalUrlMapper.xml
  33. 77 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedPatternMapper.xml
  34. 160 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedPositionMapper.xml
  35. 159 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedToothMapper.xml
  36. 362 0
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/orderCustomizedMapper.xml
  37. 6 4
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/orderMapper.xml
  38. 2 1
      tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/productColorMapper.xml
  39. 0 2
      tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminChargReceiveHandler.java
  40. 88 0
      tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminOrderCustomizedHandlers.java
  41. 270 0
      tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/customized/CustomizedHandler.java
  42. 103 56
      tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java
  43. 15 1
      tooth-wechat-web/src/main/resources/iamberry-wechat-service-mybatis.xml
  44. 281 0
      tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/customized/list_order.jsp

+ 29 - 2
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/ResultMsg.java

@@ -1,5 +1,10 @@
 package com.iamberry.wechat.core.entity;
 
+import com.iamberry.wechat.tools.ResponseJson;
+
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @description 作为服务影响的返回结果,常用业务错误,返回错误码和错误信息;
  * @author 欧阳明
@@ -20,6 +25,13 @@ public class ResultMsg implements java.io.Serializable{
 	
 	private Object data; //返回对象
 
+	public static ResultMsg getSuccess(){
+		return new ResultMsg(true, "200", "success",null);
+	}
+	public static ResultMsg getError(){
+		return new ResultMsg(true, "500", "error",null);
+	}
+
 	public ResultMsg(){}
 	
 	public ResultMsg(boolean status, String resultCode, String message,
@@ -62,7 +74,22 @@ public class ResultMsg implements java.io.Serializable{
 	public void setData(Object data) {
 		this.data = data;
 	}
-	
-	
+
+	/**
+	 * 添加
+	 */
+	public ResultMsg addData(String Key, Object value) {
+		if (this.data == null) {
+			Map map = new HashMap();
+			map.put(Key, value);
+			this.setData(map);
+		}else{
+			Map map = (Map) this.getData();
+			map.put(Key, value);
+			this.setData(map);
+		}
+		return this;
+	}
+
 
 }

+ 10 - 5
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/cart/OrderPayDto.java

@@ -28,8 +28,9 @@ public class OrderPayDto implements java.io.Serializable{
 	
 	private int meonyProportion; // 积分和人民币的比例 一个积分抵扣多少元人民币
 	
-	private String cartId; // 购物车ID,点击去支付时,需要传回来
-	
+	private String cartId; // 购物车ID,点击去支付时,需要传回来 // 普通牙刷就是购物车的id,  定制牙刷为定制表(tb_iamberry_customized_tooth)的id
+	private String isCustomize; //  1:普通牙刷购买  2:定制牙刷购买
+
 	private int balance ; //账户余额
 	
 	private HashMap addressInfo;//收货地址
@@ -118,7 +119,11 @@ public class OrderPayDto implements java.io.Serializable{
 		this.addressInfo = addressInfo;
 	}
 
-	
-	
-	
+	public String getIsCustomize() {
+		return isCustomize;
+	}
+
+	public void setIsCustomize(String isCustomize) {
+		this.isCustomize = isCustomize;
+	}
 }

+ 11 - 1
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/cart/TempOrderDto.java

@@ -29,7 +29,9 @@ public class TempOrderDto implements java.io.Serializable{
 
 	@ValidatorInterface(validatorIsRule = "[^\\s]{1,}", isEnable = true)
 	private String cartIdStr; // 购物车条目id,使用-分割
-	
+
+	private String isCustomize; //  1:普通牙刷购买  2:定制牙刷购买
+
 	private int orderIntegralNum; // 使用积分
 	
 	private String orderUserRemark; // 备注
@@ -110,6 +112,14 @@ public class TempOrderDto implements java.io.Serializable{
 		this.balancePayAmount = balancePayAmount;
 	}
 
+	public String getIsCustomize() {
+		return isCustomize;
+	}
+
+	public void setIsCustomize(String isCustomize) {
+		this.isCustomize = isCustomize;
+	}
+
 	@Override
 	public String toString() {
 		return "TempOrderDto [orderAddressInfo=" + orderAddressInfo

+ 81 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedColor.java

@@ -0,0 +1,81 @@
+package com.iamberry.wechat.core.entity.customized;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  牙刷定制-颜色表类
+ * @author w
+ * @Date 2018-05-25
+ */
+public class CustomizedColor  implements  Serializable{
+    //颜色id
+    private Integer colorId;
+    //颜色名称
+    private String colorName;
+    //色值
+    private String colorValue;
+    //颜色图片
+    private String colorImg;
+    //颜色状态:1使用中 2未使用
+    private Integer colorStatus;
+    //创建时间
+    private Date colorCreateTime;
+    //修改时间'
+    private Date colorUpdateTime;
+
+    public Integer getColorId(){
+        return colorId;
+    }
+
+    public void setColorId(Integer  colorId){
+        this.colorId=colorId;
+    }
+
+    public String getColorName(){
+        return colorName;
+    }
+
+    public void setColorName(String  colorName){
+        this.colorName=colorName;
+    }
+
+    public String getColorValue(){
+        return colorValue;
+    }
+
+    public void setColorValue(String  colorValue){
+        this.colorValue=colorValue;
+    }
+
+    public String getColorImg(){
+        return colorImg;
+    }
+
+    public void setColorImg(String  colorImg){
+        this.colorImg=colorImg;
+    }
+
+    public Integer getColorStatus(){
+        return colorStatus;
+    }
+
+    public void setColorStatus(Integer  colorStatus){
+        this.colorStatus=colorStatus;
+    }
+
+    public Date getColorCreateTime(){
+        return colorCreateTime;
+    }
+
+    public void setColorCreateTime(Date  colorCreateTime){
+        this.colorCreateTime=colorCreateTime;
+    }
+
+    public Date getColorUpdateTime(){
+        return colorUpdateTime;
+    }
+
+    public void setColorUpdateTime(Date  colorUpdateTime){
+        this.colorUpdateTime=colorUpdateTime;
+    }
+}

+ 52 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedExternalUrl.java

@@ -0,0 +1,52 @@
+package com.iamberry.wechat.core.entity.customized;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  牙刷定制外部订单url表类
+ * @author w
+ * @Date 2018-05-30
+ */
+public class CustomizedExternalUrl  implements  Serializable{
+    private static final long serialVersionUID = 4194042066434752390L;
+    //id
+    private Integer externalUrlId;
+    //外部订单号,天猫
+    private String externalId;
+    //二维码位置
+    private String externalImg;
+    //创建时间'
+    private Date externalCreateTime;
+
+    public Integer getExternalUrlId(){
+        return externalUrlId;
+    }
+
+    public void setExternalUrlId(Integer  externalUrlId){
+        this.externalUrlId=externalUrlId;
+    }
+
+    public String getExternalId(){
+        return externalId;
+    }
+
+    public void setExternalId(String  externalId){
+        this.externalId=externalId;
+    }
+
+    public String getExternalImg(){
+        return externalImg;
+    }
+
+    public void setExternalImg(String  externalImg){
+        this.externalImg=externalImg;
+    }
+
+    public Date getExternalCreateTime(){
+        return externalCreateTime;
+    }
+
+    public void setExternalCreateTime(Date  externalCreateTime){
+        this.externalCreateTime=externalCreateTime;
+    }
+}

+ 82 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedPattern.java

@@ -0,0 +1,82 @@
+package com.iamberry.wechat.core.entity.customized;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  牙刷定制-纹理表类
+ * @author w
+ * @Date 2018-05-25
+ */
+public class CustomizedPattern  implements  Serializable{
+    private static final long serialVersionUID = -6233398968985648677L;
+    //纹理id
+    private Integer patternId;
+    //纹理名称
+    private String patternName;
+    //缩略图
+    private String patternThumbnailImg;
+    //纹理图片位置
+    private String patternImg;
+    //纹理使用 1使用中 2未使用
+    private Integer patternStatus;
+    //创建时间
+    private Date patternCreateTime;
+    //修改时间'
+    private Date patternUpdateTime;
+
+    public Integer getPatternId(){
+        return patternId;
+    }
+
+    public void setPatternId(Integer  patternId){
+        this.patternId=patternId;
+    }
+
+    public String getPatternName(){
+        return patternName;
+    }
+
+    public void setPatternName(String  patternName){
+        this.patternName=patternName;
+    }
+
+    public String getPatternImg(){
+        return patternImg;
+    }
+
+    public void setPatternImg(String  patternImg){
+        this.patternImg=patternImg;
+    }
+
+    public Integer getPatternStatus(){
+        return patternStatus;
+    }
+
+    public void setPatternStatus(Integer  patternStatus){
+        this.patternStatus=patternStatus;
+    }
+
+    public Date getPatternCreateTime(){
+        return patternCreateTime;
+    }
+
+    public void setPatternCreateTime(Date  patternCreateTime){
+        this.patternCreateTime=patternCreateTime;
+    }
+
+    public Date getPatternUpdateTime(){
+        return patternUpdateTime;
+    }
+
+    public void setPatternUpdateTime(Date  patternUpdateTime){
+        this.patternUpdateTime=patternUpdateTime;
+    }
+
+    public String getPatternThumbnailImg() {
+        return patternThumbnailImg;
+    }
+
+    public void setPatternThumbnailImg(String patternThumbnailImg) {
+        this.patternThumbnailImg = patternThumbnailImg;
+    }
+}

+ 132 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedPosition.java

@@ -0,0 +1,132 @@
+package com.iamberry.wechat.core.entity.customized;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  牙刷定制--纹理头像文字位置类
+ * @author w
+ * @Date 2018-05-25
+ */
+public class CustomizedPosition  implements  Serializable{
+    private static final long serialVersionUID = 986363745957494570L;
+    //
+    private Integer positionId;
+    //位置类型 1:正面 2:右侧 3:反面 4:左侧
+    private Integer positionType;
+    //纹理id
+    private Integer patternId;
+    //纹理起始位置x轴坐标
+    private Integer positionPatternX;
+    //纹理起始位置y轴坐标
+    private Integer positionPatternY;
+    //头像起始位置x轴坐标
+    private Integer positionAvatarX;
+    //头像起始位置y轴坐标
+    private Integer positionAvatarY;
+    //文字起始位置x轴坐标
+    private Integer positionTextX;
+    //文字起始位置y轴坐标
+    private Integer positionTextY;
+    //1使用中 2未使用
+    private Integer positionStatus;
+    //创建时间
+    private Date positionCreateTime;
+    //修改时间'
+    private Date positionUpdateTime;
+
+    public Integer getPositionId(){
+        return positionId;
+    }
+
+    public void setPositionId(Integer  positionId){
+        this.positionId=positionId;
+    }
+
+    public Integer getPositionType(){
+        return positionType;
+    }
+
+    public void setPositionType(Integer  positionType){
+        this.positionType=positionType;
+    }
+
+    public Integer getPatternId(){
+        return patternId;
+    }
+
+    public void setPatternId(Integer  patternId){
+        this.patternId=patternId;
+    }
+
+    public Integer getPositionPatternX(){
+        return positionPatternX;
+    }
+
+    public void setPositionPatternX(Integer  positionPatternX){
+        this.positionPatternX=positionPatternX;
+    }
+
+    public Integer getPositionPatternY(){
+        return positionPatternY;
+    }
+
+    public void setPositionPatternY(Integer  positionPatternY){
+        this.positionPatternY=positionPatternY;
+    }
+
+    public Integer getPositionAvatarX(){
+        return positionAvatarX;
+    }
+
+    public void setPositionAvatarX(Integer  positionAvatarX){
+        this.positionAvatarX=positionAvatarX;
+    }
+
+    public Integer getPositionAvatarY(){
+        return positionAvatarY;
+    }
+
+    public void setPositionAvatarY(Integer  positionAvatarY){
+        this.positionAvatarY=positionAvatarY;
+    }
+
+    public Integer getPositionTextX(){
+        return positionTextX;
+    }
+
+    public void setPositionTextX(Integer  positionTextX){
+        this.positionTextX=positionTextX;
+    }
+
+    public Integer getPositionTextY(){
+        return positionTextY;
+    }
+
+    public void setPositionTextY(Integer  positionTextY){
+        this.positionTextY=positionTextY;
+    }
+
+    public Integer getPositionStatus(){
+        return positionStatus;
+    }
+
+    public void setPositionStatus(Integer  positionStatus){
+        this.positionStatus=positionStatus;
+    }
+
+    public Date getPositionCreateTime(){
+        return positionCreateTime;
+    }
+
+    public void setPositionCreateTime(Date  positionCreateTime){
+        this.positionCreateTime=positionCreateTime;
+    }
+
+    public Date getPositionUpdateTime(){
+        return positionUpdateTime;
+    }
+
+    public void setPositionUpdateTime(Date  positionUpdateTime){
+        this.positionUpdateTime=positionUpdateTime;
+    }
+}

+ 142 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/CustomizedTooth.java

@@ -0,0 +1,142 @@
+package com.iamberry.wechat.core.entity.customized;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  牙刷生成记录类
+ * @author w
+ * @Date 2018-05-29
+ */
+public class CustomizedTooth  implements  Serializable{
+    private static final long serialVersionUID = -5338887742912684947L;
+    //定制牙刷id
+    private Integer toothId;
+    //openid
+    private String userOpenId;
+    //商品商品id
+    private Integer productId;
+    //商品颜色id
+    private Integer colorId;
+    //定制颜色id
+    private Integer toothColorId;
+    //纹理id
+    private Integer toothPatternId;
+    //位置id
+    private Integer toothPositionId;
+    //定制文字
+    private String toothText;
+    //定制头像
+    private String toothAvatarImg;
+    //生成的牙刷图片
+    private String toothImg;
+    //类型 1微信 2天猫
+    private Integer toothType;
+    //状态:1:正常 2:作废
+    private Integer toothStatus;
+    //创建时间'
+    private Date toothCreateTime;
+
+    public Integer getToothId(){
+        return toothId;
+    }
+
+    public void setToothId(Integer  toothId){
+        this.toothId=toothId;
+    }
+
+    public String getUserOpenId(){
+        return userOpenId;
+    }
+
+    public void setUserOpenId(String  userOpenId){
+        this.userOpenId=userOpenId;
+    }
+
+    public Integer getProductId(){
+        return productId;
+    }
+
+    public void setProductId(Integer  productId){
+        this.productId=productId;
+    }
+
+    public Integer getColorId(){
+        return colorId;
+    }
+
+    public void setColorId(Integer  colorId){
+        this.colorId=colorId;
+    }
+
+    public Integer getToothColorId(){
+        return toothColorId;
+    }
+
+    public void setToothColorId(Integer  toothColorId){
+        this.toothColorId=toothColorId;
+    }
+
+    public Integer getToothPatternId(){
+        return toothPatternId;
+    }
+
+    public void setToothPatternId(Integer  toothPatternId){
+        this.toothPatternId=toothPatternId;
+    }
+
+    public Integer getToothPositionId(){
+        return toothPositionId;
+    }
+
+    public void setToothPositionId(Integer  toothPositionId){
+        this.toothPositionId=toothPositionId;
+    }
+
+    public String getToothText(){
+        return toothText;
+    }
+
+    public void setToothText(String  toothText){
+        this.toothText=toothText;
+    }
+
+    public String getToothAvatarImg(){
+        return toothAvatarImg;
+    }
+
+    public void setToothAvatarImg(String  toothAvatarImg){
+        this.toothAvatarImg=toothAvatarImg;
+    }
+
+    public String getToothImg(){
+        return toothImg;
+    }
+
+    public void setToothImg(String  toothImg){
+        this.toothImg=toothImg;
+    }
+
+    public Integer getToothType(){
+        return toothType;
+    }
+
+    public void setToothType(Integer  toothType){
+        this.toothType=toothType;
+    }
+
+    public Integer getToothStatus(){
+        return toothStatus;
+    }
+
+    public void setToothStatus(Integer  toothStatus){
+        this.toothStatus=toothStatus;
+    }
+
+    public Date getToothCreateTime(){
+        return toothCreateTime;
+    }
+
+    public void setToothCreateTime(Date  toothCreateTime){
+        this.toothCreateTime=toothCreateTime;
+    }
+}

+ 285 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/customized/OrderCustomized.java

@@ -0,0 +1,285 @@
+package com.iamberry.wechat.core.entity.customized;
+
+import com.iamberry.wechat.core.entity.order.Order;
+
+import  java.util.Date;
+import  java.io.Serializable;
+/**
+ *  牙刷定制-定制牙刷信息类
+ * @author w
+ * @Date 2018-05-30
+ */
+public class OrderCustomized  implements  Serializable{
+    private static final long serialVersionUID = -1080052785541508059L;
+    //定制牙刷id
+    private Integer customizedId;
+    //所属订单id
+    private String salesOrderId;
+    //外部订单号
+    private String customizedExternalId;
+    //定制颜色id
+    private Integer customizedColorId;
+    //颜色色值
+    private String customizedColorValue;
+    //颜色名称
+    private String customizedColorName;
+    //纹理id
+    private Integer customizedPatternId;
+    //纹理名称
+    private String customizedPatternName;
+    //纹理图片
+    private String customizedPatternImg;
+    //位置id
+    private Integer customizedPositionId;
+    //位置 1:正面 2:右侧 3:反面 4:左侧
+    private Integer customizedPositionType;
+    //纹理起始位置x轴坐标
+    private Integer customizedPositionPatternX;
+    //纹理起始位置y轴坐标
+    private Integer customizedPositionPatternY;
+    //文字起始位置x轴坐标
+    private Integer customizedPositionTextX;
+    //文字起始位置y轴坐标
+    private Integer customizedPositionTextY;
+    //头像起始位置x轴坐标
+    private Integer customizedPositionAvatarX;
+    //头像起始位置y轴坐标
+    private Integer customizedPositionAvatarY;
+    //定制文字
+    private String customizedText;
+    //定制头像
+    private String customizedAvatarImg;
+    //生成的牙刷图片
+    private String customizedImg;
+    //类型:1微信 2天猫
+    private Integer customizedType;
+    //状态 1:正常 2:外部订单未上传
+    private Integer customizedStatus;
+    //创建时间'
+    private Date customizedCreateTime;
+
+    //电话号码
+    private String salesAddressTel;
+    //物流编号
+    private String receivePostNum;
+    //订单状态
+    private Integer salesStatus;							//状态  0:取消订单  1:待支付  2:已支付、待发货  3:退款申请中  4:已退款  5:已发货  6:申请退货中  7:退货中  8:订单退货,订单关闭  9:换货中  10:换货完成
+
+    private Order orderInfo;
+
+    public Integer getCustomizedId(){
+        return customizedId;
+    }
+
+    public void setCustomizedId(Integer  customizedId){
+        this.customizedId=customizedId;
+    }
+
+    public String getSalesOrderId(){
+        return salesOrderId;
+    }
+
+    public void setSalesOrderId(String  salesOrderId){
+        this.salesOrderId=salesOrderId;
+    }
+
+    public String getCustomizedExternalId(){
+        return customizedExternalId;
+    }
+
+    public void setCustomizedExternalId(String  customizedExternalId){
+        this.customizedExternalId=customizedExternalId;
+    }
+
+    public Integer getCustomizedColorId(){
+        return customizedColorId;
+    }
+
+    public void setCustomizedColorId(Integer  customizedColorId){
+        this.customizedColorId=customizedColorId;
+    }
+
+    public String getCustomizedColorValue(){
+        return customizedColorValue;
+    }
+
+    public void setCustomizedColorValue(String  customizedColorValue){
+        this.customizedColorValue=customizedColorValue;
+    }
+
+    public String getCustomizedColorName(){
+        return customizedColorName;
+    }
+
+    public void setCustomizedColorName(String  customizedColorName){
+        this.customizedColorName=customizedColorName;
+    }
+
+    public Integer getCustomizedPatternId(){
+        return customizedPatternId;
+    }
+
+    public void setCustomizedPatternId(Integer  customizedPatternId){
+        this.customizedPatternId=customizedPatternId;
+    }
+
+    public String getCustomizedPatternName(){
+        return customizedPatternName;
+    }
+
+    public void setCustomizedPatternName(String  customizedPatternName){
+        this.customizedPatternName=customizedPatternName;
+    }
+
+    public String getCustomizedPatternImg(){
+        return customizedPatternImg;
+    }
+
+    public void setCustomizedPatternImg(String  customizedPatternImg){
+        this.customizedPatternImg=customizedPatternImg;
+    }
+
+    public Integer getCustomizedPositionId(){
+        return customizedPositionId;
+    }
+
+    public void setCustomizedPositionId(Integer  customizedPositionId){
+        this.customizedPositionId=customizedPositionId;
+    }
+
+    public Integer getCustomizedPositionType(){
+        return customizedPositionType;
+    }
+
+    public void setCustomizedPositionType(Integer  customizedPositionType){
+        this.customizedPositionType=customizedPositionType;
+    }
+
+    public Integer getCustomizedPositionPatternX(){
+        return customizedPositionPatternX;
+    }
+
+    public void setCustomizedPositionPatternX(Integer  customizedPositionPatternX){
+        this.customizedPositionPatternX=customizedPositionPatternX;
+    }
+
+    public Integer getCustomizedPositionPatternY(){
+        return customizedPositionPatternY;
+    }
+
+    public void setCustomizedPositionPatternY(Integer  customizedPositionPatternY){
+        this.customizedPositionPatternY=customizedPositionPatternY;
+    }
+
+    public Integer getCustomizedPositionTextX(){
+        return customizedPositionTextX;
+    }
+
+    public void setCustomizedPositionTextX(Integer  customizedPositionTextX){
+        this.customizedPositionTextX=customizedPositionTextX;
+    }
+
+    public Integer getCustomizedPositionTextY(){
+        return customizedPositionTextY;
+    }
+
+    public void setCustomizedPositionTextY(Integer  customizedPositionTextY){
+        this.customizedPositionTextY=customizedPositionTextY;
+    }
+
+    public Integer getCustomizedPositionAvatarX(){
+        return customizedPositionAvatarX;
+    }
+
+    public void setCustomizedPositionAvatarX(Integer  customizedPositionAvatarX){
+        this.customizedPositionAvatarX=customizedPositionAvatarX;
+    }
+
+    public Integer getCustomizedPositionAvatarY(){
+        return customizedPositionAvatarY;
+    }
+
+    public void setCustomizedPositionAvatarY(Integer  customizedPositionAvatarY){
+        this.customizedPositionAvatarY=customizedPositionAvatarY;
+    }
+
+    public String getCustomizedText(){
+        return customizedText;
+    }
+
+    public void setCustomizedText(String  customizedText){
+        this.customizedText=customizedText;
+    }
+
+    public String getCustomizedAvatarImg(){
+        return customizedAvatarImg;
+    }
+
+    public void setCustomizedAvatarImg(String  customizedAvatarImg){
+        this.customizedAvatarImg=customizedAvatarImg;
+    }
+
+    public String getCustomizedImg(){
+        return customizedImg;
+    }
+
+    public void setCustomizedImg(String  customizedImg){
+        this.customizedImg=customizedImg;
+    }
+
+    public Integer getCustomizedType(){
+        return customizedType;
+    }
+
+    public void setCustomizedType(Integer  customizedType){
+        this.customizedType=customizedType;
+    }
+
+    public Integer getCustomizedStatus(){
+        return customizedStatus;
+    }
+
+    public void setCustomizedStatus(Integer  customizedStatus){
+        this.customizedStatus=customizedStatus;
+    }
+
+    public Date getCustomizedCreateTime(){
+        return customizedCreateTime;
+    }
+
+    public void setCustomizedCreateTime(Date  customizedCreateTime){
+        this.customizedCreateTime=customizedCreateTime;
+    }
+
+    public Order getOrderInfo() {
+        return orderInfo;
+    }
+
+    public void setOrderInfo(Order orderInfo) {
+        this.orderInfo = orderInfo;
+    }
+
+    public String getSalesAddressTel() {
+        return salesAddressTel;
+    }
+
+    public void setSalesAddressTel(String salesAddressTel) {
+        this.salesAddressTel = salesAddressTel;
+    }
+
+    public String getReceivePostNum() {
+        return receivePostNum;
+    }
+
+    public void setReceivePostNum(String receivePostNum) {
+        this.receivePostNum = receivePostNum;
+    }
+
+    public Integer getSalesStatus() {
+        return salesStatus;
+    }
+
+    public void setSalesStatus(Integer salesStatus) {
+        this.salesStatus = salesStatus;
+    }
+}

+ 12 - 0
tooth-common-core/src/main/java/com/iamberry/wechat/core/entity/order/Order.java

@@ -86,6 +86,8 @@ public class Order implements java.io.Serializable{
 	
 	private String userResource;		// 用户来源
 
+	private Integer salesIsCustomized;		//是否为定制牙刷  1:不为定制   2:定制牙刷
+
 	public String getSalesAuditRemark() {
 		return salesAuditRemark;
 	}
@@ -404,4 +406,14 @@ public class Order implements java.io.Serializable{
 	public void setSelectDateType(Integer selectDateType) {
 		this.selectDateType = selectDateType;
 	}
+
+	public Integer getSalesIsCustomized() {
+		return salesIsCustomized;
+	}
+
+	public void setSalesIsCustomized(Integer salesIsCustomized) {
+		this.salesIsCustomized = salesIsCustomized;
+	}
+
+
 }

+ 1 - 1
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/cart/CartService.java

@@ -66,7 +66,7 @@ public interface CartService {
 	 * @param items
 	 * @return
 	 */
-	public boolean addOrderAndSaveOrderItem(Order order, List<OrderItem> items, List<Integer> cartIds)  throws Exception;
+	public boolean addOrderAndSaveOrderItem(Order order, List<OrderItem> items, List<Integer> cartIds,String isCustomize)  throws Exception;
 
 	/**
 	 * 修改订单信息

+ 37 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedColorService.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.face.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedColor;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-颜色表接口
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface CustomizedColorService {
+    /**
+     * 获取集合
+     * @param  customizedColor
+     * @return List
+     */
+    List<CustomizedColor> getCustomizedColorList(CustomizedColor  customizedColor);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedColor
+     */
+    CustomizedColor  getCustomizedColorById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedColor
+     * @return Integer
+     */
+    Integer  save(CustomizedColor  customizedColor);
+    /**
+     * 修改数据
+     * @param  customizedColor
+     * @return Integer
+     */
+    Integer  update(CustomizedColor  customizedColor);
+}

+ 37 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedExternalUrlService.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.face.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedExternalUrl;
+
+import java.util.List;
+
+/**
+ *  牙刷定制外部订单url表接口
+ * @author w
+ * @Date 2018-05-30
+ */
+public interface CustomizedExternalUrlService {
+    /**
+     * 获取集合
+     * @param  customizedExternalUrl
+     * @return List
+     */
+    List<CustomizedExternalUrl> getCustomizedExternalUrlList(CustomizedExternalUrl  customizedExternalUrl);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedExternalUrl
+     */
+    CustomizedExternalUrl  getCustomizedExternalUrlById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedExternalUrl
+     * @return Integer
+     */
+    Integer  save(CustomizedExternalUrl  customizedExternalUrl);
+    /**
+     * 修改数据
+     * @param  customizedExternalUrl
+     * @return Integer
+     */
+    Integer  update(CustomizedExternalUrl  customizedExternalUrl);
+}

+ 45 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedPatternService.java

@@ -0,0 +1,45 @@
+package com.iamberry.wechat.face.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedPattern;
+
+import java.util.List;
+
+/**
+ * 牙刷定制-纹理表接口
+ *
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface CustomizedPatternService {
+    /**
+     * 获取集合
+     *
+     * @param customizedPattern
+     * @return List
+     */
+    List<CustomizedPattern> getCustomizedPatternList(CustomizedPattern customizedPattern);
+
+    /**
+     * 查询单条数据
+     *
+     * @param id
+     * @return customizedPattern
+     */
+    CustomizedPattern getCustomizedPatternById(Integer id);
+
+    /**
+     * 增加数据
+     *
+     * @param customizedPattern
+     * @return Integer
+     */
+    Integer save(CustomizedPattern customizedPattern);
+
+    /**
+     * 修改数据
+     *
+     * @param customizedPattern
+     * @return Integer
+     */
+    Integer update(CustomizedPattern customizedPattern);
+}

+ 69 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedPositionService.java

@@ -0,0 +1,69 @@
+package com.iamberry.wechat.face.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedPosition;
+
+import java.util.List;
+
+/**
+ * 牙刷定制--纹理头像文字位置接口
+ *
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface CustomizedPositionService {
+    /**
+     * 获取集合
+     *
+     * @param customizedPosition
+     * @return List
+     */
+    List<CustomizedPosition> getCustomizedPositionList(CustomizedPosition customizedPosition);
+
+    /**
+     * 查询单条数据
+     *
+     * @param id
+     * @return customizedPosition
+     */
+    CustomizedPosition getCustomizedPositionById(Integer id);
+
+    /**
+     * 增加数据
+     *
+     * @param customizedPosition
+     * @return Integer
+     */
+    Integer save(CustomizedPosition customizedPosition);
+
+    /**
+     * 修改数据
+     *
+     * @param customizedPosition
+     * @return Integer
+     */
+    Integer update(CustomizedPosition customizedPosition);
+
+    /**
+     * 删除数据
+     *
+     * @param id
+     * @return Integer
+     */
+    Integer delete(Integer id);
+
+    /**
+     * 增加数据 <集合>
+     *
+     * @param customizedPositionList
+     * @return Integer
+     */
+    Integer saveList(List<CustomizedPosition> customizedPositionList);
+
+    /**
+     * 删除数据 <集合>
+     *
+     * @param ids
+     * @return Integer
+     */
+    Integer deleteList(Integer[] ids);
+}

+ 37 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/CustomizedToothService.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.face.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedTooth;
+
+import java.util.List;
+
+/**
+ *  牙刷生成记录接口
+ * @author w
+ * @Date 2018-05-29
+ */
+public interface CustomizedToothService {
+    /**
+     * 获取集合
+     * @param  customizedTooth
+     * @return List
+     */
+    List<CustomizedTooth> getCustomizedToothList(CustomizedTooth  customizedTooth);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedTooth
+     */
+    CustomizedTooth  getCustomizedToothById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedTooth
+     * @return Integer
+     */
+    Integer  save(CustomizedTooth  customizedTooth);
+    /**
+     * 修改数据
+     * @param  customizedTooth
+     * @return Integer
+     */
+    Integer  update(CustomizedTooth  customizedTooth);
+}

+ 42 - 0
tooth-wechat-interface/src/main/java/com/iamberry/wechat/face/customized/OrderCustomizedService.java

@@ -0,0 +1,42 @@
+package com.iamberry.wechat.face.customized;
+
+import com.iamberry.wechat.core.entity.customized.OrderCustomized;
+import com.iamberry.wechat.core.entity.page.PageRequest;
+import com.iamberry.wechat.core.entity.page.PagedResult;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-定制牙刷信息接口
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface OrderCustomizedService {
+    /**
+     * 获取集合
+     * @param  orderCustomized
+     * @return List
+     */
+    List<OrderCustomized> getOrderCustomizedList(OrderCustomized  orderCustomized);
+
+    public PagedResult<OrderCustomized> listOrderCustomizedPage(PageRequest<OrderCustomized> pageRequest);
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  orderCustomized
+     */
+    OrderCustomized  getOrderCustomizedById(Integer  id);
+    /**
+     * 增加数据
+     * @param  orderCustomized
+     * @return Integer
+     */
+    Integer  save(OrderCustomized  orderCustomized);
+    /**
+     * 修改数据
+     * @param  orderCustomized
+     * @return Integer
+     */
+    Integer  update(OrderCustomized  orderCustomized);
+}

+ 63 - 5
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/cart/CartServiceImpl.java

@@ -7,7 +7,10 @@ import java.util.List;
 import java.util.Map;
 
 import com.iamberry.app.tool.log.RatFWLogger;
+import com.iamberry.wechat.core.entity.customized.*;
+import com.iamberry.wechat.face.customized.CustomizedToothService;
 import com.iamberry.wechat.face.order.AdminOrderService;
+import com.iamberry.wechat.service.mapper.*;
 import com.iamberry.wechat.tools.ResultInfo;
 import com.iamberry.wechat.tools.SendMessageUtil;
 import org.apache.commons.lang.StringUtils;
@@ -33,6 +36,7 @@ import com.iamberry.wechat.face.member.CashLogService;
 import com.iamberry.wechat.face.reback.RebackServices;
 import com.iamberry.wechat.service.cart.dao.CartDao;
 import com.iamberry.wechat.service.order.dao.AdminOrderDao;
+import org.springframework.transaction.annotation.Transactional;
 
 @Service
 public class CartServiceImpl implements CartService {
@@ -58,6 +62,17 @@ public class CartServiceImpl implements CartService {
 	private AdminOrderService adminOrderService;
 
 	@Autowired
+	private OrderCustomizedMapper orderCustomizedMapper;
+	@Autowired
+	private CustomizedToothMapper customizedToothMapper;
+	@Autowired
+	private CustomizedColorMapper customizedColorMapper;
+	@Autowired
+	private CustomizedPatternMapper customizedPatternMapper;
+	@Autowired
+	private CustomizedPositionMapper customizedPositionMapper;
+
+	@Autowired
 	private RatFWLogger logger;
 	@Override
 	public List<CartDto> selectCartByOpenId(String openId) {
@@ -138,18 +153,61 @@ public class CartServiceImpl implements CartService {
 	}
 
 	@Override
-	public boolean addOrderAndSaveOrderItem(Order order, List<OrderItem> items, List<Integer> cartIds) throws Exception {
+	@Transactional
+	public boolean addOrderAndSaveOrderItem(Order order, List<OrderItem> items, List<Integer> cartIds,String isCustomize) throws Exception {
+
+		if("2".equals(isCustomize)) {        // 定制牙刷
+			order.setSalesIsCustomized(2);
+		}
 		// TODO Auto-generated method stub
 		int count = cartDao.insertOrderInfo(order);
 		if (count < 1) {
-			throw new Exception();
+			throw new RuntimeException("添加订单失败");
 		}
 		count = cartDao.insertOrderItemList(items);
 		if (count < 1) {
-			throw new Exception();
+			throw new RuntimeException("添加订单项失败");
+		}
+
+		if("2".equals(isCustomize)){		// 定制牙刷
+			Integer id = cartIds.get(0);
+			/*获取定制牙刷*/
+			CustomizedTooth customizedTooth = customizedToothMapper.getCustomizedToothById(id);
+			/*获取颜色*/
+			CustomizedColor customizedColor = customizedColorMapper.getCustomizedColorById(customizedTooth.getToothColorId());
+			/*获取纹理*/
+			CustomizedPattern customizedPattern = customizedPatternMapper.getCustomizedPatternById(customizedTooth.getToothPatternId());
+			/*获取纹理*/
+			CustomizedPosition customizedPosition = customizedPositionMapper.getCustomizedPositionById(customizedTooth.getToothPositionId());
+			OrderCustomized orderCustomized = new OrderCustomized();
+			orderCustomized.setSalesOrderId(order.getSalesOrderid());
+			orderCustomized.setCustomizedColorId(customizedColor.getColorId());
+			orderCustomized.setCustomizedColorValue(customizedColor.getColorValue());
+			orderCustomized.setCustomizedColorName(customizedColor.getColorName());
+			orderCustomized.setCustomizedPatternId(customizedPattern.getPatternId());
+			orderCustomized.setCustomizedPatternName(customizedPattern.getPatternName());
+			orderCustomized.setCustomizedPatternImg(customizedPattern.getPatternImg());
+			orderCustomized.setCustomizedPositionId(customizedPosition.getPositionId());
+			orderCustomized.setCustomizedPositionType(customizedPosition.getPositionType());
+			orderCustomized.setCustomizedPositionPatternX(customizedPosition.getPositionPatternX());
+			orderCustomized.setCustomizedPositionPatternY(customizedPosition.getPositionPatternY());
+			orderCustomized.setCustomizedPositionAvatarX(customizedPosition.getPositionAvatarX());
+			orderCustomized.setCustomizedPositionAvatarY(customizedPosition.getPositionAvatarY());
+			orderCustomized.setCustomizedPositionTextX(customizedPosition.getPositionTextX());
+			orderCustomized.setCustomizedPositionTextY(customizedPosition.getPositionTextY());
+			orderCustomized.setCustomizedText(customizedTooth.getToothText());
+			orderCustomized.setCustomizedAvatarImg(customizedTooth.getToothAvatarImg());
+			orderCustomized.setCustomizedImg(customizedTooth.getToothImg());
+			orderCustomized.setCustomizedType(1);
+			orderCustomized.setCustomizedStatus(1);
+			count = orderCustomizedMapper.save(orderCustomized);
+			if (count < 1) {
+				throw new RuntimeException("添加定制牙刷失败");
+			}
+		}else{
+			// 删除购物车项目
+			cartDao.deleteBatchCartListById(cartIds);
 		}
-		// 删除购物车项目
-		cartDao.deleteBatchCartListById(cartIds);
 		return true;
 	}
 

+ 56 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedColorServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.wechat.service.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedColor;
+import com.iamberry.wechat.face.customized.CustomizedColorService;
+import com.iamberry.wechat.service.mapper.CustomizedColorMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-颜色表接口
+ * @author w
+ * @Date 2018-05-25
+ */
+@Service
+public class CustomizedColorServiceImpl  implements CustomizedColorService {
+    @Autowired
+    private CustomizedColorMapper customizedColorMapper;
+    /**
+     * 获取集合
+     * @param  customizedColor
+     * @return List
+     */
+    @Override
+    public List<CustomizedColor> getCustomizedColorList(CustomizedColor  customizedColor){
+        return  customizedColorMapper.getCustomizedColorList(customizedColor);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedColor
+     */
+    @Override
+    public  CustomizedColor  getCustomizedColorById(Integer  id){
+        return  customizedColorMapper.getCustomizedColorById(id);
+    }
+    /**
+     * 增加数据
+     * @param  customizedColor
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(CustomizedColor  customizedColor){
+        return  customizedColorMapper.save(customizedColor);
+    }
+    /**
+     * 修改数据
+     * @param  customizedColor
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(CustomizedColor  customizedColor){
+        return  customizedColorMapper.update(customizedColor);
+    }
+}

+ 56 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedExternalUrlServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.wechat.service.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedExternalUrl;
+import com.iamberry.wechat.face.customized.CustomizedExternalUrlService;
+import com.iamberry.wechat.service.mapper.CustomizedExternalUrlMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  牙刷定制外部订单url表接口
+ * @author w
+ * @Date 2018-05-30
+ */
+@Service
+public class CustomizedExternalUrlServiceImpl  implements CustomizedExternalUrlService {
+    @Autowired
+    private CustomizedExternalUrlMapper customizedExternalUrlMapper;
+    /**
+     * 获取集合
+     * @param  customizedExternalUrl
+     * @return List
+     */
+    @Override
+    public List<CustomizedExternalUrl> getCustomizedExternalUrlList(CustomizedExternalUrl  customizedExternalUrl){
+        return  customizedExternalUrlMapper.getCustomizedExternalUrlList(customizedExternalUrl);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedExternalUrl
+     */
+    @Override
+    public  CustomizedExternalUrl  getCustomizedExternalUrlById(Integer  id){
+        return  customizedExternalUrlMapper.getCustomizedExternalUrlById(id);
+    }
+    /**
+     * 增加数据
+     * @param  customizedExternalUrl
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(CustomizedExternalUrl  customizedExternalUrl){
+        return  customizedExternalUrlMapper.save(customizedExternalUrl);
+    }
+    /**
+     * 修改数据
+     * @param  customizedExternalUrl
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(CustomizedExternalUrl  customizedExternalUrl){
+        return  customizedExternalUrlMapper.update(customizedExternalUrl);
+    }
+}

+ 56 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedPatternServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.wechat.service.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedPattern;
+import com.iamberry.wechat.face.customized.CustomizedPatternService;
+import com.iamberry.wechat.service.mapper.CustomizedPatternMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-纹理表接口
+ * @author w
+ * @Date 2018-05-25
+ */
+@Service
+public class CustomizedPatternServiceImpl  implements CustomizedPatternService {
+    @Autowired
+    private CustomizedPatternMapper customizedPatternMapper;
+    /**
+     * 获取集合
+     * @param  customizedPattern
+     * @return List
+     */
+    @Override
+    public List<CustomizedPattern> getCustomizedPatternList(CustomizedPattern  customizedPattern){
+        return  customizedPatternMapper.getCustomizedPatternList(customizedPattern);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedPattern
+     */
+    @Override
+    public  CustomizedPattern  getCustomizedPatternById(Integer  id){
+        return  customizedPatternMapper.getCustomizedPatternById(id);
+    }
+    /**
+     * 增加数据
+     * @param  customizedPattern
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(CustomizedPattern  customizedPattern){
+        return  customizedPatternMapper.save(customizedPattern);
+    }
+    /**
+     * 修改数据
+     * @param  customizedPattern
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(CustomizedPattern  customizedPattern){
+        return  customizedPatternMapper.update(customizedPattern);
+    }
+}

+ 83 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedPositionServiceImpl.java

@@ -0,0 +1,83 @@
+package com.iamberry.wechat.service.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedPosition;
+import com.iamberry.wechat.face.customized.CustomizedPositionService;
+import com.iamberry.wechat.service.mapper.CustomizedPositionMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  牙刷定制--纹理头像文字位置接口
+ * @author w
+ * @Date 2018-05-25
+ */
+@Service
+public class CustomizedPositionServiceImpl  implements CustomizedPositionService {
+    @Autowired
+    private CustomizedPositionMapper customizedPositionMapper;
+    /**
+     * 获取集合
+     * @param  customizedPosition
+     * @return List
+     */
+    @Override
+    public  List<CustomizedPosition>  getCustomizedPositionList(CustomizedPosition  customizedPosition){
+        return  customizedPositionMapper.getCustomizedPositionList(customizedPosition);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedPosition
+     */
+    @Override
+    public  CustomizedPosition  getCustomizedPositionById(Integer  id){
+        return  customizedPositionMapper.getCustomizedPositionById(id);
+    }
+    /**
+     * 增加数据
+     * @param  customizedPosition
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(CustomizedPosition  customizedPosition){
+        return  customizedPositionMapper.save(customizedPosition);
+    }
+    /**
+     * 修改数据
+     * @param  customizedPosition
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(CustomizedPosition  customizedPosition){
+        return  customizedPositionMapper.update(customizedPosition);
+    }
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    @Override
+    public  Integer  delete(Integer  id){
+        return  customizedPositionMapper.delete(id);
+    }
+    /**
+     * 增加数据 <集合>
+     * @param  customizedPositionList
+     * @return Integer
+     */
+    @Override
+    public  Integer  saveList(List<CustomizedPosition> customizedPositionList){
+        return  customizedPositionMapper.saveList(customizedPositionList);
+    }
+    /**
+     * 删除数据 <集合>
+     * @param  ids
+     * @return Integer
+     */
+    @Override
+    public  Integer  deleteList(Integer[]  ids){
+        return  customizedPositionMapper.deleteList(ids);
+    }
+}

+ 56 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/CustomizedToothServiceImpl.java

@@ -0,0 +1,56 @@
+package com.iamberry.wechat.service.customized;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedTooth;
+import com.iamberry.wechat.face.customized.CustomizedToothService;
+import com.iamberry.wechat.service.mapper.CustomizedToothMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ *  牙刷生成记录接口
+ * @author w
+ * @Date 2018-05-29
+ */
+@Service
+public class CustomizedToothServiceImpl  implements CustomizedToothService {
+    @Autowired
+    private CustomizedToothMapper customizedToothMapper;
+    /**
+     * 获取集合
+     * @param  customizedTooth
+     * @return List
+     */
+    @Override
+    public List<CustomizedTooth> getCustomizedToothList(CustomizedTooth  customizedTooth){
+        return  customizedToothMapper.getCustomizedToothList(customizedTooth);
+    }
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedTooth
+     */
+    @Override
+    public  CustomizedTooth  getCustomizedToothById(Integer  id){
+        return  customizedToothMapper.getCustomizedToothById(id);
+    }
+    /**
+     * 增加数据
+     * @param  customizedTooth
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(CustomizedTooth  customizedTooth){
+        return  customizedToothMapper.save(customizedTooth);
+    }
+    /**
+     * 修改数据
+     * @param  customizedTooth
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(CustomizedTooth  customizedTooth){
+        return  customizedToothMapper.update(customizedTooth);
+    }
+}

+ 74 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/customized/OrderCustomizedServiceImpl.java

@@ -0,0 +1,74 @@
+package com.iamberry.wechat.service.customized;
+
+import com.github.pagehelper.PageHelper;
+import com.iamberry.wechat.core.entity.customized.OrderCustomized;
+import com.iamberry.wechat.core.entity.page.PageRequest;
+import com.iamberry.wechat.core.entity.page.PagedResult;
+import com.iamberry.wechat.core.entity.receive.ChargerReceive;
+import com.iamberry.wechat.face.customized.OrderCustomizedService;
+import com.iamberry.wechat.service.mapper.OrderCustomizedMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import util.PageUtil;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-定制牙刷信息接口
+ * @author w
+ * @Date 2018-05-25
+ */
+@Service
+public class OrderCustomizedServiceImpl  implements OrderCustomizedService {
+    @Autowired
+    private OrderCustomizedMapper orderCustomizedMapper;
+    /**
+     * 获取集合
+     * @param  orderCustomized
+     * @return List
+     */
+    @Override
+    public List<OrderCustomized> getOrderCustomizedList(OrderCustomized  orderCustomized){
+        return  orderCustomizedMapper.getOrderCustomizedList(orderCustomized);
+    }
+
+    /**
+     * 获取集合
+     * @param  pageRequest
+     * @return List
+     */
+    @Override
+    public PagedResult<OrderCustomized> listOrderCustomizedPage(PageRequest<OrderCustomized> pageRequest) {
+        PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
+        List<OrderCustomized> detedctList = orderCustomizedMapper.listOrderCustomizedPage(pageRequest.getData());
+        return PageUtil.getPage(detedctList);
+    }
+
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  orderCustomized
+     */
+    @Override
+    public  OrderCustomized  getOrderCustomizedById(Integer  id){
+        return  orderCustomizedMapper.getOrderCustomizedById(id);
+    }
+    /**
+     * 增加数据
+     * @param  orderCustomized
+     * @return Integer
+     */
+    @Override
+    public  Integer  save(OrderCustomized  orderCustomized){
+        return  orderCustomizedMapper.save(orderCustomized);
+    }
+    /**
+     * 修改数据
+     * @param  orderCustomized
+     * @return Integer
+     */
+    @Override
+    public  Integer  update(OrderCustomized  orderCustomized){
+        return  orderCustomizedMapper.update(orderCustomized);
+    }
+}

+ 37 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedColorMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedColor;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-颜色表接口
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface CustomizedColorMapper {
+    /**
+     * 获取集合
+     * @param  customizedColor
+     * @return List
+     */
+    List<CustomizedColor> getCustomizedColorList(CustomizedColor  customizedColor);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedColor
+     */
+    CustomizedColor  getCustomizedColorById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedColor
+     * @return Integer
+     */
+    Integer  save(CustomizedColor  customizedColor);
+    /**
+     * 修改数据
+     * @param  customizedColor
+     * @return Integer
+     */
+    Integer  update(CustomizedColor  customizedColor);
+}

+ 37 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedExternalUrlMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedExternalUrl;
+
+import java.util.List;
+
+/**
+ *  牙刷定制外部订单url表接口
+ * @author w
+ * @Date 2018-05-30
+ */
+public interface CustomizedExternalUrlMapper {
+    /**
+     * 获取集合
+     * @param  customizedExternalUrl
+     * @return List
+     */
+    List<CustomizedExternalUrl> getCustomizedExternalUrlList(CustomizedExternalUrl  customizedExternalUrl);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedExternalUrl
+     */
+    CustomizedExternalUrl  getCustomizedExternalUrlById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedExternalUrl
+     * @return Integer
+     */
+    Integer  save(CustomizedExternalUrl  customizedExternalUrl);
+    /**
+     * 修改数据
+     * @param  customizedExternalUrl
+     * @return Integer
+     */
+    Integer  update(CustomizedExternalUrl  customizedExternalUrl);
+}

+ 37 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedPatternMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedPattern;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-纹理表接口
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface CustomizedPatternMapper {
+    /**
+     * 获取集合
+     * @param  customizedPattern
+     * @return List
+     */
+    List<CustomizedPattern> getCustomizedPatternList(CustomizedPattern  customizedPattern);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedPattern
+     */
+    CustomizedPattern  getCustomizedPatternById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedPattern
+     * @return Integer
+     */
+    Integer  save(CustomizedPattern  customizedPattern);
+    /**
+     * 修改数据
+     * @param  customizedPattern
+     * @return Integer
+     */
+    Integer  update(CustomizedPattern  customizedPattern);
+}

+ 55 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedPositionMapper.java

@@ -0,0 +1,55 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedPosition;
+
+import java.util.List;
+
+/**
+ *  牙刷定制--纹理头像文字位置接口
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface CustomizedPositionMapper {
+    /**
+     * 获取集合
+     * @param  customizedPosition
+     * @return List
+     */
+    List<CustomizedPosition> getCustomizedPositionList(CustomizedPosition  customizedPosition);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedPosition
+     */
+    CustomizedPosition  getCustomizedPositionById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedPosition
+     * @return Integer
+     */
+    Integer  save(CustomizedPosition  customizedPosition);
+    /**
+     * 修改数据
+     * @param  customizedPosition
+     * @return Integer
+     */
+    Integer  update(CustomizedPosition  customizedPosition);
+    /**
+     * 删除数据
+     * @param  id
+     * @return Integer
+     */
+    Integer  delete(Integer  id);
+    /**
+     * 增加数据 <集合>
+     * @param  customizedPositionList
+     * @return Integer
+     */
+    Integer  saveList(List<CustomizedPosition>  customizedPositionList);
+    /**
+     * 删除数据 <集合>
+     * @param  ids
+     * @return Integer
+     */
+    Integer  deleteList(Integer[]  ids);
+}

+ 37 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/CustomizedToothMapper.java

@@ -0,0 +1,37 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.customized.CustomizedTooth;
+
+import java.util.List;
+
+/**
+ *  牙刷生成记录接口
+ * @author w
+ * @Date 2018-05-29
+ */
+public interface CustomizedToothMapper {
+    /**
+     * 获取集合
+     * @param  customizedTooth
+     * @return List
+     */
+    List<CustomizedTooth> getCustomizedToothList(CustomizedTooth  customizedTooth);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  customizedTooth
+     */
+    CustomizedTooth  getCustomizedToothById(Integer  id);
+    /**
+     * 增加数据
+     * @param  customizedTooth
+     * @return Integer
+     */
+    Integer  save(CustomizedTooth  customizedTooth);
+    /**
+     * 修改数据
+     * @param  customizedTooth
+     * @return Integer
+     */
+    Integer  update(CustomizedTooth  customizedTooth);
+}

+ 44 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/OrderCustomizedMapper.java

@@ -0,0 +1,44 @@
+package com.iamberry.wechat.service.mapper;
+
+import com.iamberry.wechat.core.entity.customized.OrderCustomized;
+
+import java.util.List;
+
+/**
+ *  牙刷定制-定制牙刷信息接口
+ * @author w
+ * @Date 2018-05-25
+ */
+public interface OrderCustomizedMapper {
+    /**
+     * 获取集合
+     * @param  orderCustomized
+     * @return List
+     */
+    List<OrderCustomized> getOrderCustomizedList(OrderCustomized  orderCustomized);
+
+    /**
+     * 获取集合
+     * @param  orderCustomized
+     * @return List
+     */
+    List<OrderCustomized> listOrderCustomizedPage(OrderCustomized  orderCustomized);
+    /**
+     * 查询单条数据
+     * @param  id
+     * @return  orderCustomized
+     */
+    OrderCustomized  getOrderCustomizedById(Integer  id);
+    /**
+     * 增加数据
+     * @param  orderCustomized
+     * @return Integer
+     */
+    Integer  save(OrderCustomized  orderCustomized);
+    /**
+     * 修改数据
+     * @param  orderCustomized
+     * @return Integer
+     */
+    Integer  update(OrderCustomized  orderCustomized);
+}

+ 82 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedColorMapper.xml

@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.CustomizedColorMapper">
+    <resultMap  id="BaseResultMap" type="CustomizedColor" >
+        <result    column="color_id"    property="colorId" />
+        <result    column="color_name"    property="colorName" />
+        <result    column="color_value"    property="colorValue" />
+        <result    column="color_img"    property="colorImg" />
+        <result    column="color_status"    property="colorStatus" />
+        <result    column="color_create_time"    property="colorCreateTime" />
+        <result    column="color_update_time"    property="colorUpdateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.color_id,
+        t.color_name,
+        t.color_value,
+        t.color_img,
+        t.color_status,
+        t.color_create_time,
+        t.color_update_time
+    </sql>
+    <select id="getCustomizedColorList" resultMap="BaseResultMap" parameterType="CustomizedColor" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_color t
+        <where>
+            <if test="colorId != null ">
+                AND t.color_id = #{colorId}
+            </if >
+            <if test="colorStatus != null ">
+                AND t.color_status = #{colorStatus}
+            </if >
+        </where>
+    </select>
+    <select id="getCustomizedColorById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_color t
+        where t.color_id= #{colorId}
+    </select>
+    <insert id="save" parameterType="CustomizedColor" >
+        insert into
+        tb_iamberry_customized_color
+        (
+        color_name,
+        color_value,
+        color_img,
+        color_status
+        )
+        values
+        (
+        #{colorName},
+        #{colorValue},
+        #{colorImg},
+        #{colorStatus}
+        )
+    </insert>
+    <update id="update" parameterType="CustomizedColor" >
+        update
+        tb_iamberry_customized_color
+        <set >
+            <if test="colorName != null and colorName != ''">
+                color_name = #{colorName},
+            </if >
+            <if test="colorValue != null and colorValue != ''">
+                color_value = #{colorValue},
+            </if >
+            <if test="colorImg != null and colorImg != ''">
+                color_img = #{colorImg},
+            </if >
+            <if test="colorStatus != null ">
+                color_status = #{colorStatus},
+            </if >
+        </set >
+        where color_id= #{colorId}
+    </update>
+    <delete id="delete" parameterType="Integer" >
+        delete
+        tb_iamberry_customized_color
+        where color_id=#{colorId}
+    </delete>
+</mapper>

+ 58 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedExternalUrlMapper.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.CustomizedExternalUrlMapper">
+    <resultMap  id="BaseResultMap" type="CustomizedExternalUrl" >
+        <result    column="external_url_id"    property="externalUrlId" />
+        <result    column="external_id"    property="externalId" />
+        <result    column="external_img"    property="externalImg" />
+        <result    column="external_create_time"    property="externalCreateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.external_url_id,
+        t.external_id,
+        t.external_img,
+        t.external_create_time
+    </sql>
+    <select id="getCustomizedExternalUrlList" resultMap="BaseResultMap" parameterType="CustomizedExternalUrl" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_external_url t
+        <where>
+            <if test="externalUrlId != null ">
+                AND t.external_url_id = #{externalUrlId}
+            </if >
+        </where>
+    </select>
+    <select id="getCustomizedExternalUrlById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_external_url t
+        where t.external_url_id= #{externalUrlId}
+    </select>
+    <insert id="save" parameterType="CustomizedExternalUrl" >
+        insert into
+        tb_iamberry_customized_external_url
+        (
+        external_id,
+        external_img
+        )
+        values
+        (
+        #{externalId},
+        #{externalImg}
+        )
+    </insert>
+    <update id="update" parameterType="CustomizedExternalUrl" >
+        update
+        tb_iamberry_customized_external_url
+        <set >
+            <if test="externalId != null and externalId != ''">
+                external_id = #{externalId},
+            </if >
+            <if test="externalImg != null and externalImg != ''">
+                external_img = #{externalImg},
+            </if >
+        </set >
+        where external_url_id= #{externalUrlId}
+    </update>
+</mapper>

+ 77 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedPatternMapper.xml

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.CustomizedPatternMapper">
+    <resultMap  id="BaseResultMap" type="CustomizedPattern" >
+        <result    column="pattern_id"    property="patternId" />
+        <result    column="pattern_name"    property="patternName" />
+        <result    column="pattern_thumbnail_img"    property="patternThumbnailImg" />
+        <result    column="pattern_img"    property="patternImg" />
+        <result    column="pattern_status"    property="patternStatus" />
+        <result    column="pattern_create_time"    property="patternCreateTime" />
+        <result    column="pattern_update_time"    property="patternUpdateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.pattern_id,
+        t.pattern_name,
+        t.pattern_thumbnail_img,
+        t.pattern_img,
+        t.pattern_status,
+        t.pattern_create_time,
+        t.pattern_update_time
+    </sql>
+    <select id="getCustomizedPatternList" resultMap="BaseResultMap" parameterType="CustomizedPattern" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_pattern t
+        <where>
+            <if test="patternId != null ">
+                AND t.pattern_id = #{patternId}
+            </if >
+            <if test="patternStatus != null ">
+                AND t.pattern_status = #{patternStatus}
+            </if >
+        </where>
+    </select>
+    <select id="getCustomizedPatternById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_pattern t
+        where t.pattern_id= #{patternId}
+    </select>
+    <insert id="save" parameterType="CustomizedPattern" >
+        insert into
+        tb_iamberry_customized_pattern
+        (
+        pattern_name,
+        pattern_thumbnail_img,
+        pattern_img,
+        pattern_status
+        )
+        values
+        (
+        #{patternName},
+        #{patternThumbnailImg},
+        #{patternImg},
+        #{patternStatus}
+        )
+    </insert>
+    <update id="update" parameterType="CustomizedPattern" >
+        update
+        tb_iamberry_customized_pattern
+        <set >
+            <if test="patternName != null and patternName != ''">
+                pattern_name = #{patternName},
+            </if >
+            <if test="patternThumbnailImg != null and patternThumbnailImg != ''">
+                pattern_thumbnail_img = #{patternThumbnailImg},
+            </if >
+            <if test="patternImg != null and patternImg != ''">
+                pattern_img = #{patternImg},
+            </if >
+            <if test="patternStatus != null ">
+                pattern_status = #{patternStatus},
+            </if >
+        </set >
+        where pattern_id= #{patternId}
+    </update>
+</mapper>

+ 160 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedPositionMapper.xml

@@ -0,0 +1,160 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.CustomizedPositionMapper">
+    <resultMap  id="BaseResultMap" type="CustomizedPosition" >
+        <result    column="position_id"    property="positionId" />
+        <result    column="position_type"    property="positionType" />
+        <result    column="pattern_id"    property="patternId" />
+        <result    column="position_pattern_x"    property="positionPatternX" />
+        <result    column="position_pattern_y"    property="positionPatternY" />
+        <result    column="position_avatar_x"    property="positionAvatarX" />
+        <result    column="position_avatar_y"    property="positionAvatarY" />
+        <result    column="position_text_x"    property="positionTextX" />
+        <result    column="position_text_y"    property="positionTextY" />
+        <result    column="position_status"    property="positionStatus" />
+        <result    column="position_create_time"    property="positionCreateTime" />
+        <result    column="position_update_time"    property="positionUpdateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.position_id,
+        t.position_type,
+        t.pattern_id,
+        t.position_pattern_x,
+        t.position_pattern_y,
+        t.position_avatar_x,
+        t.position_avatar_y,
+        t.position_text_x,
+        t.position_text_y,
+        t.position_status,
+        t.position_create_time,
+        t.position_update_time
+    </sql>
+    <select id="getCustomizedPositionList" resultMap="BaseResultMap" parameterType="CustomizedPosition" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_position t
+        <where>
+            <if test="positionId != null ">
+                AND t.position_id = #{positionId}
+            </if >
+            <if test="positionType != null ">
+                AND t.position_type = #{positionType}
+            </if >
+            <if test="patternId != null ">
+                AND t.pattern_id = #{patternId}
+            </if >
+            <if test="positionStatus != null ">
+                AND t.position_status = #{positionStatus}
+            </if >
+        </where>
+    </select>
+    <select id="getCustomizedPositionById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_position t
+        where t.position_id= #{positionId}
+    </select>
+    <insert id="save" parameterType="CustomizedPosition" >
+        insert into
+        tb_iamberry_customized_position
+        (
+        position_type,
+        pattern_id,
+        position_pattern_x,
+        position_pattern_y,
+        position_avatar_x,
+        position_avatar_y,
+        position_text_x,
+        position_text_y,
+        position_status
+        )
+        values
+        (
+        #{positionType},
+        #{patternId},
+        #{positionPatternX},
+        #{positionPatternY},
+        #{positionAvatarX},
+        #{positionAvatarY},
+        #{positionTextX},
+        #{positionTextY},
+        #{positionStatus}
+        )
+    </insert>
+    <update id="update" parameterType="CustomizedPosition" >
+        update
+        tb_iamberry_customized_position
+        <set >
+            <if test="positionType != null ">
+                position_type = #{positionType},
+            </if >
+            <if test="patternId != null ">
+                pattern_id = #{patternId},
+            </if >
+            <if test="positionPatternX != null ">
+                position_pattern_x = #{positionPatternX},
+            </if >
+            <if test="positionPatternY != null ">
+                position_pattern_y = #{positionPatternY},
+            </if >
+            <if test="positionAvatarX != null ">
+                position_avatar_x = #{positionAvatarX},
+            </if >
+            <if test="positionAvatarY != null ">
+                position_avatar_y = #{positionAvatarY},
+            </if >
+            <if test="positionTextX != null ">
+                position_text_x = #{positionTextX},
+            </if >
+            <if test="positionTextY != null ">
+                position_text_y = #{positionTextY},
+            </if >
+            <if test="positionStatus != null ">
+                position_status = #{positionStatus},
+            </if >
+        </set >
+        where position_id= #{positionId}
+    </update>
+    <delete id="delete" parameterType="Integer" >
+        delete FROM
+        tb_iamberry_customized_position
+        where position_id=#{positionId}
+    </delete>
+    <insert id="saveList" parameterType="java.util.List" >
+        insert into
+        tb_iamberry_customized_position
+        (
+        position_type,
+        pattern_id,
+        position_pattern_x,
+        position_pattern_y,
+        position_avatar_x,
+        position_avatar_y,
+        position_text_x,
+        position_text_y,
+        position_status
+        )
+        values
+        <foreach collection="list" item="node" index="index" separator="," open="" close="">
+            (
+            #{node.positionType},
+            #{node.patternId},
+            #{node.positionPatternX},
+            #{node.positionPatternY},
+            #{node.positionAvatarX},
+            #{node.positionAvatarY},
+            #{node.positionTextX},
+            #{node.positionTextY},
+            #{node.positionStatus}
+            )
+        </foreach >
+    </insert>
+    <delete id="deleteList" parameterType="String" >
+        delete FROM
+        tb_iamberry_customized_position
+        where position_id  in
+        <foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
+            #{item}
+        </foreach >
+    </delete>
+</mapper>

+ 159 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/customizedToothMapper.xml

@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.CustomizedToothMapper">
+    <resultMap  id="BaseResultMap" type="CustomizedTooth" >
+        <result    column="tooth_id"    property="toothId" />
+        <result    column="user_open_id"    property="userOpenId" />
+        <result    column="product_id"    property="productId" />
+        <result    column="color_id"    property="colorId" />
+        <result    column="tooth_color_id"    property="toothColorId" />
+        <result    column="tooth_pattern_id"    property="toothPatternId" />
+        <result    column="tooth_position_id"    property="toothPositionId" />
+        <result    column="tooth_text"    property="toothText" />
+        <result    column="tooth_avatar_img"    property="toothAvatarImg" />
+        <result    column="tooth_img"    property="toothImg" />
+        <result    column="tooth_type"    property="toothType" />
+        <result    column="tooth_status"    property="toothStatus" />
+        <result    column="tooth_create_time"    property="toothCreateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.tooth_id,
+        t.user_open_id,
+        t.product_id,
+        t.color_id,
+        t.tooth_color_id,
+        t.tooth_pattern_id,
+        t.tooth_position_id,
+        t.tooth_text,
+        t.tooth_avatar_img,
+        t.tooth_img,
+        t.tooth_type,
+        t.tooth_status,
+        t.tooth_create_time
+    </sql>
+    <select id="getCustomizedToothList" resultMap="BaseResultMap" parameterType="CustomizedTooth" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_tooth t
+        <where>
+            <if test="toothId != null ">
+                AND t.tooth_id = #{toothId}
+            </if >
+            <if test="userOpenId != null and userOpenId != ''">
+                AND t.user_open_id  like  CONCAT ('%',#{userOpenId},'%')
+            </if >
+            <if test="productId != null ">
+                AND t.product_id = #{productId}
+            </if >
+            <if test="colorId != null ">
+                AND t.color_id = #{colorId}
+            </if >
+            <if test="toothColorId != null ">
+                AND t.tooth_color_id = #{toothColorId}
+            </if >
+            <if test="toothPatternId != null ">
+                AND t.tooth_pattern_id = #{toothPatternId}
+            </if >
+            <if test="toothPositionId != null ">
+                AND t.tooth_position_id = #{toothPositionId}
+            </if >
+            <if test="toothText != null and toothText != ''">
+                AND t.tooth_text  like  CONCAT ('%',#{toothText},'%')
+            </if >
+            <if test="toothAvatarImg != null and toothAvatarImg != ''">
+                AND t.tooth_avatar_img  like  CONCAT ('%',#{toothAvatarImg},'%')
+            </if >
+            <if test="toothImg != null and toothImg != ''">
+                AND t.tooth_img  like  CONCAT ('%',#{toothImg},'%')
+            </if >
+            <if test="toothType != null ">
+                AND t.tooth_type = #{toothType}
+            </if >
+            <if test="toothStatus != null ">
+                AND t.tooth_status = #{toothStatus}
+            </if >
+        </where>
+    </select>
+    <select id="getCustomizedToothById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_customized_tooth t
+        where t.tooth_id= #{toothId}
+    </select>
+    <insert id="save" keyProperty="toothId" useGeneratedKeys="true" parameterType="CustomizedTooth" >
+        insert into
+        tb_iamberry_customized_tooth
+        (
+        tooth_id,
+        user_open_id,
+        product_id,
+        color_id,
+        tooth_color_id,
+        tooth_pattern_id,
+        tooth_position_id,
+        tooth_text,
+        tooth_avatar_img,
+        tooth_img,
+        tooth_type,
+        tooth_status
+        )
+        values
+        (
+        #{toothId},
+        #{userOpenId},
+        #{productId},
+        #{colorId},
+        #{toothColorId},
+        #{toothPatternId},
+        #{toothPositionId},
+        #{toothText},
+        #{toothAvatarImg},
+        #{toothImg},
+        #{toothType},
+        #{toothStatus}
+        )
+    </insert>
+    <update id="update" parameterType="CustomizedTooth" >
+        update
+        tb_iamberry_customized_tooth
+        <set >
+            <if test="toothId != null ">
+                tooth_id = #{toothId},
+            </if >
+            <if test="userOpenId != null and userOpenId != ''">
+                user_open_id = #{userOpenId},
+            </if >
+            <if test="productId != null ">
+                product_id = #{productId},
+            </if >
+            <if test="colorId != null ">
+                color_id = #{colorId},
+            </if >
+            <if test="toothColorId != null ">
+                tooth_color_id = #{toothColorId},
+            </if >
+            <if test="toothPatternId != null ">
+                tooth_pattern_id = #{toothPatternId},
+            </if >
+            <if test="toothPositionId != null ">
+                tooth_position_id = #{toothPositionId},
+            </if >
+            <if test="toothText != null and toothText != ''">
+                tooth_text = #{toothText},
+            </if >
+            <if test="toothAvatarImg != null and toothAvatarImg != ''">
+                tooth_avatar_img = #{toothAvatarImg},
+            </if >
+            <if test="toothImg != null and toothImg != ''">
+                tooth_img = #{toothImg},
+            </if >
+            <if test="toothType != null ">
+                tooth_type = #{toothType},
+            </if >
+            <if test="toothStatus != null ">
+                tooth_status = #{toothStatus},
+            </if >
+        </set >
+        where tooth_id= #{toothId}
+    </update>
+</mapper>

+ 362 - 0
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/orderCustomizedMapper.xml

@@ -0,0 +1,362 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.iamberry.wechat.service.mapper.OrderCustomizedMapper">
+    <resultMap  id="BaseResultMap" type="OrderCustomized" >
+        <result    column="customized_id"    property="customizedId" />
+        <result    column="sales_order_id"    property="salesOrderId" />
+        <result    column="customized_external_id"    property="customizedExternalId" />
+        <result    column="customized_color_id"    property="customizedColorId" />
+        <result    column="customized_color_value"    property="customizedColorValue" />
+        <result    column="customized_color_name"    property="customizedColorName" />
+        <result    column="customized_pattern_id"    property="customizedPatternId" />
+        <result    column="customized_pattern_name"    property="customizedPatternName" />
+        <result    column="customized_pattern_img"    property="customizedPatternImg" />
+        <result    column="customized_position_id"    property="customizedPositionId" />
+        <result    column="customized_position_type"    property="customizedPositionType" />
+        <result    column="customized_position_pattern_x"    property="customizedPositionPatternX" />
+        <result    column="customized_position_pattern_y"    property="customizedPositionPatternY" />
+        <result    column="customized_position_text_x"    property="customizedPositionTextX" />
+        <result    column="customized_position_text_y"    property="customizedPositionTextY" />
+        <result    column="customized_position_avatar_x"    property="customizedPositionAvatarX" />
+        <result    column="customized_position_avatar_y"    property="customizedPositionAvatarY" />
+        <result    column="customized_text"    property="customizedText" />
+        <result    column="customized_avatar_img"    property="customizedAvatarImg" />
+        <result    column="customized_img"    property="customizedImg" />
+        <result    column="customized_type"    property="customizedType" />
+        <result    column="customized_status"    property="customizedStatus" />
+        <result    column="customized_create_time"    property="customizedCreateTime" />
+    </resultMap>
+    <sql    id="Base_List" >
+        t.customized_id,
+        t.sales_order_id,
+        t.customized_external_id,
+        t.customized_color_id,
+        t.customized_color_value,
+        t.customized_color_name,
+        t.customized_pattern_id,
+        t.customized_pattern_name,
+        t.customized_pattern_img,
+        t.customized_position_id,
+        t.customized_position_type,
+        t.customized_position_pattern_x,
+        t.customized_position_pattern_y,
+        t.customized_position_text_x,
+        t.customized_position_text_y,
+        t.customized_position_avatar_x,
+        t.customized_position_avatar_y,
+        t.customized_text,
+        t.customized_avatar_img,
+        t.customized_img,
+        t.customized_type,
+        t.customized_status,
+        t.customized_create_time
+    </sql>
+    <select id="getOrderCustomizedList" resultMap="BaseResultMap" parameterType="OrderCustomized" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_order_customized t
+        <where>
+            <if test="customizedId != null ">
+                AND t.customized_id = #{customizedId}
+            </if >
+            <if test="salesOrderId != null and salesOrderId != ''">
+                AND t.sales_order_id = #{salesOrderId}
+            </if >
+            <if test="customizedExternalId != null and customizedExternalId != ''">
+                AND t.customized_external_id = #{customizedExternalId}
+            </if >
+            <if test="customizedColorId != null ">
+                AND t.customized_color_id = #{customizedColorId}
+            </if >
+            <if test="customizedPatternId != null ">
+                AND t.customized_pattern_id = #{customizedPatternId}
+            </if >
+            <if test="customizedPositionId != null ">
+                AND t.customized_position_id = #{customizedPositionId}
+            </if >
+            <if test="customizedPositionType != null ">
+                AND t.customized_position_type = #{customizedPositionType}
+            </if >
+            <if test="customizedType != null ">
+                AND t.customized_type = #{customizedType}
+            </if >
+            <if test="customizedStatus != null ">
+                AND t.customized_status = #{customizedStatus}
+            </if >
+        </where>
+    </select>
+
+    <resultMap  id="BaseResultOrderMap" type="OrderCustomized" >
+        <result    column="customized_id"    property="customizedId" />
+        <result    column="sales_order_id"    property="salesOrderId" />
+        <result    column="customized_external_id"    property="customizedExternalId" />
+        <result    column="customized_color_id"    property="customizedColorId" />
+        <result    column="customized_color_value"    property="customizedColorValue" />
+        <result    column="customized_color_name"    property="customizedColorName" />
+        <result    column="customized_pattern_id"    property="customizedPatternId" />
+        <result    column="customized_pattern_name"    property="customizedPatternName" />
+        <result    column="customized_pattern_img"    property="customizedPatternImg" />
+        <result    column="customized_position_id"    property="customizedPositionId" />
+        <result    column="customized_position_type"    property="customizedPositionType" />
+        <result    column="customized_position_pattern_x"    property="customizedPositionPatternX" />
+        <result    column="customized_position_pattern_y"    property="customizedPositionPatternY" />
+        <result    column="customized_position_text_x"    property="customizedPositionTextX" />
+        <result    column="customized_position_text_y"    property="customizedPositionTextY" />
+        <result    column="customized_position_avatar_x"    property="customizedPositionAvatarX" />
+        <result    column="customized_position_avatar_y"    property="customizedPositionAvatarY" />
+        <result    column="customized_text"    property="customizedText" />
+        <result    column="customized_avatar_img"    property="customizedAvatarImg" />
+        <result    column="customized_img"    property="customizedImg" />
+        <result    column="customized_type"    property="customizedType" />
+        <result    column="customized_status"    property="customizedStatus" />
+        <result    column="customized_create_time"    property="customizedCreateTime" />
+        <association property="orderInfo" javaType="com.iamberry.wechat.core.entity.order.Order">
+            <id    column="sales_orderid"    property="salesOrderid" />
+            <result    column="sales_openid"    property="salesOpenid" />
+            <result    column="sales_yet_amount"    property="salesYetAmount" />
+            <result    column="sales_amount"    property="salesAmount" />
+            <result    column="sales_integral_num"    property="salesIntegralNum" />
+            <result    column="sales_rate_amount"    property="salesRateAmount" />
+            <result    column="sales_create_date"    property="salesCreateDate" />
+            <result    column="sales_reward_integral_num"    property="salesRewardIntegralNum" />
+            <result    column="sales_post_num"    property="salesPostNum" />
+            <result    column="sales_post_firm"    property="salesPostFirm" />
+            <result    column="sales_status"    property="salesStatus" />
+            <result    column="sales_send_date"    property="salesSendDate" />
+            <result    column="sales_return_date"    property="salesReturnDate" />
+            <result    column="sales_address_info"    property="salesAddressInfo" />
+            <result    column="sales_address_postnum"    property="salesAddressPostnum" />
+            <result    column="sales_address_tel"    property="salesAddressTel" />
+            <result    column="sales_address_name"    property="salesAddressName" />
+            <result    column="sales_return_des"    property="salesReturnDes" />
+            <result    column="sales_admin_remark"    property="salesAdminRemark" />
+            <result    column="sales_user_remark"    property="salesUserRemark" />
+            <result    column="sales_transaction_id"    property="salesTransactionId" />
+            <result    column="sales_transaction_date"    property="salesTransactionDate" />
+            <result    column="sales_refund_no"    property="salesRefundNo" />
+            <result    column="sales_transaction_refund_id"    property="salesTransactionRefundId" />
+            <result    column="sales_color_type"    property="salesColorType" />
+            <result    column="sales_proxy_reward"    property="salesProxyReward" />
+            <result    column="Sales_coupon_receive_id"    property="couponId" />
+            <result    column="sales_is_rfund"    property="salesIsRfund" />
+            <result    column="sales_audit_remark"    property="salesAuditRemark" />
+            <result    column="sales_is_customized"    property="salesIsCustomized" />
+        </association>
+    </resultMap>
+    <select id="listOrderCustomizedPage" resultMap="BaseResultOrderMap" parameterType="OrderCustomized" >
+        select
+            t.customized_id,
+            t.sales_order_id,
+            t.customized_external_id,
+            t.customized_color_id,
+            t.customized_color_value,
+            t.customized_color_name,
+            t.customized_pattern_id,
+            t.customized_pattern_name,
+            t.customized_pattern_img,
+            t.customized_position_id,
+            t.customized_position_type,
+            t.customized_position_pattern_x,
+            t.customized_position_pattern_y,
+            t.customized_position_text_x,
+            t.customized_position_text_y,
+            t.customized_position_avatar_x,
+            t.customized_position_avatar_y,
+            t.customized_text,
+            t.customized_avatar_img,
+            t.customized_img,
+            t.customized_type,
+            t.customized_status,
+            t.customized_create_time,
+            so.sales_orderid,
+            so.sales_openid,
+            so.sales_yet_amount,
+            so.sales_amount,
+            so.sales_reward_num,
+            so.sales_integral_num,
+            so.sales_rate_amount,
+            so.sales_create_date,
+            so.sales_reward_integral_num,
+            so.sales_post_num,
+            so.sales_post_firm,
+            so.sales_status,
+            so.sales_send_date,
+            so.sales_return_date,
+            so.sales_address_info,
+            so.sales_address_postnum,
+            so.sales_address_tel,
+            so.sales_address_name,
+            so.sales_return_des,
+            so.sales_admin_remark,
+            so.sales_user_remark,
+            so.sales_transaction_id,
+            so.sales_transaction_date,
+            so.sales_refund_no,
+            so.sales_transaction_refund_id,
+            so.sales_color_type,
+            so.sales_proxy_reward,
+            so.Sales_coupon_receive_id,
+            so.sales_is_rfund,
+            so.sales_audit_remark,
+            so.sales_is_customized
+        from tb_iamberry_order_customized t
+        LEFT JOIN tb_iamberry_shop_sales_order so ON t.sales_order_id = so.SALES_ORDERID
+        <where>
+            <if test="customizedId != null ">
+                AND t.customized_id = #{customizedId}
+            </if >
+            <if test="salesOrderId != null and salesOrderId != ''">
+                AND t.sales_order_id = #{salesOrderId}
+            </if >
+            <if test="customizedExternalId != null and customizedExternalId != ''">
+                AND t.customized_external_id = #{customizedExternalId}
+            </if >
+            <if test="customizedColorId != null ">
+                AND t.customized_color_id = #{customizedColorId}
+            </if >
+            <if test="customizedPatternId != null ">
+                AND t.customized_pattern_id = #{customizedPatternId}
+            </if >
+            <if test="customizedPositionId != null ">
+                AND t.customized_position_id = #{customizedPositionId}
+            </if >
+            <if test="customizedPositionType != null ">
+                AND t.customized_position_type = #{customizedPositionType}
+            </if >
+            <if test="customizedType != null ">
+                AND t.customized_type = #{customizedType}
+            </if >
+            <if test="customizedStatus != null ">
+                AND t.customized_status = #{customizedStatus}
+            </if >
+        </where>
+    </select>
+
+    <select id="getOrderCustomizedById" resultMap="BaseResultMap" parameterType="Integer" >
+        select
+        <include refid="Base_List" />
+        from tb_iamberry_order_customized t
+        where t.customized_id= #{customizedId}
+    </select>
+    <insert id="save" parameterType="OrderCustomized" >
+        insert into
+        tb_iamberry_order_customized
+        (
+        sales_order_id,
+        customized_external_id,
+        customized_color_id,
+        customized_color_value,
+        customized_color_name,
+        customized_pattern_id,
+        customized_pattern_name,
+        customized_pattern_img,
+        customized_position_id,
+        customized_position_type,
+        customized_position_pattern_x,
+        customized_position_pattern_y,
+        customized_position_text_x,
+        customized_position_text_y,
+        customized_position_avatar_x,
+        customized_position_avatar_y,
+        customized_text,
+        customized_avatar_img,
+        customized_img,
+        customized_type,
+        customized_status
+        )
+        values
+        (
+        #{salesOrderId},
+        #{customizedExternalId},
+        #{customizedColorId},
+        #{customizedColorValue},
+        #{customizedColorName},
+        #{customizedPatternId},
+        #{customizedPatternName},
+        #{customizedPatternImg},
+        #{customizedPositionId},
+        #{customizedPositionType},
+        #{customizedPositionPatternX},
+        #{customizedPositionPatternY},
+        #{customizedPositionTextX},
+        #{customizedPositionTextY},
+        #{customizedPositionAvatarX},
+        #{customizedPositionAvatarY},
+        #{customizedText},
+        #{customizedAvatarImg},
+        #{customizedImg},
+        #{customizedType},
+        #{customizedStatus}
+        )
+    </insert>
+    <update id="update" parameterType="OrderCustomized" >
+        update
+        tb_iamberry_order_customized
+        <set >
+            <if test="salesOrderId != null and salesOrderId != ''">
+                sales_order_id = #{salesOrderId},
+            </if >
+            <if test="customizedExternalId != null and customizedExternalId != ''">
+                customized_external_id = #{customizedExternalId},
+            </if >
+            <if test="customizedColorId != null ">
+                customized_color_id = #{customizedColorId},
+            </if >
+            <if test="customizedColorValue != null and customizedColorValue != ''">
+                customized_color_value = #{customizedColorValue},
+            </if >
+            <if test="customizedColorName != null and customizedColorName != ''">
+                customized_color_name = #{customizedColorName},
+            </if >
+            <if test="customizedPatternId != null ">
+                customized_pattern_id = #{customizedPatternId},
+            </if >
+            <if test="customizedPatternName != null and customizedPatternName != ''">
+                customized_pattern_name = #{customizedPatternName},
+            </if >
+            <if test="customizedPatternImg != null and customizedPatternImg != ''">
+                customized_pattern_img = #{customizedPatternImg},
+            </if >
+            <if test="customizedPositionId != null ">
+                customized_position_id = #{customizedPositionId},
+            </if >
+            <if test="customizedPositionType != null ">
+                customized_position_type = #{customizedPositionType},
+            </if >
+            <if test="customizedPositionPatternX != null ">
+                customized_position_pattern_x = #{customizedPositionPatternX},
+            </if >
+            <if test="customizedPositionPatternY != null ">
+                customized_position_pattern_y = #{customizedPositionPatternY},
+            </if >
+            <if test="customizedPositionTextX != null ">
+                customized_position_text_x = #{customizedPositionTextX},
+            </if >
+            <if test="customizedPositionTextY != null ">
+                customized_position_text_y = #{customizedPositionTextY},
+            </if >
+            <if test="customizedPositionAvatarX != null ">
+                customized_position_avatar_x = #{customizedPositionAvatarX},
+            </if >
+            <if test="customizedPositionAvatarY != null ">
+                customized_position_avatar_y = #{customizedPositionAvatarY},
+            </if >
+            <if test="customizedText != null and customizedText != ''">
+                customized_text = #{customizedText},
+            </if >
+            <if test="customizedAvatarImg != null and customizedAvatarImg != ''">
+                customized_avatar_img = #{customizedAvatarImg},
+            </if >
+            <if test="customizedImg != null and customizedImg != ''">
+                customized_img = #{customizedImg},
+            </if >
+            <if test="customizedType != null ">
+                customized_type = #{customizedType},
+            </if >
+            <if test="customizedStatus != null ">
+                customized_status = #{customizedStatus},
+            </if >
+        </set >
+        where customized_id= #{customizedId}
+    </update>
+</mapper>

+ 6 - 4
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/orderMapper.xml

@@ -17,7 +17,7 @@ PUBLIC
 			 		SALES_INTEGRAL_NUM, SALES_RATE_AMOUNT, SALES_CREATE_DATE,
 			 		SALES_REWARD_INTEGRAL_NUM, SALES_ADDRESS_INFO, SALES_ADDRESS_POSTNUM,
 			 		SALES_ADDRESS_TEL, SALES_ADDRESS_NAME, SALES_USER_REMARK, SALES_STATUS, 
-			 		SALES_PROXY_REWARD, SALES_REWARD_NUM,SALES_COUPON_RECEIVE_ID, Sales_balance_amount
+			 		SALES_PROXY_REWARD, SALES_REWARD_NUM,SALES_COUPON_RECEIVE_ID, Sales_balance_amount, sales_is_customized
 				)
 		 VALUES 
 		  	( 
@@ -38,7 +38,8 @@ PUBLIC
 			  1,
 			  #{salesRewardNum},
 			  #{couponId},
-			  #{balancePayAmount}
+			  #{balancePayAmount},
+			  #{salesIsCustomized}
 		  	)
 	</insert>
 	
@@ -93,8 +94,9 @@ PUBLIC
 			SALES_INTEGRAL_NUM salesIntegralNum, SALES_AMOUNT salesAmount, SALES_YET_AMOUNT salesYetAmount, 
 			SALES_BALANCE_AMOUNT balancePayAmount,
 			SALES_OPENID  salesOpenid,
-			SALES_COUPON_RECEIVE_ID couponId
-		FROM 
+			SALES_COUPON_RECEIVE_ID couponId,
+			sales_is_customized salesIsCustomized
+		FROM
 			TB_IAMBERRY_SHOP_SALES_ORDER 
 		WHERE 
 			SALES_ORDERID = #{salesOrderid} 

+ 2 - 1
tooth-wechat-service/src/main/java/com/iamberry/wechat/service/mapper/productColorMapper.xml

@@ -8,8 +8,9 @@
 		COLOR_NAME colorName,
 		COLOR_DISCOUNT colorDiscount,
 		COLOR_PRICE colorPrice,
-		
+		COLOR_STATUS colorStatus,
 		COLOR_69CODE color69Code,
+		COLOR_IMG colorImg,
 		COLOR_CRETAE_TIME colorCretaeTime,
 		COLOR_UPDATE_TIME colorUpdateTime
 	</sql>

+ 0 - 2
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminChargReceiveHandler.java

@@ -32,8 +32,6 @@ public class AdminChargReceiveHandler {
     /**
      * 查询积分记录 并分页 (支持查询条件模糊搜索)
      * 2018年2月24日
-     * @author mzx
-     * @param pageNO	分页信息
      * @return
      */
     @RequestMapping("/listReceive")

+ 88 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminOrderCustomizedHandlers.java

@@ -0,0 +1,88 @@
+package com.iamberry.wechat.handles.admin;
+
+import com.iamberry.app.tool.log.RatFWLogger;
+import com.iamberry.wechat.core.entity.OrderUtil;
+import com.iamberry.wechat.core.entity.ResultMsg;
+import com.iamberry.wechat.core.entity.customized.OrderCustomized;
+import com.iamberry.wechat.core.entity.drp.PlaceInfo;
+import com.iamberry.wechat.core.entity.member.CashLog;
+import com.iamberry.wechat.core.entity.member.Member;
+import com.iamberry.wechat.core.entity.mq.MQMessage;
+import com.iamberry.wechat.core.entity.order.*;
+import com.iamberry.wechat.core.entity.page.PageRequest;
+import com.iamberry.wechat.core.entity.page.PagedResult;
+import com.iamberry.wechat.core.entity.reback.RebackInfo;
+import com.iamberry.wechat.core.entity.receive.ChargerReceive;
+import com.iamberry.wechat.core.entity.relationship.DealerRelation;
+import com.iamberry.wechat.core.entity.relationship.WdRelation;
+import com.iamberry.wechat.face.customized.OrderCustomizedService;
+import com.iamberry.wechat.face.drp.PlaceInfoService;
+import com.iamberry.wechat.face.efast.EfastRentService;
+import com.iamberry.wechat.face.member.MemberService;
+import com.iamberry.wechat.face.order.AdminOrderService;
+import com.iamberry.wechat.face.order.CodeService;
+import com.iamberry.wechat.face.reback.LoadRewardTaskService;
+import com.iamberry.wechat.face.reback.RebackServices;
+import com.iamberry.wechat.face.relationship.DealerRelationService;
+import com.iamberry.wechat.face.relationship.WdRelationService;
+import com.iamberry.wechat.handles.mq.MQServiceProxy;
+import com.iamberry.wechat.tools.NameUtils;
+import com.iamberry.wechat.tools.ResultInfo;
+import com.iamberry.wechat.tools.SendMessageUtil;
+import com.iamberry.wechat.utils.StitchAttrUtil;
+import org.apache.commons.collections.map.HashedMap;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.net.URLDecoder;
+import java.text.DecimalFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
+import static com.iamberry.wechat.service.ImberryConfig.INFORM_SHIPPING;
+//import cn.jpush.api.common.connection.IHttpClient.RequestMethod;
+
+@Controller
+@RequestMapping("/admin/customized")
+public class AdminOrderCustomizedHandlers {
+
+    @Autowired
+    private OrderCustomizedService orderCustomizedService;
+
+    /**
+     *  查询
+     * 2018年2月24日
+     * @param pageNO	分页信息
+     * @return
+     */
+    @RequestMapping("/order_list")
+    public ModelAndView listIntegral(OrderCustomized orderCustomized,
+                                     @RequestParam(value= "pageSize",defaultValue= "10" ,required=false) Integer pageSize,
+                                     @RequestParam(value = "pageNO", defaultValue = "1",required=false) Integer pageNO,
+                                     @RequestParam(value = "totalNum", defaultValue = "0", required = false) Integer totalNum,
+                                     HttpServletRequest request) throws Exception {
+        ModelAndView mv = new ModelAndView("admin/customized/list_order");
+        // 封装请求数据
+        PageRequest<OrderCustomized> pageRequest = new PageRequest<>(orderCustomized, pageNO, pageSize, totalNum == 0);
+        // 查询订单列表
+        PagedResult<OrderCustomized> result = orderCustomizedService.listOrderCustomizedPage(pageRequest);
+        if (totalNum != 0) {
+            result.setTotal(totalNum);
+        }
+        StitchAttrUtil.addNoPro("orderInfo");
+        StitchAttrUtil.setModelAndView(orderCustomized, mv, "/admin/customized/list_order", result);
+        return mv;
+    }
+
+}

+ 270 - 0
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/customized/CustomizedHandler.java

@@ -0,0 +1,270 @@
+package com.iamberry.wechat.handles.customized;
+
+import com.iamberry.wechat.core.entity.ResultMsg;
+import com.iamberry.wechat.core.entity.WechatUtils;
+import com.iamberry.wechat.core.entity.customized.CustomizedColor;
+import com.iamberry.wechat.core.entity.customized.CustomizedPattern;
+import com.iamberry.wechat.core.entity.customized.CustomizedPosition;
+import com.iamberry.wechat.core.entity.customized.CustomizedTooth;
+import com.iamberry.wechat.core.entity.member.Member;
+import com.iamberry.wechat.face.customized.CustomizedColorService;
+import com.iamberry.wechat.face.customized.CustomizedPatternService;
+import com.iamberry.wechat.face.customized.CustomizedPositionService;
+import com.iamberry.wechat.face.customized.CustomizedToothService;
+import com.iamberry.wechat.face.member.MemberService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import sun.misc.BASE64Decoder;
+
+import javax.servlet.http.HttpServletRequest;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.OutputStream;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Random;
+
+/**
+ *  定制牙刷
+ */
+@Controller
+@RequestMapping("/wechat/customized")
+public class CustomizedHandler {
+
+    @Autowired
+    private CustomizedColorService customizedColorService;
+    @Autowired
+    private CustomizedPatternService customizedPatternService;
+    @Autowired
+    private CustomizedPositionService customizedPositionService;
+    @Autowired
+    private CustomizedToothService customizedToothService;
+    @Autowired
+    private MemberService memberService;
+
+    /**
+     * 获取颜色和图案
+     * @param req
+     * @return
+     */
+    @RequestMapping("/color_patterns")
+    @ResponseBody
+    public ResultMsg getColorPatterns(HttpServletRequest req){
+        ResultMsg rm = ResultMsg.getSuccess();
+
+        CustomizedColor customizedColor = new CustomizedColor();
+        customizedColor.setColorStatus(1);
+        List<CustomizedColor> customizedColorList = customizedColorService.getCustomizedColorList(customizedColor);
+
+        CustomizedPattern customizedPattern = new CustomizedPattern();
+        customizedPattern.setPatternStatus(1);
+        List<CustomizedPattern> customizedPatternList = customizedPatternService.getCustomizedPatternList(customizedPattern);
+
+        rm.addData("customizedColorList",customizedColorList);
+        rm.addData("customizedPatternList",customizedPatternList);
+        return rm;
+    }
+
+    /**
+     * 根据纹理获取位置信息
+     * @param req
+     * @return
+     */
+    @RequestMapping("/get_position")
+    @ResponseBody
+    public ResultMsg getPosition(HttpServletRequest req,Integer patternId){
+        ResultMsg rm = ResultMsg.getSuccess();
+
+        if(patternId == null){
+            return ResultMsg.getError();
+        }
+
+        CustomizedPosition customizedPosition = new CustomizedPosition();
+        customizedPosition.setPositionStatus(1);
+        customizedPosition.setPatternId(patternId);
+        List<CustomizedPosition> customizedPositionList = customizedPositionService.getCustomizedPositionList(customizedPosition);
+
+        rm.addData("customizedPositionList",customizedPositionList);
+        return rm;
+    }
+
+    /**
+     * 上传头像
+     * @param req
+     * @return
+     */
+    @RequestMapping("/upload_avatar")
+    @ResponseBody
+    public ResultMsg uploadAvatar(HttpServletRequest req,String avatarImg){
+        Member member = WechatUtils.getUserBySession(req);
+        member = memberService.getMemberByUserOpenId(member.getUserOpenid());
+
+        ResultMsg rm = ResultMsg.getSuccess();
+        if(avatarImg == null || "".equals(avatarImg)){
+            return ResultMsg.getError();
+        }
+
+        String acatar[] = avatarImg.split(",");
+        avatarImg = acatar[1];
+
+        String dataStaing = new SimpleDateFormat("yyyyMMdd").format(new Date());
+        String path = "common/images/customized/avatar/" + dataStaing + "/";
+
+        // 生成文件
+        String filePath = req.getSession().getServletContext().getRealPath("/") + path ;
+        File imgfile = new File(filePath); //全路径
+        if (!imgfile.exists()){
+            imgfile.mkdirs();
+        }
+        // 生成文件名
+        String files = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".png";
+        // 生成文件
+        String filename = filePath + files;
+        String avatarImgPath = path + files;     //返回路径
+        byte[] buffer;//图像转换的目的字节数组
+        BASE64Decoder base64 = new BASE64Decoder();  //新建64位解码器
+        try {
+            buffer = base64.decodeBuffer(avatarImg);//64位解码到字节数组中
+            //写进文件  创建一个向具有指定名称的文件中写入数据的输出文件流。创建一个新 FileDescriptor 对象来表示此文件连接。
+
+            File file = new File(filename); //全路径
+            if (!file.exists()){
+                file.createNewFile();
+            }
+            FileOutputStream fos = new FileOutputStream(file); //设置好保存路径,创建文件输出流。
+            fos.write(buffer);  //写入
+            fos.flush();  //刷新
+            fos.close();  //关闭
+            fos = null;//释放
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultMsg.getError();
+        }
+        rm.addData("avatarImgPath",avatarImgPath);
+        return rm;
+    }
+
+    /**
+     * 生成牙刷
+     * @param req
+     * @param productId  商品id
+     * @param colorId 颜色id
+     * @param toothColorId  定制颜色id
+     * @param positionId 位置id
+     * @param avatarImgPath 头像图片位置
+     * @param toothImg 牙刷
+     * @param toothText 文字
+     * @return
+     */
+    @RequestMapping("/generate")
+    @ResponseBody
+    public ResultMsg generate(HttpServletRequest req,
+                              @RequestParam(value= "productId",defaultValue= "70" ,required=false) Integer productId,
+                              @RequestParam(value= "colorId",defaultValue= "75" ,required=false) Integer colorId,
+                              Integer toothColorId,Integer positionId,String avatarImgPath,String toothImg,String toothText){
+        Member member = WechatUtils.getUserBySession(req);
+        member = memberService.getMemberByUserOpenId(member.getUserOpenid());
+        ResultMsg rm = ResultMsg.getSuccess();
+
+        if(toothColorId == null || positionId == null || avatarImgPath == null || "".equals(avatarImgPath)
+                || toothImg == null || "".equals(toothImg) || toothText == null || "".equals(toothText) ){
+            return ResultMsg.getError();
+        }
+
+        /*生成图片*/
+        String acatar[] = toothImg.split(",");
+        toothImg = acatar[1];
+
+        String dataStaing = new SimpleDateFormat("yyyyMMdd").format(new Date());
+        String path = "common/images/customized/tooth/" + dataStaing + "/";
+
+        // 生成文件
+        String filePath = req.getSession().getServletContext().getRealPath("/") + path ;
+        File imgfile = new File(filePath); //全路径
+        if (!imgfile.exists()){
+            imgfile.mkdirs();
+        }
+        // 生成文件名
+        String files = new SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()) + ".png";
+        // 生成文件
+        String filename = filePath + files;
+        String toothImgPath = path + files;     //返回路径
+        byte[] buffer;//图像转换的目的字节数组
+        BASE64Decoder base64 = new BASE64Decoder();  //新建64位解码器
+        try {
+            buffer = base64.decodeBuffer(toothImg);//64位解码到字节数组中
+            File file = new File(filename); //全路径
+            if (!file.exists()){
+                file.createNewFile();
+            }
+            FileOutputStream fos = new FileOutputStream(file); //设置好保存路径,创建文件输出流。
+            fos.write(buffer);  //写入
+            fos.flush();  //刷新
+            fos.close();  //关闭
+            fos = null;//释放
+        }catch (Exception e){
+            e.printStackTrace();
+            return ResultMsg.getError();
+        }
+
+        CustomizedPosition customizedPosition = customizedPositionService.getCustomizedPositionById(positionId);
+
+        CustomizedTooth customizedTooth = new CustomizedTooth();
+        customizedTooth.setUserOpenId(member.getUserOpenid());
+        customizedTooth.setProductId(productId);
+        customizedTooth.setColorId(colorId);
+        customizedTooth.setToothColorId(toothColorId);
+        customizedTooth.setToothPatternId(customizedPosition.getPatternId());
+        customizedTooth.setToothPositionId(positionId);
+        customizedTooth.setToothAvatarImg(avatarImgPath);
+        customizedTooth.setToothImg(toothImgPath);
+        customizedTooth.setToothText(toothText);
+        customizedTooth.setToothType(1);    //1微信
+        customizedTooth.setToothStatus(1);  //正常
+        Integer flag = customizedToothService.save(customizedTooth);
+        if(flag < 0){
+            return ResultMsg.getError();
+        }
+        return rm.addData("toothId",customizedTooth.getToothId());
+    }
+
+
+    /**
+     * 生成位置集合
+     * @return
+     */
+    @RequestMapping("/gp")
+    @ResponseBody
+    public ResultMsg generatedPosition(HttpServletRequest req){
+        ResultMsg rm = ResultMsg.getSuccess();
+        List<CustomizedPosition> customizedPositionList = new ArrayList<>();
+        List<CustomizedPattern> customizedPatternList = customizedPatternService.getCustomizedPatternList(new CustomizedPattern());
+        for (CustomizedPattern customizedPattern:customizedPatternList) {
+            for (int i=0;i<4;i++){
+                CustomizedPosition customizedPosition = new CustomizedPosition();
+                customizedPosition.setPatternId(customizedPattern.getPatternId());
+                customizedPosition.setPositionType(i+1);  //位置类型 1:正面 2:右侧 3:反面 4:左侧
+                customizedPosition.setPositionPatternX(1000);
+                customizedPosition.setPositionPatternY(1000);
+                customizedPosition.setPositionAvatarX(1000);
+                customizedPosition.setPositionAvatarY(1000);
+                customizedPosition.setPositionTextX(1000);
+                customizedPosition.setPositionTextY(1000);
+                customizedPosition.setPositionStatus(1);
+                customizedPositionList.add(customizedPosition);
+            }
+        }
+        Integer flag = customizedPositionService.saveList(customizedPositionList);
+        return rm;
+    }
+
+
+
+
+
+}

+ 103 - 56
tooth-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java

@@ -8,10 +8,12 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.core.entity.customized.CustomizedTooth;
 import com.iamberry.wechat.core.entity.integral.StayIntegral;
 import com.iamberry.wechat.core.entity.mq.MQMessage;
 import com.iamberry.wechat.core.entity.product.ProductColor;
 import com.iamberry.wechat.core.entity.product.QrcodeGift;
+import com.iamberry.wechat.face.customized.CustomizedToothService;
 import com.iamberry.wechat.face.integral.UseIntegralService;
 import com.iamberry.wechat.face.mq.EfastOrderService;
 import com.iamberry.wechat.face.order.AdminOrderService;
@@ -108,6 +110,9 @@ public class OrderHandler {
 	@Autowired
 	private EfastOrderService efastOrderService;
 
+	@Autowired
+	private CustomizedToothService customizedToothService;
+
 	/**
 	 * 支付前,调用方法
 	 * @param request
@@ -125,39 +130,70 @@ public class OrderHandler {
 		// 用户信息
 		String openId  = WechatUtils.getUserBySession(request).getUserOpenid();
 		Member member = memberService.getMemberByUserOpenId(openId);
-		String cartIds = request.getParameter("cartIds");
-		if (cartIds == null) {
-			msg.setMessage(ResultInfo.cartEmptyError);
-			return msg;
+		String cartIds = request.getParameter("cartIds");	//普通牙刷就是购物车的id,  定制牙刷为定制表(tb_iamberry_customized_tooth)的id
+		String isCustomize = request.getParameter("isCustomize");	// 1:普通牙刷购买  2:定制牙刷购买
+		if(isCustomize == null || "".equals(isCustomize)){	//默认为普通牙刷
+			isCustomize = "1";
 		}
-		cartIds.trim();
-		// split 购物车ID
-		String [] cartList = cartIds.split("-");
-		if (cartList == null || cartList.length <= 0) {
+
+		if (cartIds == null || isCustomize==null) {
 			msg.setMessage(ResultInfo.cartEmptyError);
 			return msg;
 		}
-		// 转化 String 类型的购物车ID集合 --> Integer 类型的购物车集合
-		Integer[] cartIntList = new Integer[cartList.length];
-		for (int i = 0; i < cartList.length; i++) {
-			String string = cartList[i];
-			try {
-				cartIntList[i] = Integer.parseInt(string);
-			} catch (Exception e) {
-				msg.setMessage(e.getMessage());
+		cartIds = cartIds.trim();
+		/*获取购物项--start*/
+		List<CartDto> cartDtos = new ArrayList<>();
+		if("1".equals(isCustomize)){
+			// split 购物车ID
+			String [] cartList = cartIds.split("-");
+			if (cartList == null || cartList.length <= 0) {
+				msg.setMessage(ResultInfo.cartEmptyError);
 				return msg;
 			}
-		}
-		if (cartIntList.length <= 0) {
-			msg.setMessage(ResultInfo.cartEmptyError);
-			return msg;
-		}
-		// 根据购物车ID,查询数据库中对应的产品信息(ID、产品状态)
-		List<CartDto> cartDtos = cartService.selectCartItemByListId(cartIntList);
-		if (cartDtos == null || cartDtos.size() <= 0) {
+			// 转化 String 类型的购物车ID集合 --> Integer 类型的购物车集合
+			Integer[] cartIntList = new Integer[cartList.length];
+			for (int i = 0; i < cartList.length; i++) {
+				String string = cartList[i];
+				try {
+					cartIntList[i] = Integer.parseInt(string);
+				} catch (Exception e) {
+					msg.setMessage(e.getMessage());
+					return msg;
+				}
+			}
+			if (cartIntList.length <= 0) {
+				msg.setMessage(ResultInfo.cartEmptyError);
+				return msg;
+			}
+			// 根据购物车ID,查询数据库中对应的产品信息(ID、产品状态)
+			cartDtos = cartService.selectCartItemByListId(cartIntList);
+			if (cartDtos == null || cartDtos.size() <= 0) {
+				msg.setMessage(ResultInfo.cartEmptyError);
+				return msg;
+			}
+		}else if("2".equals(isCustomize)){
+			Integer id = Integer.valueOf(cartIds);
+			CustomizedTooth customizedTooth = customizedToothService.getCustomizedToothById(id);
+			CartDto cartDto = new CartDto();
+			cartDto.setCartOpenId(member.getUserOpenid());
+			cartDto.setCartProductId(customizedTooth.getProductId());
+			cartDto.setCartColorId(customizedTooth.getColorId());
+			cartDto.setCartNum(1);
+			ProductColor productColor = productColorService.selectProductColorById(customizedTooth.getColorId());
+			if(productColor == null ){
+				msg.setMessage("获取信息失败");
+				return msg;
+			}
+			cartDto.setProductStatus(productColor.getColorStatus());
+			cartDto.setProductType(productColor.getColorProductType());
+			cartDto.setProductPrice(productColor.getColorPrice());
+			cartDto.setProductDiscount(productColor.getColorDiscount());
+			cartDtos.add(cartDto);
+		}else{
 			msg.setMessage(ResultInfo.cartEmptyError);
 			return msg;
 		}
+		/*获取购物项--end*/
 
 		// 判断当前提交的购物车ID,有多少产品在售
 		int total = 0; // 支付金额
@@ -227,18 +263,6 @@ public class OrderHandler {
 				if(toothbrushTotal <  couponItemDto.getCouponToothbrushEnough()){
 					flag = false;
 				}
-
-//				Date couponUseEndDate = couponItemDto.getCouponUseEndDate();
-//				Calendar nowTime = Calendar.getInstance();
-//				nowTime.setTime(couponUseEndDate);
-//				nowTime.set(Calendar.HOUR_OF_DAY, 23);
-//				nowTime.set(Calendar.MINUTE, 59);
-//				nowTime.set(Calendar.SECOND, 59);
-//				couponUseEndDate = nowTime.getTime();
-//				/*控制是否过期*/
-//				if((couponUseEndDate.getTime() < new Date().getTime())  ){
-//					flag = false;
-//				}
 			}else{
 				flag = false;
 			}
@@ -248,9 +272,9 @@ public class OrderHandler {
 		}
 		/*插入优惠券*/
 		dto.setCouponItems(list);
-
 		dto.setCartId(cartIds);// 购物车ID
 		dto.setPayTotal(total); // 支付金额,单位为分
+		dto.setIsCustomize(isCustomize);//判断是否为定制牙刷
 		dto.setCartItems(tempCarts); // 订单项
 		dto.setSuccess(true); // 请求成功
 		dto.setMeonyProportion(0);
@@ -359,26 +383,49 @@ public class OrderHandler {
 			msg.setMessage("未选择商品,请重新选择商品并结算!");
 			return msg;
 		}
+		if(temp.getOrderUserRemark() != null){
+			if (temp.getOrderUserRemark().length() > 100) {
+				msg.setMessage("备注只能输入100个字符");
+				return msg;
+			}
+		}
 
-//		if (temp.getOrderUserRemark() != null && !temp.getOrderUserRemark().isEmpty()) {
-//			Pattern pattern = Pattern.compile("^[\u4e00-\u9fa5_a-zA-Z0-9]+$");
-//			if (!pattern.matcher(temp.getOrderUserRemark()).find()) {
-//				msg.setMessage(ResultInfo.paramFormatError);
-//				return msg;
-//			}
-//			if (!(temp.getOrderUserRemark().length() >= 1 && temp.getOrderUserRemark().length() <= 100)) {
-//				msg.setMessage(ResultInfo.paramFormatError);
-//				return msg;
-//			}
-//		}
-		Integer [] cartId = null;
-		try {
-			cartId = checkCartIdListString(temp.getCartIdStr());
-		} catch (Exception e) { // 一旦发生异常,表示错误
-			msg.setMessage(ResultInfo.paramFormatError);
+		List<CartDto> cartDtos = new ArrayList<>();
+		if("1".equals(temp.getIsCustomize())){	//  1:普通牙刷购买  2:定制牙刷购买
+			Integer [] cartId = null;
+			try {
+				cartId = checkCartIdListString(temp.getCartIdStr());
+			} catch (Exception e) { // 一旦发生异常,表示错误
+				msg.setMessage(ResultInfo.paramFormatError);
+				return msg;
+			}
+			cartDtos = cartService.selectCartItemByListId(cartId);
+		}else if("2".equals(temp.getIsCustomize())){
+			Integer id = Integer.valueOf(temp.getCartIdStr());
+			CustomizedTooth customizedTooth = customizedToothService.getCustomizedToothById(id);
+			CartDto cartDto = new CartDto();
+			cartDto.setCartId(Integer.valueOf(temp.getCartIdStr()));
+			cartDto.setCartOpenId(member.getUserOpenid());
+			cartDto.setCartProductId(customizedTooth.getProductId());
+			cartDto.setCartColorId(customizedTooth.getColorId());
+			cartDto.setCartNum(1);
+			ProductColor productColor = productColorService.selectProductColorById(customizedTooth.getColorId());
+			if(productColor == null ){
+				msg.setMessage("获取信息失败");
+				return msg;
+			}
+			cartDto.setProductStatus(productColor.getColorStatus());
+			cartDto.setProductType(productColor.getColorProductType());
+			cartDto.setProductPrice(productColor.getColorPrice());
+			cartDto.setProductDiscount(productColor.getColorDiscount());
+			cartDto.setProductName(productColor.getColorProductName());
+			cartDto.setProductIntroduceImg(productColor.getColorImg());
+			cartDtos.add(cartDto);
+		}else{
+			msg.setMessage("error");
 			return msg;
 		}
-		List<CartDto> cartDtos = cartService.selectCartItemByListId(cartId);
+
 		if (cartDtos == null || cartDtos.size() <= 0) {// 根据购物车ID,查询数据库中对应的产品信息(ID、产品状态)
 			msg.setMessage(ResultInfo.cartEmptyError);
 			return msg;
@@ -407,7 +454,7 @@ public class OrderHandler {
 			if (cartDto.getProductStatus() != null && cartDto.getProductStatus().intValue() == 1) {
 				cartIds.add(cartDto.getCartId());
 				Integer subTotal = cartDto.getCartNum() * cartDto.getProductPrice(); // 小计
-				total += subTotal;
+ 				total += subTotal;
 				OrderItem item = new OrderItem();
 				item.setItemNum(cartDto.getCartNum());
 				item.setItemProductDiscount(cartDto.getProductPrice());
@@ -552,7 +599,7 @@ public class OrderHandler {
 		// 保存
 		boolean flag = false;
 		try {
-			flag = cartService.addOrderAndSaveOrderItem(order, list, cartIds);
+			flag = cartService.addOrderAndSaveOrderItem(order, list, cartIds, temp.getIsCustomize());
 			//System.out.println("====插入订单列表信息===="+flag);
 			//修改优惠券状态为临时状态
 			if(hasCoupon){

+ 15 - 1
tooth-wechat-web/src/main/resources/iamberry-wechat-service-mybatis.xml

@@ -256,9 +256,16 @@
 		<typeAlias type="com.iamberry.wechat.core.entity.integral.IntegralProductGrade" alias="IntegralProductGrade"/>
 		<typeAlias type="com.iamberry.wechat.core.entity.integral.IntegralProductPicture" alias="IntegralProductPicture"/>
 
-
 		<typeAlias type="com.iamberry.wechat.core.entity.product.ProductRelatedRstProduce" alias="ProductRelatedRstProduce"/>
 
+		<!--牙刷定制-->
+		<typeAlias type="com.iamberry.wechat.core.entity.customized.CustomizedColor" alias="CustomizedColor"/>
+		<typeAlias type="com.iamberry.wechat.core.entity.customized.CustomizedPattern" alias="CustomizedPattern"/>
+		<typeAlias type="com.iamberry.wechat.core.entity.customized.CustomizedPosition" alias="CustomizedPosition"/>
+		<typeAlias type="com.iamberry.wechat.core.entity.customized.OrderCustomized" alias="OrderCustomized"/>
+		<typeAlias type="com.iamberry.wechat.core.entity.customized.CustomizedTooth" alias="CustomizedTooth"/>
+		<typeAlias type="com.iamberry.wechat.core.entity.customized.CustomizedExternalUrl" alias="CustomizedExternalUrl"/>
+
 		<package name="com.iamberry.wechat.core.entity.rent"/>
 	</typeAliases>
 	<!-- PageHelper -->
@@ -369,6 +376,13 @@
 		<mapper resource="com/iamberry/wechat/service/mapper/integralProductMapper.xml"/>
 		<mapper resource="com/iamberry/wechat/service/mapper/integralProductPictureMapper.xml"/>
 
+		<!--牙刷定制-->
+		<mapper resource="com/iamberry/wechat/service/mapper/customizedColorMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/customizedPatternMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/customizedPositionMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/orderCustomizedMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/customizedToothMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/customizedExternalUrlMapper.xml"/>
 
 	</mappers>
 </configuration>

+ 281 - 0
tooth-wechat-web/src/main/webapp/WEB-INF/views/admin/customized/list_order.jsp

@@ -0,0 +1,281 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+         pageEncoding="UTF-8"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<!DOCTYPE HTML>
+<html>
+<head>
+    <meta charset="utf-8">
+    <meta name="renderer" content="webkit|ie-comp|ie-stand">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
+    <meta http-equiv="Cache-Control" content="no-siteapp" />
+    <LINK rel="Bookmark" href="/favicon.ico">
+    <LINK rel="Shortcut Icon" href="/favicon.ico" />
+    <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.min.css" rel="stylesheet" type="text/css" />
+    <link href="${pageContext.request.contextPath }/common/admin/css/H-ui.admin.css" rel="stylesheet" type="text/css" />
+    <link href="${pageContext.request.contextPath }/common/admin/skin/default/skin.css" rel="stylesheet" type="text/css" id="skin" />
+    <link href="${pageContext.request.contextPath }/common/admin/lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
+    <link href="${pageContext.request.contextPath }/common/admin/css/style.css" rel="stylesheet" type="text/css" />
+
+    <!--[if IE 6]>
+    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
+    <script>DD_belatedPNG.fix('*');</script>
+    <![endif]-->
+    <title>定制牙刷订单管理列表</title>
+</head>
+<body>
+<nav class="breadcrumb">
+    <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
+    定制牙刷订单管理 <span class="c-gray en">&gt;</span> 定制牙刷订单管理列表 <a
+        class="btn btn-success radius r mr-20"
+        style="line-height: 1.6em; margin-top: 3px"
+        href="javascript:location.replace(location.href);" title="刷新"><i
+        class="Hui-iconfont">&#xe68f;</i></a>
+</nav>
+<div class="pd-20">
+    <form action="${pageContext.request.contextPath }/admin/receive/listReceive" method="post" style="text-align: center;margin-bottom: 10px;">
+
+        <input name="salesOrderId" id="salesOrderId" value="${salesOrderId }" placeholder="订单编号" style="width: 150px" class="input-text" type="text">
+        <input name="salesAddressTel" id="salesAddressTel" value="${salesAddressTel }" placeholder="手机号码" style="width: 150px" class="input-text" type="text">
+        <input name="salesPostNum" id="receivePostNum" value="${salesPostNum }" placeholder="物流编号" style="width: 150px" class="input-text" type="text">
+
+        <span class="select-box" style="width: 150px">
+            <select id="receiveStatus" name="receiveStatus" class="select">
+                <option value="" >订单状态</option>
+                <option value="1" ${salesStatus==1?'selected':''}>待付款</option>
+                <option value="2" ${salesStatus==2?'selected':''}>已付款(待发货)</option>
+                <option value="3" ${salesStatus==3?'selected':''}>已发货</option>
+            </select>
+        </span>
+
+        <button name="" id="submitBtn" class="btn btn-success" type="submit">
+            <i class="Hui-iconfont"></i> 搜索
+        </button>
+    </form>
+    <form id="goodsform" >
+        <table class="table table-border table-bordered table-bg">
+            <thead>
+            <tr>
+                <th scope="col" colspan="13">定制牙刷订单管理列表</th>
+            </tr>
+            <tr class="text-c">
+                <th width="150">订单号</th>
+                <th width="150">订单状态</th>
+                <th width="150">姓名</th>
+                <th width="150">电话</th>
+                <th width="150">用户备注</th>
+                <th width="150">物流公司</th>
+                <th width="150">物流单号</th>
+                <th width="80">牙刷图片</th>
+                <th width="100">类型</th>
+                <th width="180">状态</th>
+                <th width="180">创建时间</th>
+                <th width="100">操作</th>
+            </tr>
+            </thead>
+            <tbody>
+            <c:if test="${! (empty page.dataList) }">
+                <c:forEach items="${page.dataList }" var="infolist">
+                <tr class="text-c">
+
+                    <td>${infolist.salesOrderId }</td>
+
+                   <td>
+                        <c:choose>
+                            <c:when test="${infolist.orderInfo.salesStatus ==0 }">取消订单</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==1 }">待支付</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==2 }">已支付、待发货</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==3 }">退款申请中</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==4 }">已退款</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==5 }">已发货</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==6 }">申请退货中</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==7 }">退货中</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==8 }">订单退货,订单关闭</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==9 }">换货中</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==10 }">换货完成</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==11 }">申请换货中</c:when>
+                            <c:when test="${infolist.orderInfo.salesStatus ==12 }">订单完成</c:when>
+                        </c:choose>
+                    </td>
+
+                   <td>${infolist.orderInfo.salesAddressName }</td>
+                   <td>${infolist.orderInfo.salesAddressTel}</td>
+                   <td>${infolist.orderInfo.salesUserRemark}</td>
+                   <td>
+                        <c:choose>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'sto' }">申通快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'yto' }">圆通快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == '02' }">上门送货</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'sf' }">顺丰快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'ems' }">邮政EMS</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'zto' }">中通快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'zjs' }">宅急送</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'yunda' }">韵达快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'cces' }">cces快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'pick' }">上门提货</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'htky' }">汇通快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'ttkdex' }">天天快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'stars' }">星晨急便</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == 'jd' }">京东快递</c:when>
+                            <c:when test="${infolist.orderInfo.salesPostFirm == '01' }">其他</c:when>
+                        </c:choose>
+                    </td>
+                    <td width="150"><a href="#" onclick="openLogistics('物流信息','/tooth/view/view_logistics.html?billCode=${infolist.orderInfo.salesPostNum}&billName=${order.salesPostFirm  }',375,500);">${order.salesPostNum }</a></td>
+
+                    <td><img width="100" height="100" src="${pageContext.request.contextPath }/${infolist.customizedImg }" /></td>
+
+                    <td>
+                        <c:choose>
+                            <c:when test="${infolist.customizedType == 1 }">微信</c:when>
+                            <c:when test="${infolist.customizedType == 2 }">天猫</c:when>
+                        </c:choose>
+                    </td>
+                    <td>
+                        <c:choose>
+                            <c:when test="${infolist.customizedStatus == 1 }">正常</c:when>
+                            <c:when test="${infolist.customizedStatus == 2 }">未上传订单</c:when>
+                        </c:choose>
+                    </td>
+
+                    <td><fmt:formatDate value="${infolist.customizedCreateTime}" pattern="yyyy-MM-dd"/></td>
+
+                    <td>
+                    <%-- <c:if test="${infolist.receiveStatus == 2 }">
+                           <a href="javascript:void(0)" lang="发货" title="发货" alt="发货" onclick="ship(${infolist.receiveId })">
+                                <i class="Hui-iconfont">&#xe627;</i>
+                            </a>
+                        </c:if>
+                        <c:if test="${infolist.receiveStatus == 1 || infolist.receiveStatus == 3 }">
+                          -
+                        </c:if>--%>
+                    </td>
+                 </c:forEach>
+             </c:if>
+                <c:if test="${empty page.dataList}">
+                    <tr align="center"><td colspan="13" style="text-align: center;">未查询到该类数据!</td></tr>
+                </c:if>
+            </tbody>
+        </table>
+        <div align="right" class="mt-10 mb-10 mr-10">
+            <%@include file="/common/other/paper/pager.jsp"%>
+        </div>
+    </form>
+</div>
+
+
+<div class="layui-layer layui-anim layui-layer-iframe" id="layui-layer4" times="4" showtime="0" contype="string" style="display:none;z-index: 2; width: 400px; height: 260px; position: absolute; top: 100px; left: 379px;">
+    <form action="#" method="post" class="form form-horizontal" id="form-admin-add">
+        <input type="hidden" id="shopReceiveId" name="shopReceiveId" value="">
+        <div class="layui-layer-title" id="sendOrderDivTitle" style="cursor: move;" move="ok">确认发货</div>
+        <br>
+        <div class="row cl">
+            <label class="form-label col-3"><span class="c-red"></span>&nbsp;&nbsp;物流编号:</label>
+            <div class="formControls col-5">
+                <input type="text" id="order-post-num-id" class="input-text" value="" placeholder="请输入物流编号" name="postNum" datatype="*2-16" nullmsg="用户名不能为空">
+            </div>
+            <div class="col-4"> </div>
+        </div>
+        <br>
+        <div class="row cl">
+            <label class="form-label col-3"><span class="c-red"></span>&nbsp;&nbsp;物流公司:</label>
+            <div class="formControls col-5"> <span class="select-box" style="width:150px;">
+				<select class="select" name="postFirm" size="1" id="postFirm">
+					<option value="">请选择物流公司</option>
+					<option value="sto">申通快递</option>
+					<option value="yto">圆通快递</option>
+					<option value="sf">顺丰快递</option>
+					<option value="ems">邮政EMS</option>
+					<option value="zto">中通快递</option>
+					<option value="zjs">宅急送</option>
+					<option value="yunda">韵达快递</option>
+					<option value="cces">cces快递</option>
+					<option value="pick">上门提货</option>
+					<option value="htky">汇通快递</option>
+					<option value="ttkdex">天天快递</option>
+					<option value="stars">星晨急便</option>
+					<option value="jd">京东快递</option>
+					<option value="01">其他</option>
+					<option value="02">上门送货</option>
+				</select>
+				</span> </div>
+        </div>
+        <br>
+        <div class="col-9 col-offset-3">
+            <input class="btn btn-danger" onclick="return shipPost(this)" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
+        </div>
+    </form>
+
+    <span class="layui-layer-setwin">
+			<a class="layui-layer-ico layui-layer-close layui-layer-close1" onclick="exitWindowsDiv(this)" href="javascript:;"></a>
+    </span>
+</div>
+
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/jquery/1.9.1/jquery.min.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/lib/layer/1.9.3/layer.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/H-ui.admin.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/js/tips.js"></script>
+<script type="text/javascript" src="${pageContext.request.contextPath }/common/admin/My97DatePicker/WdatePicker.js"></script>
+<script type="text/javascript">
+    /* $(document).ready(function(){
+     $('#beginDate').datepicker();//时间控件
+     $('#endDate').datepicker();
+     }); */
+    /**
+     * 发货
+     * @param receiveId
+     */
+    function  ship(receiveId){
+        $("#layui-layer4").show();
+        $("#shopReceiveId").val(receiveId);
+    }
+
+    /**
+     * 发货
+     * @param receiveId
+     */
+    function  shipPost(node){
+        var url = "${pageContext.request.contextPath }" + '/admin/receive/ship';
+        var receiveId = $('#shopReceiveId').val();
+        var receivePostNum = $('#order-post-num-id').val();
+        var receivePostFirm = $('#postFirm').val();
+        if (receivePostNum == null || receivePostNum == '') {
+            layer.msg("请填写物流编号!",{icon: 5,time:2000});
+            return false;
+        }
+        if (receivePostFirm == null || receivePostFirm == '') {
+            layer.msg("请选择物流公司!",{icon: 5,time:2000});
+            return false;
+        }
+        $.ajax({
+            type: "POST",
+            url: url,
+            traditional : true,
+            data: {
+                receiveId : receiveId,
+                receivePostFirm : receivePostFirm,
+                receivePostNum : receivePostNum
+            },
+            dataType: "json",
+            success: function(data){
+                if(data.status){
+                    exitWindowsDiv(node);
+                    layer.msg("发货成功!",{icon: 5,time:2000});
+                    return false;
+                }else{
+                    layer.msg("发货失败,请重试!",{icon: 5,time:2000});
+                    return false;
+                }
+            }
+        });
+    }
+
+    // 关闭窗口
+    function exitWindowsDiv(_this) {
+        $(_this).parent().parent().hide();
+    }
+</script>
+</body>
+</html>