Browse Source

微信支付模块开发,修改类名,区别同名文件

ZhangWenQiang 6 years atrás
parent
commit
0979e79958

+ 2 - 2
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatpay/entity/HpUser.java

@@ -13,7 +13,7 @@ import java.util.Date;
  * @author zwq
  * @version 2019-03-27
  */
-public class HpUser extends DataEntity<HpUser> {
+public class HpUserPay extends DataEntity<HpUserPay> {
 
     private static final long serialVersionUID = 1L;
     private String phone;        // 手机(APP登录用户名即手机)
@@ -54,7 +54,7 @@ public class HpUser extends DataEntity<HpUser> {
     private String idCardNumber;        // 身份证号码
     private String birthYear;    //出生年份
 
-    public HpUser() {
+    public HpUserPay() {
         super();
         this.setIdType(IDTYPE_AUTO);
     }

+ 2 - 2
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatpay/mapper/HpUserMapper.java

@@ -5,7 +5,7 @@ package com.jeeplus.modules.wechatpay.mapper;
 
 import com.jeeplus.core.persistence.BaseMapper;
 import com.jeeplus.core.persistence.annotation.MyBatisMapper;
-import com.jeeplus.modules.wechatpay.entity.HpUser;
+import com.jeeplus.modules.wechatpay.entity.HpUserPay;
 
 /**
  * 开心用户MAPPER接口
@@ -14,7 +14,7 @@ import com.jeeplus.modules.wechatpay.entity.HpUser;
  * @version 2019-03-20
  */
 @MyBatisMapper
-public interface HpUserMapper extends BaseMapper<HpUser> {
+public interface HpUserPayMapper extends BaseMapper<HpUserPay> {
 
 
 }

+ 2 - 2
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatpay/mapper/xml/HpUserMapper.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.jeeplus.modules.wechatpay.mapper.HpUserMapper">
+<mapper namespace="com.jeeplus.modules.wechatpay.mapper.HpUserPayMapper">
     
 	<sql id="hpUserColumns">
 		a.id AS "id",
@@ -52,7 +52,7 @@
 	</sql>
 	
     
-	<select id="get" resultType="com.jeeplus.modules.wechatpay.entity.HpUser" >
+	<select id="get" resultType="com.jeeplus.modules.wechatpay.entity.HpUserPay" >
 		SELECT 
 			<include refid="hpUserColumns"/>
 		FROM hp_user a

+ 6 - 6
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatpay/service/HpUserService.java

@@ -5,8 +5,8 @@ package com.jeeplus.modules.wechatpay.service;
 
 
 import com.jeeplus.core.service.CrudService;
-import com.jeeplus.modules.wechatpay.entity.HpUser;
-import com.jeeplus.modules.wechatpay.mapper.HpUserMapper;
+import com.jeeplus.modules.wechatpay.entity.HpUserPay;
+import com.jeeplus.modules.wechatpay.mapper.HpUserPayMapper;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -20,20 +20,20 @@ import java.util.List;
  */
 @Service
 @Transactional(readOnly = true)
-public class HpUserService extends CrudService<HpUserMapper, HpUser> {
+public class HpUserPayService extends CrudService<HpUserPayMapper, HpUserPay> {
 
 
-    public HpUser get(String id) {
+    public HpUserPay get(String id) {
         return super.get(id);
     }
 
-    public List<HpUser> findList(HpUser hpUser) {
+    public List<HpUserPay> findList(HpUserPay hpUser) {
         return super.findList(hpUser);
     }
 
 
     @Transactional(readOnly = false)
-    public void save(HpUser hpUser) {
+    public void save(HpUserPay hpUser) {
         super.save(hpUser);
     }
 

+ 7 - 7
happy-job-module-hppay/src/main/java/com/jeeplus/modules/wechatpay/utils/WeChatPay.java

@@ -1,9 +1,9 @@
 package com.jeeplus.modules.wechatpay.utils;
 
 import com.jeeplus.modules.wechatpay.entity.HpPayAccount;
-import com.jeeplus.modules.wechatpay.entity.HpUser;
+import com.jeeplus.modules.wechatpay.entity.HpUserPay;
 import com.jeeplus.modules.wechatpay.service.HpPayAccountService;
-import com.jeeplus.modules.wechatpay.service.HpUserService;
+import com.jeeplus.modules.wechatpay.service.HpUserPayService;
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -45,7 +45,7 @@ public class WeChatPay {
     @Autowired
     private HpPayAccountService hpPayAccountService;
     @Autowired
-    private HpUserService hpUserService;
+    private HpUserPayService hpUserService;
 
     /**
      * 用户支付给商家
@@ -110,9 +110,9 @@ public class WeChatPay {
             }
 
             // 获取用户openId
-            HpUser hpUser = new HpUser();
+            HpUserPay hpUser = new HpUserPay();
             hpUser = hpUserService.get(fansId);
-            if(hpUser != null){
+            if (hpUser != null) {
                 openid = hpUser.getMinaOpenid();
             }
 
@@ -257,10 +257,10 @@ public class WeChatPay {
                 // 获取fansId
                 String fansId = "";
 
-                HpUser hpUser = new HpUser();
+                HpUserPay hpUser = new HpUserPay();
                 hpUser.setMinaOpenid(openid);
                 hpUser = hpUserService.get(hpUser);
-                if(hpUser != null){
+                if (hpUser != null) {
                     fansId = hpUser.getId();
                 }