1、解决出场二维码没有使用,导致无法再次入场问题
2、解决回调退款未更新数据库总退款金额 3、解决查询用户手机号关联查询脚本问题
This commit is contained in:
@@ -12,6 +12,9 @@ public class Barcode {
|
||||
*/
|
||||
private String orderSn;
|
||||
|
||||
/**
|
||||
* 0 - 未使用 1 - 已使用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private Integer memberId;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.ydd.oms.task;
|
||||
|
||||
import com.enums.StayEnum;
|
||||
import com.sv.entity.Barcode;
|
||||
import com.sv.entity.MemberEnterStatus;
|
||||
import com.sv.mapper.BarcodeMapper;
|
||||
import com.sv.mapper.MemberEnterStatusMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -25,6 +27,8 @@ public class ClearPersonTask {
|
||||
|
||||
@Resource
|
||||
MemberEnterStatusMapper memberEnterStatusMapper;
|
||||
@Resource
|
||||
BarcodeMapper barcodeMapper;
|
||||
|
||||
@Scheduled(cron = "0 0 1 * * ?")
|
||||
public void clearMember(){
|
||||
@@ -40,6 +44,18 @@ public class ClearPersonTask {
|
||||
memberEnterStatusMapper.updateByPrimaryKey(memberEnterStatus);
|
||||
}
|
||||
}
|
||||
List<Barcode> noUseOutBarcode = barcodeMapper.findNoUseOutBarcode();
|
||||
if (noUseOutBarcode != null && noUseOutBarcode.size() > 0) {
|
||||
logger.info("有" + noUseOutBarcode.size() + "出场二维码没有使用!!!");
|
||||
Date date = new Date();
|
||||
for (Barcode barcode : noUseOutBarcode) {
|
||||
barcode.setStatus(1);
|
||||
barcode.setModifiedId(1);
|
||||
barcode.setModifiedTime(date);
|
||||
logger.info("用户:" + barcode.getMemberId() + ",又未使用的出场二维码");
|
||||
barcodeMapper.updateByPrimaryKeySelective(barcode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.sv.annotation.NoPlatform;
|
||||
import com.sv.entity.Barcode;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BarcodeMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
@@ -29,4 +31,7 @@ public interface BarcodeMapper {
|
||||
|
||||
@NoPlatform
|
||||
Barcode checkIsUsed(@Param("barcode") String barcode);
|
||||
|
||||
@NoPlatform
|
||||
List<Barcode> findNoUseOutBarcode();
|
||||
}
|
||||
|
||||
@@ -189,7 +189,9 @@ public class MemberRefundService extends BaseServiceImpl {
|
||||
if (barcodeOrderTime != null) {
|
||||
if (barcodeOrderTime.getOrderSn() != null
|
||||
&& barcodeOrderTime.getOrderSn().equals(memberRefund.getOrderSn())) {
|
||||
barcodeOrderTime.setSumPayMoney(barcodeOrderTime.getSumPayMoney() == null ? 0 : barcodeOrderTime.getSumPayMoney() + memberRefund.getMoney().intValue());
|
||||
barcodeOrderTime.setSumPayMoney(
|
||||
(barcodeOrderTime.getSumPayMoney() == null ? 0 : barcodeOrderTime.getSumPayMoney())
|
||||
+ memberRefund.getMoney().intValue());
|
||||
barcodeOrderTime.setPayMoney(0);
|
||||
barcodeOrderTime.setModifiedTime(new Date());
|
||||
barcodeOrderTimeMapper.updateByPrimaryKey(barcodeOrderTime);
|
||||
|
||||
@@ -194,4 +194,11 @@
|
||||
where barcode = #{barcode,jdbcType=VARCHAR}
|
||||
</select>
|
||||
|
||||
<select id="findNoUseOutBarcode" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from sv_barcode
|
||||
where status = 0 and enter = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -341,7 +341,7 @@
|
||||
sum((select IFNULL(sum(ot.price),0) from sv_order ot
|
||||
where ot.member_id = t.member_id and (ot.order_sn = t.order_sn or ot.order_sn = t.order_add_sn)
|
||||
) - IFNULL(t.sum_pay_money,0)) orderSumMoney
|
||||
from sv_barcode_order_time t
|
||||
from sv_barcode_order_time t LEFT JOIN sv_member m on t.member_id = m.id
|
||||
where 1=1
|
||||
<if test="state != null and state == 2">
|
||||
AND (t.status = 1 or t.paying = #{state})
|
||||
|
||||
Reference in New Issue
Block a user