赵冬冬 пре 4 година
родитељ
комит
c1f9ae606b

+ 2 - 2
forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/mapper/OmsOrderPayMapper.java

@@ -10,7 +10,7 @@ public interface OmsOrderPayMapper {
 
 
     int deleteByExample(OmsOrderPayExample example);
     int deleteByExample(OmsOrderPayExample example);
 
 
-    int deleteByPrimaryKey(Long id);
+    int deleteByPrimaryKey(String id);
 
 
     int insert(OmsOrderPay record);
     int insert(OmsOrderPay record);
 
 
@@ -18,7 +18,7 @@ public interface OmsOrderPayMapper {
 
 
     List<OmsOrderPay> selectByExample(OmsOrderPayExample example);
     List<OmsOrderPay> selectByExample(OmsOrderPayExample example);
 
 
-    OmsOrderPay selectByPrimaryKey(Long id);
+    OmsOrderPay selectByPrimaryKey(String id);
 
 
     int updateByExampleSelective(@Param("record") OmsOrderPay record, @Param("example") OmsOrderPayExample example);
     int updateByExampleSelective(@Param("record") OmsOrderPay record, @Param("example") OmsOrderPayExample example);
 
 

+ 3 - 3
forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/model/OmsOrderPay.java

@@ -7,7 +7,7 @@ import java.util.Date;
 
 
 public class OmsOrderPay implements Serializable {
 public class OmsOrderPay implements Serializable {
     @ApiModelProperty(value = "id")
     @ApiModelProperty(value = "id")
-    private Long id;
+    private String id;
 
 
     @ApiModelProperty(value = "订单id")
     @ApiModelProperty(value = "订单id")
     private Long orderId;
     private Long orderId;
@@ -35,11 +35,11 @@ public class OmsOrderPay implements Serializable {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
-    public Long getId() {
+    public String getId() {
         return id;
         return id;
     }
     }
 
 
-    public void setId(Long id) {
+    public void setId(String id) {
         this.id = id;
         this.id = id;
     }
     }
 
 

+ 20 - 10
forest-portal/portal-mbg/src/main/java/com/hwrj/cloud/portal/model/OmsOrderPayExample.java

@@ -116,52 +116,62 @@ public class OmsOrderPayExample {
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdEqualTo(Long value) {
+        public Criteria andIdEqualTo(String value) {
             addCriterion("id =", value, "id");
             addCriterion("id =", value, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdNotEqualTo(Long value) {
+        public Criteria andIdNotEqualTo(String value) {
             addCriterion("id <>", value, "id");
             addCriterion("id <>", value, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdGreaterThan(Long value) {
+        public Criteria andIdGreaterThan(String value) {
             addCriterion("id >", value, "id");
             addCriterion("id >", value, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+        public Criteria andIdGreaterThanOrEqualTo(String value) {
             addCriterion("id >=", value, "id");
             addCriterion("id >=", value, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdLessThan(Long value) {
+        public Criteria andIdLessThan(String value) {
             addCriterion("id <", value, "id");
             addCriterion("id <", value, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdLessThanOrEqualTo(Long value) {
+        public Criteria andIdLessThanOrEqualTo(String value) {
             addCriterion("id <=", value, "id");
             addCriterion("id <=", value, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdIn(List<Long> values) {
+        public Criteria andIdLike(String value) {
+            addCriterion("id like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotLike(String value) {
+            addCriterion("id not like", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<String> values) {
             addCriterion("id in", values, "id");
             addCriterion("id in", values, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdNotIn(List<Long> values) {
+        public Criteria andIdNotIn(List<String> values) {
             addCriterion("id not in", values, "id");
             addCriterion("id not in", values, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdBetween(Long value1, Long value2) {
+        public Criteria andIdBetween(String value1, String value2) {
             addCriterion("id between", value1, value2, "id");
             addCriterion("id between", value1, value2, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }
 
 
-        public Criteria andIdNotBetween(Long value1, Long value2) {
+        public Criteria andIdNotBetween(String value1, String value2) {
             addCriterion("id not between", value1, value2, "id");
             addCriterion("id not between", value1, value2, "id");
             return (Criteria) this;
             return (Criteria) this;
         }
         }

+ 11 - 11
forest-portal/portal-mbg/src/main/resources/com/hwrj/cloud/portal/mapper/OmsOrderPayMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.hwrj.cloud.portal.mapper.OmsOrderPayMapper">
 <mapper namespace="com.hwrj.cloud.portal.mapper.OmsOrderPayMapper">
   <resultMap id="BaseResultMap" type="com.hwrj.cloud.portal.model.OmsOrderPay">
   <resultMap id="BaseResultMap" type="com.hwrj.cloud.portal.model.OmsOrderPay">
-    <id column="id" jdbcType="BIGINT" property="id" />
+    <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="order_id" jdbcType="BIGINT" property="orderId" />
     <result column="order_id" jdbcType="BIGINT" property="orderId" />
     <result column="pay_money" jdbcType="DECIMAL" property="payMoney" />
     <result column="pay_money" jdbcType="DECIMAL" property="payMoney" />
     <result column="create_id" jdbcType="BIGINT" property="createId" />
     <result column="create_id" jdbcType="BIGINT" property="createId" />
@@ -88,15 +88,15 @@
       order by ${orderByClause}
       order by ${orderByClause}
     </if>
     </if>
   </select>
   </select>
-  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+  <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
     select 
     select 
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from oms_order_pay
     from oms_order_pay
-    where id = #{id,jdbcType=BIGINT}
+    where id = #{id,jdbcType=VARCHAR}
   </select>
   </select>
-  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
     delete from oms_order_pay
     delete from oms_order_pay
-    where id = #{id,jdbcType=BIGINT}
+    where id = #{id,jdbcType=VARCHAR}
   </delete>
   </delete>
   <delete id="deleteByExample" parameterType="com.hwrj.cloud.portal.model.OmsOrderPayExample">
   <delete id="deleteByExample" parameterType="com.hwrj.cloud.portal.model.OmsOrderPayExample">
     delete from oms_order_pay
     delete from oms_order_pay
@@ -105,7 +105,7 @@
     </if>
     </if>
   </delete>
   </delete>
   <insert id="insert" parameterType="com.hwrj.cloud.portal.model.OmsOrderPay">
   <insert id="insert" parameterType="com.hwrj.cloud.portal.model.OmsOrderPay">
-    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.String">
       SELECT LAST_INSERT_ID()
       SELECT LAST_INSERT_ID()
     </selectKey>
     </selectKey>
     insert into oms_order_pay (order_id, pay_money, create_id, 
     insert into oms_order_pay (order_id, pay_money, create_id, 
@@ -116,7 +116,7 @@
       #{status,jdbcType=INTEGER}, #{payType,jdbcType=INTEGER})
       #{status,jdbcType=INTEGER}, #{payType,jdbcType=INTEGER})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.hwrj.cloud.portal.model.OmsOrderPay">
   <insert id="insertSelective" parameterType="com.hwrj.cloud.portal.model.OmsOrderPay">
-    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
+    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.String">
       SELECT LAST_INSERT_ID()
       SELECT LAST_INSERT_ID()
     </selectKey>
     </selectKey>
     insert into oms_order_pay
     insert into oms_order_pay
@@ -183,7 +183,7 @@
     update oms_order_pay
     update oms_order_pay
     <set>
     <set>
       <if test="record.id != null">
       <if test="record.id != null">
-        id = #{record.id,jdbcType=BIGINT},
+        id = #{record.id,jdbcType=VARCHAR},
       </if>
       </if>
       <if test="record.orderId != null">
       <if test="record.orderId != null">
         order_id = #{record.orderId,jdbcType=BIGINT},
         order_id = #{record.orderId,jdbcType=BIGINT},
@@ -216,7 +216,7 @@
   </update>
   </update>
   <update id="updateByExample" parameterType="map">
   <update id="updateByExample" parameterType="map">
     update oms_order_pay
     update oms_order_pay
-    set id = #{record.id,jdbcType=BIGINT},
+    set id = #{record.id,jdbcType=VARCHAR},
       order_id = #{record.orderId,jdbcType=BIGINT},
       order_id = #{record.orderId,jdbcType=BIGINT},
       pay_money = #{record.payMoney,jdbcType=DECIMAL},
       pay_money = #{record.payMoney,jdbcType=DECIMAL},
       create_id = #{record.createId,jdbcType=BIGINT},
       create_id = #{record.createId,jdbcType=BIGINT},
@@ -257,7 +257,7 @@
         pay_type = #{payType,jdbcType=INTEGER},
         pay_type = #{payType,jdbcType=INTEGER},
       </if>
       </if>
     </set>
     </set>
-    where id = #{id,jdbcType=BIGINT}
+    where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
   <update id="updateByPrimaryKey" parameterType="com.hwrj.cloud.portal.model.OmsOrderPay">
   <update id="updateByPrimaryKey" parameterType="com.hwrj.cloud.portal.model.OmsOrderPay">
     update oms_order_pay
     update oms_order_pay
@@ -269,6 +269,6 @@
       update_time = #{updateTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP},
       status = #{status,jdbcType=INTEGER},
       status = #{status,jdbcType=INTEGER},
       pay_type = #{payType,jdbcType=INTEGER}
       pay_type = #{payType,jdbcType=INTEGER}
-    where id = #{id,jdbcType=BIGINT}
+    where id = #{id,jdbcType=VARCHAR}
   </update>
   </update>
 </mapper>
 </mapper>

+ 1 - 1
forest-portal/portal-mbg/src/main/resources/generatorConfig.xml

@@ -37,7 +37,7 @@
         <javaClientGenerator type="XMLMAPPER" targetPackage="com.hwrj.cloud.portal.mapper"
         <javaClientGenerator type="XMLMAPPER" targetPackage="com.hwrj.cloud.portal.mapper"
                              targetProject="forest-portal\portal-mbg\src\main\java"/>
                              targetProject="forest-portal\portal-mbg\src\main\java"/>
         <!--生成全部表tableName设为%-->
         <!--生成全部表tableName设为%-->
-        <table tableName="ums_company_share">
+        <table tableName="oms_order_pay">
             <generatedKey column="id" sqlStatement="MySql" identity="true"/>
             <generatedKey column="id" sqlStatement="MySql" identity="true"/>
         </table>
         </table>
     </context>
     </context>

+ 5 - 5
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/controller/WechatH5PayController.java

@@ -63,13 +63,13 @@ public class WechatH5PayController {
 
 
         orderRequest.setNonceStr(s);
         orderRequest.setNonceStr(s);
         //商品描述
         //商品描述
-        orderRequest.setBody(omsOrder.getNote());
+        orderRequest.setBody("林业产品");
         //商户订单号(支付编号)
         //商户订单号(支付编号)
         GeneratorIdUtils generatorIdUtils = new GeneratorIdUtils();
         GeneratorIdUtils generatorIdUtils = new GeneratorIdUtils();
-        Long orderNum = generatorIdUtils.nextId();
+        String orderNum = generatorIdUtils.nextId();
         log.info("orderNum:" + orderNum);
         log.info("orderNum:" + orderNum);
         //设置商户订单号
         //设置商户订单号
-        orderRequest.setOutTradeNo(orderNum.toString());
+        orderRequest.setOutTradeNo(orderNum);
         //设置金额
         //设置金额
         //data.getTotalPrice();
         //data.getTotalPrice();
         BigDecimal money = omsOrder.getPayAmount();
         BigDecimal money = omsOrder.getPayAmount();
@@ -89,7 +89,7 @@ public class WechatH5PayController {
         log.info("wxpayCallbackUrl=================>{}", wxpayCallbackUrl);
         log.info("wxpayCallbackUrl=================>{}", wxpayCallbackUrl);
         orderRequest.setNotifyUrl(wxpayCallbackUrl);
         orderRequest.setNotifyUrl(wxpayCallbackUrl);
         //交易类型
         //交易类型
-        orderRequest.setTradeType(WxPayConstants.TradeType.APP);
+        orderRequest.setTradeType(WxPayConstants.TradeType.JSAPI);
         //用户标识 获取用户openid
         //用户标识 获取用户openid
         orderRequest.setOpenid(openid);
         orderRequest.setOpenid(openid);
         // 这个可能是偏向原生一点的统一下单,返回的参数有很多没用的 或者null值 建议使用 createOrder下单
         // 这个可能是偏向原生一点的统一下单,返回的参数有很多没用的 或者null值 建议使用 createOrder下单
@@ -153,7 +153,7 @@ public class WechatH5PayController {
             String orderNum = wxPayOrderNotifyResult.getOutTradeNo();
             String orderNum = wxPayOrderNotifyResult.getOutTradeNo();
             log.info("orderNum:" + orderNum);
             log.info("orderNum:" + orderNum);
             //将订单更新为支付
             //将订单更新为支付
-            omsOrderPayService.update(Long.valueOf(orderNum));
+            omsOrderPayService.update(orderNum);
             /**
             /**
              * 自己的业务
              * 自己的业务
              */
              */

+ 2 - 2
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/OmsOrderPayService.java

@@ -4,7 +4,7 @@ import com.hwrj.cloud.portal.model.OmsOrder;
 
 
 
 
 public interface OmsOrderPayService {
 public interface OmsOrderPayService {
-    void insert(OmsOrder omsOrder, Long orderNum);
+    void insert(OmsOrder omsOrder, String orderNum);
 
 
-    void update(Long valueOf);
+    void update(String valueOf);
 }
 }

+ 2 - 2
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/service/impl/OmsOrderPayServiceImpl.java

@@ -23,7 +23,7 @@ public class OmsOrderPayServiceImpl implements OmsOrderPayService {
     private OmsOrderMapper omsOrderMapper;
     private OmsOrderMapper omsOrderMapper;
 
 
     @Override
     @Override
-    public void insert(OmsOrder omsOrder, Long orderNum) {
+    public void insert(OmsOrder omsOrder, String orderNum) {
         UmsMember currentMember = memberService.getCurrentMember();
         UmsMember currentMember = memberService.getCurrentMember();
         OmsOrderPay record = new OmsOrderPay();
         OmsOrderPay record = new OmsOrderPay();
         record.setId(orderNum);
         record.setId(orderNum);
@@ -38,7 +38,7 @@ public class OmsOrderPayServiceImpl implements OmsOrderPayService {
     }
     }
 
 
     @Override
     @Override
-    public void update(Long valueOf) {
+    public void update(String valueOf) {
         OmsOrderPay omsOrderPay = omsOrderPayMapper.selectByPrimaryKey(valueOf);
         OmsOrderPay omsOrderPay = omsOrderPayMapper.selectByPrimaryKey(valueOf);
         omsOrderPay.setStatus(1);
         omsOrderPay.setStatus(1);
         omsOrderPay.setUpdateTime(new Date());
         omsOrderPay.setUpdateTime(new Date());

+ 3 - 3
forest-portal/portal-server/src/main/java/com/hwrj/cloud/portal/util/GeneratorIdUtils.java

@@ -28,7 +28,7 @@ public class GeneratorIdUtils {
         this.workerId = (long)(255 & this.getLastIP());
         this.workerId = (long)(255 & this.getLastIP());
     }
     }
 
 
-    public synchronized Long nextId() {
+    public synchronized String nextId() {
         long timestamp = this.currentTime();
         long timestamp = this.currentTime();
         if (timestamp < this.lastTimestamp) {
         if (timestamp < this.lastTimestamp) {
             throw new RuntimeException(String.format("时钟向后移动。拒绝在%d毫秒内生成id", this.lastTimestamp - timestamp));
             throw new RuntimeException(String.format("时钟向后移动。拒绝在%d毫秒内生成id", this.lastTimestamp - timestamp));
@@ -46,8 +46,8 @@ public class GeneratorIdUtils {
             long suffix = this.datacenterId << (int)this.datacenterIdShift | this.workerId << (int)this.workerIdShift | this.sequence;
             long suffix = this.datacenterId << (int)this.datacenterIdShift | this.workerId << (int)this.workerIdShift | this.sequence;
             SimpleDateFormat timePe = new SimpleDateFormat("yyyyMMddHHMMssSSS");
             SimpleDateFormat timePe = new SimpleDateFormat("yyyyMMddHHMMssSSS");
             String datePrefix = timePe.format(timestamp);
             String datePrefix = timePe.format(timestamp);
-            Long aLong = Long.valueOf(datePrefix + suffix);
+            String s = datePrefix + suffix;
-            return aLong;
+            return s;
         }
         }
     }
     }