记得上下班打卡 | git大法好,push需谨慎

Commit a2e4e924 authored by GaoHu's avatar GaoHu

打款新增演出状态判断,如果演出部位已结束则不能打款

parent 997ec0d9
...@@ -173,6 +173,11 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -173,6 +173,11 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
public AjaxResult price(SmilePriceParam smilePriceParam) { public AjaxResult price(SmilePriceParam smilePriceParam) {
SmilePrice smilePrice = new SmilePrice(); SmilePrice smilePrice = new SmilePrice();
BeanUtils.copyProperties(smilePriceParam, smilePrice); BeanUtils.copyProperties(smilePriceParam, smilePrice);
//查询演出状态
AjaxResult showStatue = showStatue(smilePriceParam);
if (showStatue != null) {
return showStatue;
}
Integer status = smileRedisUtils.getShowPriceUid(smilePriceParam.getPerformancesId(), smilePriceParam.getUid()); Integer status = smileRedisUtils.getShowPriceUid(smilePriceParam.getPerformancesId(), smilePriceParam.getUid());
if (smilePriceParam.getStatus().equals(status)) { if (smilePriceParam.getStatus().equals(status)) {
return AjaxResult.warn("不可重复打款"); return AjaxResult.warn("不可重复打款");
...@@ -208,6 +213,16 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -208,6 +213,16 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
return AjaxResult.success(); return AjaxResult.success();
} }
private AjaxResult showStatue(SmilePriceParam smilePriceParam) {
LambdaQueryWrapper<KylinPerformances> queryWrapper = Wrappers.lambdaQuery(KylinPerformances.class);
queryWrapper.eq(KylinPerformances::getPerformancesId, smilePriceParam.getPerformancesId());
LocalDateTime timeEnd = kylinPerformancesMapper.selectOne(queryWrapper).getTimeEnd();
if (timeEnd.isBefore(LocalDateTime.now())){
return AjaxResult.warn("演出尚未结束不能进行打款");
}
return null;
}
@Override @Override
public AjaxResult getShowById(String performancesId) { public AjaxResult getShowById(String performancesId) {
if (!StringUtils.isEmpty(performancesId)) { if (!StringUtils.isEmpty(performancesId)) {
...@@ -349,6 +364,11 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -349,6 +364,11 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
@Override @Override
public AjaxResult allPrice(SmilePriceParam smilePriceParam) { public AjaxResult allPrice(SmilePriceParam smilePriceParam) {
Integer showPriceId = smileRedisUtils.getShowPriceId(smilePriceParam.getPerformancesId()); Integer showPriceId = smileRedisUtils.getShowPriceId(smilePriceParam.getPerformancesId());
//查询演出状态
AjaxResult showStatue = showStatue(smilePriceParam);
if (showStatue != null) {
return showStatue;
}
//判断打款标识 //判断打款标识
if (smilePriceParam.getStatus().equals(showPriceId)) { if (smilePriceParam.getStatus().equals(showPriceId)) {
return AjaxResult.warn("不可重复提交"); return AjaxResult.warn("不可重复提交");
...@@ -356,7 +376,6 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -356,7 +376,6 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
if (smilePriceParam.getStatus().equals(0)) { if (smilePriceParam.getStatus().equals(0)) {
//打款 //打款
smileRedisUtils.setShowPriceId(smilePriceParam.getPerformancesId()); smileRedisUtils.setShowPriceId(smilePriceParam.getPerformancesId());
//
} else { } else {
//未打款 //未打款
smileRedisUtils.delShowPriceId(smilePriceParam.getPerformancesId()); smileRedisUtils.delShowPriceId(smilePriceParam.getPerformancesId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment