Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
d63861ac13
|
|
@ -38,7 +38,6 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@Api(hidden = true)
|
||||
@EnableTransactionManagement
|
||||
@SpringBootApplication
|
||||
|
||||
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
||||
public class AppRun {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.ysk.cashier.mybatis.service;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopUserFlow;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -15,7 +16,7 @@ public interface TbShopUserFlowService extends IService<TbShopUserFlow> {
|
|||
BigDecimal sumUserFlowAmountByConditions(Long shopId, String startTime, String endTime);
|
||||
|
||||
|
||||
Map selectByUserId(Integer userId, Integer page, Integer pageSize);
|
||||
IPage<Map<String, Object>> selectByUserId(Integer userId, Integer page, Integer pageSize);
|
||||
|
||||
Integer selectCountByUserId(Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,19 @@ package cn.ysk.cashier.mybatis.service.impl;
|
|||
import cn.ysk.cashier.mybatis.entity.TbShopUserFlow;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbShopUserFlowMapper;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopUserFlowService;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.*;
|
||||
import org.springframework.security.core.parameters.P;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -23,21 +31,19 @@ public class TbShopUserFlowServiceImpl extends ServiceImpl<TbShopUserFlowMapper,
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map selectByUserId(Integer userId, Integer page, Integer pageSize) {
|
||||
public IPage<Map<String, Object>> selectByUserId(Integer userId, Integer page, Integer pageSize) {
|
||||
|
||||
Map map=new HashMap();
|
||||
int count= baseMapper.selectCountByUserId(userId);
|
||||
if(count>0){
|
||||
Pageable pageable = PageRequest.of(page, pageSize, Sort.by("id").descending());
|
||||
List<TbShopUserFlow> userFlows=baseMapper.selectByUserId(userId,pageable.getPageNumber(),pageable.getPageSize());
|
||||
map.put("totalElements",count);
|
||||
map.put("content",userFlows);
|
||||
}else {
|
||||
QueryWrapper<TbShopUserFlow> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.eq("shop_user_id",userId);
|
||||
|
||||
map.put("totalElements",0);
|
||||
map.put("content",null);
|
||||
}
|
||||
return map;
|
||||
List<OrderItem> orders=new ArrayList<>();
|
||||
OrderItem orderItem=new OrderItem();
|
||||
orderItem.setColumn("id");
|
||||
orderItem.setAsc(false);
|
||||
orders.add(orderItem);
|
||||
Page page1=new Page<>(page,pageSize);
|
||||
page1.setOrders(orders);
|
||||
return baseMapper.selectMapsPage(page1,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -327,11 +327,6 @@ public class TbPayServiceImpl implements TbPayService {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private final TbMShopUserMapper shopUserMapper;
|
||||
private final TbShopUserFlowMapper shopUserFlowMapper;
|
||||
|
||||
@Override
|
||||
public TbOrderInfo vipPay(@NotNull Integer shopId, @NotNull Integer orderId, Double discount, Integer vipUserId) {
|
||||
|
||||
|
|
@ -386,6 +381,11 @@ public class TbPayServiceImpl implements TbPayService {
|
|||
return orderInfo;
|
||||
}
|
||||
|
||||
|
||||
private final TbMShopUserMapper shopUserMapper;
|
||||
private final TbShopUserFlowMapper shopUserFlowMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public TbOrderInfo cashPay(PayDTO payDTO) {
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectOne(new LambdaUpdateWrapper<TbOrderInfo>()
|
||||
|
|
|
|||
Loading…
Reference in New Issue