服务包订单,查看服务包及详情
This commit is contained in:
parent
fbaf417de9
commit
540bc77b1a
|
@ -29,6 +29,18 @@ public class AppVipDetailsController {
|
||||||
return appVipDetailsService.selectVipDetails();
|
return appVipDetailsService.selectVipDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员的详情信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Login
|
||||||
|
@ApiParam("获取会员的详情信息")
|
||||||
|
@GetMapping("/getVipDetailByUser")
|
||||||
|
public Result getVipDetailByUser(Long userId) {
|
||||||
|
return appVipDetailsService.getVipDetailByUser(userId);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加会员的详情信息
|
* 添加会员的详情信息
|
||||||
*
|
*
|
||||||
|
|
|
@ -9,7 +9,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import weixin.popular.bean.card.Discount;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -40,4 +39,10 @@ public class VipDetails implements Serializable {
|
||||||
private Integer vipType;
|
private Integer vipType;
|
||||||
//优惠力度
|
//优惠力度
|
||||||
private BigDecimal rate;
|
private BigDecimal rate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long userId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,13 @@ public interface VipDetailsService extends IService<VipDetails> {
|
||||||
*/
|
*/
|
||||||
Result selectVipDetails();
|
Result selectVipDetails();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员的详情信息
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Result getVipDetailByUser(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加会员的详情信息
|
* 添加会员的详情信息
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.sqx.modules.app.service.impl;
|
package com.sqx.modules.app.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.app.dao.VipDetailsDao;
|
import com.sqx.modules.app.dao.VipDetailsDao;
|
||||||
|
@ -7,12 +8,24 @@ import com.sqx.modules.app.entity.VipDetails;
|
||||||
import com.sqx.modules.app.service.VipDetailsService;
|
import com.sqx.modules.app.service.VipDetailsService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class VipDetailsServiceImpl extends ServiceImpl<VipDetailsDao, VipDetails> implements VipDetailsService {
|
public class VipDetailsServiceImpl extends ServiceImpl<VipDetailsDao, VipDetails> implements VipDetailsService {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result selectVipDetails() {
|
public Result selectVipDetails() {
|
||||||
return Result.success().put("data", baseMapper.selectList(null));
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("vip_type", 0);
|
||||||
|
queryWrapper.orderByAsc("id");
|
||||||
|
List<VipDetails> list = baseMapper.selectList(queryWrapper);
|
||||||
|
return Result.success().put("data", list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result getVipDetailByUser(Long userId){
|
||||||
|
VipDetails vipDetails = baseMapper.getVipDetailByUser(userId);
|
||||||
|
return Result.success().put("data", vipDetails);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class AppUserPackageOrderController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserPackageOrderService service;
|
private UserPackageOrderService service;
|
||||||
|
|
||||||
@Login
|
// @Login
|
||||||
@PostMapping("/insertOrders")
|
@PostMapping("/insertOrders")
|
||||||
@ApiOperation("添加订单")
|
@ApiOperation("添加订单")
|
||||||
public Result insertOrders(@RequestBody UserPackageOrder userPackageOrder){
|
public Result insertOrders(@RequestBody UserPackageOrder userPackageOrder){
|
||||||
|
@ -29,7 +29,7 @@ public class AppUserPackageOrderController {
|
||||||
return service.insertOrders(userPackageOrder);
|
return service.insertOrders(userPackageOrder);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Login
|
// @Login
|
||||||
@PostMapping("/payOrder")
|
@PostMapping("/payOrder")
|
||||||
@ApiOperation("钱包支付订单")
|
@ApiOperation("钱包支付订单")
|
||||||
public Result payOrder(Long ordersId){
|
public Result payOrder(Long ordersId){
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.sqx.modules.bl.order.controller;
|
||||||
|
|
||||||
|
import com.sqx.common.utils.Result;
|
||||||
|
import com.sqx.modules.bl.order.entity.UserPackage;
|
||||||
|
import com.sqx.modules.bl.order.service.UserPackageService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/user/package")
|
||||||
|
@Api(value = "用户服务包管理", tags = {"用户服务包"})
|
||||||
|
public class UserPackageController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserPackageService service;
|
||||||
|
|
||||||
|
@GetMapping("/findList")
|
||||||
|
@ApiOperation("查询服务包")
|
||||||
|
public Result findList(UserPackage userPackage){
|
||||||
|
return service.findList(userPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -10,6 +10,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/user/package/detail")
|
@RequestMapping("/user/package/detail")
|
||||||
|
@ -25,5 +27,4 @@ public class UserPackageDetailController {
|
||||||
return service.findDetailUsedQuantity(userPackageDetail);
|
return service.findDetailUsedQuantity(userPackageDetail);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,14 @@ import com.sqx.modules.bl.massage.entity.MassagePackage;
|
||||||
import com.sqx.modules.bl.order.entity.UserPackage;
|
import com.sqx.modules.bl.order.entity.UserPackage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface UserPackageDao extends BaseMapper<UserPackage> {
|
public interface UserPackageDao extends BaseMapper<UserPackage> {
|
||||||
|
|
||||||
|
List<UserPackage> findList(UserPackage userPackage);
|
||||||
|
|
||||||
|
List<UserPackage> findListByMapping(UserPackage userPackage);
|
||||||
|
|
||||||
int insert(UserPackage userPackage);
|
int insert(UserPackage userPackage);
|
||||||
}
|
}
|
|
@ -98,6 +98,12 @@ public class UserPackage implements Serializable {
|
||||||
*/
|
*/
|
||||||
private String city;
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态 0待支付
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private Integer page;
|
private Integer page;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package com.sqx.modules.bl.order.service;
|
package com.sqx.modules.bl.order.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.bl.order.entity.UserPackage;
|
import com.sqx.modules.bl.order.entity.UserPackage;
|
||||||
|
|
||||||
public interface UserPackageService extends IService<UserPackage> {
|
public interface UserPackageService extends IService<UserPackage> {
|
||||||
|
|
||||||
|
Result findList(UserPackage userPackage);
|
||||||
|
|
||||||
int insert(UserPackage userPackage);
|
int insert(UserPackage userPackage);
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.sqx.modules.bl.order.service.impl;
|
package com.sqx.modules.bl.order.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.sqx.common.utils.Result;
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.bl.order.dao.UserPackageDetailDao;
|
import com.sqx.modules.bl.order.dao.UserPackageDetailDao;
|
||||||
import com.sqx.modules.bl.order.entity.UserPackageDetail;
|
import com.sqx.modules.bl.order.entity.UserPackageDetail;
|
||||||
|
@ -14,7 +15,13 @@ public class UserPackageDetailServiceImpl extends ServiceImpl<UserPackageDetailD
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result findDetailUsedQuantity(UserPackageDetail userPackageDetail){
|
public Result findDetailUsedQuantity(UserPackageDetail userPackageDetail){
|
||||||
return Result.success().put("data",baseMapper.findDetailUsedQuantity(userPackageDetail));
|
List<UserPackageDetail> list = Lists.newArrayList();
|
||||||
|
if(userPackageDetail.getStatus() == 0){
|
||||||
|
list = baseMapper.findMassagePackageDetails(userPackageDetail);
|
||||||
|
}else{
|
||||||
|
list = baseMapper.findDetailUsedQuantity(userPackageDetail);
|
||||||
|
}
|
||||||
|
return Result.success().put("data",list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,14 +1,33 @@
|
||||||
package com.sqx.modules.bl.order.service.impl;
|
package com.sqx.modules.bl.order.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.sqx.common.utils.Result;
|
||||||
import com.sqx.modules.bl.order.dao.UserPackageDao;
|
import com.sqx.modules.bl.order.dao.UserPackageDao;
|
||||||
import com.sqx.modules.bl.order.entity.UserPackage;
|
import com.sqx.modules.bl.order.entity.UserPackage;
|
||||||
import com.sqx.modules.bl.order.service.UserPackageService;
|
import com.sqx.modules.bl.order.service.UserPackageService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class UserPackageServiceImpl extends ServiceImpl<UserPackageDao, UserPackage> implements UserPackageService {
|
public class UserPackageServiceImpl extends ServiceImpl<UserPackageDao, UserPackage> implements UserPackageService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result findList(UserPackage userPackage){
|
||||||
|
List<UserPackage> list = Lists.newArrayList();
|
||||||
|
if(userPackage.getStatus() == 0){
|
||||||
|
list = baseMapper.findListByMapping(userPackage);
|
||||||
|
}else{
|
||||||
|
list = baseMapper.findList(userPackage);
|
||||||
|
}
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
UserPackage up = list.get(i);
|
||||||
|
up.setStatus(userPackage.getStatus());
|
||||||
|
}
|
||||||
|
return Result.success().put("data",list);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insert(UserPackage userPackage){
|
public int insert(UserPackage userPackage){
|
||||||
return baseMapper.insert(userPackage);
|
return baseMapper.insert(userPackage);
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
b.classify_id as type
|
b.classify_id as type
|
||||||
from bl_massage_package_detail a inner join massage_type b on a.massage_type_id = b.massage_type_id
|
from bl_massage_package_detail a inner join massage_type b on a.massage_type_id = b.massage_type_id
|
||||||
where a.main_id = #{params.mainId}
|
where a.main_id = #{params.mainId}
|
||||||
|
<if test="params.status!=null and params.status!=0">
|
||||||
|
and b.status=#{params.status}
|
||||||
|
</if>
|
||||||
order by a.id desc
|
order by a.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,45 @@
|
||||||
|
|
||||||
<mapper namespace="com.sqx.modules.bl.order.dao.UserPackageDao">
|
<mapper namespace="com.sqx.modules.bl.order.dao.UserPackageDao">
|
||||||
|
|
||||||
|
<select id="findList" resultType="com.sqx.modules.bl.order.entity.UserPackage">
|
||||||
|
select
|
||||||
|
id,
|
||||||
|
user_id,
|
||||||
|
package_id,
|
||||||
|
orders_id,
|
||||||
|
orders_no,
|
||||||
|
create_time,
|
||||||
|
title,
|
||||||
|
type,
|
||||||
|
old_price,
|
||||||
|
price,
|
||||||
|
package_img,
|
||||||
|
content,
|
||||||
|
content_img,
|
||||||
|
labels,
|
||||||
|
city
|
||||||
|
from bl_user_package
|
||||||
|
where orders_id = #{ordersId}
|
||||||
|
order by id
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findListByMapping" resultType="com.sqx.modules.bl.order.entity.UserPackage">
|
||||||
|
select
|
||||||
|
a.id,
|
||||||
|
a.title,
|
||||||
|
a.type,
|
||||||
|
a.old_price,
|
||||||
|
a.price,
|
||||||
|
a.package_img,
|
||||||
|
a.content,
|
||||||
|
a.content_img,
|
||||||
|
a.labels,
|
||||||
|
a.city
|
||||||
|
from bl_massage_package a inner join bl_user_package_order_mapping b on a.id = b.package_id
|
||||||
|
where b.orders_id = #{ordersId}
|
||||||
|
order by a.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.order.entity.UserPackageOrder">
|
<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.sqx.modules.bl.order.entity.UserPackageOrder">
|
||||||
insert into bl_user_package(
|
insert into bl_user_package(
|
||||||
user_id,
|
user_id,
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
a.price,
|
a.price,
|
||||||
(case a.status when 1 then 1 else 0 end) as usedQuantity,
|
(case a.status when 1 then 1 else 0 end) as usedQuantity,
|
||||||
(case a.status when 0 then 1 else 0 end) as unUsedQuantity
|
(case a.status when 0 then 1 else 0 end) as unUsedQuantity
|
||||||
from bl_user_package_detail a inner join bl_user_package b on a.main_id = b.id
|
from bl_user_package_detail a
|
||||||
where b.orders_id = #{ordersId}
|
where a.main_id = #{mainId}
|
||||||
group by a.massage_type_id,a.title,a.massage_img,a.package_price,a.price
|
group by a.massage_type_id,a.title,a.massage_img,a.package_price,a.price
|
||||||
order by a.massage_type_id
|
order by a.massage_type_id
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue