瀏覽代碼

修改了爱贝源项目信息

liuzhiwei 7 年之前
父節點
當前提交
92a05082ee
共有 55 個文件被更改,包括 1798 次插入1455 次删除
  1. 15 0
      iamberry-common-core/pom.xml
  2. 1 1
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/AdminUtils.java
  3. 8 8
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/WechatUtils.java
  4. 59 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/phone/PhoneCode.java
  5. 76 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductChildType.java
  6. 142 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductColor.java
  7. 95 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductFittings.java
  8. 84 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/SalesUserGift.java
  9. 67 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/search/SearchInfo.java
  10. 130 0
      iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/warrantyCard/WarrantyCard.java
  11. 96 128
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/WeixinUtil.java
  12. 0 14
      iamberry-common-interface/pom.xml
  13. 0 5
      iamberry-common-tool/pom.xml
  14. 58 0
      iamberry-common-tool/src/main/java/com/iamberry/jwt/AES.java
  15. 63 0
      iamberry-common-tool/src/main/java/com/iamberry/jwt/TokenUtil.java
  16. 13 0
      iamberry-common-tool/src/main/java/com/iamberry/jwt/UserNotLoginException.java
  17. 116 0
      iamberry-common-tool/src/main/java/com/iamberry/jwt/WebJsonTokenUtil.java
  18. 45 5
      iamberry-common-tool/src/main/java/com/iamberry/wechat/tools/NameUtils.java
  19. 4 4
      iamberry-common-tool/src/main/java/com/iamberry/zk/ZookeeperFactory.java
  20. 1 1
      iamberry-common-web/pom.xml
  21. 15 0
      iamberry-wechat-interface/pom.xml
  22. 26 36
      iamberry-wechat-service/pom.xml
  23. 3 0
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/admin/AdminLoginServiceImpl.java
  24. 2 5
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/qrcode/QrcodeServiceImpl.java
  25. 2 2
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/qrcode/TemporaryQrcodeServiceImpl.java
  26. 0 22
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/start/InitApp.java
  27. 2 2
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/wechat/ConfigServiceImpl.java
  28. 2 4
      iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/wechat/WeChatServiceImpl.java
  29. 0 47
      iamberry-wechat-service/src/main/resources/ResultInfo.properties
  30. 0 85
      iamberry-wechat-service/src/main/resources/iamberry-wechat-service-provider.xml
  31. 0 64
      iamberry-wechat-service/src/main/resources/iamberry-wechat-service-spring.xml
  32. 0 35
      iamberry-wechat-service/src/main/resources/log4j.properties
  33. 0 10
      iamberry-wechat-service/src/main/resources/wx_public_no.properties
  34. 28 1
      iamberry-wechat-web/pom.xml
  35. 1 3
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminLoginHandler.java
  36. 4 6
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/SystemHandler.java
  37. 2 8
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/CartHandlers.java
  38. 2 4
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/home/HomeHandler.java
  39. 1 10
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java
  40. 1 4
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/RequestWechatPayHandler.java
  41. 3 9
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/WechatBackHandler.java
  42. 239 0
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/warranty/WarrantyCardHandler.java
  43. 3 9
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/wechat/menu/MenuInfoHandler.java
  44. 2 5
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/wechat/template/Template.java
  45. 8 11
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/utils/SendMessageUtil.java
  46. 0 524
      iamberry-wechat-web/src/main/java/com/iamberry/wechat/utils/WeixinUtil.java
  47. 2 2
      iamberry-wechat-web/src/main/resources/ResultInfo.properties
  48. 39 21
      iamberry-wechat-service/src/main/resources/iamberry-wechat-service-datasource.xml
  49. 74 6
      iamberry-wechat-service/src/main/resources/iamberry-wechat-service-mybatis.xml
  50. 0 331
      iamberry-wechat-web/src/main/resources/iamberry-wechat-web-consumer.xml
  51. 17 11
      iamberry-wechat-web/src/main/resources/iamberry-wechat-web-ioc.xml
  52. 25 8
      iamberry-wechat-web/src/main/resources/iamberry-wechat-web-springmvc.xml
  53. 193 0
      iamberry-wechat-web/src/main/resources/platform.properties
  54. 4 4
      iamberry-wechat-web/src/main/resources/wx_public_no.properties
  55. 25 0
      iamberry-wechat-web/src/main/webapp/WEB-INF/web.xml

+ 15 - 0
iamberry-common-core/pom.xml

@@ -34,4 +34,19 @@
 			</plugin>
 		</plugins>
 	</build>
+
+	<!-- 配置 -->
+	<profiles>
+		<profile>
+			<id>sonar</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<properties>
+				<sonar.host.url>http://sonar.iamberry.com/</sonar.host.url>
+				<sonar.login>admin</sonar.login>
+				<sonar.password>iamberry123</sonar.password>
+			</properties>
+		</profile>
+	</profiles>
 </project>

+ 1 - 1
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/AdminUtils.java

