添加取餐码功能
This commit is contained in:
@@ -101,6 +101,7 @@ public class TbOrderInfo implements Serializable {
|
|||||||
private List<TbOrderDetail> detailList;
|
private List<TbOrderDetail> detailList;
|
||||||
private String winnnerNo;
|
private String winnnerNo;
|
||||||
private String isWinner;
|
private String isWinner;
|
||||||
|
private String outNumber;
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
public TbOrderInfo(){
|
public TbOrderInfo(){
|
||||||
super();
|
super();
|
||||||
|
|||||||
@@ -20,4 +20,6 @@ public class RedisCst {
|
|||||||
|
|
||||||
public static final String INTEGRAL_COIN_KEY = "INTEGRAL:COIN:KEY";
|
public static final String INTEGRAL_COIN_KEY = "INTEGRAL:COIN:KEY";
|
||||||
public static final String COUPONS_COIN_KEY = "COUPONS:COIN:KEY";
|
public static final String COUPONS_COIN_KEY = "COUPONS:COIN:KEY";
|
||||||
|
|
||||||
|
public static final String OUT_NUMBER="ORDER:NUMBER:";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,6 +412,25 @@ public class CartService1 {
|
|||||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||||
orderInfo.setIsUseCoupon(isuseYhq);
|
orderInfo.setIsUseCoupon(isuseYhq);
|
||||||
orderInfo.setUserCouponAmount(couponAmount);
|
orderInfo.setUserCouponAmount(couponAmount);
|
||||||
|
|
||||||
|
JSONObject object=new JSONObject();
|
||||||
|
String outNumber= redisUtil.getMessage(RedisCst.OUT_NUMBER.concat(jsonObject.getString("shopId")));
|
||||||
|
Integer number=1;
|
||||||
|
if(Objects.isNull(outNumber)){
|
||||||
|
object.put("outNumber",number);
|
||||||
|
object.put("times",DateUtils.getDay());
|
||||||
|
}else {
|
||||||
|
object=JSONObject.parseObject(outNumber);
|
||||||
|
if(object.getString("times").equals(DateUtils.getDay())){
|
||||||
|
number=object.getInteger("outNumber")+1;
|
||||||
|
object.put("outNumber",number);
|
||||||
|
}else {
|
||||||
|
object.put("outNumber",number);
|
||||||
|
object.put("times",DateUtils.getDay());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderInfo.setOutNumber(number+"");
|
||||||
|
redisUtil.saveMessage(RedisCst.OUT_NUMBER.concat(jsonObject.getString("shopId")),object.toString());
|
||||||
orderInfoMapper.insert(orderInfo);
|
orderInfoMapper.insert(orderInfo);
|
||||||
orderId = orderInfo.getId();
|
orderId = orderInfo.getId();
|
||||||
}
|
}
|
||||||
@@ -701,6 +720,26 @@ public class CartService1 {
|
|||||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||||
orderInfo.setIsUseCoupon(isuseYhq);
|
orderInfo.setIsUseCoupon(isuseYhq);
|
||||||
orderInfo.setUserCouponAmount(couponAmount);
|
orderInfo.setUserCouponAmount(couponAmount);
|
||||||
|
|
||||||
|
JSONObject object=new JSONObject();
|
||||||
|
String outNumber= redisUtil.getMessage(RedisCst.OUT_NUMBER.concat(jsonObject.getString("shopId")));
|
||||||
|
Integer number=1;
|
||||||
|
if(Objects.isNull(outNumber)){
|
||||||
|
object.put("outNumber",number);
|
||||||
|
object.put("times",DateUtils.getDay());
|
||||||
|
}else {
|
||||||
|
object=JSONObject.parseObject(outNumber);
|
||||||
|
if(object.getString("times").equals(DateUtils.getDay())){
|
||||||
|
number=object.getInteger("outNumber")+1;
|
||||||
|
object.put("outNumber",number);
|
||||||
|
}else {
|
||||||
|
object.put("outNumber",number);
|
||||||
|
object.put("times",DateUtils.getDay());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderInfo.setOutNumber(number+"");
|
||||||
|
redisUtil.saveMessage(RedisCst.OUT_NUMBER.concat(jsonObject.getString("shopId")),object.toString());
|
||||||
|
|
||||||
orderInfoMapper.insert(orderInfo);
|
orderInfoMapper.insert(orderInfo);
|
||||||
orderId = orderInfo.getId();
|
orderId = orderInfo.getId();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -750,9 +750,9 @@ public class PayService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if("0".equals(userInfo.getIsPwd())){
|
// if("0".equals(userInfo.getIsPwd())){
|
||||||
return Result.fail("用户支付密码未设置");
|
// return Result.fail("用户支付密码未设置");
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
|
TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
<result column="table_name" jdbcType="VARCHAR" property="tableName"/>
|
<result column="table_name" jdbcType="VARCHAR" property="tableName"/>
|
||||||
<result column="is_buy_coupon" jdbcType="VARCHAR" property="isBuyCoupon"/>
|
<result column="is_buy_coupon" jdbcType="VARCHAR" property="isBuyCoupon"/>
|
||||||
<result column="is_use_coupon" jdbcType="VARCHAR" property="isUseCoupon"/>
|
<result column="is_use_coupon" jdbcType="VARCHAR" property="isUseCoupon"/>
|
||||||
|
<result column="out_number" jdbcType="VARCHAR" property="outNumber"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount,
|
id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount,
|
||||||
@@ -56,7 +57,7 @@
|
|||||||
billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score,
|
billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score,
|
||||||
user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group,
|
user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group,
|
||||||
updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,
|
updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,
|
||||||
remark,master_id,`table_name`,is_buy_coupon,is_use_coupon
|
remark,master_id,`table_name`,is_buy_coupon,is_use_coupon,out_number
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -83,7 +84,7 @@
|
|||||||
deduct_score, user_coupon_id, user_coupon_amount,
|
deduct_score, user_coupon_id, user_coupon_amount,
|
||||||
refund_able, paid_time, is_effect,
|
refund_able, paid_time, is_effect,
|
||||||
is_group, updated_at, system_time,
|
is_group, updated_at, system_time,
|
||||||
created_at, is_accepted, pay_order_no,trade_day,source,remark,master_id,table_name,is_buy_coupon,is_use_coupon
|
created_at, is_accepted, pay_order_no,trade_day,source,remark,master_id,table_name,is_buy_coupon,is_use_coupon,out_number
|
||||||
)
|
)
|
||||||
values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
|
values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
|
||||||
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
||||||
#{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,jdbcType=VARCHAR},
|
#{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,jdbcType=VARCHAR},
|
||||||
#{tradeDay,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
|
#{tradeDay,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
|
||||||
#{masterId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR}, #{isBuyCoupon,jdbcType=VARCHAR}, #{isUseCoupon,jdbcType=VARCHAR}
|
#{masterId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR}, #{isBuyCoupon,jdbcType=VARCHAR}, #{isUseCoupon,jdbcType=VARCHAR},#{outNumber,jdbcType=VARCHAR}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo"
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo"
|
||||||
@@ -226,6 +227,11 @@
|
|||||||
<if test="isBuyCoupon != null">
|
<if test="isBuyCoupon != null">
|
||||||
is_buy_coupon,
|
is_buy_coupon,
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
|
||||||
|
<if test="outNumber != null">
|
||||||
|
out_number,
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -348,6 +354,10 @@
|
|||||||
<if test="payOrderNo != null">
|
<if test="payOrderNo != null">
|
||||||
#{payOrderNo,jdbcType=VARCHAR},
|
#{payOrderNo,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
|
<if test="outNumber != null">
|
||||||
|
#{outNumber,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo">
|
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo">
|
||||||
|
|||||||
Reference in New Issue
Block a user