浏览代码

余额支付

xubh 4 年之前
父节点
当前提交
fd14c9c0f2

+ 6 - 1
src/main/java/com/minpay/common/action/LoginAction.java

@@ -176,6 +176,11 @@ public class LoginAction implements IMINAction {
 		} else {
 			res.set("isCheckIng", "0");
 		}
+		VmEquipmentInf vmEquipmentInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmEquipmentInfMapper.class).selectByPrimaryKey(equNo);
+		if(vmEquipmentInf == null){
+			throw new MINBusinessException("机器不存在");
+		}
+
 		MINActionResult result = null;
 		if("WX".equals(type)){
 			result = this.getWxPayOpenid(channel, code);
@@ -223,7 +228,6 @@ public class LoginAction implements IMINAction {
 			}
 			res.set("isMerchants","0");
 			if("1".equals(person.getIsUser())){
-				VmEquipmentInf vmEquipmentInf = Service.lookup(IMINDataBaseService.class).getMybatisMapper(VmEquipmentInfMapper.class).selectByPrimaryKey(equNo);
 				if(vmEquipmentInf.getBranchid().equals(person.getUserId())){
 					res.set("isMerchants",person.getIsUser());  //是本机器的商户(是否管理员)
 					res.set("role",person.getRole());
@@ -249,6 +253,7 @@ public class LoginAction implements IMINAction {
 		// 注册到session
 		User sessionUser = new User(person);
 		sessionUser.setEquipmentNo(equNo);
+		sessionUser.setBranchId(vmEquipmentInf.getBranchid());
 		res.setSessionId(MINServiceLocator.getInstance().lookup(IMINSessionService.class).registerSession(request, sessionUser));
 		res.set("nickName", result.get("nickName"));
 		res.set("headImgurl", result.get("headImgurl"));

+ 1 - 2
src/main/java/com/minpay/db/table/mapper/VmRechargeRuleMapper.java

@@ -3,9 +3,8 @@ package com.minpay.db.table.mapper;
 import com.minpay.db.table.model.VmRechargeRule;
 import com.minpay.db.table.model.VmRechargeRuleExample;
 import com.startup.minpay.frame.jdbc.IMINMybatisEntityMapper;
-import org.apache.ibatis.annotations.Param;
-
 import java.util.List;
+import org.apache.ibatis.annotations.Param;
 
 public interface VmRechargeRuleMapper extends IMINMybatisEntityMapper<VmRechargeRule, String, VmRechargeRuleExample> {
     /**

+ 32 - 0
src/main/java/com/minpay/db/table/model/VmRechargeRule.java

@@ -60,6 +60,14 @@ public class VmRechargeRule extends AbstractMINBean {
     private String state;
 
     /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column vm_recharge_rule.VRR_BRANCH
+     *
+     * @mbggenerated
+     */
+    private String branch;
+
+    /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column vm_recharge_rule.VRR_ID
      *
@@ -226,4 +234,28 @@ public class VmRechargeRule extends AbstractMINBean {
     public void setState(String state) {
         this.state = state == null ? null : state.trim();
     }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column vm_recharge_rule.VRR_BRANCH
+     *
+     * @return the value of vm_recharge_rule.VRR_BRANCH
+     *
+     * @mbggenerated
+     */
+    public String getBranch() {
+        return branch;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column vm_recharge_rule.VRR_BRANCH
+     *
+     * @param branch the value for vm_recharge_rule.VRR_BRANCH
+     *
+     * @mbggenerated
+     */
+    public void setBranch(String branch) {
+        this.branch = branch == null ? null : branch.trim();
+    }
 }

+ 78 - 0
src/main/java/com/minpay/db/table/model/VmRechargeRuleExample.java

@@ -735,6 +735,84 @@ public class VmRechargeRuleExample {
             addCriterion("VRR_STATE not between", value1, value2, "state");
             return (Criteria) this;
         }
+
+        public Criteria andBranchIsNull() {
+            addCriterion("VRR_BRANCH is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIsNotNull() {
+            addCriterion("VRR_BRANCH is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchEqualTo(String value) {
+            if(value == null ){
+                andBranchIsNull();
+            } else {
+                addCriterion("VRR_BRANCH =", value, "branch");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotEqualTo(String value) {
+            if(value == null ){
+                andBranchIsNotNull();
+            } else {
+                addCriterion("VRR_BRANCH <>", value, "branch");
+            }
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchGreaterThan(String value) {
+            addCriterion("VRR_BRANCH >", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchGreaterThanOrEqualTo(String value) {
+            addCriterion("VRR_BRANCH >=", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLessThan(String value) {
+            addCriterion("VRR_BRANCH <", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLessThanOrEqualTo(String value) {
+            addCriterion("VRR_BRANCH <=", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchLike(String value) {
+            addCriterion("VRR_BRANCH like", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotLike(String value) {
+            addCriterion("VRR_BRANCH not like", value, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchIn(List<String> values) {
+            addCriterion("VRR_BRANCH in", values, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotIn(List<String> values) {
+            addCriterion("VRR_BRANCH not in", values, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchBetween(String value1, String value2) {
+            addCriterion("VRR_BRANCH between", value1, value2, "branch");
+            return (Criteria) this;
+        }
+
+        public Criteria andBranchNotBetween(String value1, String value2) {
+            addCriterion("VRR_BRANCH not between", value1, value2, "branch");
+            return (Criteria) this;
+        }
     }
 
     /**

+ 20 - 5
src/main/resources/com/minpay/db/table/mapper/VmRechargeRuleMapper.xml

@@ -13,6 +13,7 @@
     <result column="VRR_CREATE_TIME" jdbcType="VARCHAR" property="createTime" />
     <result column="VRR_CREATE_USER" jdbcType="VARCHAR" property="createUser" />
     <result column="VRR_STATE" jdbcType="VARCHAR" property="state" />
+    <result column="VRR_BRANCH" jdbcType="VARCHAR" property="branch" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -86,7 +87,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     VRR_ID, VRR_RECHARGE_AMT, VRR_GIVE_AMT, VRR_DESC, VRR_CREATE_TIME, VRR_CREATE_USER, 
-    VRR_STATE
+    VRR_STATE, VRR_BRANCH
   </sql>
   <select id="selectByExample" parameterType="com.minpay.db.table.model.VmRechargeRuleExample" resultMap="BaseResultMap">
     <!--
@@ -141,10 +142,10 @@
     -->
     insert into vm_recharge_rule (VRR_ID, VRR_RECHARGE_AMT, VRR_GIVE_AMT, 
       VRR_DESC, VRR_CREATE_TIME, VRR_CREATE_USER, 
-      VRR_STATE)
+      VRR_STATE, VRR_BRANCH)
     values (#{id,jdbcType=VARCHAR}, #{rechargeAmt,jdbcType=VARCHAR}, #{giveAmt,jdbcType=VARCHAR}, 
       #{desc,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR}, #{createUser,jdbcType=VARCHAR}, 
-      #{state,jdbcType=VARCHAR})
+      #{state,jdbcType=VARCHAR}, #{branch,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.minpay.db.table.model.VmRechargeRule">
     <!--
@@ -174,6 +175,9 @@
       <if test="state != null">
         VRR_STATE,
       </if>
+      <if test="branch != null">
+        VRR_BRANCH,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -197,6 +201,9 @@
       <if test="state != null">
         #{state,jdbcType=VARCHAR},
       </if>
+      <if test="branch != null">
+        #{branch,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.minpay.db.table.model.VmRechargeRuleExample" resultType="java.lang.Integer">
@@ -237,6 +244,9 @@
       <if test="record.state != null">
         VRR_STATE = #{record.state,jdbcType=VARCHAR},
       </if>
+      <if test="record.branch != null">
+        VRR_BRANCH = #{record.branch,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -254,7 +264,8 @@
       VRR_DESC = #{record.desc,jdbcType=VARCHAR},
       VRR_CREATE_TIME = #{record.createTime,jdbcType=VARCHAR},
       VRR_CREATE_USER = #{record.createUser,jdbcType=VARCHAR},
-      VRR_STATE = #{record.state,jdbcType=VARCHAR}
+      VRR_STATE = #{record.state,jdbcType=VARCHAR},
+      VRR_BRANCH = #{record.branch,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -284,6 +295,9 @@
       <if test="state != null">
         VRR_STATE = #{state,jdbcType=VARCHAR},
       </if>
+      <if test="branch != null">
+        VRR_BRANCH = #{branch,jdbcType=VARCHAR},
+      </if>
     </set>
     where VRR_ID = #{id,jdbcType=VARCHAR}
   </update>
@@ -298,7 +312,8 @@
       VRR_DESC = #{desc,jdbcType=VARCHAR},
       VRR_CREATE_TIME = #{createTime,jdbcType=VARCHAR},
       VRR_CREATE_USER = #{createUser,jdbcType=VARCHAR},
-      VRR_STATE = #{state,jdbcType=VARCHAR}
+      VRR_STATE = #{state,jdbcType=VARCHAR},
+      VRR_BRANCH = #{branch,jdbcType=VARCHAR}
     where VRR_ID = #{id,jdbcType=VARCHAR}
   </update>
 </mapper>