@@ -76,7 +76,7 @@ public class AdminUtils {
 	 * @param name
 	 * @param value
 	 */
-	public void createCookie(HttpServletResponse response, String name, String value) {
+	public static void createCookie(HttpServletResponse response, String name, String value) {
 		Cookie cookie = new Cookie(name,value);
 		cookie.setMaxAge(604800);
 //		cookie.setDomain(".acoolrat.com"); // 一旦正式的环境,使用此

+ 8 - 8
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/WechatUtils.java

@@ -16,30 +16,30 @@ import com.iamberry.wechat.core.entity.member.Member;
 import com.iamberry.wechat.tools.NameUtils;
 
 /**
- * description : 微信端用户工具类 
+ * description : 微信端用户工具类
  * @author 何秀刚
  * create date:2016年2月25日
  */
 @Component
 public class WechatUtils {
-	
+
 	@Autowired
 	private AdminUtils adminUtils;
 	public void setAdminUtils(AdminUtils adminUtils) {
 		this.adminUtils = adminUtils;
 	}
-	
+
 	@Autowired
 	private MD5 md5;
 	public void setMd5(MD5 md5) {
 		this.md5 = md5;
 	}
-	
+
 	/**
 	 * 将用户信息保存到session中,并做安全设置
 	 * @param object
 	 * @param request
-	 * @throws Exception 
+	 * @throws Exception
 	 */
 	public void saveUserToSession(Member object, HttpServletRequest request, HttpServletResponse response) throws Exception {
 		// 一旦登陆成功,就改变sessionID的值,防止发生session fixation
@@ -49,7 +49,7 @@ public class WechatUtils {
 		// 保存cookie,多项验证
 		adminUtils.createCookie(response, "wechat_login_openid", md5.encrypt(object.getUserId()+""));
 	}
-	
+
 	/**
 	 * 获取当前用户
 	 * @param request
@@ -73,7 +73,7 @@ public class WechatUtils {
 		}
 		return null;
 	}
-	
+
 	/**
 	 * 微信授权获取openid
 	 * @param tokenId
@@ -100,7 +100,7 @@ public class WechatUtils {
 		}
 		return null;
 	}
-	
+
 	public static String getOpenIdFunction() {
 		String redirect_url = NameUtils.WECHAT_BACK_URL;
 		String url = null;

+ 59 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/phone/PhoneCode.java

@@ -0,0 +1,59 @@
+package com.iamberry.wechat.core.entity.phone;
+
+import java.util.Date;
+
+/**
+ * 手机号码
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class PhoneCode implements java.io.Serializable {
+
+    private static final long serialVersionUID = -6134185769178346067L;
+
+    private Integer codeId;         //id
+    private String codeTel;         //手机号码
+    private String codePhoneCode;   //验证码
+    private Date codeSendTime;      //发送时间
+    private Date codeCreateTime;    //创建时间
+
+    public Integer getCodeId() {
+        return codeId;
+    }
+
+    public void setCodeId(Integer codeId) {
+        this.codeId = codeId;
+    }
+
+    public String getCodeTel() {
+        return codeTel;
+    }
+
+    public void setCodeTel(String codeTel) {
+        this.codeTel = codeTel;
+    }
+
+    public String getCodePhoneCode() {
+        return codePhoneCode;
+    }
+
+    public void setCodePhoneCode(String codePhoneCode) {
+        this.codePhoneCode = codePhoneCode;
+    }
+
+    public Date getCodeSendTime() {
+        return codeSendTime;
+    }
+
+    public void setCodeSendTime(Date codeSendTime) {
+        this.codeSendTime = codeSendTime;
+    }
+
+    public Date getCodeCreateTime() {
+        return codeCreateTime;
+    }
+
+    public void setCodeCreateTime(Date codeCreateTime) {
+        this.codeCreateTime = codeCreateTime;
+    }
+}
+

+ 76 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductChildType.java

@@ -0,0 +1,76 @@
+package com.iamberry.wechat.core.entity.product;
+
+import java.util.Date;
+
+/**
+ * 产品子类型表
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class ProductChildType implements java.io.Serializable {
+
+    private static final long serialVersionUID = 118586515844190687L;
+
+    private Integer childTypeId;        //id
+    private Integer typeId;             //产品类型
+    private String childTypeName;       //名字
+    private String childTypeDetilas;    //简介
+    private Date childTypeCreateDate;   //创建时间
+    private Date childTypeUpdateDate;   //更新时间
+    private Integer childTypeState;     //状态    1:使用中,2:停用,3:删除
+
+    public Integer getChildTypeId() {
+        return childTypeId;
+    }
+
+    public void setChildTypeId(Integer childTypeId) {
+        this.childTypeId = childTypeId;
+    }
+
+    public Integer getTypeId() {
+        return typeId;
+    }
+
+    public void setTypeId(Integer typeId) {
+        this.typeId = typeId;
+    }
+
+    public String getChildTypeName() {
+        return childTypeName;
+    }
+
+    public void setChildTypeName(String childTypeName) {
+        this.childTypeName = childTypeName;
+    }
+
+    public String getChildTypeDetilas() {
+        return childTypeDetilas;
+    }
+
+    public void setChildTypeDetilas(String childTypeDetilas) {
+        this.childTypeDetilas = childTypeDetilas;
+    }
+
+    public Date getChildTypeCreateDate() {
+        return childTypeCreateDate;
+    }
+
+    public void setChildTypeCreateDate(Date childTypeCreateDate) {
+        this.childTypeCreateDate = childTypeCreateDate;
+    }
+
+    public Date getChildTypeUpdateDate() {
+        return childTypeUpdateDate;
+    }
+
+    public void setChildTypeUpdateDate(Date childTypeUpdateDate) {
+        this.childTypeUpdateDate = childTypeUpdateDate;
+    }
+
+    public Integer getChildTypeState() {
+        return childTypeState;
+    }
+
+    public void setChildTypeState(Integer childTypeState) {
+        this.childTypeState = childTypeState;
+    }
+}

+ 142 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductColor.java

@@ -0,0 +1,142 @@
+package com.iamberry.wechat.core.entity.product;
+
+import com.iamberry.wechat.core.entity.PageBean;
+
+import java.util.Date;
+
+/**
+ * 产品颜色表
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class ProductColor implements java.io.Serializable {
+
+    private static final long serialVersionUID = -3182942653682960921L;
+
+    private Integer colorId;			//id
+    private Integer colorProductId;		//所属产品id
+    private String colorProductName;	//所属产品名称
+    private String colorProductPic;		//产品介绍图
+    private Integer colorProductType;	//产品类型
+    private Integer productChildType;   //产品子类型
+    private String colorName;			//颜色名称
+    private Integer colorDiscount;		//产品折扣价
+    private Integer colorStatus;        //状态    1:使用中,2:禁用
+    private Integer colorPrice;			//产品市场价
+    private String color69Code;			//产品69码
+    private Date colorCretaeTime;		//创建时间
+    private Date colorUpdateTime;	//修改时间
+
+    private PageBean page = new PageBean();		//分页
+
+    public Integer getColorStatus() {
+        return colorStatus;
+    }
+
+    public void setColorStatus(Integer colorStatus) {
+        this.colorStatus = colorStatus;
+    }
+
+    public Integer getProductChildType() {
+        return productChildType;
+    }
+
+    public void setProductChildType(Integer productChildType) {
+        this.productChildType = productChildType;
+    }
+
+    public Integer getColorId() {
+        return colorId;
+    }
+
+    public void setColorId(Integer colorId) {
+        this.colorId = colorId;
+    }
+
+    public Integer getColorProductId() {
+        return colorProductId;
+    }
+
+    public void setColorProductId(Integer colorProductId) {
+        this.colorProductId = colorProductId;
+    }
+
+    public String getColorProductName() {
+        return colorProductName;
+    }
+
+    public void setColorProductName(String colorProductName) {
+        this.colorProductName = colorProductName;
+    }
+
+    public String getColorProductPic() {
+        return colorProductPic;
+    }
+
+    public void setColorProductPic(String colorProductPic) {
+        this.colorProductPic = colorProductPic;
+    }
+
+    public Integer getColorProductType() {
+        return colorProductType;
+    }
+
+    public void setColorProductType(Integer colorProductType) {
+        this.colorProductType = colorProductType;
+    }
+
+    public String getColorName() {
+        return colorName;
+    }
+
+    public void setColorName(String colorName) {
+        this.colorName = colorName;
+    }
+
+    public Integer getColorDiscount() {
+        return colorDiscount;
+    }
+
+    public void setColorDiscount(Integer colorDiscount) {
+        this.colorDiscount = colorDiscount;
+    }
+
+    public Integer getColorPrice() {
+        return colorPrice;
+    }
+
+    public void setColorPrice(Integer colorPrice) {
+        this.colorPrice = colorPrice;
+    }
+
+    public String getColor69Code() {
+        return color69Code;
+    }
+
+    public void setColor69Code(String color69Code) {
+        this.color69Code = color69Code;
+    }
+
+    public Date getColorCretaeTime() {
+        return colorCretaeTime;
+    }
+
+    public void setColorCretaeTime(Date colorCretaeTime) {
+        this.colorCretaeTime = colorCretaeTime;
+    }
+
+    public Date getColorUpdateTime() {
+        return colorUpdateTime;
+    }
+
+    public void setColorUpdateTime(Date colorUpdateTime) {
+        this.colorUpdateTime = colorUpdateTime;
+    }
+
+    public PageBean getPage() {
+        return page;
+    }
+
+    public void setPage(PageBean page) {
+        this.page = page;
+    }
+}

+ 95 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/ProductFittings.java

@@ -0,0 +1,95 @@
+package com.iamberry.wechat.core.entity.product;
+
+import java.util.Date;
+
+/**
+ * 产品配件表
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class ProductFittings implements java.io.Serializable {
+
+    private static final long serialVersionUID = -5278198298126095215L;
+
+    private Integer fittingsId;         //id
+    private Integer productId;          //产品id
+    private String fittingsName;        //配件名称
+    private Integer fittingsPrice;      //配件市场价
+    private Integer fittingsDiscount;   //配件折扣价
+    private String fittingsBar;         //产品条码(SKU)
+    private String fittingsPic;         //介绍图
+    private Integer fittingsStatus;     //状态    1:使用中 2:未使用
+
+    private Date fittingsCretaeTime;    //创建时间
+
+    public Integer getFittingsId() {
+        return fittingsId;
+    }
+
+    public void setFittingsId(Integer fittingsId) {
+        this.fittingsId = fittingsId;
+    }
+
+    public Integer getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Integer productId) {
+        this.productId = productId;
+    }
+
+    public String getFittingsName() {
+        return fittingsName;
+    }
+
+    public void setFittingsName(String fittingsName) {
+        this.fittingsName = fittingsName;
+    }
+
+    public Integer getFittingsPrice() {
+        return fittingsPrice;
+    }
+
+    public void setFittingsPrice(Integer fittingsPrice) {
+        this.fittingsPrice = fittingsPrice;
+    }
+
+    public Integer getFittingsDiscount() {
+        return fittingsDiscount;
+    }
+
+    public void setFittingsDiscount(Integer fittingsDiscount) {
+        this.fittingsDiscount = fittingsDiscount;
+    }
+
+    public String getFittingsBar() {
+        return fittingsBar;
+    }
+
+    public void setFittingsBar(String fittingsBar) {
+        this.fittingsBar = fittingsBar;
+    }
+
+    public String getFittingsPic() {
+        return fittingsPic;
+    }
+
+    public void setFittingsPic(String fittingsPic) {
+        this.fittingsPic = fittingsPic;
+    }
+
+    public Integer getFittingsStatus() {
+        return fittingsStatus;
+    }
+
+    public void setFittingsStatus(Integer fittingsStatus) {
+        this.fittingsStatus = fittingsStatus;
+    }
+
+    public Date getFittingsCretaeTime() {
+        return fittingsCretaeTime;
+    }
+
+    public void setFittingsCretaeTime(Date fittingsCretaeTime) {
+        this.fittingsCretaeTime = fittingsCretaeTime;
+    }
+}

+ 84 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/product/SalesUserGift.java

@@ -0,0 +1,84 @@
+package com.iamberry.wechat.core.entity.product;
+
+import java.util.Date;
+
+/**
+ * 赠送礼品表
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class SalesUserGift implements java.io.Serializable {
+
+    private static final long serialVersionUID = 5090826454779421819L;
+    private Integer userId;             //id
+    private Integer userProductId;      //产品ID
+    private Integer userColorId;        //商品颜色id
+    private Integer userGiftId;         //赠送产品id
+    private Integer userGiftColor;      //产品颜色id
+    private Integer userGiftCount;      //赠送产品数量
+    private Integer userStatus;         //状态    1:使用,2:停用
+    private Date userCreateTime;        //创建时间
+
+    public Integer getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Integer userId) {
+        this.userId = userId;
+    }
+
+    public Integer getUserProductId() {
+        return userProductId;
+    }
+
+    public void setUserProductId(Integer userProductId) {
+        this.userProductId = userProductId;
+    }
+
+    public Integer getUserColorId() {
+        return userColorId;
+    }
+
+    public void setUserColorId(Integer userColorId) {
+        this.userColorId = userColorId;
+    }
+
+    public Integer getUserGiftId() {
+        return userGiftId;
+    }
+
+    public void setUserGiftId(Integer userGiftId) {
+        this.userGiftId = userGiftId;
+    }
+
+    public Integer getUserGiftColor() {
+        return userGiftColor;
+    }
+
+    public void setUserGiftColor(Integer userGiftColor) {
+        this.userGiftColor = userGiftColor;
+    }
+
+    public Integer getUserGiftCount() {
+        return userGiftCount;
+    }
+
+    public void setUserGiftCount(Integer userGiftCount) {
+        this.userGiftCount = userGiftCount;
+    }
+
+    public Integer getUserStatus() {
+        return userStatus;
+    }
+
+    public void setUserStatus(Integer userStatus) {
+        this.userStatus = userStatus;
+    }
+
+    public Date getUserCreateTime() {
+        return userCreateTime;
+    }
+
+    public void setUserCreateTime(Date userCreateTime) {
+        this.userCreateTime = userCreateTime;
+    }
+}

+ 67 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/search/SearchInfo.java

@@ -0,0 +1,67 @@
+package com.iamberry.wechat.core.entity.search;
+
+import java.util.Date;
+
+/**
+ * 历史搜索记录表
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class SearchInfo implements java.io.Serializable {
+
+    private static final long serialVersionUID = -7269098573441145124L;
+
+    private Integer searchId;           //id
+    private String userOpenId;          //openId
+    private String searchDetails;       //搜索内容
+    private Integer searchNum;          //搜索次数
+    private Date searchCreateDate;      //创建时间
+    private Integer searchTypeState;    //状态 1:使用中,2:停用
+
+    public Integer getSearchId() {
+        return searchId;
+    }
+
+    public void setSearchId(Integer searchId) {
+        this.searchId = searchId;
+    }
+
+    public String getUserOpenId() {
+        return userOpenId;
+    }
+
+    public void setUserOpenId(String userOpenId) {
+        this.userOpenId = userOpenId;
+    }
+
+    public String getSearchDetails() {
+        return searchDetails;
+    }
+
+    public void setSearchDetails(String searchDetails) {
+        this.searchDetails = searchDetails;
+    }
+
+    public Integer getSearchNum() {
+        return searchNum;
+    }
+
+    public void setSearchNum(Integer searchNum) {
+        this.searchNum = searchNum;
+    }
+
+    public Date getSearchCreateDate() {
+        return searchCreateDate;
+    }
+
+    public void setSearchCreateDate(Date searchCreateDate) {
+        this.searchCreateDate = searchCreateDate;
+    }
+
+    public Integer getSearchTypeState() {
+        return searchTypeState;
+    }
+
+    public void setSearchTypeState(Integer searchTypeState) {
+        this.searchTypeState = searchTypeState;
+    }
+}

+ 130 - 0
iamberry-common-core/src/main/java/com/iamberry/wechat/core/entity/warrantyCard/WarrantyCard.java

@@ -0,0 +1,130 @@
+package com.iamberry.wechat.core.entity.warrantyCard;
+
+import java.util.Date;
+
+/**
+ * 质保卡表
+ * Created by liuzhiwei on 2017/12/14.
+ */
+public class WarrantyCard implements java.io.Serializable {
+
+    private static final long serialVersionUID = 4505271888069944956L;
+
+    private Integer cardId;             //id
+    private String userOpenId;          //openId
+    private Integer productChildType;   //产品子类型id
+    private String cardNo;              //编号
+    private String cardProductName;     //产品名称
+    private Integer cardWatero;         //水质范围
+    private Date cardSalesTime;         //购买时间
+    private Date cardEndTime;           //保修截止时间
+    private Date cardCreateDate;        //创建时间
+    private String cardProvince;        //省
+    private String cardCity;            //市
+    private String cardDistrict;        //区
+    private Integer cardTypeState;      //状态 1:使用中,2:停用
+
+    public Integer getCardId() {
+        return cardId;
+    }
+
+    public void setCardId(Integer cardId) {
+        this.cardId = cardId;
+    }
+
+    public String getUserOpenId() {
+        return userOpenId;
+    }
+
+    public void setUserOpenId(String userOpenId) {
+        this.userOpenId = userOpenId;
+    }
+
+    public Integer getProductChildType() {
+        return productChildType;
+    }
+
+    public void setProductChildType(Integer productChildType) {
+        this.productChildType = productChildType;
+    }
+
+    public String getCardNo() {
+        return cardNo;
+    }
+
+    public void setCardNo(String cardNo) {
+        this.cardNo = cardNo;
+    }
+
+    public String getCardProductName() {
+        return cardProductName;
+    }
+
+    public void setCardProductName(String cardProductName) {
+        this.cardProductName = cardProductName;
+    }
+
+    public Integer getCardWatero() {
+        return cardWatero;
+    }
+
+    public void setCardWatero(Integer cardWatero) {
+        this.cardWatero = cardWatero;
+    }
+
+    public Date getCardSalesTime() {
+        return cardSalesTime;
+    }
+
+    public void setCardSalesTime(Date cardSalesTime) {
+        this.cardSalesTime = cardSalesTime;
+    }
+
+    public Date getCardEndTime() {
+        return cardEndTime;
+    }
+
+    public void setCardEndTime(Date cardEndTime) {
+        this.cardEndTime = cardEndTime;
+    }
+
+    public Date getCardCreateDate() {
+        return cardCreateDate;
+    }
+
+    public void setCardCreateDate(Date cardCreateDate) {
+        this.cardCreateDate = cardCreateDate;
+    }
+
+    public String getCardProvince() {
+        return cardProvince;
+    }
+
+    public void setCardProvince(String cardProvince) {
+        this.cardProvince = cardProvince;
+    }
+
+    public String getCardCity() {
+        return cardCity;
+    }
+
+    public void setCardCity(String cardCity) {
+        this.cardCity = cardCity;
+    }
+
+    public String getCardDistrict() {
+        return cardDistrict;
+    }
+
+    public void setCardDistrict(String cardDistrict) {
+        this.cardDistrict = cardDistrict;
+    }
+
+    public Integer getCardTypeState() {
+        return cardTypeState;
+    }
+
+    public void setCardTypeState(Integer cardTypeState) {
+        this.cardTypeState = cardTypeState;
+    }
+}

+ 96 - 128
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/WeixinUtil.java

@@ -1,4 +1,4 @@
-package com.iamberry.wechat.service;
+package com.iamberry.wechat.tools;
 
 import java.io.BufferedReader;
 import java.io.InputStream;
@@ -7,8 +7,6 @@ import java.io.OutputStream;
 import java.net.ConnectException;
 import java.net.URL;
 import java.net.URLEncoder;
-import java.security.KeyManagementException;
-import java.security.NoSuchAlgorithmException;
 import java.util.Date;
 import java.util.logging.Logger;
 
@@ -19,90 +17,58 @@ import javax.net.ssl.TrustManager;
 
 import net.sf.json.JSONObject;
 
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
+import org.slf4j.LoggerFactory;
 
-import com.iamberry.app.tool.log.RatFWLogger;
+import com.iamberry.cache.LocalCache;
 import com.iamberry.wechat.core.entity.wx.AccessToken;
 import com.iamberry.wechat.core.entity.wx.ITTempLate;
 import com.iamberry.wechat.core.entity.wx.Menu;
 import com.iamberry.wechat.core.entity.wx.QRCJson;
 import com.iamberry.wechat.core.entity.wx.Ticket;
 import com.iamberry.wechat.core.entity.wx.Token;
-import com.iamberry.wechat.service.mapper.TokenMapper;
-import com.iamberry.wechat.tools.MyX509TrustManager;
-import com.iamberry.wechat.tools.NameUtils;
 
 /**
  * 公众平台通用接口工具类
- * 
+ *
  * @author fzh
- * 
+ *
  */
-@Component
 public class WeixinUtil {
-	
-	
-	@Autowired
-	private RatFWLogger logger;
-	
-	@Autowired
-	private TokenMapper tokenMapper;
+
+
+	// 日志
+	private  static org.slf4j.Logger logger = LoggerFactory.getLogger(WeixinUtil.class);
+
+	// 发送短信模板的URL
 	private static String sendTemplate = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
-	public void setTokenMapper(TokenMapper tokenMapper) {
-		this.tokenMapper = tokenMapper;
-	}
-	
+
+	// token缓存
+	private static LocalCache<String, Token> cache = new LocalCache<>(2);
+
 	/**
 	 * 网页授权获取access_token
-	 * 
+	 *
 	 * @param code
 	 * @return
 	 */
-	public JSONObject getParamByOauth2(String code) {
+	public static JSONObject getParamByOauth2(String code) {
 		JSONObject jsonObject = null;
 		try {
 			// 得到access_token和openid
-			jsonObject = httpRequest(NameUtils.oauth2_getToken_url.replaceAll("CODE", code).replaceAll("APPID", NameUtils.appId).replaceAll("SECRET", NameUtils.appSecret), "GET", null);
+			jsonObject = httpRequest(NameUtils.oauth2_getToken_url.replaceAll("CODE", code).replaceAll("APPID", NameUtils.getConfig("appId")).replaceAll("SECRET", NameUtils.getConfig("appSecret")), "GET", null);
 			if (null != jsonObject) {
 				return jsonObject;
 			}
 		} catch (Exception e) {
 			// 获取token失败
-			logger.error(this, "获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
+			logger.error("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
 		}
 		return null;
 	}
-	private SSLContext context = null;
-	
-	/**
-	 * 获取SSLContext实例
-	 * @return SSLContext实例
-	 * @throws KeyManagementException
-	 * @throws NoSuchAlgorithmException
-	 * @author 献
-	 * @Time   2016年11月17日
-	 */
-	public SSLContext getSSLContext() throws KeyManagementException, NoSuchAlgorithmException {
-		if (context != null) {
-			return context;
-		}
-		synchronized (context) {
-			if (context != null) {
-				return context;
-			}
-			// 创建SSLContext,不向对方提供安全证书,并且校验对方安全的的实现为空
-			TrustManager[] tm = { new MyX509TrustManager() };
-			SSLContext sslContext = SSLContext.getInstance("SSL");
-			sslContext.init(null, tm, new java.security.SecureRandom());
-			context = sslContext;
-			return context;
-		}
-	}
 
 	/**
 	 * 发起https请求并获取结果
-	 * 
+	 *
 	 * @param requestUrl
 	 *            请求地址
 	 * @param requestMethod
@@ -114,32 +80,31 @@ public class WeixinUtil {
 	 *         sun.net.www.protocol.http.HttpURLConnection cannot be cast to
 	 *         javax.net.ssl.HttpsURLConnection
 	 */
-	public JSONObject httpRequest(String requestUrl,
-			String requestMethod, String outputStr) {
+	public static JSONObject httpRequest(String requestUrl,
+										 String requestMethod, String outputStr) {
 		JSONObject jsonObject = null;
-		StringBuilder buffer = new StringBuilder();
+		StringBuffer buffer = new StringBuffer();
 		try {
-			// 获取SSLContext实例
-			SSLContext sslContext = getSSLContext();
+			// 创建SSLContext对象,并使用我们指定的信任管理器初始化
+			TrustManager[] tm = { new MyX509TrustManager() };
+			SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
+			sslContext.init(null, tm, new java.security.SecureRandom());
 			// 从上述SSLContext对象中得到SSLSocketFactory对象
 			SSLSocketFactory ssf = sslContext.getSocketFactory();
 
-			// 请求工具初始化
 			URL url = new URL(requestUrl);
-			HttpsURLConnection httpUrlConn = (HttpsURLConnection) url.openConnection();
+			HttpsURLConnection httpUrlConn = (HttpsURLConnection) url
+					.openConnection();
 			httpUrlConn.setSSLSocketFactory(ssf);
 
 			httpUrlConn.setDoOutput(true);
 			httpUrlConn.setDoInput(true);
 			httpUrlConn.setUseCaches(false);
-			httpUrlConn.setConnectTimeout(15000);
 
 			// 设置请求方式(GET/POST)
 			httpUrlConn.setRequestMethod(requestMethod);
-			if ("GET".equalsIgnoreCase(requestMethod)) {
-				//  如果是GET请求,直接发起,因为参数已经存在于URL中
+			if ("GET".equalsIgnoreCase(requestMethod))
 				httpUrlConn.connect();
-			}
 
 			// 当有数据需要提交时
 			if (null != outputStr) {
@@ -176,15 +141,18 @@ public class WeixinUtil {
 
 	/**
 	 * 获取access_token
-	 * @param appid 		凭证
-	 * @param appsecret 	密钥
+	 *
+	 * @param appid
+	 *            凭证
+	 * @param appsecret
+	 *            密钥
 	 * @return
 	 */
-	public AccessToken getAccessToken(String appid, String appsecret) {
-		
+	public static AccessToken getAccessToken(String appid, String appsecret) {
+
 		// 根据public No查询access_token
-		Token token = tokenMapper.selectOne(NameUtils.pubNo);
-		
+		Token token = cache.get(NameUtils.getConfig("pubNo"));
+
 		AccessToken accessToken = null;
 		//判断数据库中是否存在token
 		if (token != null) {
@@ -196,7 +164,7 @@ public class WeixinUtil {
 				accessToken.setToken(token.getToken());
 				return accessToken;
 			} else {
-				String requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.appId).replace("APPSECRET", NameUtils.appSecret);
+				String requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.getConfig("appId")).replace("APPSECRET", NameUtils.getConfig("appSecret"));
 				JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
 				// 如果请求成功
 				if (null != jsonObject) {
@@ -206,18 +174,17 @@ public class WeixinUtil {
 						accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
 						token.setToken(accessToken.getToken());
 						token.setEndDate(new Date(date.getTime() + 6500000));
-						token.setAppid(NameUtils.pubNo);
+						token.setAppid(NameUtils.getConfig("pubNo"));
 						try {
-							tokenMapper.updateToken(token);
+							cache.put(NameUtils.getConfig("pubNo"), token);
 						} catch (Exception e) {
-							logger.error(this,"更新token失败:" + e.getMessage());
+							logger.error(e.getMessage());
 						}
 						return accessToken;
 					} catch (Exception e) {
-						e.printStackTrace();
 						accessToken = null;
 						// 获取token失败
-						Logger.getAnonymousLogger().info("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
+						logger.error("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
 					}
 				}
 			}
@@ -230,22 +197,23 @@ public class WeixinUtil {
 					accessToken = new AccessToken();
 					accessToken.setToken(jsonObject.getString("access_token"));
 					accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
-					
+
 					token = new Token();
 					token.setToken(accessToken.getToken());
 					token.setEndDate(new Date(new Date().getTime() + 6500000));
-					token.setAppid(NameUtils.pubNo);
-					
+					token.setAppid(NameUtils.getConfig("pubNo"));
+
 					try {
-						tokenMapper.updateToken(token);
+						cache.put(NameUtils.getConfig("pubNo"), token);
 					} catch (Exception e) {
 						// 更新失败
+						logger.error(e.getMessage());
 					}
 					return accessToken;
 				} catch (Exception e) {
 					accessToken = null;
 					// 获取token失败
-					Logger.getAnonymousLogger().info("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
+					logger.error("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
 				}
 			}
 		}
@@ -254,11 +222,11 @@ public class WeixinUtil {
 
 	/**
 	 * 获取jsapi_ticket(jsapi_ticket的有效期为7200秒)
-	 * 
+	 *
 	 * @param token
 	 * @return
 	 */
-	public Ticket getTicket(String token) {
+	public static Ticket getTicket(String token) {
 		Ticket ticket = null;
 		String requestUrl = NameUtils.jsapi_ticket_url.replace("ACCESS_TOKEN", token);
 		JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
@@ -273,23 +241,23 @@ public class WeixinUtil {
 			ticket.setExpiresIn(jsonObject.getInt("expires_in"));
 		} catch (Exception e) {
 			// 获取token失败
-			Logger.getAnonymousLogger().info("获取ticket失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-			
+			logger.error("获取ticket失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
+
 			// 判断错误信息是否为 access_token 失效的问题,只有access失效,我们才重新获取,否则每次获取可能导致access_token资源耗尽
-			if (jsonObject.getInt("errcode") != 40001) 
+			if (jsonObject.getInt("errcode") != 40001)
 				return null;
-			
+
 			// 强制刷新access_token,存在多线程安全隐患!
-			requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.appId).replace("APPSECRET", NameUtils.appSecret);
+			requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.getConfig("appId")).replace("APPSECRET", NameUtils.getConfig("appSecret"));
 			JSONObject accessTokenJsonObject = httpRequest(requestUrl, "GET", null);
-			
+
 			// 报错access_token信息,不管报错与否
 			Token wechatToken = new Token();
 			wechatToken.setEndDate(new Date(new Date().getTime() + 6500000));
-			wechatToken.setAppid(NameUtils.pubNo);
+			wechatToken.setAppid(NameUtils.getConfig("pubNo"));
 			wechatToken.setToken(accessTokenJsonObject.getString("access_token"));
-			tokenMapper.updateToken(wechatToken);
-			
+			cache.put(NameUtils.getConfig("pubNo"), wechatToken);
+
 			// 重新获取一次
 			requestUrl = NameUtils.jsapi_ticket_url.replace("ACCESS_TOKEN", wechatToken.getToken());
 			jsonObject = httpRequest(requestUrl, "GET", null);
@@ -297,20 +265,20 @@ public class WeixinUtil {
 			ticket.setTicket(jsonObject.getString("ticket"));
 			ticket.setExpiresIn(jsonObject.getInt("expires_in"));
 		}
-	
+
 		return ticket;
 	}
 
 	/**
 	 * 创建菜单
-	 * 
+	 *
 	 * @param menu
 	 *            菜单实例
 	 * @param accessToken
 	 *            有效的access_token
 	 * @return 0表示成功,其他值表示失败
 	 */
-	public int createMenu(Menu menu, String accessToken) {
+	public static int createMenu(Menu menu, String accessToken) {
 		int result = 0;
 		// 拼装创建菜单的url
 		String url = NameUtils.menu_create_url.replace("ACCESS_TOKEN", accessToken);
@@ -329,11 +297,11 @@ public class WeixinUtil {
 
 	/**
 	 * 创建菜单
-	 * 
+	 *
 	 * @param jsonMenu
 	 * @param accessToken
 	 */
-	public int createMenu(String jsonMenu, String accessToken) {
+	public static int createMenu(String jsonMenu, String accessToken) {
 		int result = 0;
 		// 拼装创建菜单的url
 		String url = NameUtils.menu_create_url.replace("ACCESS_TOKEN", accessToken);
@@ -350,14 +318,14 @@ public class WeixinUtil {
 
 	/**
 	 * 创建二维码
-	 * 
-	 * @param qrCode
+	 *
+	 * @param json
 	 * @return
 	 */
-	public QRCJson createQrcode(String json) {
+	public static QRCJson createQrcode(String json) {
 		QRCJson qrcJson = new QRCJson();
 		try {
-			AccessToken at = this.getAccessToken(NameUtils.appId, NameUtils.appSecret);
+			AccessToken at = getAccessToken(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"));
 			if (at != null) {
 				String token = at.getToken();
 				JSONObject jsonObject = httpRequest(NameUtils.get_token_url.replaceAll("TOKEN", token), "POST", json);
@@ -378,18 +346,18 @@ public class WeixinUtil {
 
 	/**
 	 * 生成网页授权链接
-	 * 
+	 *
 	 * @param type
 	 * @param redirectURI
 	 */
-	public String getOauth2Url(String type, String redirectURI) {
+	public static String getOauth2Url(String type, String redirectURI) {
 		String url = "";
 		try {
 			redirectURI = URLEncoder.encode(redirectURI, "utf-8");
 			if ("snsapi_base".equals(type)) {
-				url = NameUtils.oauth2_url.replace("SCOPE", "snsapi_base").replace("APPID", NameUtils.appId).replace("REDIRECT_URI", redirectURI);
+				url = NameUtils.oauth2_url.replace("SCOPE", "snsapi_base").replace("APPID", NameUtils.getConfig("appId")).replace("REDIRECT_URI", redirectURI);
 			} else {
-				url = NameUtils.oauth2_url.replace("SCOPE", "snsapi_userinfo").replace("APPID", NameUtils.appId).replace("REDIRECT_URI", redirectURI);
+				url = NameUtils.oauth2_url.replace("SCOPE", "snsapi_userinfo").replace("APPID", NameUtils.getConfig("appId")).replace("REDIRECT_URI", redirectURI);
 			}
 			return url;
 		} catch (Exception e) {
@@ -400,17 +368,17 @@ public class WeixinUtil {
 
 	/**
 	 * (网页授权)拉取用户信息
-	 * 
+	 *
 	 * @param code
 	 * @param type
 	 * @return
 	 */
-	public JSONObject getUserInfoByOauth2(String code, String type) {
+	public static JSONObject getUserInfoByOauth2(String code, String type) {
 		JSONObject jsonObject = null;
 		String openid = "", access_token = "";
 		try {
 			// 得到access_token和openid
-			jsonObject = httpRequest(NameUtils.oauth2_getToken_url.replaceAll("CODE", code).replaceAll("APPID", NameUtils.appId).replaceAll("SECRET", NameUtils.appSecret), "GET", null);
+			jsonObject = httpRequest(NameUtils.oauth2_getToken_url.replaceAll("CODE", code).replaceAll("APPID", NameUtils.getConfig("appId")).replaceAll("SECRET", NameUtils.getConfig("appSecret")), "GET", null);
 			if (null != jsonObject) {
 				openid = jsonObject.getString("openid");
 				access_token = jsonObject.getString("access_token");
@@ -426,19 +394,19 @@ public class WeixinUtil {
 		} catch (Exception e) {
 			access_token = null;
 			// 获取token失败
-System.out.println("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
+			logger.error("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
 		}
 		return null;
 	}
 
 	/**
 	 * 拉取用户信息
-	 * 
+	 *
 	 * @param code
 	 * @param appid
 	 * @param secret
 	 */
-	public String[] getOpenId(String code, String appid, String secret) {
+	public  static String[] getOpenId(String code, String appid, String secret) {
 		String[] strs = new String[2];
 		String url = "", openid = "", access_token = "";
 		Logger.getAnonymousLogger().info("code = " + code);
@@ -463,12 +431,12 @@ System.out.println("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt(
 
 	/**
 	 * 根据openid拉取用户信息
-	 * 
+	 *
 	 * @param openid
 	 * @return
 	 */
-	public JSONObject getUserInfo(String openid) {
-		AccessToken token = this.getAccessToken(NameUtils.appId, NameUtils.appSecret);
+	public  static JSONObject getUserInfo(String openid) {
+		AccessToken token = getAccessToken(NameUtils.getConfig("appId"), NameUtils.getConfig("appSecret"));
 		if (token == null) {
 			// 此处如果出错,只能说明程序逻辑改变,存在多线程安全隐患
 			return null;
@@ -485,24 +453,24 @@ System.out.println("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt(
 		try {
 			jsonObject.getString("sex");
 		} catch (Exception e) {
-			
+
 			// 记录日志
-			logger.error(this, "getUserInfo method throw exception:" + e.getMessage() + "[" + jsonObject + "]");
-			
+			logger.error("getUserInfo method throw exception:" + e.getMessage() + "[" + jsonObject + "]");
+
 			// 判断错误信息是否为 access_token 失效的问题,只有access失效,我们才重新获取,否则每次获取可能导致access_token资源耗尽
-			if (jsonObject.getInt("errcode") != 40001) 
+			if (jsonObject.getInt("errcode") != 40001)
 				return jsonObject;
-			
+
 			// 强制刷新access_token,存在多线程安全隐患!
-			String requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.appId).replace("APPSECRET", NameUtils.appSecret);
+			String requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.getConfig("appId")).replace("APPSECRET", NameUtils.getConfig("appSecret"));
 			JSONObject accessTokenJsonObject = httpRequest(requestUrl, "GET", null);
-			
+
 			// 报错access_token信息,不管报错与否
 			Token wechatToken = new Token();
 			wechatToken.setEndDate(new Date(new Date().getTime() + 6500000));
-			wechatToken.setAppid(NameUtils.pubNo);
+			wechatToken.setAppid(NameUtils.getConfig("pubNo"));
 			wechatToken.setToken(accessTokenJsonObject.getString("access_token"));
-			tokenMapper.updateToken(wechatToken);
+			cache.put(NameUtils.getConfig("pubNo"), wechatToken);
 			// 再次获取用户信息
 			return httpRequest(NameUtils.userinfo_url.replaceAll("ACCESS_TOKEN", wechatToken.getToken()).replaceAll("OPENID", openid), "GET", null);
 		}
@@ -512,11 +480,11 @@ System.out.println("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt(
 	/**
 	 * 发送模板消息 appId 公众账号的唯一标识 appSecret 公众账号的密钥 openId 用户标识
 	 */
-	public void sendTemplateMessage(String appId, String appSecret,
-			String openId, String template_id, Object data, String redirectUrl) {
+	public static void sendTemplateMessage(String appId, String appSecret,
+										   String openId, String template_id, Object data, String redirectUrl) {
 
 		// 准备数据
-		AccessToken token = this.getAccessToken(appId, appSecret);
+		AccessToken token = getAccessToken(appId, appSecret);
 		String access_token = token.getToken();
 		String url = sendTemplate  + access_token;
 
@@ -525,7 +493,7 @@ System.out.println("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt(
 		temp.setTouser(openId);
 		temp.setTemplate_id(template_id);
 		temp.setUrl(redirectUrl);
-		temp.setData(data);
+		temp.setData(JSONObject.fromObject(data));
 
 		// format
 		String jsonString = JSONObject.fromObject(temp).toString();

+ 0 - 14
iamberry-common-interface/pom.xml

@@ -30,18 +30,4 @@
 			<version>1.0.0</version>
 		</dependency>
 	</dependencies>
-	<build>
-		<finalName>iamberry-common-interface</finalName>
-		<plugins>
-			<plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-compiler-plugin</artifactId>
-				<version>3.3</version>
-				<configuration>
-					<source>1.7</source>
-					<target>1.7</target>
-				</configuration>
-			</plugin>
-		</plugins>
-	</build>
 </project>

+ 0 - 5
iamberry-common-tool/pom.xml

@@ -15,11 +15,6 @@
 	<!-- 依赖 -->
 	<dependencies>
 		<dependency>
-			<groupId>com.iamberry</groupId>
-			<artifactId>iamberry-common-config</artifactId>
-			<version>1.0.0</version>
-		</dependency>
-		<dependency>
 		    <groupId>org.elasticsearch</groupId>
 		    <artifactId>elasticsearch</artifactId>
 		    <version>2.4.1</version>

+ 58 - 0
iamberry-common-tool/src/main/java/com/iamberry/jwt/AES.java

@@ -0,0 +1,58 @@
+package com.iamberry.jwt;
+
+import org.apache.commons.codec.binary.Base64;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.IvParameterSpec;
+import javax.crypto.spec.SecretKeySpec;
+
+public class AES {
+
+	private static final String key = "7dm9b2n79dzugnzu";
+	private static final String initVector = "jp5xi3ycqtzbqldv";
+
+	public static String encrypt(String value) {
+		try {
+			IvParameterSpec iv = new IvParameterSpec(initVector.getBytes("UTF-8"));
+			SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
+
+			Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
+			cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
+
+			byte[] encrypted = cipher.doFinal(value.getBytes());
+
+			return Base64.encodeBase64String(encrypted);
+		} catch (Exception ex) {
+			ex.printStackTrace();
+		}
+
+		return null;
+	}
+
+	public static String decrypt(String encrypted) {
+		try {
+			IvParameterSpec iv = new IvParameterSpec(initVector.getBytes("UTF-8"));
+			SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes("UTF-8"), "AES");
+
+			Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING");
+			cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
+
+			byte[] original = cipher.doFinal(Base64.decodeBase64(encrypted));
+
+			return new String(original);
+		} catch (Exception ex) {
+			ex.printStackTrace();
+		}
+
+		return null;
+	}
+
+	// public static void main(String[] args) {
+	// String key = "Bar12345Bar12345"; // 128 bit key
+	// String initVector = "RandomInitVector"; // 16 bytes IV
+	// System.out.println(System.currentTimeMillis());
+	// System.out.println(decrypt(key, initVector, encrypt(key, initVector,
+	// "Hello World")));
+	// System.out.println(System.currentTimeMillis());
+	// }
+}

+ 63 - 0
iamberry-common-tool/src/main/java/com/iamberry/jwt/TokenUtil.java

@@ -0,0 +1,63 @@
+package com.iamberry.jwt;
+
+import java.security.SecureRandom;
+import java.util.UUID;
+
+/**
+ * @website www.ratfw.com
+ * @author 献
+ * @tel 18271840547
+ * @date 2016年8月30日
+ * @explain 生成安全随机的token工具类
+ */
+public class TokenUtil {
+	/**
+	 * 创建一个安全的随机数组byte[]
+	 * 
+	 * @return
+	 */
+	private static byte[] createRandomByte() {
+		try {
+			SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
+			byte[] bytes = new byte[1024 / 8];
+			random.nextBytes(bytes);
+			int count = 10;
+			byte[] seed = random.generateSeed(count);
+			random = SecureRandom.getInstance("SHA1PRNG");
+			random.setSeed(seed);
+			SecureRandom random2 = SecureRandom.getInstance("SHA1PRNG");
+			random2.setSeed(seed);
+			return seed;
+		} catch (Exception e) {
+			return UUID.randomUUID().toString().getBytes();
+		}
+	}
+
+	/**
+	 * byte[] 转 字符串
+	 * 
+	 * @param b
+	 * @return
+	 */
+	private static String byte2hex(byte[] b) {
+		String hs = "";
+		String stmp = "";
+		for (int n = 0; n < b.length; n++) {
+			stmp = (Integer.toHexString(b[n] & 0XFF));
+			if (stmp.length() == 1)
+				hs = hs + "0" + stmp;
+			else
+				hs = hs + stmp;
+		}
+		return hs.toUpperCase();
+	}
+
+	/**
+	 * 获取一个安全的token
+	 * 
+	 * @return
+	 */
+	public static String getToken() {
+		return byte2hex(createRandomByte());
+	}
+}

+ 13 - 0
iamberry-common-tool/src/main/java/com/iamberry/jwt/UserNotLoginException.java

@@ -0,0 +1,13 @@
+package com.iamberry.jwt;
+/**
+ * 当用户没有登录时,抛出异常
+ * @company	深圳爱贝源科技有限公司
+ * @website www.iamberry.com
+ * @author 	献
+ * @tel		18271840547
+ * @date	2016年11月24日
+ * @explain
+ */
+public class UserNotLoginException extends RuntimeException {
+	private static final long serialVersionUID = 1L;
+}

+ 116 - 0
iamberry-common-tool/src/main/java/com/iamberry/jwt/WebJsonTokenUtil.java

@@ -0,0 +1,116 @@
+package com.iamberry.jwt;
+
+import com.auth0.jwt.JWTSigner;
+import com.auth0.jwt.JWTVerifier;
+import com.auth0.jwt.JWTVerifyException;
+import org.apache.commons.lang3.StringUtils;
+
+import java.io.IOException;
+import java.security.InvalidKeyException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SignatureException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @company	深圳爱贝源科技有限公司
+ * @website www.iamberry.com
+ * @author 	献
+ * @tel		18271840547
+ * @date	2016年11月15日
+ * @explain	使用JWT完成用户Token生成
+ */
+public class WebJsonTokenUtil {
+	
+	/**
+	 * 根据secretToken加密用户id、openid,生成json web token
+	 * @param userid		用户id
+	 * @param openId		openid
+	 * @param secretToken	token,限制为8位
+	 * @return				
+	 * @author 献
+	 * @Time   2016年11月24日
+	 */
+	public static String getToken(Integer userid, String openId, String secretToken) {
+		JWTSigner signer = new JWTSigner(secretToken);
+		// 当前时间
+		long iat = System.currentTimeMillis() / 1000L;
+		// 过期时间,设置为三天以后,需要重新获取token
+		long exp = iat + 259200L;
+		// 创建对象
+		HashMap<String, Object> claims = new HashMap<String, Object>();
+		claims.put("exp", exp);
+		claims.put("iat", iat);
+		claims.put("userid", AES.encrypt(userid.toString()));
+		claims.put("WC_OPENID", openId);
+		StringBuilder jsonToken = new StringBuilder(signer.sign(claims));
+		return jsonToken.toString();
+	}
+	
+	/**
+	 * return:
+	 * 	1:token过期,失效						<br>
+	 * 	2:token正常								<br>
+	 * 		可以通过get("userid")获取userid		<br>
+	 * 		可以通过get("WC_OPENID")获取openid	<br>
+	 * @param userToken
+	 * @return
+	 */
+	public static Map<String, Object> verifier(String userToken, String key) {
+		JWTVerifier verifier = new JWTVerifier(key);
+		Map<String, Object> claims = null;
+		try {
+			// 解析TOKEN
+			claims = verifier.verify(userToken.substring(8));
+		} catch (InvalidKeyException e) {
+			// 无效的键
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", "Key error");
+			return error;
+		} catch (NoSuchAlgorithmException e) {
+			// 没有这样的算法
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", "No Such Algorithm");
+			return error;
+		} catch (IllegalStateException e) {
+			// 非法状态
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", "Illegal State");
+			return error;
+		} catch (SignatureException e) {
+			// 签名有误
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", "Signature State Error");
+			return error;
+		} catch (IOException e) {
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", "IO Exception");
+			return error;
+		} catch (JWTVerifyException e) {
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", e.getMessage());
+			return error;
+		}
+		
+		// 解析userid
+		String temp = AES.decrypt(claims.get("userid").toString());
+		if (StringUtils.isEmpty(temp)) {
+			Map<String, Object> error = new HashMap<String, Object>();
+			error.put("status", 1);
+			error.put("message", "Data has been tampered with");
+			return error;
+		}
+		// 重新定义ID
+		claims.put("userid", temp);
+
+		claims.put("status", 2);
+		claims.put("message", "SUCCESS");
+		return claims;
+	}
+}

+ 45 - 5
iamberry-common-tool/src/main/java/com/iamberry/wechat/tools/NameUtils.java

@@ -1,10 +1,36 @@
 package com.iamberry.wechat.tools;
+
+import com.iamberry.zk.ZookeeperFactory;
+
+import java.io.IOException;
+import java.util.Properties;
+
 /**
  * 本类保存所有常见、常用名称,如登陆用户在session中的名称,验证码在session中的名称
  * 慎重修改!
  * @author 何秀刚
  */
 public class NameUtils {
+
+	private static volatile Properties properties = null;
+
+	public static String getConfig(String keyName) {
+		try {
+			if (properties == null) {
+				synchronized (NameUtils.class) {
+					if (properties == null) {
+						properties = ZookeeperFactory.loadProperties("classpath:platform.properties");
+					}
+				}
+			}
+			return properties.getProperty(keyName);
+		} catch (IOException e) {
+			throw new AttrNotFoundException();
+		}
+	}
+
+	static class AttrNotFoundException extends RuntimeException {private static final long serialVersionUID = 1L;}
+
 	// 验证码session中保存的名称
 	public static final String VERIFYCODE_NAME = "verifyCode";
 	// 会员登陆成功过后session中保存的名称
@@ -124,14 +150,20 @@ public class NameUtils {
     //description : 微信公众号的一些基本信息	 @author 何秀刚 	create date:2016年3月10日
     
 //    /**
-//	 * 测试账号信息:爱贝源科技
-	 
+	/* 测试账号信息:爱贝源科技
 	public final static String pubNo = "gh_63843ac1ca52";// 微信号
 	public final static String appId = "wxd995fb95b97ece1b";// 应用ID
 	public final static String token = "weixin";// token
 	public final static String appSecret = "34922854462fba23cf54ce859349fcf4";// 应用密钥
 	public final static String partner = "1347735301";// 微信支付商户号
-//     */
+     */
+
+	/** 公众号账户信息:水时代 */
+	public final static String pubNo = "gh_c73446c8ce91";// 微信号
+	public final static String appId = "wxc71b789fad06a2d7";// 应用ID
+	public final static String token = "weixin";// token
+	public final static String appSecret = "8a90e3ab0e2db7772f5f64e7ed2f4b98";// 应用密钥
+	public final static String partner = "1321590501";// 微信支付商户号
     
 	/** 公众号账户信息:爱贝源 */
 	/*
@@ -141,14 +173,22 @@ public class NameUtils {
 	public final static String appSecret = "c006d5a6af80b5291265a1364fd17edc";// 应用密钥
 	public final static String partner = "1340351501";// 微信支付商户号
 	*/
+
+	/** 公众号商户信息 */
+	public final static String partnerkey = "cdb9075e7ecad945ba788bc5aedM212B";// 财付通初始密码
+	public final static String charset = "UTF-8"; // 支付编码
+	public final static String KEYSTORE_FILE = "E:/apiclient_cert.p12"; // 支付API安全文件FILE位置,但是现在保存到/resource/apiclient_cert.p12
+	public final static String KEYSTORE_PASSWORD = "1240220902"; // 支付API安全文件密码
+	public final static String ipAddress = "120.25.79.106"; // ip地址
+
 //	
 //	/** 公众号商户信息 */
-//	public final static String partner = "1340351501";// 微信支付商户号
+	/*public final static String partner = "1340351501";// 微信支付商户号
 	public final static String partnerkey = "8a90e3ab0e2db7772f5f64e7edwechat";// 财付通初始密码
 	public final static String charset = "UTF-8"; // 支付编码
 	public final static String KEYSTORE_FILE = "E:/apiclient_cert.p12"; // 支付API安全文件FILE位置,但是现在保存到/resource/apiclient_cert.p12
 	public final static String KEYSTORE_PASSWORD = partner; // 支付API安全文件密码
-	public final static String ipAddress = "120.76.152.52"; // ip地址
+	public final static String ipAddress = "120.76.152.52"; // ip地址*/
 	
 	/** 微信支付回掉url接口 */
 	public final static String ORDER_PAY_BACK_URL = NameUtils.PATH_ROOT + "/iamberry/cart/payBack"; // 销售订单支付成功后回调地址

+ 4 - 4
iamberry-common-tool/src/main/java/com/iamberry/zk/ZookeeperFactory.java

@@ -58,7 +58,7 @@ public final class ZookeeperFactory {
 	 * Class 装载的顺序,静态代码块优先
 	 */
 	static {
-		// 加载
+		/*// 加载
 		propertiesPersister = new DefaultPropertiesPersister();
 		resourceLoader = new PathMatchingResourcePatternResolver();
 		
@@ -67,7 +67,7 @@ public final class ZookeeperFactory {
 		logger.info("zk.start property:" + zkStart);
 		if ("true".equals(zkStart) || zkStart == null) {
 			initZookeeper();
-		}
+		}*/
 	}
 	
 	/**
@@ -137,7 +137,7 @@ public final class ZookeeperFactory {
 	// 编码
 	private static final String DEFAULT_ENCODING = "UTF-8";
 	// Spring-core 获取配置文件的类
-	private static PropertiesPersister propertiesPersister = null;
+	private static PropertiesPersister propertiesPersister = new DefaultPropertiesPersister();
 	// Spring-core 获取资源的类
-	private static ResourceLoader resourceLoader = null;
+	private static ResourceLoader resourceLoader = new PathMatchingResourcePatternResolver();
 }

+ 1 - 1
iamberry-common-web/pom.xml

@@ -14,7 +14,7 @@
 	<artifactId>iamberry-common-web</artifactId>
 	<version>1.0.0</version>
 	<build>
-		<finalName>iamberry-wechat-web</finalName>
+		<finalName>iamberry-common-web</finalName>
 		<plugins>
 			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>

+ 15 - 0
iamberry-wechat-interface/pom.xml

@@ -39,4 +39,19 @@
             </plugin>
         </plugins>
     </build>
+
+    <!-- 配置 -->
+    <profiles>
+        <profile>
+            <id>sonar</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <properties>
+                <sonar.host.url>http://sonar.iamberry.com/</sonar.host.url>
+                <sonar.login>admin</sonar.login>
+                <sonar.password>iamberry123</sonar.password>
+            </properties>
+        </profile>
+    </profiles>
 </project>

+ 26 - 36
iamberry-wechat-service/pom.xml

@@ -21,25 +21,6 @@
 		</dependency>
 		<!-- 公共接口 -->
 		<dependency>
-			<groupId>com.iamberry</groupId>
-			<artifactId>iamberry-common-tool</artifactId>
-			<version>1.0.0</version>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.boot</groupId>
-			<artifactId>spring-boot-starter</artifactId>
-			<exclusions>
-				<exclusion>
-					<artifactId>log4j-over-slf4j</artifactId>
-					<groupId>org.slf4j</groupId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.springframework.boot</groupId>
-					<artifactId>spring-boot-starter-logging</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
 			<groupId>org.quartz-scheduler</groupId>
 			<artifactId>quartz</artifactId>
 			<version>2.2.1</version>
@@ -50,23 +31,6 @@
 		<finalName>iamberry-wechat-service</finalName>
 		<plugins>
 			<plugin>
-				<groupId>org.springframework.boot</groupId>
-				<artifactId>spring-boot-maven-plugin</artifactId>
-				<version>1.4.1.BUILD-SNAPSHOT</version>
-				<executions>
-					<execution>
-						<goals>
-							<goal>repackage</goal>
-						</goals>
-					</execution>
-				</executions>
-				<configuration>
-					<mainClass>com.iamberry.service.start.InitApp</mainClass>
-					<layout>JAR</layout>
-					<addResources>true</addResources>
-				</configuration>
-			</plugin>
-			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-compiler-plugin</artifactId>
 				<version>3.3</version>
@@ -76,5 +40,31 @@
 				</configuration>
 			</plugin>
 		</plugins>
+		<resources>
+			<resource>
+				<directory>src/main/java</directory>
+				<includes>
+					<include>**/*.properties</include>
+					<include>**/*.xml</include>
+				</includes>
+				<filtering>false</filtering>
+			</resource>
+		</resources>
 	</build>
+
+	<!-- 配置 -->
+	<profiles>
+		<profile>
+			<id>sonar</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<properties>
+				<sonar.host.url>http://sonar.iamberry.com/</sonar.host.url>
+				<sonar.login>admin</sonar.login>
+				<sonar.password>iamberry123</sonar.password>
+			</properties>
+		</profile>
+	</profiles>
+
 </project>

+ 3 - 0
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/admin/AdminLoginServiceImpl.java

@@ -35,6 +35,9 @@ public class AdminLoginServiceImpl implements AdminLoginService {
 	
 	public Object selectAdminInfoByNameAndPwd(AdminLoginDTO dto) throws Exception {
 		try {
+			if (dto == null || dto.getAdminLoginPwd() == null) {
+				return null;
+			}
 			dto.setAdminLoginPwd(md5.encrypt(dto.getAdminLoginPwd()));
 			// 权限错误最小化
 			/*AdminChildInfo adminChildInfo = adminLoginDAO.selectAdminChildInfoByNameAndPwd(dto);

+ 2 - 5
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/qrcode/QrcodeServiceImpl.java

@@ -2,11 +2,9 @@ package com.iamberry.wechat.service.qrcode;
 
 import java.util.List;
 import java.util.regex.Matcher;
-
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-
 import com.iamberry.app.tool.log.RatFWLogger;
 import com.iamberry.wechat.core.entity.drp.PlaceInfo;
 import com.iamberry.wechat.core.entity.member.Member;
@@ -17,13 +15,13 @@ import com.iamberry.wechat.core.entity.wx.QRCJson;
 import com.iamberry.wechat.face.home.HomeService;
 import com.iamberry.wechat.face.qrcode.QrcodeService;
 import com.iamberry.wechat.face.wechat.WeChatService;
-import com.iamberry.wechat.service.WeixinUtil;
 import com.iamberry.wechat.service.home.dao.HomeServiceDao;
 import com.iamberry.wechat.service.mapper.PlaceInfoMapper;
 import com.iamberry.wechat.service.qrcode.dao.QrcodeDao;
 import com.iamberry.wechat.service.relationship.Dao.WdRelationDao;
 import com.iamberry.wechat.tools.NameUtils;
 import com.iamberry.wechat.tools.StaticInfo;
+import com.iamberry.wechat.tools.WeixinUtil;
 
 /**
  * @author 何秀刚
@@ -37,8 +35,7 @@ public class QrcodeServiceImpl implements QrcodeService {
 	private RatFWLogger log;
 	
 	private Object lock = new Object(); // 防止多人抢二维码
-	
-	@Autowired
+
 	private WeixinUtil weixinUtil;
 	
 	@Autowired

+ 2 - 2
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/qrcode/TemporaryQrcodeServiceImpl.java

@@ -2,6 +2,7 @@ package com.iamberry.wechat.service.qrcode;
 
 import java.util.Date;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -10,7 +11,6 @@ import com.iamberry.wechat.core.entity.qrcode.QrcodeResult;
 import com.iamberry.wechat.core.entity.qrcode.TemporaryQrcode;
 import com.iamberry.wechat.core.entity.wx.QRCJson;
 import com.iamberry.wechat.face.qrcode.TemporaryQrcodeService;
-import com.iamberry.wechat.service.WeixinUtil;
 import com.iamberry.wechat.service.home.dao.HomeServiceDao;
 import com.iamberry.wechat.service.mapper.TemporaryQrcodeMapper;
 import com.iamberry.wechat.tools.DateTimeUtil;
@@ -25,7 +25,7 @@ import com.iamberry.wechat.tools.NameUtils;
 public class TemporaryQrcodeServiceImpl implements TemporaryQrcodeService {
 	@Autowired
 	private HomeServiceDao homeServiceDao;
-	@Autowired
+
 	private WeixinUtil weixinUtil;
 	@Autowired
 	private TemporaryQrcodeMapper temporaryQrcodeMapper;

+ 0 - 22
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/start/InitApp.java

@@ -1,22 +0,0 @@
-package com.iamberry.wechat.service.start;
-import java.util.concurrent.CountDownLatch;
-
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.ImportResource;
-import org.springframework.context.support.AbstractApplicationContext;
-
-@ImportResource("classpath:iamberry-wechat-service-spring.xml")
-@SpringBootApplication
-public class InitApp {
-    @Bean
-    public CountDownLatch closeLatch() {
-        return new CountDownLatch(1);
-    }
-	public static void main(String[] args) throws Exception {
-		AbstractApplicationContext ctx = (AbstractApplicationContext) new SpringApplicationBuilder().sources(InitApp.class).web(false).run(args);
-		CountDownLatch closeLatch = ctx.getBean(CountDownLatch.class);
-		closeLatch.await();
-	}
-}

+ 2 - 2
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/wechat/ConfigServiceImpl.java

@@ -3,6 +3,7 @@ package com.iamberry.wechat.service.wechat;
 import java.sql.SQLException;
 import java.util.Date;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import net.sf.json.JSONObject;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -12,7 +13,6 @@ import com.iamberry.wechat.core.entity.wx.Config;
 import com.iamberry.wechat.core.entity.wx.ConfigJSSDK;
 import com.iamberry.wechat.core.entity.wx.WechatShare;
 import com.iamberry.wechat.face.wechat.ConfigService;
-import com.iamberry.wechat.service.WeixinUtil;
 import com.iamberry.wechat.service.wechat.dao.ConfigDAO;
 import com.iamberry.wechat.tools.SignUtil;
 
@@ -24,7 +24,7 @@ public class ConfigServiceImpl implements ConfigService {
 		this.configDAO = configDAO;
 	}
 	
-	@Autowired
+
 	private WeixinUtil weixinUtil;
 
 	public Config getConfig(String appId) {

+ 2 - 4
iamberry-wechat-service/src/main/java/com/iamberry/wechat/service/wechat/WeChatServiceImpl.java

@@ -6,8 +6,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletRequest;
-
+import com.iamberry.wechat.tools.WeixinUtil;
 import net.sf.json.JSONObject;
 
 import org.apache.commons.lang3.StringUtils;
@@ -44,7 +43,6 @@ import com.iamberry.wechat.face.wechat.MenuKeySetService;
 import com.iamberry.wechat.face.wechat.WeChatService;
 import com.iamberry.wechat.service.MessageManager;
 import com.iamberry.wechat.service.MessageUtil;
-import com.iamberry.wechat.service.WeixinUtil;
 import com.iamberry.wechat.service.home.dao.HomeServiceDao;
 import com.iamberry.wechat.service.mapper.PlaceInfoMapper;
 import com.iamberry.wechat.service.member.dao.MemberDao;
@@ -65,7 +63,7 @@ public class WeChatServiceImpl implements WeChatService {
 	@Autowired
 	private KeyWordService keyWordService;
 	
-	@Autowired
+
 	private WeixinUtil weixinUtil;
 	
 	@Autowired

+ 0 - 47
iamberry-wechat-service/src/main/resources/ResultInfo.properties

@@ -1,47 +0,0 @@
-SUCCESSINFO=\u64CD\u4F5C\u6210\u529F\uFF01
-ERRORINFO=\u64CD\u4F5C\u5931\u8D25\uFF01
-SUCCESSCODE=200
-ERRORCODE=500
-getMoneyLimitDown=100
-getMoneyLimitTop=200000000
-getMoneyLimitError=\u91D1\u989D\u4E0D\u80FD\u5927\u4E8E\u8D26\u6237\u4F59\u989D
-getMoneyCountError=\u5F53\u6708\u53D6\u73B0\u6B21\u6570\u4E0D\u80FD\u8D85\u8FC7\u4E24\u6B21
-loginOutError=\u767B\u9646\u4FE1\u606F\u4E22\u5931\uFF0C\u8BF7\u767B\u9646!
-paramFormatError=\u53C2\u6570\u683C\u5F0F\u6709\u8BEF\uFF0C\u8BF7\u68C0\u6D4B!
-withdrawCountOutError=\u5BF9\u4E0D\u8D77,\u672C\u6708\u63D0\u73B0\u6B21\u6570\u5DF2\u7ECF\u4F7F\u7528\u5B8C\u6210!
-cartEmptyError=\u6CA1\u6709\u9009\u4E2D\u8D2D\u7269\u9879\uFF0C\u6216\u8005\u8D2D\u7269\u8F66\u5DF2\u7ECF\u7ED3\u7B97\uFF01
-integralOutError=\u62B5\u6263\u79EF\u5206\u4E0D\u80FD\u5927\u4E8E\u7528\u6237\u53EF\u7528\u79EF\u5206!
-userIntegralOutError=\u5BF9\u4E0D\u8D77,\u60A8\u7684\u53EF\u7528\u79EF\u5206\u4E0D\u8DB3\u63D0\u73B0!
-userMoneyOutError=\u5BF9\u4E0D\u8D77,\u60A8\u7684\u53EF\u7528\u91D1\u989D\u4E0D\u8DB3\u63D0\u73B0!
-integralOutOrderMeonyError=\u62B5\u6263\u79EF\u5206\u91D1\u989D\u4E0D\u80FD\u5927\u4E8E\u7B49\u4E8E\u8BA2\u5355\u91D1\u989D!
-userNoDrpError=\u60A8\u4E0D\u662F\u4EE3\u7406\u5546\uFF0C\u65E0\u6CD5\u67E5\u770B\u4E8C\u7EF4\u7801!
-APPLY_AGAIN=\u60A8\u7684\u7533\u8BF7\u5DF2\u7ECF\u63D0\u4EA4,\u8BF7\u7B49\u5F85\u5BA1\u6838!
-APPLY_EXIST=\u60A8\u5DF2\u7ECF\u662F\u5FAE\u4EE3\u7406!
-APPLY_OPENID_IS_NULL=\u8BF7\u5173\u6CE8\u516C\u4F17\u53F7!
-APPLY_ORDER_IS_NULL=\u4EB2~\u81F3\u5C11\u5B8C\u6210\u4E00\u6B21\u8D2D\u4E70\u624D\u80FD\u7533\u8BF7\u54E6~
-repeatNameError=\u5206\u9500\u5546\u7528\u6237\u540D\u91CD\u590D
-lostMemberInfo=\u7528\u6237\u4FE1\u606F\u4E22\u5931\uFF01
-initPorxySuccessPrifix=\u5C0A\u656C\u7684
-initPorxySuccessSuffix=\u60A8\u597D\uFF01\n\u606D\u559C\u60A8\u6FC0\u6D3B\u8D26\u6237\u6210\u529F\uFF01\n\u8BF7\u5728\u3010\u670D\u52A1\u4E2D\u5FC3\u3011-\u3010\u7ECF\u9500\u5E73\u53F0\u3011\u67E5\u770B\u3002
-initPorxyErrorByCodeError=\u5BF9\u4E0D\u8D77!\n\u60A8\u8F93\u5165\u7684\u6FC0\u6D3B\u7801\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u8BD5!
-initPorxyErrorByUseInit=\u5BF9\u4E0D\u8D77!\n\u60A8\u8F93\u5165\u7684\u6FC0\u6D3B\u7801\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u8BD5!
-initPorxyErrorByUseBuild=\u5BF9\u4E0D\u8D77\uFF01\u60A8\u7684\u5FAE\u4FE1\u5DF2\u7ECF\u7ED1\u5B9A\u4E86\u5176\u4ED6\u4EE3\u7406\u5546\u4FE1\u606F\uFF01\u5BFC\u81F4\u65E0\u6CD5\u7ED1\u5B9A!
-initPorxyErrorByCodeWrong=\u5BF9\u4E0D\u8D77!\n\u60A8\u8F93\u5165\u7684\u6FC0\u6D3B\u7801\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u8BD5!
-subDefaultResponseText=\u611F\u8C22\u60A8\u5173\u6CE8\u6211\u4EEC\uFF0C\u6211\u4EEC\u4F1A\u4E3A\u60A8\u63D0\u4F9B\u6700\u597D\u7684\u670D\u52A1!
-messageDefaultResponseText=\u60A8\u597D\uFF0C\u6709\u4EC0\u4E48\u80FD\u5E2E\u5230\u60A8\u7684?
-messageIsNullResponseText=\u60A8\u597D\uFF0C\u6709\u4EC0\u4E48\u80FD\u5E2E\u5230\u60A8\u7684\uFF01
-imageMessageResponseText=\u54CE\u54DF ~ \u60A8\u53D1\u7684\u56FE\u7247\u6211\u6682\u65F6\u4E0D\u61C2\n\u6709\u4EC0\u4E48\u80FD\u5E2E\u5230\u60A8\u5462\uFF1F
-locationMessageResponseText=\u54CE\u54DF ~ \u60A8\u53D1\u7684\u5730\u5740\u6211\u6682\u65F6\u4E0D\u61C2\n\u6709\u4EC0\u4E48\u80FD\u5E2E\u5230\u60A8\u5462\uFF1F
-linkMessageResponseText=\u54CE\u54DF ~ \u60A8\u53D1\u7684\u94FE\u63A5\u6211\u6682\u65F6\u4E0D\u61C2\n\u6709\u4EC0\u4E48\u80FD\u5E2E\u5230\u60A8\u5462\uFF1F
-videoMessageResponseText=\u54CE\u54DF ~ \u60A8\u53D1\u7684\u8BED\u97F3\u6211\u6682\u65F6\u4E0D\u61C2\n\u6709\u4EC0\u4E48\u80FD\u5E2E\u5230\u60A8\u5462\uFF1F
-tryCatchDefaultResponseText=\u5BF9\u4E0D\u8D77\uFF0C\u6682\u65F6\u65E0\u6CD5\u7ED9\u60A8\u56DE\u590D...
-rebateOrderText={1}\u8D2D\u4E70\u4E86{2}\u8BA2\u5355\uFF0C\u7ED9{3}\u8FD4\u5229{4}\u5143\u94B1
-DRP_INDEX_PAGE = http://h5.iamberry.com/iamberry/wechat/drp/indexPage
-INDEX_PAGE = http://h5.iamberry.com/iamberry/wechat/index
-drpBookAthorNoEnough=\u5206\u9500\u5546\u8BA2\u8D27\u6743\u9650\u4E0D\u8DB3
-follow_reply_message_text=\u606D\u559C\u60A8\uFF0C\u5DF2\u83B7\u5F97\u8D2D\u4E70\u51B2\u5976\u673A\u4F18\u60E0100\u5143\u8D44\u683C!
-follow_reply_message_is_image_text=false
-#\u8D2D\u7269\u8F66\u6D3B\u52A8
-ISSHOW=\u662F
-CARTDESC=\u4EAC\u4E1C\u4F17\u7B79\u4EF7¥399\uFF0C\u5FEB\u5FEB\u70B9\u6211\u524D\u5F80\uFF01
-CART_URL=http://z.jd.com/project/details/53631.html?from=jr_search&type=0

+ 0 - 85
iamberry-wechat-service/src/main/resources/iamberry-wechat-service-provider.xml

@@ -1,85 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans
-					http://www.springframework.org/schema/beans/spring-beans.xsd
-					http://code.alibabatech.com/schema/dubbo          
-   					http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-	<!-- 提供方应用信息,用于计算依赖关系-->
-    <dubbo:application name="iamberry-wechat-service-provider"/>
-   
- 	<!-- 使用zookeeper注册中心暴露服务地址 -->
-	<dubbo:registry address="zookeeper://127.0.0.1:2181"/>
- 
-    <!-- 用dubbo协议在20880端口暴露服务 -->
-    <dubbo:protocol name="dubbo" port="-1"/>
-    
-   <dubbo:monitor protocol="registry"/>
-    
-    <!-- 当ProtocolConfig和ServiceConfig没有设置时,使用默认值 -->
-    <dubbo:provider timeout="30000" threadpool="fixed" threads="500" accepts="100" accesslog="true"/>
- 
-    <dubbo:service interface="com.iamberry.wechat.face.admin.AdminAdministratorService" ref="adminAdministratorServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.admin.AdminLoginService" ref="adminLoginServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.admin.AdminLogService" ref="adminLogServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.admin.AdminPermissionsService" ref="adminPermissionsServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.admin.SystemService" ref="systemServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.agent.AgentMemberService" ref="agentMemberServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.agent.AgentOrderService" ref="agentOrderServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.banner.AdminBannerService" ref="adminBannerServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.bindingapp.BindingMacService" ref="bindingMacServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.cart.CartService" ref="cartServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.cart.ProductInfoService" ref="productInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.coupon.AdminCouponItemService" ref="adminCouponItemServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.coupon.CouponItemService" ref="couponItemServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.coupon.CouponTypeService" ref="couponTypeServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.drp.DrpRoleInfoService" ref="drpRoleInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.drp.PlaceInfoService" ref="placeInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.drp.PlaceLogsService" ref="placeLogsServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.drp.PlaceOrderService" ref="placeOrderServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.drp.PlaceWithDrawalsLogsService" ref="placeWithDrawalsLogsServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.flow.TemplateFlowInfoService" ref="templateFlowInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.flow.TemplateInfoService" ref="templateInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.home.HomeService" ref="homeServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.member.CashLogService" ref="cashLogServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.member.IntegralService" ref="integralServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.member.MemberService" ref="memberServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.member.ShareInfoService" ref="shareInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.member.WithdrawService" ref="withdrawServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.mq.EfastOrderService" ref="efastOrderServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.mq.MQSerivce" ref="MQSerivceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.news.NewsService" ref="newsServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.order.AdminOrderService" ref="adminOrderServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.pay.PayService" ref="payServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.porduct.ProductImageTextService" ref="productImageTextServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.porduct.ProductPictureService" ref="productPictureServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.porduct.ProductService" ref="productServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.qrcode.QrcodeService" ref="qrcodeServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.qrcode.TemporaryQrcodeService" ref="temporaryQrcodeServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.reback.RebackServices" ref="rebackServicesImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.reback.RebackStaticService" ref="rebackStaticServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.relationship.DealerRelationService" ref="dealerRelationServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.relationship.WdRelationService" ref="wdRelationServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.ConfigService" ref="configServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.FirstJoinKeyService" ref="firstJoinKeyServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.ImageTextInfoService" ref="imageTextInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.ImageTextMoreService" ref="imageTextMoreServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.KeyWordService" ref="keyWordServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.MenuInfoService" ref="menuInfoServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.MenuKeySetService" ref="menuKeySetServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.TokenService" ref="tokenServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.wechat.WeChatService" ref="weChatServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.statistics.AdminStatisticsService" ref="adminStatisticsServiceImpl" timeout="30000"/> 
-	<dubbo:service interface="com.iamberry.wechat.face.porduct.ProductTypeService" ref="productTypeServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.task.WechatTaskService" ref="wechatTaskServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.rewards.RewardsService" ref="rewardsServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.rewards.SalesLogService" ref="salesLogServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.game.GameService" ref="gameServiceImpl" timeout="30000"/>
-	<!-- 营养自测 -->
-	<dubbo:service interface="com.iamberry.wechat.face.questionnaire.QuestionnaireService" ref="questionnaireServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.questionnaire.QuestionOptionService" ref="questionOptionServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.questionnaire.QuestionnaireAnswerService" ref="questionnaireAnswerServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.questionnaire.QuestionnaireAnswerDetailedService" ref="questionnaireAnswerDetailedServiceImpl" timeout="30000"/>
-	<dubbo:service interface="com.iamberry.wechat.face.questionnaire.QuestionnairePaperService" ref="questionnairePaperServiceImpl" timeout="30000"/>
-	
-</beans>

+ 0 - 64
iamberry-wechat-service/src/main/resources/iamberry-wechat-service-spring.xml

@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	xmlns:context="http://www.springframework.org/schema/context"
-	xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
-	xmlns:cache="http://www.springframework.org/schema/cache"
-	xmlns:tx="http://www.springframework.org/schema/tx"
-	default-autowire="byName"
-	default-lazy-init="true"
-    xmlns:task="http://www.springframework.org/schema/task"
-	xmlns:aop="http://www.springframework.org/schema/aop"
-	xmlns:ehcache-spring="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
-	xmlns:p="http://www.springframework.org/schema/p"
-	xmlns:websocket="http://www.springframework.org/schema/websocket" 
-	xsi:schemaLocation=
-		"http://www.springframework.org/schema/aop
-		http://www.springframework.org/schema/aop/spring-aop-4.1.xsd
-		http://www.springframework.org/schema/beans
-		http://www.springframework.org/schema/beans/spring-beans.xsd
-		http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
-		http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.1.xsd
-		http://www.springframework.org/schema/cache
-		http://www.springframework.org/schema/cache/spring-cache-4.1.xsd
-		http://www.springframework.org/schema/tx 
-		http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
-		http://www.springframework.org/schema/task  
-		http://www.springframework.org/schema/task/spring-task-3.1.xsd  
-		http://www.springframework.org/schema/websocket 
-		http://www.springframework.org/schema/websocket/spring-websocket.xsd
-		http://www.springframework.org/schema/context
-		http://www.springframework.org/schema/context/spring-context-3.2.xsd">
-		
-	<!-- 配置自动扫描的包:不扫描控制器和异常处理 -->
-	<context:component-scan base-package="com.iamberry">
-		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
-		<context:exclude-filter type="annotation" expression="org.springframework.web.bind.annotation.ControllerAdvice" />
-	</context:component-scan>
-	
-	<!-- 使用CGLIB动态代理 -->
-    <aop:aspectj-autoproxy proxy-target-class="true"/>
-    
-	<!-- 数据源配置 -->
-    <import resource="classpath:iamberry-wechat-service-datasource.xml"/>
-    
-	<!-- 平台LOG配置,立即加载,拒绝懒加载 -->
-	<bean id="logger" class="com.iamberry.app.tool.log.RatFWLogger" scope="singleton" autowire="byName" lazy-init="false">
-		<property name="appId" value="iamberry" />
-	</bean>
-    
-	<!-- 开启注解启动定时器 -->
-    <task:annotation-driven/>
-    
-    <!-- 加载静态资源文件 -->
-    <bean id="loadResultInfo" class="com.iamberry.wechat.tools.loadResultUtil" lazy-init="false"></bean>
-    
-    <!-- 通过Dubbo 完成SOA -->
-	<import resource="classpath:iamberry-wechat-service-provider.xml"/>
-	
-    <!-- 配置springContextHolder -->
-    <bean class="com.iamberry.zk.SpringContextHolder" lazy-init="false" />
-    
-    <!-- 启动ZK 上报机器信息的节点 -->
-	<bean class="com.iamberry.zk.StartZK" lazy-init="false"/>
-</beans>

+ 0 - 35
iamberry-wechat-service/src/main/resources/log4j.properties

@@ -1,35 +0,0 @@
-#levels: debug, info, warn, error, fatal
-log4j.rootLogger=info,stdout,infoLog,errorLog
-
-#\u63a7\u5236\u53f0
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Target=System.out
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m %n
-log4j.appender.stdout.File=D:/log/iamberry/service/iamberry_out.log
-
-#\u4e3b\u65e5\u5fd7\u6587\u4ef6
-log4j.appender.infoLog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.infoLog.File=D:/log/iamberry/service/iamberry_info.log
-log4j.appender.infoLog.Append=true
-log4j.appender.infoLog.Threshold=INFO
-log4j.appender.infoLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.infoLog.layout.ConversionPattern=%d %p [%c] - %m %n 
-log4j.appender.infoLog.encoding=UTF-8
-
-#\u9519\u8bef\u65e5\u5fd7
-log4j.appender.errorLog=org.apache.log4j.DailyRollingFileAppender
-log4j.appender.errorLog.File=D:/log/iamberry/service/iamberry_error.log
-log4j.appender.errorLog.Append=true
-log4j.appender.errorLog.Threshold=ERROR
-log4j.appender.errorLog.layout=org.apache.log4j.PatternLayout
-log4j.appender.errorLog.layout.ConversionPattern=%d %p [%c] - %m %n 
-log4j.appender.errorLog.encoding=UTF-8
-
-#\u663e\u793aSQL\u8bed\u53e5\u90e8\u5206
-log4j.logger.com.iamberry.wechat.service=DEBUG
-log4j.logger.java.sql.ResultSet=INFO
-log4j.logger.org.apache=INFO
-log4j.logger.java.sql.Connection=DEBUG
-log4j.logger.java.sql.Statement=DEBUG
-log4j.logger.java.sql.PreparedStatement=DEBUG

+ 0 - 10
iamberry-wechat-service/src/main/resources/wx_public_no.properties

@@ -1,10 +0,0 @@
-pubNo=gh_069cd4a82950
-appId=wx2abd86e7dd0c8bc3
-token=weixin
-appSecret=e3b11ca050578ac8b794b510b16b2020
-partner=1240220902
-partnerkey=cdb9075e7ecad945ba788bc5aedM212B
-charset=UTF-8
-KEYSTORE_FILE=E:/apiclient_cert.p12
-KEYSTORE_PASSWORD=1240220902
-ipAddress=120.25.79.106

+ 28 - 1
iamberry-wechat-web/pom.xml

@@ -20,7 +20,7 @@
 		</dependency>
 		<dependency>
 			<groupId>com.iamberry</groupId>
-			<artifactId>iamberry-wechat-interface</artifactId>
+			<artifactId>iamberry-wechat-service</artifactId>
 			<version>1.0.0</version>
 		</dependency>
 		<dependency>
@@ -45,6 +45,18 @@
 			<groupId>javax.servlet</groupId>
 			<artifactId>jstl</artifactId>
 		</dependency>
+		<dependency>
+			<groupId>org.jsoup</groupId>
+			<artifactId>jsoup</artifactId>
+			<version>1.7.3</version>
+		</dependency>
+
+		<!-- 新的项目使用druid -->
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>druid</artifactId>
+			<version>1.0.20</version>
+		</dependency>
 	</dependencies>
 	<build>
 		<finalName>iamberry-wechat-web</finalName>
@@ -60,4 +72,19 @@
 			</plugin>
 		</plugins>
 	</build>
+
+	<!-- 配置 -->
+	<profiles>
+		<profile>
+			<id>sonar</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+			<properties>
+				<sonar.host.url>http://sonar.iamberry.com/</sonar.host.url>
+				<sonar.login>admin</sonar.login>
+				<sonar.password>iamberry123</sonar.password>
+			</properties>
+		</profile>
+	</profiles>
 </project>

+ 1 - 3
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/AdminLoginHandler.java

@@ -56,8 +56,6 @@ public class AdminLoginHandler {
 	public ModelAndView loginUI(HttpServletRequest request,
 			HttpServletResponse response) throws Exception {
 		ModelAndView mv = new ModelAndView("admin/main/login");
-		String s = request.getParameter("s");
-//System.out.println("log...");
 		// 校验用户是否登陆成功
 		if (adminUtils.getLoginAdminUser(request.getSession()) != null) {
 			mv.setViewName("admin/main/index"); // 转向home页
@@ -104,7 +102,7 @@ public class AdminLoginHandler {
 			// 注册二级管理员的权限
 			request.getSession().setAttribute("permission", adminLoginService.selectAdminChildHavePermissionById(adminInfo.getAdminId()));
 		}
-		
+
 		// 登陆成功
 		//adminUtils.setCookieToResponse(response, dto.getAdminLoginName(), dto.getAdminLoginPwd()); // 更新cookie内容
 		mv.setViewName("admin/main/index"); // 转向home页

+ 4 - 6
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/admin/SystemHandler.java

@@ -10,6 +10,7 @@ import java.util.concurrent.Executors;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -23,7 +24,6 @@ import com.iamberry.wechat.tools.NameUtils;
 import com.iamberry.wechat.tools.ResponseJson;
 import com.iamberry.wechat.tools.loadResultUtil;
 import com.iamberry.wechat.utils.StaticCacheMemory;
-import com.iamberry.wechat.utils.WeixinUtil;
 import com.iamberry.zk.HostInfo;
 import com.iamberry.zk.ZookeeperQueue;
 
@@ -36,9 +36,7 @@ import com.iamberry.zk.ZookeeperQueue;
 @Controller
 @RequestMapping("/admin/system")
 public class SystemHandler {
-	
-	@Autowired
-	private WeixinUtil weixinUtil;
+
 
 	@RequestMapping("/set")
 	public void set(HttpServletResponse response) {
@@ -96,7 +94,7 @@ public class SystemHandler {
 		final String message = String.format(tempMessageFormat, StringUtils.split(tempMessageInfo, "#s"));
 		if (users.length <= 100) {
 			for (String string : users) {
-				try {weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, string, tempMessageId, message, tempMessageURL);} catch (Exception e) {}
+				try {WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, string, tempMessageId, message, tempMessageURL);} catch (Exception e) {}
 			}
 			response.getWriter().print("发送成功!");
 		} else {
@@ -111,7 +109,7 @@ public class SystemHandler {
 						int stopNum = startNum + 100;	// 结束
 						for (;startNum <= stopNum; startNum++) {
 							System.out.println("count:" + startNum);
-							try {weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, users[startNum], tempMessageId, message, tempMessageURL);} catch (Exception e) {}
+							try {WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, users[startNum], tempMessageId, message, tempMessageURL);} catch (Exception e) {}
 						}
 					}
 				});

+ 2 - 8
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/cart/CartHandlers.java

@@ -9,6 +9,7 @@ import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 
+import com.iamberry.wechat.tools.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -39,11 +40,7 @@ import com.iamberry.wechat.face.member.MemberService;
 import com.iamberry.wechat.face.order.AdminOrderService;
 import com.iamberry.wechat.face.pay.PayService;
 import com.iamberry.wechat.handles.mq.MQServiceProxy;
-import com.iamberry.wechat.tools.NameUtils;
-import com.iamberry.wechat.tools.ResultInfo;
-import com.iamberry.wechat.tools.StaticInfo;
-import com.iamberry.wechat.tools.ValidatorUtil;
-import com.iamberry.wechat.utils.WeixinUtil;
+
 /**
  * @company	深圳爱贝源科技有限公司
  * @website www.iamberry.com
@@ -60,9 +57,6 @@ public class CartHandlers {
 	private CartService cartService;
 	
 	@Autowired
-	private WeixinUtil weixinUtil;
-	
-	@Autowired
 	private WechatUtils wechatUtils;
 	
 	@Autowired

+ 2 - 4
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/home/HomeHandler.java

@@ -8,6 +8,7 @@ import java.util.Map;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Async;
@@ -27,7 +28,6 @@ import com.iamberry.wechat.face.home.HomeService;
 import com.iamberry.wechat.face.member.MemberService;
 import com.iamberry.wechat.tools.NameUtils;
 import com.iamberry.wechat.tools.ResultInfo;
-import com.iamberry.wechat.utils.WeixinUtil;
 
 /**
  * @company	深圳爱贝源科技有限公司
@@ -55,9 +55,7 @@ public class HomeHandler {
 
 	@Autowired
 	private SystemService systemService;
-	
-	@Autowired
-	private WeixinUtil weixinUtil;
+
 	
 	/**
 	 * 微信商城首页URL

+ 1 - 10
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/order/OrderHandler.java

@@ -12,6 +12,7 @@ import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.tools.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -46,13 +47,6 @@ import com.iamberry.wechat.face.member.MemberService;
 import com.iamberry.wechat.face.pay.PayService;
 import com.iamberry.wechat.face.reback.RebackServices;
 import com.iamberry.wechat.handles.mq.MQServiceProxy;
-import com.iamberry.wechat.tools.NameUtils;
-import com.iamberry.wechat.tools.OrderNOUtil;
-import com.iamberry.wechat.tools.ResultInfo;
-import com.iamberry.wechat.tools.Sha1Util;
-import com.iamberry.wechat.tools.TenpayUtil;
-import com.iamberry.wechat.tools.ValidatorUtil;
-import com.iamberry.wechat.utils.WeixinUtil;
 
 /**
  * @author 何秀刚
@@ -68,9 +62,6 @@ public class OrderHandler {
 	private CartService cartService;
 	
 	@Autowired
-	private WeixinUtil weixinUtil;
-	
-	@Autowired
 	private WechatUtils wechatUtils;
 	
 	@Autowired

+ 1 - 4
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/RequestWechatPayHandler.java

@@ -5,6 +5,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -21,7 +22,6 @@ import com.iamberry.wechat.face.home.HomeService;
 import com.iamberry.wechat.face.pay.PayService;
 import com.iamberry.wechat.tools.NameUtils;
 import com.iamberry.wechat.tools.ValidatorUtil;
-import com.iamberry.wechat.utils.WeixinUtil;
 
 /**
  * @author 何秀刚<br>
@@ -38,9 +38,6 @@ public class RequestWechatPayHandler {
 	private CartService cartService;
 	
 	@Autowired
-	private WeixinUtil weixinUtil;
-	
-	@Autowired
 	private WechatUtils wechatUtils;
 	
 	@Autowired

+ 3 - 9
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/pay/WechatBackHandler.java

@@ -3,6 +3,7 @@ package com.iamberry.wechat.handles.pay;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -12,7 +13,6 @@ import com.iamberry.wechat.core.entity.WechatUtils;
 import com.iamberry.wechat.core.entity.member.Member;
 import com.iamberry.wechat.face.home.HomeService;
 import com.iamberry.wechat.tools.NameUtils;
-import com.iamberry.wechat.utils.WeixinUtil;
 
 /**
  * @author 何秀刚
@@ -22,19 +22,13 @@ import com.iamberry.wechat.utils.WeixinUtil;
  */
 @Controller
 public class WechatBackHandler {
-
-	@Autowired
-	private WeixinUtil weixinUtil;
-	public void setWeixinUtil(WeixinUtil weixinUtil) {
-		this.weixinUtil = weixinUtil;
-	}
 	
 	@Autowired
 	private HomeService homeService;
 	public void setHomeService(HomeService homeService) {
 		this.homeService = homeService;
 	}
-	
+
 	@Autowired
 	private WechatUtils wechatUtils;
 	public void setWechatUtils(WechatUtils wechatUtils) {
@@ -60,7 +54,7 @@ public class WechatBackHandler {
 		}
 		try {
 			// 通过code get微信的openid
-			String[] str = weixinUtil.getOpenId(code, NameUtils.appId, NameUtils.appSecret);
+			String[] str = WeixinUtil.getOpenId(code, NameUtils.appId, NameUtils.appSecret);
 			String openId = str[0];
 			if (openId == null || openId.isEmpty()) {
 				mv.setViewName("redirect:" + WechatUtils.getOpenIdFunction());

File diff suppressed because it is too large
+ 239 - 0
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/warranty/WarrantyCardHandler.java


+ 3 - 9
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/wechat/menu/MenuInfoHandler.java

@@ -3,6 +3,7 @@ package com.iamberry.wechat.handles.wechat.menu;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -12,7 +13,6 @@ import com.iamberry.wechat.core.entity.wx.AccessToken;
 import com.iamberry.wechat.core.entity.wx.MenuInfo;
 import com.iamberry.wechat.face.wechat.MenuInfoService;
 import com.iamberry.wechat.tools.NameUtils;
-import com.iamberry.wechat.utils.WeixinUtil;
 /**
  * @company	深圳爱贝源科技有限公司
  * @website www.iamberry.com
@@ -30,12 +30,6 @@ public class MenuInfoHandler {
 		this.menuInfoService = menuInfoService;
 	}
 	
-	@Autowired
-	private WeixinUtil weixinUtil;
-	public void setWeixinUtil(WeixinUtil weixinUtil) {
-		this.weixinUtil = weixinUtil;
-	}
-	
 	/**
 	 * 自定义菜单页面
 	 * @return
@@ -80,11 +74,11 @@ public class MenuInfoHandler {
 	public ModelAndView createMenu(HttpServletRequest request){
 		ModelAndView mv = new ModelAndView();
 		int result = -1;
-		AccessToken accessToken = weixinUtil.getAccessToken(NameUtils.appId, NameUtils.appSecret);
+		AccessToken accessToken = WeixinUtil.getAccessToken(NameUtils.appId, NameUtils.appSecret);
 		if(accessToken != null){
 			String jsondata = request.getParameter("jsondata").replaceAll("},]", "}]");
 			if(jsondata != null && accessToken.getToken() != null){
-				result = weixinUtil.createMenu(jsondata, accessToken.getToken());
+				result = WeixinUtil.createMenu(jsondata, accessToken.getToken());
 				if(result == 0){
 					mv.addObject("rs", "yes");
 				}else{

+ 2 - 5
iamberry-wechat-web/src/main/java/com/iamberry/wechat/handles/wechat/template/Template.java

@@ -2,6 +2,7 @@ package com.iamberry.wechat.handles.wechat.template;
 
 import java.util.Date;
 
+import com.iamberry.wechat.tools.WeixinUtil;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -10,7 +11,6 @@ import com.iamberry.app.tool.log.RatFWLogger;
 import com.iamberry.wechat.core.entity.mq.MQMessage;
 import com.iamberry.wechat.handles.mq.MQServiceProxy;
 import com.iamberry.wechat.tools.NameUtils;
-import com.iamberry.wechat.utils.WeixinUtil;
 
 /**
  * @company	深圳爱贝源科技有限公司
@@ -27,9 +27,6 @@ public class Template {
 	private MQServiceProxy mqSerivce;
 	
 	@Autowired
-	private WeixinUtil weixinUtil;
-	
-	@Autowired
 	private RatFWLogger fwLogger;
 	
 	/**
@@ -78,7 +75,7 @@ public class Template {
 		
 		String [] datas = StringUtils.split("-", message.getServiceOtherMessage());
 		try {
-			weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, message.getServiceToMessage(), datas[0], datas[1], datas[2]);;
+			WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, message.getServiceToMessage(), datas[0], datas[1], datas[2]);;
 			return true;
 		} catch (Exception e) {
 			fwLogger.error(this, e.getMessage());

+ 8 - 11
iamberry-wechat-web/src/main/java/com/iamberry/wechat/utils/SendMessageUtil.java

@@ -1,14 +1,11 @@
 package com.iamberry.wechat.utils;
 
-
-
 import java.util.HashMap;
-
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
-
 import com.iamberry.wechat.tools.NameUtils;
 import com.iamberry.wechat.tools.ResultInfo;
+import com.iamberry.wechat.tools.WeixinUtil;
 /**
  * @company	深圳爱贝源科技有限公司
  * @website www.iamberry.com
@@ -19,8 +16,7 @@ import com.iamberry.wechat.tools.ResultInfo;
  */
 @Component
 public class SendMessageUtil {
-		@Autowired
-		private WeixinUtil weixinUtil;
+
 		//快递公司列表
 		public static HashMap<String, String> hashmap = new HashMap<String, String>();
 		//正式环境
@@ -43,20 +39,21 @@ public class SendMessageUtil {
 			boolean result =false;
 			switch (type) {
 			case 1:  //1,收益成功通知
-				result = weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId,ResultInfo.rewards_template_id, date, url);
+				WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId,ResultInfo.rewards_template_id, date, url);
 				break;
 			case 2:  // 2,发货提醒通知 
-				result = weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId, ResultInfo.Shipment_template_id, date, url);
+				WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId, ResultInfo.Shipment_template_id, date, url);
 				break;
 			case 3:  //3、收入提醒通知
-				result = weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId, ResultInfo.Income_template_id, date, url);
+				WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId, ResultInfo.Income_template_id, date, url);
 				break;
 			case 4:  //4、订单未支付通知
-				result = weixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId, ResultInfo.Order_template_id, date, url);
+				WeixinUtil.sendTemplateMessage(NameUtils.appId, NameUtils.appSecret, openId, ResultInfo.Order_template_id, date, url);
 				break;
 			default: 
 				break;
 			}
-			return  result;
+			result = true;
+			return result;
 		}
 }

+ 0 - 524
iamberry-wechat-web/src/main/java/com/iamberry/wechat/utils/WeixinUtil.java

@@ -1,524 +0,0 @@
-package com.iamberry.wechat.utils;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.ConnectException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.util.Date;
-import java.util.logging.Logger;
-
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocketFactory;
-import javax.net.ssl.TrustManager;
-
-import net.sf.json.JSONObject;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import com.iamberry.app.tool.log.RatFWLogger;
-import com.iamberry.wechat.core.entity.wx.AccessToken;
-import com.iamberry.wechat.core.entity.wx.ITTempLate;
-import com.iamberry.wechat.core.entity.wx.Menu;
-import com.iamberry.wechat.core.entity.wx.QRCJson;
-import com.iamberry.wechat.core.entity.wx.Ticket;
-import com.iamberry.wechat.core.entity.wx.Token;
-import com.iamberry.wechat.face.wechat.TokenService;
-import com.iamberry.wechat.tools.MyX509TrustManager;
-import com.iamberry.wechat.tools.NameUtils;
-
-/**
- * @company	深圳爱贝源科技有限公司
- * @website www.iamberry.com
- * @author 	献
- * @tel		18271840547
- * @date	2016年11月3日
- * @explain	微信公众平台通用接口工具类
- */
-@Component
-public class WeixinUtil {
-	
-	
-	@Autowired
-	private RatFWLogger logger;
-	
-	@Autowired
-	private TokenService tokenService;
-	
-	private static String sendTemplate = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=";
-	
-	/**
-	 * 网页授权获取access_token
-	 * 
-	 * @param code
-	 * @return
-	 */
-	public JSONObject getParamByOauth2(String code) {
-		JSONObject jsonObject = null;
-		// 得到access_token和openid
-		jsonObject = httpRequest(NameUtils.oauth2_getToken_url.replaceAll("CODE", code).replaceAll("APPID", NameUtils.appId).replaceAll("SECRET", NameUtils.appSecret), "GET", null);
-		if (null != jsonObject) {
-			return jsonObject;
-		}
-		// 获取token失败
-		return null;
-	}
-
-	/**
-	 * 发起https请求并获取结果
-	 * 
-	 * @param requestUrl
-	 *            请求地址
-	 * @param requestMethod
-	 *            请求方式(GET/POST)
-	 * @param outputStr
-	 *            提交的数据
-	 * @return JSONObject(通过JSONObject.get(key)的方式获取json对象的属性值)
-	 *         java.lang.ClassCastException:
-	 *         sun.net.www.protocol.http.HttpURLConnection cannot be cast to
-	 *         javax.net.ssl.HttpsURLConnection
-	 */
-	public JSONObject httpRequest(String requestUrl,
-			String requestMethod, String outputStr) {
-		JSONObject jsonObject = null;
-		StringBuffer buffer = new StringBuffer();
-		try {
-			// 创建SSLContext对象,并使用我们指定的信任管理器初始化
-			TrustManager[] tm = { new MyX509TrustManager() };
-			SSLContext sslContext = SSLContext.getInstance("SSL", "SunJSSE");
-			sslContext.init(null, tm, new java.security.SecureRandom());
-			// 从上述SSLContext对象中得到SSLSocketFactory对象
-			SSLSocketFactory ssf = sslContext.getSocketFactory();
-
-			URL url = new URL(requestUrl);
-			HttpsURLConnection httpUrlConn = (HttpsURLConnection) url
-					.openConnection();
-			httpUrlConn.setSSLSocketFactory(ssf);
-
-			httpUrlConn.setDoOutput(true);
-			httpUrlConn.setDoInput(true);
-			httpUrlConn.setUseCaches(false);
-
-			// 设置请求方式(GET/POST)
-			httpUrlConn.setRequestMethod(requestMethod);
-			if ("GET".equalsIgnoreCase(requestMethod))
-				httpUrlConn.connect();
-
-			// 当有数据需要提交时
-			if (null != outputStr) {
-				OutputStream outputStream = httpUrlConn.getOutputStream();
-				// 注意编码格式,防止中文乱码
-				outputStream.write(outputStr.getBytes("UTF-8"));
-				outputStream.close();
-			}
-
-			// 将返回的输入流转换成字符串
-			InputStream inputStream = httpUrlConn.getInputStream();
-			InputStreamReader inputStreamReader = new InputStreamReader(inputStream, "utf-8");
-			BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
-
-			String str = null;
-			while ((str = bufferedReader.readLine()) != null) {
-				buffer.append(str);
-			}
-			bufferedReader.close();
-			inputStreamReader.close();
-			// 释放资源
-			inputStream.close();
-			inputStream = null;
-			httpUrlConn.disconnect();
-			jsonObject = JSONObject.fromObject(buffer.toString());
-		} catch (ConnectException ce) {
-			Logger.getAnonymousLogger().info("Weixin server connection timed out.");
-		} catch (Exception e) {
-			Logger.getAnonymousLogger().info("信任管理器请求时..." + e);
-			Logger.getAnonymousLogger().info("jsonObject..." + jsonObject);
-		}
-		return jsonObject;
-	}
-
-	/**
-	 * 获取access_token
-	 * @param appid  凭证
-	 * @param appsecret 密钥
-	 * @return
-	 */
-	public AccessToken getAccessToken(String appid, String appsecret) {
-		
-		// 查询缓存,如果是第一次,绝对为空
-		Token accessTokenMemory = StaticCacheMemory.getAccessToken();
-		if (accessTokenMemory != null) {
-			if (new Date().getTime() < accessTokenMemory.getEndDate().getTime()) {
-				AccessToken accessToken = new AccessToken();
-				accessToken.setExpiresIn(7200);
-				accessToken.setToken(accessTokenMemory.getToken());
-				return accessToken;
-			}
-		}
-		
-		// 根据public No查询access_token
-		Token token = tokenService.selectOne(NameUtils.pubNo);
-		
-		// 查询到了植入环境中
-		StaticCacheMemory.setAccessToken(token);
-		AccessToken accessToken = null;
-		//判断数据库中是否存在token
-		if (token != null) {
-			//判断token是否失效
-			Date date = new Date();
-			if (date.getTime() < token.getEndDate().getTime()) {
-				accessToken = new AccessToken();
-				accessToken.setExpiresIn(7200);
-				accessToken.setToken(token.getToken());
-				return accessToken;
-			} else {
-				String requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.appId).replace("APPSECRET", NameUtils.appSecret);
-				JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
-				// 如果请求成功
-				if (null != jsonObject) {
-					try {
-						accessToken = new AccessToken();
-						accessToken.setToken(jsonObject.getString("access_token"));
-						accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
-						token.setToken(accessToken.getToken());
-						token.setEndDate(new Date(date.getTime() + 6500000));
-						token.setAppid(NameUtils.pubNo);
-						try {
-							tokenService.updateToken(token);
-							StaticCacheMemory.setAccessToken(token);
-						} catch (Exception e) {
-							System.out.println("更新token失败:" + e.getMessage());
-						}
-						return accessToken;
-					} catch (Exception e) {
-						e.printStackTrace();
-						accessToken = null;
-						// 获取token失败
-						Logger.getAnonymousLogger().info("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-					}
-				}
-			}
-		} else {
-			String requestUrl = NameUtils.access_token_url.replace("APPID", appid).replace("APPSECRET", appsecret);
-			JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
-			// 如果请求成功
-			if (null != jsonObject) {
-				try {
-					accessToken = new AccessToken();
-					accessToken.setToken(jsonObject.getString("access_token"));
-					accessToken.setExpiresIn(jsonObject.getInt("expires_in"));
-					
-					token = new Token();
-					token.setToken(accessToken.getToken());
-					token.setEndDate(new Date(new Date().getTime() + 6500000));
-					token.setAppid(NameUtils.pubNo);
-					
-					try {
-						tokenService.updateToken(token);
-						StaticCacheMemory.setAccessToken(token);
-					} catch (Exception e) {
-						// 更新失败
-					}
-					return accessToken;
-				} catch (Exception e) {
-					accessToken = null;
-					// 获取token失败
-					Logger.getAnonymousLogger().info("获取token失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-				}
-			}
-		}
-		return accessToken;
-	}
-	
-	/**
-	 * 获取jsapi_ticket(jsapi_ticket的有效期为7200秒)
-	 * @param token
-	 * @return
-	 */
-	public Ticket getTicket(String token) {
-		Ticket ticket = null;
-		String requestUrl = NameUtils.jsapi_ticket_url.replace("ACCESS_TOKEN", token);
-		JSONObject jsonObject = httpRequest(requestUrl, "GET", null);
-		if (null == jsonObject) {
-			// 网络异常
-			return null;
-		}
-
-		try {
-			ticket = new Ticket();
-			ticket.setTicket(jsonObject.getString("ticket"));
-			ticket.setExpiresIn(jsonObject.getInt("expires_in"));
-		} catch (Exception e) {
-			// 获取token失败
-			Logger.getAnonymousLogger().info("获取ticket失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-			
-			// 判断错误信息是否为 access_token 失效的问题,只有access失效,我们才重新获取,否则每次获取可能导致access_token资源耗尽
-			if (jsonObject.getInt("errcode") != 40001) 
-				return null;
-			
-			// 强制刷新access_token,存在多线程安全隐患!
-			requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.appId).replace("APPSECRET", NameUtils.appSecret);
-			JSONObject accessTokenJsonObject = httpRequest(requestUrl, "GET", null);
-			
-			// 报错access_token信息,不管报错与否
-			Token wechatToken = new Token();
-			wechatToken.setEndDate(new Date(new Date().getTime() + 6500000));
-			wechatToken.setAppid(NameUtils.pubNo);
-			wechatToken.setToken(accessTokenJsonObject.getString("access_token"));
-			tokenService.updateToken(wechatToken);
-			StaticCacheMemory.setAccessToken(wechatToken);
-			
-			// 重新获取一次
-			requestUrl = NameUtils.jsapi_ticket_url.replace("ACCESS_TOKEN", wechatToken.getToken());
-			jsonObject = httpRequest(requestUrl, "GET", null);
-			ticket = new Ticket();
-			ticket.setTicket(jsonObject.getString("ticket"));
-			ticket.setExpiresIn(jsonObject.getInt("expires_in"));
-		}
-	
-		return ticket;
-	}
-
-	/**
-	 * 创建菜单
-	 * @param menu 菜单实例
-	 * @param accessToken 有效的access_token
-	 * @return 0表示成功,其他值表示失败
-	 */
-	public int createMenu(Menu menu, String accessToken) {
-		int result = 0;
-		// 拼装创建菜单的url
-		String url = NameUtils.menu_create_url.replace("ACCESS_TOKEN", accessToken);
-		// 将菜单对象转换成json字符串
-		String jsonMenu = JSONObject.fromObject(menu).toString();
-		// 调用接口创建菜单
-		JSONObject jsonObject = httpRequest(url, "POST", jsonMenu);
-		if (null != jsonObject) {
-			if (0 != jsonObject.getInt("errcode")) {
-				result = jsonObject.getInt("errcode");
-				Logger.getAnonymousLogger().info("创建菜单失败 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * 创建菜单
-	 * @param jsonMenu
-	 * @param accessToken
-	 */
-	public int createMenu(String jsonMenu, String accessToken) {
-		int result = 0;
-		// 拼装创建菜单的url
-		String url = NameUtils.menu_create_url.replace("ACCESS_TOKEN", accessToken);
-		// 调用接口创建菜单
-		JSONObject jsonObject = httpRequest(url, "POST", jsonMenu);
-		if (null != jsonObject) {
-			if (0 != jsonObject.getInt("errcode")) {
-				result = jsonObject.getInt("errcode");
-				Logger.getAnonymousLogger().info("创建菜单失败 errcode:{} errmsg:{} " + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-			}
-		}
-		return result;
-	}
-
-	/**
-	 * 创建二维码
-	 * @param qrCode
-	 * @return
-	 */
-	public QRCJson createQrcode(String json) {
-		AccessToken at = this.getAccessToken(NameUtils.appId, NameUtils.appSecret);
-		if (at == null) {
-			return null;
-		}
-
-		String token = at.getToken();
-		JSONObject jsonObject = httpRequest(NameUtils.get_token_url.replaceAll("TOKEN", token), "POST", json);
-		if (jsonObject == null) {
-			return null;
-		}
-
-		QRCJson qrcJson = new QRCJson();
-		String ticket = null;
-		try {
-			ticket = URLEncoder.encode(jsonObject.getString("ticket"), "UTF-8");
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-		}
-		qrcJson.setTicket(ticket);
-		qrcJson.setUrl(NameUtils.show_qrcode_url + ticket);
-		if (json.contains("expire_seconds")) {// 临时二维码才有过期时间
-			qrcJson.setExpire_seconds(jsonObject.getString("expire_seconds"));
-		}
-		return qrcJson;
-	}
-
-	/**
-	 * 生成网页授权链接
-	 * 
-	 * @param type
-	 * @param redirectURI
-	 */
-	public String getOauth2Url(String type, String redirectURI) {
-		String url = "";
-		try {
-			redirectURI = URLEncoder.encode(redirectURI, "utf-8");
-		} catch (UnsupportedEncodingException e) {
-			e.printStackTrace();
-		}
-		if ("snsapi_base".equals(type)) {
-			url = NameUtils.oauth2_url.replace("SCOPE", "snsapi_base").replace("APPID", NameUtils.appId).replace("REDIRECT_URI", redirectURI);
-		} else {
-			url = NameUtils.oauth2_url.replace("SCOPE", "snsapi_userinfo").replace("APPID", NameUtils.appId).replace("REDIRECT_URI", redirectURI);
-		}
-		return url;
-	}
-
-	/**
-	 * (网页授权)拉取用户信息
-	 * 
-	 * @param code
-	 * @param type
-	 * @return
-	 */
-	public JSONObject getUserInfoByOauth2(String code, String type) {
-		JSONObject jsonObject = null;
-		String openid = "", access_token = "";
-		// 得到access_token和openid
-		jsonObject = httpRequest(NameUtils.oauth2_getToken_url.replaceAll("CODE", code).replaceAll("APPID", NameUtils.appId).replaceAll("SECRET", NameUtils.appSecret), "GET", null);
-		if (null == jsonObject) {
-			return null;
-		}
-
-		openid = jsonObject.getString("openid");
-		access_token = jsonObject.getString("access_token");
-		// 获取用户信息
-		if ("info".equals(type) && !"".equals(openid) && !"".equals(access_token)) {
-			jsonObject = null;
-			jsonObject = httpRequest(NameUtils.oauth2_getUserInfo_url.replaceAll("ACCESS_TOKEN", access_token).replaceAll("OPENID", openid), "GET", null);
-			if (jsonObject != null)
-				return jsonObject;
-		}
-		return jsonObject;
-	}
-
-	/**
-	 * 拉取用户信息
-	 * 
-	 * @param code
-	 * @param appid
-	 * @param secret
-	 */
-	public String[] getOpenId(String code, String appid, String secret) {
-		String[] strs = new String[2];
-		String url = "", openid = "", access_token = "";
-		Logger.getAnonymousLogger().info("code = " + code + ", appid = " + appid + ", secret = " + secret);
-		// 得到access_token和openid
-		url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";
-		JSONObject jsonObject = httpRequest(url.replaceAll("CODE", code).replaceAll("APPID", appid).replaceAll("SECRET", secret), "GET", null);
-		if (null == jsonObject) {
-			return null;
-		}
-
-		openid = jsonObject.getString("openid");
-		access_token = jsonObject.getString("access_token");
-		strs[0] = openid;
-		strs[1] = access_token;
-		return strs;
-	}
-
-	/**
-	 * 根据openid拉取用户信息
-	 * @param openid
-	 * @return
-	 */
-	public JSONObject getUserInfo(String openid) {
-		AccessToken token = this.getAccessToken(NameUtils.appId, NameUtils.appSecret);
-		if (token == null) {
-			// 此处如果出错,只能说明程序逻辑改变,存在多线程安全隐患
-			return null;
-		}
-
-		// 获取信息
-		JSONObject jsonObject = httpRequest(NameUtils.userinfo_url.replaceAll("ACCESS_TOKEN", token.getToken()).replaceAll("OPENID", openid), "GET", null);
-		if (null == jsonObject) {
-			// 网络错误
-			return null;
-		}
-
-		// 对数据进行get(防止出现问题,能够让程序及时补救), 如果抛出异常,表示access_token可能失效,强制获取一次。
-		try {
-			jsonObject.getString("sex");
-		} catch (Exception e) {
-			
-			// 记录日志
-			logger.error(this, "getUserInfo method throw exception:" + e.getMessage() + "[" + jsonObject + "]");
-			
-			// 判断错误信息是否为 access_token 失效的问题,只有access失效,我们才重新获取,否则每次获取可能导致access_token资源耗尽
-			if (jsonObject.getInt("errcode") != 40001) 
-				return jsonObject;
-			
-			// 强制刷新access_token,存在多线程安全隐患!
-			String requestUrl = NameUtils.access_token_url.replace("APPID", NameUtils.appId).replace("APPSECRET", NameUtils.appSecret);
-			JSONObject accessTokenJsonObject = httpRequest(requestUrl, "GET", null);
-			
-			// 报错access_token信息,不管报错与否
-			Token wechatToken = new Token();
-			wechatToken.setEndDate(new Date(new Date().getTime() + 6500000));
-			wechatToken.setAppid(NameUtils.pubNo);
-			wechatToken.setToken(accessTokenJsonObject.getString("access_token"));
-			tokenService.updateToken(wechatToken);
-			StaticCacheMemory.setAccessToken(wechatToken);
-			
-			// 再次获取用户信息
-			return httpRequest(NameUtils.userinfo_url.replaceAll("ACCESS_TOKEN", wechatToken.getToken()).replaceAll("OPENID", openid), "GET", null);
-		}
-		return jsonObject;
-	}
-
-	/**
-	 * 发送模板消息 appId 公众账号的唯一标识 appSecret 公众账号的密钥 openId 用户标识
-	 */
-	public boolean sendTemplateMessage(String appId, String appSecret,
-			String openId, String template_id, Object data, String redirectUrl) {
-
-		// 准备数据
-		AccessToken token = this.getAccessToken(appId, appSecret);
-		String access_token = token.getToken();
-		
-		String url = sendTemplate  + access_token;
-
-		//json格式转换
-		String jsonObj = JSONObject.fromObject(data).toString();
-		data = "="+jsonObj.toString()+"=";
-		
-		// 准备模版
-		ITTempLate temp = new ITTempLate();
-		temp.setTouser(openId);
-		temp.setTemplate_id(template_id);
-		temp.setUrl(redirectUrl);
-		temp.setData(data);
-
-		// format
-		String jsonString = JSONObject.fromObject(temp).toString();
-		
-		jsonString = jsonString.replace("\"=", "").replace("=\"", "").replaceAll("\\\\", "");
-	
-		// send
-		JSONObject jsonObject = httpRequest(url, "POST", jsonString);
-		if (null == jsonObject) {
-			return false;
-		}
-		if (0 != jsonObject.getInt("errcode")) {
-			logger.info("错误 errcode:{} errmsg:{}" + jsonObject.getInt("errcode") + jsonObject.getString("errmsg"));
-			return false;
-		}
-		return true;
-	}
-}

+ 2 - 2
iamberry-wechat-web/src/main/resources/ResultInfo.properties

@@ -45,7 +45,7 @@ follow_reply_message_text=\u606D\u559C\u60A8\uFF0C\u5DF2\u83B7\u5F97\u8D2D\u4E70
 follow_reply_message_is_image_text=false
 #\u8D2D\u7269\u8F66\u6D3B\u52A8
 ISSHOW=\u662F
-CARTDESC=\u4EAC\u4E1C\u4F17\u7B79\u4EF7¥399\uFF0C\u5FEB\u5FEB\u70B9\u6211\u524D\u5F80\uFF01
+CARTDESC=\u4EAC\u4E1C\u4F17\u7B79\u4EF7\uFFFD399\uFF0C\u5FEB\u5FEB\u70B9\u6211\u524D\u5F80\uFF01
 CART_URL=http://z.jd.com/project/details/53631.html?from=jr_search&type=0
 
 #\u5206\u4EAB\u8BED
@@ -57,7 +57,7 @@ shareThree=\u5DE5\u4F5C\u5FD9\u7684\u5F88\uFF0C\u5B9D\u5B9D\u4E00\u76F4\u662F\u8
 
 #xiaoxi moban
 #ce shi  huanjin
-INDEX_PAGE =http://h5.iamberry.com/iamberry/wechat/index
+#INDEX_PAGE =http://h5.iamberry.com/iamberry/wechat/index
 PAGE_SHIPMENT = http://h5.iamberry.com/iamberry/pay/goOrderInfo?orderId=
 TUIHUI_SHIPMENT = http://h5.iamberry.com/iamberry/wechat/agentWechat/reback
 ORDER_GUOQI = http://h5.iamberry.com/iamberry/pay/goOrderList

+ 39 - 21
iamberry-wechat-service/src/main/resources/iamberry-wechat-service-datasource.xml

@@ -13,21 +13,44 @@
 					http://www.springframework.org/schema/context/spring-context.xsd
 					http://www.springframework.org/schema/tx
 					http://www.springframework.org/schema/tx/spring-tx.xsd">
-    <!--理由加密使用-->
-	<bean id="jdbcUrlBean" class="com.iamberry.wechat.tools.DataSourceManager"></bean>
+	<!-- 获取jdbc配置文件 -->
+	<context:property-placeholder location="classpath:jdbc.properties"/>
 
-    <!--ratfw后台配置库数据源-->
-    <bean id="ratfwDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
-		<property name="driverClass" value="#{jdbcUrlBean.jdbcDriver}"></property>
-		<property name="jdbcUrl" value="#{jdbcUrlBean.jdbcUrl}"></property>
-		<property name="user" value="#{jdbcUrlBean.jdbcUserName}"></property>
-		<property name="password" value="#{jdbcUrlBean.jdbcPassword}"></property>
-		<!--连接池初始化值 -->
-		<property name="initialPoolSize" value="3"></property>
-		<!--连接池最大值 -->
-		<property name="maxPoolSize" value="#{jdbcUrlBean.maxPoolSize}"></property>
-		<!--最小空闲值,当空闲连接少于阀值时,连接池会预申请一些连接 -->
-		<property name="minPoolSize" value="2"></property>
+	<!--app 前台配置库数据源-->
+	<bean id="ratfwDataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
+		<!-- 数据源驱动类可不写,Druid默认会自动根据URL识别DriverClass -->
+		<property name="driverClassName" value="${jdbc.driver}" />
+		<!-- 基本属性 url、user、password -->
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
+		<!-- 配置初始化大小、最小、最大 -->
+		<property name="initialSize" value="${jdbc.pool.init}" />
+		<property name="minIdle" value="${jdbc.pool.minIdle}" />
+		<property name="maxActive" value="${jdbc.pool.maxActive}" />
+		<!-- 配置获取连接等待超时的时间 -->
+		<property name="maxWait" value="60000" />
+		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
+		<property name="timeBetweenEvictionRunsMillis" value="60000" />
+		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+		<property name="minEvictableIdleTimeMillis" value="300000" />
+		<property name="validationQuery" value="${jdbc.testSql}" />
+		<property name="testWhileIdle" value="true" />
+		<property name="testOnBorrow" value="false" />
+		<property name="testOnReturn" value="false" />
+		<property name="filters" value="stat"/>
+		<!-- 配置监控统计拦截的filters -->
+		<property name="proxyFilters">
+			<list>
+				<ref bean="wall-filter"/>
+			</list>
+		</property>
+	</bean>
+	<bean id="wall-filter" class="com.alibaba.druid.wall.WallFilter">
+		<property name="config" ref="wall-config" />
+	</bean>
+	<bean id="wall-config" class="com.alibaba.druid.wall.WallConfig">
+		<property name="multiStatementAllow" value="true" />
 	</bean>
 
 	<!-- 配置SqlSessionFactoryBean -->
@@ -35,15 +58,14 @@
 		<!-- 配置数据源 -->
 		<property name="dataSource" ref="ratfwDataSource" />
 		<property name="configLocation" value="classpath:iamberry-wechat-service-mybatis.xml" />
-		<property name="mapperLocations" value="classpath:com/iamberry/wechat/service/mapper/*.xml" />
 	</bean>
 
 	<!-- 自动扫描SQL隐射文件 -->
 	<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
 		<!-- basePackage:指定SQL映射文件、接口的包,自动加载SQL映射文件和接口 -->
-		<property name="basePackage" value="com.iamberry.wechat.service.mapper"></property>
+		<property name="basePackage"  value="com.iamberry.**.service.**.mapper" />
 		<!-- 引用SQLSessionFactoryBean -->
-		<property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />
+		<property name="sqlSessionFactoryBeanName"  value="sqlSessionFactory" />
 	</bean>
 
 	<!-- 事物管理 -->
@@ -51,10 +73,6 @@
 		<property name="dataSource" ref="ratfwDataSource" />
 	</bean>
 
-
-	<!-- 注解方式配置事物 在service中@Transactional
-	<tx:annotation-driven transaction-manager="transactionManager" /> -->
-
 	<tx:advice id="webTxAdvice" transaction-manager="transactionManager">
 		<tx:attributes>
 			<!-- 需要多个service协同操作,并需要事务支持的均以doxxx开头-->

+ 74 - 6
iamberry-wechat-service/src/main/resources/iamberry-wechat-service-mybatis.xml

@@ -2,11 +2,18 @@
 <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
 <configuration>
 	<!-- 设置  -->
-	<settings>  
-        <setting name="lazyLoadingEnabled" value="false" />  
+	<settings>
+		<!--关闭懒加载-->
+		<setting name="lazyLoadingEnabled" value="false" />
+		<!-- 日志使用log4j -->
+		<setting name="logImpl" value="LOG4J"/>
+		<!-- 开启驼峰命名转换 map_entity to mapEntity -->
 		<setting name="mapUnderscoreToCamelCase" value="true" />
-		<setting name="useColumnLabel" value="true" />    
-    </settings>
+		<!-- 使用jdbc的getGeneratedKeys获取数据库自增主键 -->
+		<setting name="useGeneratedKeys" value="true" />
+		<!-- 开启别列名转换 : select name as title form table -->
+		<setting name="useColumnLabel" value="true" />
+	</settings>
     <!-- 别名设置 -->
 	<typeAliases>
 		<typeAlias type="com.iamberry.wechat.core.entity.admin.AdminChildHavePermission" alias="AdminChildHavePermission"/>
@@ -168,8 +175,69 @@
 		<typeAlias type="com.iamberry.wechat.core.entity.questionnaire.QuestionnaireQuestion" alias="QuestionnaireQuestion"/>
 		<typeAlias type="com.iamberry.wechat.core.entity.questionnaire.QuestionnairePaperDto" alias="QuestionnairePaperDto"/>
 		<typeAlias type="com.iamberry.wechat.core.entity.questionnaire.QuestionnaireQuestionDto" alias="QuestionnaireQuestionDto"/>
-		
-		
 	</typeAliases>
 
+	<mappers>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminBannerMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminChildPermissionsMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminCouponItemMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminLogMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminOrderMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/adminStatisticsMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/agentApplyMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/agentMemberMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/agentOrderMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/bindingMacMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/cartMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/cashLogMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/configMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/couponItemMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/couponTypeMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/dealerRelationMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/drpRoleInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/firstAccessMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/firstJoinKeyMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/gameMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/homeMemberMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/imageTextInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/integralMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/keyWordMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/memberMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/menuInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/menuKeySetMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/mqMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/newsMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/orderMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/placeInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/placeLogsMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/placeOrderMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/placeWithDrawalsLogsMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/productImageTextMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/productInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/productMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/productPictureMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/qrcodeMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionnaireAnswerDetailedMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionnaireAnswerMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionnaireMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionnaireOptionMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionnairePaperMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionnaireQuestionMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/questionOptionMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/rebackInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/rewardsMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/salesLogMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/shareInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/systemMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/taskMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/templateFlowInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/templateInfoMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/temporaryQrcodeMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/tokenMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/wdRelationMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/wechatShareMapper.xml"/>
+		<mapper resource="com/iamberry/wechat/service/mapper/withdrawMapper.xml"/>
+	</mappers>
+
 </configuration>

+ 0 - 331
iamberry-wechat-web/src/main/resources/iamberry-wechat-web-consumer.xml

@@ -1,331 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans
-					http://www.springframework.org/schema/beans/spring-beans.xsd
-					http://code.alibabatech.com/schema/dubbo          
-   					http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
-   					
-	<!-- 消费方应用名,用于计算依赖关系,不是匹配条件,不要与提供方一样 -->
-	<dubbo:application name="iamberry-wechat-web-consumer"/>
-	
-	<!-- 使用multicast广播注册中心暴露发现服务地址 -->
-	<dubbo:registry address="zookeeper://127.0.0.1:2181" />
-	
-	<!-- dubbo所有事件下发线程池,最多接受50,超过等等 -->
-	<dubbo:protocol threads="1000" dispather="all" threadpool="fixed"/>
-	
-	<!-- 自动从注册中心发现监控
-	<dubbo:monitor protocol="registry"/> -->
-	
-	<!-- 非幂等性接口方法,可以重复调用3次,其他不重试 -->
-    <dubbo:reference retries="0" interface="com.iamberry.wechat.face.admin.AdminAdministratorService" id="adminAdministratorServiceImpl" check="false" timeout="30000">
-    	<dubbo:method name="insertadmin" retries="2"/>
-    	<dubbo:method name="selectAdminChildInfoByName" retries="2"/>
-    	<dubbo:method name="selectAdminChildInfoByList" retries="2"/>
-    	<dubbo:method name="selectAdminChildInfoByNameList" retries="2"/>
-    	<dubbo:method name="deleteAdminChildInfoById" retries="2"/>
-    	<dubbo:method name="selectAdminChildInfoById" retries="2"/>
-    	<dubbo:method name="updateAdminChildInfoById" retries="2"/>
-    	<dubbo:method name="updatePermissionsById" retries="2"/>
-    	<dubbo:method name="selectAdminChildInfoByCount" retries="2"/>
-    	<dubbo:method name="selectAdminChildInfoByNameCount" retries="2"/>
-    	<dubbo:method name="updateAdminByPwd" retries="2"/>
-    	<dubbo:method name="updateSuperAdminByPwd" retries="2"/>
-    </dubbo:reference>
-    
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.admin.AdminLoginService" id="adminLoginServiceImpl" check="false" timeout="30000">
-    	<dubbo:method name="selectAdminInfoByNameAndPwd" retries="2"/>
-    	<dubbo:method name="selectAdminChildHavePermissionById" retries="2"/>
-    	<dubbo:method name="selectMenusById" retries="2"/>
-	</dubbo:reference>
-	
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.admin.AdminLogService" id="adminLogServiceImpl" check="false" timeout="30000">
-    	<dubbo:method name="insertOne" retries="2"/>
-	</dubbo:reference>
-	
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.admin.AdminPermissionsService" id="adminPermissionsServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectPermissionById" retries="2"/>
-		<dubbo:method name="insertPermissionById" retries="2"/>
-		<dubbo:method name="deletePermissionById" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.admin.SystemService" id="systemServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectOneShopRuleById" retries="2"/>
-		<dubbo:method name="selectAllShopRule" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.agent.AgentMemberService" id="agentMemberServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getMyOrderStatusCount" retries="2"/>
-		<dubbo:method name="getAgentMemberInfo" retries="2"/>
-		<dubbo:method name="getWillIncomeByOpenId" retries="2"/>
-		<dubbo:method name="getMemberInfo" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.agent.AgentOrderService" id="agentOrderServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getAgentOrderListByOpenId" retries="2"/>
-		<dubbo:method name="getAgentOrderCountByUserId" retries="2"/>
-		<dubbo:method name="getProductCountByOpenId" retries="2"/>
-		<dubbo:method name="selectCountOrderByOpenId" retries="2"/>
-		<dubbo:method name="getPayedOrderByOpenId" retries="2"/>
-		<dubbo:method name="updateOrderLockTypeByOrderId" retries="2"/>
-		<dubbo:method name="getOrderListAndCountByOpenid" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.banner.AdminBannerService" id="adminBannerServiceImpl" check="false" timeout="30000">
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.bindingapp.BindingMacService" id="bindingMacServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getOneById" retries="2"/>
-		<dubbo:method name="insert" retries="0"/>
-		<dubbo:method name="update" retries="2"/>
-		<dubbo:method name="selectAll" retries="2"/>
-		<dubbo:method name="getAllCount" retries="2"/>
-		<dubbo:method name="testExist" retries="2"/>
-		<dubbo:method name="deleteBindingById" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.cart.CartService" id="cartServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectCartByOpenId" retries="2"/>
-		<dubbo:method name="getCartNumByCartOpenId" retries="2"/>
-		<dubbo:method name="updateCartByOpenId" retries="0"/>
-		<dubbo:method name="getCartNumByOpenId" retries="2"/>
-		<dubbo:method name="getCartByCartProductId" retries="2"/>
-		<dubbo:method name="addProductToCart" retries="0"/>
-		<dubbo:method name="deleteCartByCartId" retries="0"/>
-		<dubbo:method name="selectShopOrder" retries="2"/>
-		<dubbo:method name="getOrderNumByOpenId" retries="2"/>
-		<dubbo:method name="selectShopOrderItem" retries="2"/>
-		<dubbo:method name="getShopOrderByOrderId" retries="2"/>
-		<dubbo:method name="selectCartItemByListId" retries="2"/>
-		<dubbo:method name="addOrderAndSaveOrderItem" retries="0"/>
-		<dubbo:method name="updateOrderStatus" retries="2"/>
-		<dubbo:method name="selectOrderStatusByOrderId" retries="2"/>
-		<dubbo:method name="getOpenIdAndStatus" retries="2"/>
-		<dubbo:method name="updateOrderByOrderId" retries="2"/>
-		<dubbo:method name="selectOrderInfoById" retries="2"/>
-		<dubbo:method name="getReluByRid" retries="2"/>
-		<dubbo:method name="getItemNumByOrderId" retries="2"/>
-		<dubbo:method name="supdateStateByOrderId" retries="2"/>
-		<dubbo:method name="getCouponReduceByItemId" retries="2"/>
-		<dubbo:method name="getOrderList" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.cart.ProductInfoService" id="productInfoServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectPageProduct" retries="2"/>
-		<dubbo:method name="getProductByProductId" retries="2"/>
-		<dubbo:method name="getProductByProductName" retries="2"/>
-		<dubbo:method name="selectProductCount" retries="2"/>
-		<dubbo:method name="selectIndexPageProduct" retries="2"/>
-		<dubbo:method name="cacheIndexPageProduct" retries="2"/>
-		<dubbo:method name="updateProductNumList" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.coupon.AdminCouponItemService" id="adminCouponItemServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getAllCouponItem" retries="2"/>
-		<dubbo:method name="getCouponItemCount" retries="2"/>
-		<dubbo:method name="getCouponItemByCouponItemId" retries="2"/>
-		<dubbo:method name="updateCouponItem" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.coupon.CouponItemService" id="couponItemServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getCouponItemDtoList" retries="2"/>
-		<dubbo:method name="getCouponItemCount" retries="2"/>
-		<dubbo:method name="insertCouponItem" retries="2"/>
-		<dubbo:method name="getCouponItemById" retries="2"/>
-		<dubbo:method name="updateCouponItemById" retries="2"/>
-		<dubbo:method name="updateCouponItemList" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.coupon.CouponTypeService" id="couponTypeServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getCouponTypeList" retries="2"/>
-		<dubbo:method name="getCouponTypeCount" retries="2"/>
-		<dubbo:method name="insertCouponType" retries="0"/>
-		<dubbo:method name="getCouponTypeById" retries="2"/>
-		<dubbo:method name="getUnGetCoupon" retries="2"/>
-		<dubbo:method name="updateCouponTypeForItem" retries="2"/>
-		<dubbo:method name="updateCouponTypeById" retries="2"/>
-		<dubbo:method name="deleteCouponTypeById" retries="0"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.drp.DrpRoleInfoService" id="drpRoleInfoServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getDrpRoleList" retries="2"/>
-		<dubbo:method name="getDrpRoleList2" retries="2"/>
-		<dubbo:method name="selectDrpRoleCount" retries="2"/>
-		<dubbo:method name="addDrpRoleInfo" retries="0"/>
-		<dubbo:method name="selectDrpRoleInfo" retries="2"/>
-		<dubbo:method name="updateDrpRoleInfo" retries="2"/>
-		<dubbo:method name="updateDrpRoleStatus" retries="2"/>
-		<dubbo:method name="getDrpRoleListByState" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.drp.PlaceInfoService" id="placeInfoServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="delete" retries="2"/>
-		<dubbo:method name="addOne" retries="0"/>
-		<dubbo:method name="update" retries="2"/>
-		<dubbo:method name="batchInsert" retries="0"/>
-		<dubbo:method name="getPlaceInfoById" retries="2"/>
-		<dubbo:method name="getPlaceInfoByOpenId" retries="2"/>
-		<dubbo:method name="getOnePlaceInfoByInitcode" retries="2"/>
-		<dubbo:method name="SearchPlaceInfo" retries="2"/>
-		<dubbo:method name="SearchPlaceInfoPage" retries="2"/>
-		<dubbo:method name="insertOne" retries="0"/>
-		<dubbo:method name="getTotalMoneyByPlaceId" retries="2"/>
-		<dubbo:method name="selectPlaceIdByOpenId" retries="2"/>
-		<dubbo:method name="selectPlaceInfosForDownLoad" retries="2"/>
-		<dubbo:method name="batchUpdate" retries="2"/>
-		<dubbo:method name="getPlaceId" retries="2"/>
-		<dubbo:method name="selectApplyPlaceLogs" retries="2"/>
-		<dubbo:method name="getCount" retries="2"/>
-		<dubbo:method name="updateApplyStatus" retries="2"/>
-		<dubbo:method name="selectApplyLogsByPlaceID" retries="2"/>
-		<dubbo:method name="handlerApplyLogs" retries="2"/>
-		<dubbo:method name="addApplyPlaceLogs" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.drp.PlaceLogsService" id="placeLogsServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="SearchPlaceLogsPage" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.drp.PlaceOrderService" id="placeOrderServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getOrderPaper" retries="2"/>
-		<dubbo:method name="getOrderPaperById" retries="2"/>
-		<dubbo:method name="submitOrder" retries="0"/>
-		<dubbo:method name="payOrder" retries="2"/>
-		<dubbo:method name="getSearchPaidOrder" retries="2"/>
-		<dubbo:method name="getSearchPaidOrderNext" retries="2"/>
-		<dubbo:method name="getSearchPaidOrderAdmin" retries="2"/>
-		<dubbo:method name="UpdateOrder" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.drp.PlaceWithDrawalsLogsService" id="placeWithDrawalsLogsServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getTheRule" retries="2"/>
-		<dubbo:method name="getOne" retries="2"/>
-		<dubbo:method name="apply" retries="0"/>
-		<dubbo:method name="submitApply" retries="0"/>
-		<dubbo:method name="dealApply" retries="2"/>
-		<dubbo:method name="HistoryRecords" retries="2"/>
-		<dubbo:method name="HistoryRecordsNext" retries="2"/>
-		<dubbo:method name="HistoryRecordsManager" retries="2"/>
-		<dubbo:method name="insertTest" retries="0"/>
-		<dubbo:method name="getTotalMoneyByPlaceId" retries="2"/>
-		<dubbo:method name="selectAllMore" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.flow.TemplateFlowInfoService" id="templateFlowInfoServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getTemplateFlowInfo" retries="2"/>
-		<dubbo:method name="addTemplateFlowList" retries="0"/>
-		<dubbo:method name="getFlowInfoListByTemplateId" retries="2"/>
-		<dubbo:method name="updateTemplateFlowInfo" retries="2"/>
-		<dubbo:method name="getTypeId" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.flow.TemplateInfoService" id="templateInfoServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getSelectTemplateInfo" retries="2"/>
-		<dubbo:method name="getTemplateList" retries="2"/>
-		<dubbo:method name="getTemplateCount" retries="2"/>
-		<dubbo:method name="addTemplateInfo" retries="0"/>
-		<dubbo:method name="getTemplateInfoById" retries="2"/>
-		<dubbo:method name="updateTemplateInfo" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.home.HomeService" id="homeServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectNowBannerByType" retries="2"/>
-		<dubbo:method name="selectMemberInfoByOpenId" retries="2"/>
-		<dubbo:method name="updateWechatMemberInfoByByOpenid" retries="2"/>
-		<dubbo:method name="insertMemberInfo" retries="0"/>
-		<dubbo:method name="updateUserResAndTypeByOpenid" retries="2"/>
-		<dubbo:method name="updateMemberStatusByOpenId" retries="2"/>
-		<dubbo:method name="selectMemberQrcodeUrlByOpenid" retries="2"/>
-		<dubbo:method name="updateMemberQrcodeByOpenid" retries="2"/>
-		<dubbo:method name="selectOnePlaceInfoByCode" retries="2"/>
-		<dubbo:method name="updateOpenidById" retries="2"/>
-		<dubbo:method name="selectUserIntegralByOpenid" retries="2"/>
-		<dubbo:method name="selectUserInfoByPlaceId" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.member.CashLogService" id="cashLogServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getAllCashLog" retries="2"/>
-		<dubbo:method name="addCashLog" retries="0"/>
-		<dubbo:method name="deleteCashLogs" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.member.IntegralService" id="integralServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.member.MemberService" id="memberServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="getMemberByUserId" retries="2"/>
-		<dubbo:method name="getMemberByUserOpenId" retries="2"/>
-		<dubbo:method name="getCount" retries="2"/>
-		<dubbo:method name="getMemberByPage" retries="2"/>
-		<dubbo:method name="updateMemberByUserId" retries="2"/>
-		<dubbo:method name="updateUserIntegral" retries="0"/>
-		<dubbo:method name="updateUserUseIntegral" retries="0"/>
-		<dubbo:method name="selectUserIntegralByWechatProxyId" retries="2"/>
-		<dubbo:method name="selectUserIdentityAndQrcodeByOpenId" retries="2"/>
-		<dubbo:method name="selectUserResAndIdSByOpenId" retries="2"/>
-		<dubbo:method name="updateUserIncomeByOpenId" retries="0"/>
-		<dubbo:method name="updateUserFlagByOpenId" retries="2"/>
-		<dubbo:method name="selectDownCountByUserId" retries="2"/>
-		<dubbo:method name="buildChildUser" retries="2"/>
-		<dubbo:method name="getDownInfoAndBuyedCount" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.member.ShareInfoService" id="shareInfoServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="addShareInfo" retries="2"/>
-		<dubbo:method name="getShareInfoByOpenidAndType" retries="2"/>
-		<dubbo:method name="getShareInfoById" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.member.WithdrawService" id="withdrawServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectWithDraw" retries="2"/>
-		<dubbo:method name="getCount" retries="2"/>
-		<dubbo:method name="updateWithdraw" retries="2"/>
-		<dubbo:method name="addApplyWithdraw" retries="0"/>
-		<dubbo:method name="addApplyCashWithdraw" retries="0"/>
-		<dubbo:method name="selectLogsByOpenid" retries="2"/>
-		<dubbo:method name="selectLogsCountByOpenid" retries="2"/>
-		<dubbo:method name="selectWithdrawLogsById" retries="2"/>
-		<dubbo:method name="handleWithdrawStatus" retries="2"/>
-		<dubbo:method name="handleWithdrawCashStatus" retries="2"/>
-		<dubbo:method name="selectUseLogsCount" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.mq.EfastOrderService" id="efastOrderServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="selectEfastSendOrderInfo" retries="2"/>
-		<dubbo:method name="selectEfastSendOrderList" retries="2"/>
-		<dubbo:method name="addOrderInfoToEfast" retries="2"/>
-		<dubbo:method name="sendOrderInfoToEfast" retries="2"/>
-		<dubbo:method name="selectEfastReturnOrderInfo" retries="2"/>
-		<dubbo:method name="returnOrderInfoToEfast" retries="2"/>
-		<dubbo:method name="exchangeOrderInfoToEfast" retries="2"/>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.mq.MQSerivce" id="mQSerivceImplProxy" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.news.NewsService" id="newsServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="1" interface="com.iamberry.wechat.face.order.AdminOrderService" id="adminOrderServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="updateOrderIntegral" retries="1"></dubbo:method>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.pay.PayService" id="payServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.porduct.ProductImageTextService" id="productImageTextServiceImpl" check="false" timeout="30000"/>
-	
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.porduct.ProductPictureService" id="productPictureServiceImpl" check="false" timeout="30000"/>
-	
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.porduct.ProductService" id="productServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="addProduct" retries="0"></dubbo:method>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.qrcode.QrcodeService" id="qrcodeServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="updateQRcodeStatusByUserOpenid" retries="0"/>
-		<dubbo:method name="updateQRcodeScannNumAndSubNum" retries="0"/>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.qrcode.TemporaryQrcodeService" id="temporaryQrcodeServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="applyTempQrcode" retries="0"/>
-		<dubbo:method name="insertTempQrcode" retries="0"/>
-	</dubbo:reference>
-	<dubbo:reference retries="0" interface="com.iamberry.wechat.face.reback.LoadRewardTaskService" id="loadRewardTaskServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.reback.RebackServices" id="rebackServicesImpl" check="false" timeout="30000">
-		<dubbo:method name="insert" retries="0"/>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.reback.RebackStaticService" id="rebackStaticServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.relationship.DealerRelationService" id="dealerRelationServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="insertDealerRelation" retries="0"></dubbo:method>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.relationship.WdRelationService" id="wdRelationServiceImpl" check="false" timeout="30000">
-		<dubbo:method name="insertWdRelation" retries="0"></dubbo:method>
-	</dubbo:reference>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.ConfigService" id="configServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.FirstJoinKeyService" id="firstJoinKeyServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.ImageTextInfoService" id="imageTextInfoServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.ImageTextMoreService" id="imageTextMoreServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.KeyWordService" id="keyWordServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.MenuInfoService" id="menuInfoServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.MenuKeySetService" id="menuKeySetServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.TokenService" id="tokenServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.wechat.WeChatService" id="weChatServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.statistics.AdminStatisticsService" id="adminStatisticsServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.porduct.ProductTypeService" id="productTypeServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.task.WechatTaskService" id="wechatTaskServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.rewards.RewardsService" id="rewardsServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.rewards.SalesLogService" id="salesLogServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.game.GameService" id="gameServiceImpl" check="false" timeout="30000"/>
-	<!-- 营养自测service -->
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.questionnaire.QuestionnaireService" id="questionnaireServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.questionnaire.QuestionOptionService" id="questionOptionServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.questionnaire.QuestionnaireAnswerService" id="questionnaireAnswerServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.questionnaire.QuestionnaireAnswerDetailedService" id="questionnaireAnswerDetailedServiceImpl" check="false" timeout="30000"/>
-	<dubbo:reference retries="2" interface="com.iamberry.wechat.face.questionnaire.QuestionnairePaperService" id="questionnairePaperServiceImpl" check="false" timeout="30000"/>
-</beans>

+ 17 - 11
iamberry-wechat-web/src/main/resources/iamberry-wechat-web-ioc.xml

@@ -38,6 +38,9 @@
 	
 	<!-- 使用CGLIB动态代理 -->
     <aop:aspectj-autoproxy proxy-target-class="true"/>
+
+	<!-- 数据源配置 -->
+	<import resource="classpath:iamberry-wechat-service-datasource.xml"/>
     
     <!-- 配置springContextHolder -->
     <bean class="com.iamberry.zk.SpringContextHolder" lazy-init="false" />
@@ -49,11 +52,6 @@
 	
 	<!-- 加载静态资源 -->
 	<bean id="loadResultInfo" class="com.iamberry.wechat.tools.loadResultUtil" lazy-init="false"></bean>
-	
-	 
-	<!-- 缺省的异步任务线程池
-	<task:executor id="asyncExecutor" pool-size="1-1000" rejection-policy="CALLER_RUNS" queue-capacity="10" />
-    <task:annotation-driven executor="asyncExecutor"/> --> 
     
     
     <!-- 将30天后奖励积分的定时任务的xml引入
@@ -61,10 +59,18 @@
     
 	<!-- 开启注解启动定时器 -->
     <!--<task:annotation-driven/>-->
-    
-    <!-- 加载zk config -->
-    <!-- <context:property-placeholder location="classpath:zk.properties"/> -->
-    
-    <!-- 通过Dubbo 完成SOA -->
-	<import resource="classpath:iamberry-wechat-web-consumer.xml"/>
+
+	<!-- spring监控 -->
+	<bean id="druid-stat-interceptor" class="com.alibaba.druid.support.spring.stat.DruidStatInterceptor">
+	</bean>
+	<bean id="druid-stat-pointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut" scope="prototype">
+		<property name="patterns">
+			<list>
+				<value>com.iamberry.wechat.*</value>
+			</list>
+		</property>
+	</bean>
+	<aop:config proxy-target-class="true">
+		<aop:advisor advice-ref="druid-stat-interceptor" pointcut-ref="druid-stat-pointcut" />
+	</aop:config>
 </beans>

+ 25 - 8
iamberry-wechat-web/src/main/resources/iamberry-wechat-web-springmvc.xml

@@ -21,7 +21,7 @@
 	</context:component-scan>
 	
 	<!-- 配置freeMarker视图解析器 -->
-    <bean id="viewResolverFtl" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
+    <!--<bean id="viewResolverFtl" class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
         <property name="viewClass" value="org.springframework.web.servlet.view.freemarker.FreeMarkerView"/>
         <property name="contentType" value="text/html; charset=UTF-8"/>
         <property name="exposeRequestAttributes" value="true" />
@@ -31,9 +31,9 @@
         <property name="cache" value="true" />
         <property name="suffix" value=".ftl" />
         <property name="order" value="0"/>
-    </bean>
+    </bean>-->
 
-    <!-- 配置FREEMARKER的视图解析器 -->
+    <!--&lt;!&ndash; 配置FREEMARKER的视图解析器 &ndash;&gt;
     <bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
         <property name="templateLoaderPath" value="/WEB-INF/views/"/>
         <property name="freemarkerVariables">
@@ -44,7 +44,7 @@
         <property name="defaultEncoding" value="UTF-8"/>
         <property name="freemarkerSettings">
             <props>
-            	<!-- 指定更新模版文件的间隔时间,相当于多长时间检测一下是否有必要重新加载模版文件,0 表示每次都重新加载,否则为多少毫秒钟检测一下模版是否更改  -->
+            	&lt;!&ndash; 指定更新模版文件的间隔时间,相当于多长时间检测一下是否有必要重新加载模版文件,0 表示每次都重新加载,否则为多少毫秒钟检测一下模版是否更改  &ndash;&gt;
                 <prop key="template_update_delay">3600</prop>
                 <prop key="locale">zh_CN</prop>
                 <prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
@@ -53,7 +53,7 @@
             </props>
         </property>
     </bean>
-    <bean id="fmXmlEscape" class="freemarker.template.utility.XmlEscape"/>
+    <bean id="fmXmlEscape" class="freemarker.template.utility.XmlEscape"/>-->
     
 	<!-- 配置JSP视图解析器: 如何把 handler 方法返回值解析为实际的物理视图 -->
 	<bean id="viewResolverJsp" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
@@ -73,9 +73,26 @@
 	<!--<mvc:resources location="/common/" mapping="/common/**" />  
 	<mvc:resources location="/css/" mapping="/css/**" />  
 	<mvc:resources location="/image/" mapping="/image/**" />  
-	<mvc:resources location="/ueditor/" mapping="/ueditor/**" />  --> 
-	<!-- 解决配置mvc:default-servlet-handler后,前台handler方法失效问 -->
-	<mvc:annotation-driven></mvc:annotation-driven>
+	<mvc:resources location="/ueditor/" mapping="/ueditor/**" />  -->
+    <!-- 解决配置mvc:default-servlet-handler后,前台handler方法失效问 -->
+    <mvc:annotation-driven>
+        <!-- 配置@ResponseBody后,如果返回为Entity,有null的数据返回,增大返回数据大小 -->
+        <mvc:message-converters>
+            <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
+                <property name="objectMapper">
+                    <bean class="com.fasterxml.jackson.databind.ObjectMapper">
+                        <!-- 为null字段时不显示 -->
+                        <property name="serializationInclusion">
+                            <value type="com.fasterxml.jackson.annotation.JsonInclude.Include">NON_NULL</value>
+                        </property>
+                    </bean>
+                </property>
+            </bean>
+        </mvc:message-converters>
+    </mvc:annotation-driven>
+
+
+
 	<!-- 配置MultipartResolver -->
 	<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
 		<!-- 默认的编码 -->

File diff suppressed because it is too large
+ 193 - 0
iamberry-wechat-web/src/main/resources/platform.properties


+ 4 - 4
iamberry-wechat-web/src/main/resources/wx_public_no.properties

@@ -1,8 +1,8 @@
-pubNo=gh_069cd4a82950
-appId=wx2abd86e7dd0c8bc3
+pubNo=gh_c73446c8ce91
+appId=wxc71b789fad06a2d7
 token=weixin
-appSecret=e3b11ca050578ac8b794b510b16b2020
-partner=1240220902
+appSecret=8a90e3ab0e2db7772f5f64e7ed2f4b98
+partner=1321590501
 partnerkey=cdb9075e7ecad945ba788bc5aedM212B
 charset=UTF-8
 KEYSTORE_FILE=E:/apiclient_cert.p12

+ 25 - 0
iamberry-wechat-web/src/main/webapp/WEB-INF/web.xml

@@ -78,6 +78,31 @@
 		<filter-name>cors</filter-name>
 		<url-pattern>/*</url-pattern>
 	</filter-mapping>
+
+	<!-- WEB 监控 -->
+	<filter>
+		<filter-name>DruidWebStatFilter</filter-name>
+		<filter-class>com.alibaba.druid.support.http.WebStatFilter</filter-class>
+	</filter>
+	<filter-mapping>
+		<filter-name>DruidWebStatFilter</filter-name>
+		<url-pattern>/*</url-pattern>
+	</filter-mapping>
+
+	<!-- 解决Tomcat内部缓存问题 -->
+	<filter>
+		<filter-name>ExpiresFilter</filter-name>
+		<filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
+		<init-param>
+			<param-name>ExpiresByType text/html</param-name>
+			<param-value>access plus -1 minutes</param-value>
+		</init-param>
+	</filter>
+	<filter-mapping>
+		<filter-name>ExpiresFilter</filter-name>
+		<url-pattern>/*</url-pattern>
+		<dispatcher>REQUEST</dispatcher>
+	</filter-mapping>
 	
 	<!-- 错误页面定义 -->
 	<error-page>