修改篮球入场支付方式
This commit is contained in:
@@ -215,9 +215,9 @@ public class VenueService extends BaseServiceImpl {
|
||||
* 我要进场
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BarCodeResult join(Integer memberId, Integer venueId) {
|
||||
BarCodeResult barCodeResult = new BarCodeResult();
|
||||
barCodeResult.setFlg(0);
|
||||
public BasketEnterResult join(Integer memberId, Integer venueId) {
|
||||
BasketEnterResult basketEnterResult = new BasketEnterResult();
|
||||
basketEnterResult.setFlg(0);
|
||||
// 判断用户是否登录
|
||||
if (memberId == null) {
|
||||
throw new ServiceException(com.ydd.framework.core.exception.ExceptionCodeTemplate.NEED_LOGIN);
|
||||
@@ -245,15 +245,15 @@ public class VenueService extends BaseServiceImpl {
|
||||
if (memberCards.size() == 0) {
|
||||
Member member = memberService.findById(memberId);
|
||||
if (member.getMoney().compareTo(price) == -1) {
|
||||
barCodeResult.setFlg(2);
|
||||
basketEnterResult.setFlg(2);
|
||||
// if (PayStyleEnum.HOUR.getValue() == venue.getPayStyle()){
|
||||
// // 按时入场余额需要包含两个小时的场地费
|
||||
// barCodeResult.setMsg("请保证账户至少有两个小时余额:" + price + "元,余额不足,请先充值");
|
||||
// }else {
|
||||
// barCodeResult.setMsg("此次订单金额为:" + price + "元,余额不足,请先充值");
|
||||
// }
|
||||
barCodeResult.setMsg("此次订单金额为:" + price + "元,余额不足,请先充值");
|
||||
return barCodeResult;
|
||||
basketEnterResult.setMsg("此次订单金额为:" + price + "元,余额不足,请先充值");
|
||||
return basketEnterResult;
|
||||
}
|
||||
Integer timePayHour = 1;
|
||||
if(PayStyleEnum.TIME.getValue() == venue.getPayStyle()){
|
||||
@@ -276,7 +276,7 @@ public class VenueService extends BaseServiceImpl {
|
||||
} else {
|
||||
//余额不足
|
||||
logger.error("用户" + memberId + "余额不足核销失败");
|
||||
barCodeResult.setMsg("此次订单金额为:" + price + "元,余额不足,请先充值");
|
||||
basketEnterResult.setMsg("此次订单金额为:" + price + "元,余额不足,请先充值");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,7 +287,7 @@ public class VenueService extends BaseServiceImpl {
|
||||
// flag = 1;
|
||||
// return flag;
|
||||
// }
|
||||
return barCodeResult;
|
||||
return basketEnterResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,8 +297,8 @@ public class VenueService extends BaseServiceImpl {
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BarCodeResult out(Integer memberId, Integer venueId) {
|
||||
BarCodeResult result = new BarCodeResult();
|
||||
public BasketEnterResult out(Integer memberId, Integer venueId) {
|
||||
BasketEnterResult result = new BasketEnterResult();
|
||||
result.setFlg(0);
|
||||
// 判断用户是否登录
|
||||
if (memberId == null) {
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BarcodeService extends BaseServiceImpl {
|
||||
@Resource
|
||||
BarcodeMapper barcodeMapper;
|
||||
|
||||
public String newBarcode (String deviceName, EnterEnum enterEnum, Integer venueId, Integer memberId){
|
||||
public String newBarcode (String deviceName, String orderSn, EnterEnum enterEnum, Integer venueId, Integer memberId){
|
||||
String barcode = "";
|
||||
Barcode res = barcodeMapper.findBarcode(venueId, memberId);
|
||||
if (res == null) {
|
||||
@@ -39,6 +39,7 @@ public class BarcodeService extends BaseServiceImpl {
|
||||
b.setStatus(BarCodeStatusEnum.INIT.getValue());
|
||||
b.setMemberId(memberId);
|
||||
b.setVenueId(venueId);
|
||||
b.setOrderSn(orderSn);
|
||||
b.setEnter(enterEnum.getValue());
|
||||
barcodeMapper.insert(b);
|
||||
}else {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<constructor >
|
||||
<idArg column="id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="barcode" jdbcType="VARCHAR" javaType="java.lang.String" />
|
||||
<arg column="order_sn" jdbcType="VARCHAR" javaType="java.lang.String" />
|
||||
<arg column="status" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="member_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
<arg column="venue_id" jdbcType="INTEGER" javaType="java.lang.Integer" />
|
||||
@@ -16,7 +17,7 @@
|
||||
</constructor>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List" >
|
||||
id, barcode, status, member_id, venue_id, enter, created_id, modified_id, created_time,
|
||||
id, barcode, order_sn, status, member_id, venue_id, enter, created_id, modified_id, created_time,
|
||||
modified_time
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
|
||||
@@ -30,11 +31,11 @@
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.sv.entity.Barcode" >
|
||||
insert into sv_barcode (id, barcode, status,
|
||||
insert into sv_barcode (id, barcode, order_sn, status,
|
||||
member_id, venue_id, enter,
|
||||
created_id, modified_id, created_time,
|
||||
modified_time)
|
||||
values (#{id,jdbcType=INTEGER}, #{barcode,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
||||
values (#{id,jdbcType=INTEGER}, #{barcode,jdbcType=VARCHAR}, #{orderSn,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
||||
#{memberId,jdbcType=INTEGER}, #{venueId,jdbcType=INTEGER}, #{enter,jdbcType=INTEGER},
|
||||
#{createdId,jdbcType=INTEGER}, #{modifiedId,jdbcType=INTEGER}, #{createdTime,jdbcType=TIMESTAMP},
|
||||
#{modifiedTime,jdbcType=TIMESTAMP})
|
||||
@@ -48,6 +49,9 @@
|
||||
<if test="barcode != null" >
|
||||
barcode,
|
||||
</if>
|
||||
<if test="orderSn != null" >
|
||||
order_sn,
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status,
|
||||
</if>
|
||||
@@ -80,6 +84,9 @@
|
||||
<if test="barcode != null" >
|
||||
#{barcode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="orderSn != null" >
|
||||
#{orderSn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
@@ -112,6 +119,9 @@
|
||||
<if test="barcode != null" >
|
||||
barcode = #{barcode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="barcode != null" >
|
||||
order_sn = #{orderSn,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null" >
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
@@ -142,6 +152,7 @@
|
||||
<update id="updateByPrimaryKey" parameterType="com.sv.entity.Barcode" >
|
||||
update sv_barcode
|
||||
set barcode = #{barcode,jdbcType=VARCHAR},
|
||||
order_sn = #{orderSn,jdbcType=INTEGER},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
member_id = #{memberId,jdbcType=INTEGER},
|
||||
venue_id = #{venueId,jdbcType=INTEGER},
|
||||
|
||||
Reference in New Issue
Block a user