| @@ -21,7 +21,10 @@ public class WxOrderPress implements Serializable { | |||||
| protected List<Long> ids; | protected List<Long> ids; | ||||
| @Transient | @Transient | ||||
| protected String sortColumns; | protected String sortColumns; | ||||
| /**租户ID**/ | |||||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||||
| private String tenantId; | |||||
| /**订单ID*/ | /**订单ID*/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | ||||
| private Long orderId; | private Long orderId; | ||||
| @@ -40,6 +43,7 @@ public class WxOrderPress implements Serializable { | |||||
| public static enum Field | public static enum Field | ||||
| { | { | ||||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | ||||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||||
| ,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC") | ,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC") | ||||
| ,UserId_ASC("`user_id` ASC"),UserId_DESC("`user_id` DESC") | ,UserId_ASC("`user_id` ASC"),UserId_DESC("`user_id` DESC") | ||||
| ,PressValue_ASC("`press_value` ASC"),PressValue_DESC("`press_value` DESC") | ,PressValue_ASC("`press_value` ASC"),PressValue_DESC("`press_value` DESC") | ||||
| @@ -2,7 +2,6 @@ package com.iformall.mapper; | |||||
| import java.util.*; | import java.util.*; | ||||
| import com.iformall.common.CommonMapper; | import com.iformall.common.CommonMapper; | ||||
| import org.apache.ibatis.annotations.Param; | |||||
| import com.iformall.domain.po.WxOrderPress; | import com.iformall.domain.po.WxOrderPress; | ||||
| public interface WxOrderPressMapper extends CommonMapper<WxOrderPress, Long> { | public interface WxOrderPressMapper extends CommonMapper<WxOrderPress, Long> { | ||||
| @@ -401,7 +401,8 @@ public class WxOrderServiceImpl implements WxOrderService { | |||||
| orderPress.setOrderId(orderNumber); | orderPress.setOrderId(orderNumber); | ||||
| orderPress.setUserId(user.getId()); | orderPress.setUserId(user.getId()); | ||||
| orderPress.setCreateDate(curr); | orderPress.setCreateDate(curr); | ||||
| orderPress.setPressValue(PressUtils.stateLessPressValue(total, left_total, coupon.getPressLimitNum(), 0)); | |||||
| int lPressValue = PressUtils.stateLessPressValue(total, left_total, coupon.getPressLimitNum(), 0); | |||||
| orderPress.setPressValue(lPressValue); | |||||
| try { | try { | ||||
| // 保存订单 | // 保存订单 | ||||
| @@ -49,4 +49,9 @@ public class PressUtils { | |||||
| return current.intValue() * 100; | return current.intValue() * 100; | ||||
| } | } | ||||
| public static void main(String[] args) { | |||||
| int iValue = stateLessPressValue( 1800, 1800, 5, 0); | |||||
| System.out.println(iValue); | |||||
| } | |||||
| } | } | ||||
| @@ -3,6 +3,7 @@ | |||||
| <mapper namespace="com.iformall.mapper.WxOrderPressMapper"> | <mapper namespace="com.iformall.mapper.WxOrderPressMapper"> | ||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOrderPress"> | <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxOrderPress"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="order_id" jdbcType="BIGINT" property="orderId" /> | <result column="order_id" jdbcType="BIGINT" property="orderId" /> | ||||
| <result column="user_id" jdbcType="BIGINT" property="userId" /> | <result column="user_id" jdbcType="BIGINT" property="userId" /> | ||||
| <result column="press_value" jdbcType="INTEGER" property="pressValue" /> | <result column="press_value" jdbcType="INTEGER" property="pressValue" /> | ||||
| @@ -17,8 +18,11 @@ | |||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != orderId "> | |||||
| and `order_id` = #{orderId} | and `order_id` = #{orderId} | ||||
| </if> | </if> | ||||
| <if test=" null != userId "> | <if test=" null != userId "> | ||||