添加取餐码功能
This commit is contained in:
parent
69b7ed77ec
commit
e2b22116a0
|
|
@ -101,6 +101,7 @@ public class TbOrderInfo implements Serializable {
|
|||
private List<TbOrderDetail> detailList;
|
||||
private String winnnerNo;
|
||||
private String isWinner;
|
||||
private String outNumber;
|
||||
private static final long serialVersionUID = 1L;
|
||||
public TbOrderInfo(){
|
||||
super();
|
||||
|
|
|
|||
|
|
@ -20,4 +20,6 @@ public class RedisCst {
|
|||
|
||||
public static final String INTEGRAL_COIN_KEY = "INTEGRAL: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.setIsUseCoupon(isuseYhq);
|
||||
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);
|
||||
orderId = orderInfo.getId();
|
||||
}
|
||||
|
|
@ -701,6 +720,26 @@ public class CartService1 {
|
|||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||
orderInfo.setIsUseCoupon(isuseYhq);
|
||||
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);
|
||||
orderId = orderInfo.getId();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -750,9 +750,9 @@ public class PayService {
|
|||
}
|
||||
|
||||
|
||||
if("0".equals(userInfo.getIsPwd())){
|
||||
return Result.fail("用户支付密码未设置");
|
||||
}
|
||||
// if("0".equals(userInfo.getIsPwd())){
|
||||
// return Result.fail("用户支付密码未设置");
|
||||
// }
|
||||
|
||||
|
||||
TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
<result column="table_name" jdbcType="VARCHAR" property="tableName"/>
|
||||
<result column="is_buy_coupon" jdbcType="VARCHAR" property="isBuyCoupon"/>
|
||||
<result column="is_use_coupon" jdbcType="VARCHAR" property="isUseCoupon"/>
|
||||
<result column="out_number" jdbcType="VARCHAR" property="outNumber"/>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
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,
|
||||
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`,
|
||||
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>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
select
|
||||
|
|
@ -83,7 +84,7 @@
|
|||
deduct_score, 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,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},
|
||||
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
||||
|
|
@ -99,7 +100,7 @@
|
|||
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
||||
#{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,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 id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo"
|
||||
|
|
@ -226,6 +227,11 @@
|
|||
<if test="isBuyCoupon != null">
|
||||
is_buy_coupon,
|
||||
</if>
|
||||
|
||||
|
||||
<if test="outNumber != null">
|
||||
out_number,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
|
|
@ -348,6 +354,10 @@
|
|||
<if test="payOrderNo != null">
|
||||
#{payOrderNo,jdbcType=VARCHAR},
|
||||
</if>
|
||||
|
||||
<if test="outNumber != null">
|
||||
#{outNumber,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo">
|
||||
|
|
|
|||
Loading…
Reference in New Issue