This commit is contained in:
parent
ba898c005b
commit
1ebca429a4
|
@ -1,5 +1,6 @@
|
|||
package org.dromara.system.controller.wx;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.constant.TenantConstants;
|
||||
|
@ -40,6 +41,7 @@ public class WxScaleController extends BaseController {
|
|||
/**
|
||||
* 查询心理测评量列表
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/pageList")
|
||||
public TableDataInfo<SysScaleVo> pageList(SysScaleBo bo, PageQuery pageQuery) {
|
||||
bo.setOrderBy("num");
|
||||
|
@ -49,6 +51,7 @@ public class WxScaleController extends BaseController {
|
|||
/**
|
||||
* 查询心理测评量列表
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/typeList")
|
||||
public R<List<SysScaleVo>> pageListTest(SysScaleBo bo) {
|
||||
bo.setOrderBy("num");
|
||||
|
@ -58,6 +61,7 @@ public class WxScaleController extends BaseController {
|
|||
/**
|
||||
* 查询心理测评量列表,默认展示两条数据
|
||||
*/
|
||||
@SaIgnore
|
||||
@GetMapping("/list")
|
||||
public R<Map<String, List<SysScaleVo>>> list(String scaleType) {
|
||||
if (StringUtils.isEmpty(scaleType)) {
|
||||
|
|
|
@ -86,8 +86,7 @@ public class ActivityServiceImpl implements IActivityService {
|
|||
private LambdaQueryWrapper<Activity> buildQueryWrapper(ActivityBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Activity> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getActivityTitle()), Activity::getActivityTitle, bo.getActivityTitle());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getActivityDetails()), Activity::getActivityDetails, bo.getActivityDetails());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getActivityTitle()), Activity::getActivityTitle, bo.getActivityTitle());
|
||||
lqw.eq(bo.getStartTime() != null, Activity::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, Activity::getEndTime, bo.getEndTime());
|
||||
lqw.eq(bo.getStatus() != null, Activity::getStatus, bo.getStatus());
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
|||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.service.OssService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
@ -114,11 +115,20 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
|
|||
@Override
|
||||
public WxPayMpOrderResult insertByBo(ReservationOrderBo bo) throws Exception {
|
||||
String openId = LoginHelper.getOpenId();
|
||||
Long userId = LoginHelper.getUserId();
|
||||
BigDecimal price;
|
||||
Long id = bo.getId();
|
||||
if (id == null) {
|
||||
ReservationOrder add = MapstructUtils.convert(bo, ReservationOrder.class);
|
||||
ReservationTime reservationTime = timeMapper.selectById(add.getTimeId());
|
||||
Long timeId = add.getTimeId();
|
||||
boolean exists = baseMapper.exists(new LambdaQueryWrapper<ReservationOrder>()
|
||||
.eq(ReservationOrder::getTimeId, timeId)
|
||||
.eq(ReservationOrder::getCreateBy, userId)
|
||||
.eq(ReservationOrder::getOrderStatus, 0));
|
||||
if(exists){
|
||||
throw new ServiceException("账户下已有此预约时间的待支付订单,请确认后再支付");
|
||||
}
|
||||
ReservationTime reservationTime = timeMapper.selectById(timeId);
|
||||
Counselor counselor = counselorMapper.selectById(reservationTime.getCounselorId());
|
||||
price = counselor.getPrice();
|
||||
add.setCounselorId(counselor.getId());
|
||||
|
@ -128,7 +138,7 @@ public class ReservationOrderServiceImpl implements IReservationOrderService {
|
|||
validEntityBeforeSave(add);
|
||||
baseMapper.insert(add);
|
||||
id = add.getId();
|
||||
}else{
|
||||
} else {
|
||||
ReservationOrder reservationOrder = baseMapper.selectById(id);
|
||||
Counselor counselor = counselorMapper.selectById(reservationOrder.getCounselorId());
|
||||
price = counselor.getPrice();
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.github.binarywang.wxpay.bean.request.WxPayUnifiedOrderRequest;
|
|||
import com.github.binarywang.wxpay.service.WxPayService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.dromara.common.core.service.OssService;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
@ -118,6 +119,13 @@ public class SysScaleOrderServiceImpl implements ISysScaleOrderService {
|
|||
Long userId = LoginHelper.getUserId();
|
||||
SysScaleOrder add = MapstructUtils.convert(bo, SysScaleOrder.class);
|
||||
Long scaleId = add.getScaleId();
|
||||
boolean exists = baseMapper.exists(new LambdaQueryWrapper<SysScaleOrder>()
|
||||
.eq(SysScaleOrder::getScaleId, scaleId)
|
||||
.eq(SysScaleOrder::getCreateBy, userId)
|
||||
.eq(SysScaleOrder::getOrderStatus, 0));
|
||||
if (exists) {
|
||||
throw new ServiceException("账户下已有此量表的待支付订单,请确认后再支付");
|
||||
}
|
||||
//初始量测记录
|
||||
SysEvaluationRecord record = new SysEvaluationRecord();
|
||||
record.setUserId(userId);
|
||||
|
|
|
@ -100,7 +100,7 @@
|
|||
select scale_id
|
||||
from sys_evaluation_record
|
||||
where user_id = #{userId}
|
||||
and tenant_id = '000000'
|
||||
and status >= 0
|
||||
group by scale_id
|
||||
</select>
|
||||
|
||||
|
|
Loading…
Reference in New Issue