Compare commits

...

4 Commits

Author SHA1 Message Date
曹磊 d482faae0a 用户钱包明细流水 2024-06-17 21:57:13 +08:00
曹磊 ee4fa62ef5 Merge remote-tracking branch 'origin/master' 2024-06-17 20:10:19 +08:00
曹磊 0fb820c8a1 获取服务疗程详细列表 2024-06-15 21:18:01 +08:00
曹磊 0e1e0813fa 查看用户服务包详情 2024-06-15 21:08:08 +08:00
26 changed files with 184 additions and 47 deletions

View File

@ -1,6 +1,9 @@
package com.sqx.modules.app.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sqx.modules.app.entity.UserMoneyDetails;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -14,4 +17,6 @@ public interface UserMoneyDetailsDao extends BaseMapper<UserMoneyDetails> {
BigDecimal selectSumRefund(Long userId,String startTime,String endTime);
int insert(UserMoneyDetails userMoneyDetails);
IPage<UserMoneyDetails> findUserMontyDetailPage(Page<UserMoneyDetails> page, @Param("userId") Long userId);
}

View File

@ -99,4 +99,11 @@ public class UserMoneyDetails implements Serializable {
private Integer blFlag;
@TableField(exist = false)
private Integer page;
@TableField(exist = false)
private Integer limit;
}

View File

@ -14,6 +14,7 @@ import com.sqx.modules.app.service.*;
import com.sqx.modules.artificer.entity.Artificer;
import com.sqx.modules.artificer.entity.Period;
import com.sqx.modules.artificer.service.ArtificerService;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import com.sqx.modules.message.entity.MessageInfo;
import com.sqx.modules.message.service.MessageService;
import com.sqx.modules.utils.PeriodUtil;
@ -143,11 +144,10 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
return userMoneyDetailsDao.selectMyProfit(userId);
}
@Override
public PageUtils balanceDetailed(Long userId, Page<UserMoneyDetails> pages) {
return new PageUtils(userMoneyDetailsDao.selectPage(pages,new QueryWrapper<UserMoneyDetails>().eq("user_id",userId).orderByDesc("create_time ")));
// return new PageUtils(userMoneyDetailsDao.selectPage(pages,new QueryWrapper<UserMoneyDetails>().eq("user_id",userId).orderByDesc("create_time ")));
return new PageUtils(userMoneyDetailsDao.findUserMontyDetailPage(pages,userId));
}
@Override

View File

@ -195,10 +195,10 @@ public class ArtificerController {
String endTime,Integer isAdd,String ordersNo,String artificerName,
String oneUserName,String oneArtificerUserName,
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
String shopName,Integer warning,String title,String classifyId){
String shopName,Integer warning,String title,String classifyId, Long userPackageId){
return ordersService.selectOrdersList(userId, page, limit, status, city, name, phone,
artificerId, parentId, startTime, endTime, isAdd, ordersNo, artificerName,
oneUserName, oneArtificerUserName, startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId);
oneUserName, oneArtificerUserName, startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId, userPackageId);
}
@GetMapping("/excelOrdersList")

View File

@ -19,6 +19,8 @@ import com.sqx.modules.artificer.dao.ArtificerDao;
import com.sqx.modules.artificer.dao.UserRechargeDao;
import com.sqx.modules.artificer.entity.*;
import com.sqx.modules.artificer.service.*;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import com.sqx.modules.bl.collect.service.CollectMassageService;
import com.sqx.modules.common.dao.CommonInfoDao;
import com.sqx.modules.common.entity.CommonInfo;
import com.sqx.modules.common.service.CommonInfoService;
@ -80,7 +82,8 @@ public class AppArtificerController {
private ArtificerDao artificerDao;
@Autowired
private UserRechargeDao userRechargeDao;
@Autowired
private CollectMassageService collectMassageService;
@GetMapping("/selectMassageTypePage")
@ApiOperation("查询按摩分类(分页)")
@ -100,7 +103,16 @@ public class AppArtificerController {
@GetMapping("/selectMassageTypeById")
@ApiOperation("查询详情")
public Result selectMassageTypeById(Long massageTypeId){
public Result selectMassageTypeById(Long massageTypeId,Long userId){
if(userId!=null){
//插入浏览历史
CollectMassage collectMassage=new CollectMassage();
collectMassage.setClassify(2);
collectMassage.setUserId(userId);
collectMassage.setProjectId(massageTypeId);
collectMassage.setFlag(1);
collectMassageService.insertCollect(collectMassage);
}
MassageType massageType = massageTypeService.getById(massageTypeId);
SysDictEntity sysDictEntity = sysDictService.getById(massageType.getClassifyId());
if(sysDictEntity!=null){
@ -194,10 +206,10 @@ public class AppArtificerController {
Integer isAdd,String ordersNo,String artificerName,
String oneUserName,String oneArtificerUserName,
String startServeTime,String endServeTime,Integer overTimeOrders,
Long shopId,String shopName,Integer warning,String title,String classifyId){
Long shopId,String shopName,Integer warning,String title,String classifyId, Long userPackageId){
return ordersService.selectOrdersList(userId, page, limit, status, city, userName, phone, artificerId,
parentId, startTime, endTime, isAdd, ordersNo, artificerName, oneUserName, oneArtificerUserName,
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId);
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId, userPackageId);
}
@Login
@ -208,10 +220,10 @@ public class AppArtificerController {
Integer isAdd,String ordersNo,String artificerName,
String oneUserName,String oneArtificerUserName,
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
String shopName,Integer warning,String title,String classifyId){
String shopName,Integer warning,String title,String classifyId, Long userPackageId){
return ordersService.selectOrdersList(userId, page, limit, status, city, userName, phone, artificerId,
parentId, startTime, endTime, isAdd, ordersNo, artificerName, oneUserName, oneArtificerUserName,
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId);
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId, userPackageId);
}
@Login

View File

@ -26,7 +26,7 @@ public interface OrdersDao extends BaseMapper<Orders> {
@Param("endTime") String endTime,@Param("isAdd") Integer isAdd,String ordersNo,String artificerName,
String oneUserName,String oneArtificerUserName,
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,String shopName,Integer warning,
String title,String classifyId);
String title,String classifyId,Long userPackageId);
List<Orders> excelOrdersList(@Param("userId") Long userId,@Param("status") Integer status,
@Param("city") String city,@Param("userName") String userName,@Param("phone") String phone,

View File

@ -301,6 +301,10 @@ public class Orders implements Serializable {
* 用户服务包ID
*/
private Long userPackageId;
/**
* 用户服务包明细ID
*/
private Long userPackageDetailId;
/**
* 项目名称

View File

@ -31,7 +31,7 @@ public interface OrdersService extends IService<Orders> {
String endTime,Integer isAdd,String ordersNo,String artificerName,
String oneUserName,String oneArtificerUserName,
String startServeTime,String endServeTime,Integer overTimeOrders,Long shopId,
String shopName,Integer warning,String title,String classifyId);
String shopName,Integer warning,String title,String classifyId, Long userPackageId);
ExcelData excelOrdersList(Long userId,Integer status,String city,
String name,String phone,Long artificerId,Long parentId,String startTime,

View File

@ -1203,11 +1203,11 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
String endTime, Integer isAdd, String ordersNo, String artificerName,
String oneUserName, String oneArtificerUserName,
String startServeTime, String endServeTime, Integer overTimeOrders,
Long shopId, String shopName, Integer warning, String title, String classifyId) {
Long shopId, String shopName, Integer warning, String title, String classifyId, Long userPackageId) {
Page<Orders> pages = new Page<>(page, limit);
IPage<Orders> ordersIPage = baseMapper.selectOrdersList(pages, userId, status,
city, name, phone, artificerId, parentId, startTime, endTime, isAdd, ordersNo,
artificerName, oneUserName, oneArtificerUserName, startServeTime, endServeTime, overTimeOrders, shopId, shopName, warning, title, classifyId);
artificerName, oneUserName, oneArtificerUserName, startServeTime, endServeTime, overTimeOrders, shopId, shopName, warning, title, classifyId, userPackageId);
List<Orders> records = ordersIPage.getRecords();
for (Orders orders : records) {
List<OrdersMassage> ordersMassageList = ordersMassageService.list(new QueryWrapper<OrdersMassage>().eq("orders_id", orders.getOrdersId()));

View File

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 浏览记录
@ -25,7 +26,7 @@ public class CollectMassage implements Serializable {
private long collectId;
/**
* 技师id
* 服务或项目id
*/
private Long projectId;
@ -59,4 +60,18 @@ public class CollectMassage implements Serializable {
private Integer limit;
@TableField(exist = false)
private String title;
@TableField(exist = false)
private String massageImg;
@TableField(exist = false)
private BigDecimal oldPrice;
@TableField(exist = false)
private BigDecimal price;
@TableField(exist = false)
private String content;
@TableField(exist = false)
private String type;
@TableField(exist = false)
private String remarks;
}

View File

@ -20,11 +20,18 @@ public class AppMassagePackageDetailController {
private MassagePackageDetailService service;
@Login
@GetMapping("/findPage")
@GetMapping("/findAppPage")
@ApiOperation("查询按服务包详情(分页)")
public Result findPage(MassagePackageDetail massagePackageDetail){
public Result findAppPage(MassagePackageDetail massagePackageDetail){
massagePackageDetail.setStatus(1);
return service.findPage(massagePackageDetail);
return service.findAppPage(massagePackageDetail);
}
@Login
@GetMapping("/getAppPackageDetail")
@ApiOperation("查询服务包详情")
public Result getAppPackageDetail(MassagePackageDetail massagePackageDetail){
return service.getAppPackageDetail(massagePackageDetail);
}
}

View File

@ -22,4 +22,5 @@ public interface MassagePackageDetailDao extends BaseMapper<MassagePackageDetail
IPage<MassagePackageDetail> findMassagePage(Page<MassagePackageDetail> page, @Param("params") MassagePackageDetail massagePackageDetail);
int delete(MassagePackageDetail massagePackageDetail);
MassagePackage findPackagePrice(MassagePackageDetail massagePackageDetail);
MassagePackageDetail getAppPackageDetail(Long id);
}

View File

@ -16,4 +16,5 @@ public interface MassagePackageDetailService extends IService<MassagePackageDeta
void delete(MassagePackageDetail massagePackageDetail);
Result findAppPage(MassagePackageDetail massagePackageDetail);
Result getAppPackageDetail(MassagePackageDetail massagePackageDetail);
}

View File

@ -114,4 +114,10 @@ public class MassagePackageServiceDetailImpl extends ServiceImpl<MassagePackageD
return Result.success(map);
}
@Override
public Result getAppPackageDetail(MassagePackageDetail massagePackageDetail){
massagePackageDetail = baseMapper.getAppPackageDetail(massagePackageDetail.getId());
return Result.success().put("data",massagePackageDetail);
}
}

View File

@ -164,6 +164,18 @@ public class UserPackageDetail implements Serializable {
@TableField(exist = false)
private Integer sales;
/**
* 疗程描述
*/
@TableField(exist = false)
private String intervalDaysStr;
/**
* 上次预约时间
*/
@TableField(exist = false)
private String maxTime;
@TableField(exist = false)
private Integer page;

View File

@ -47,7 +47,6 @@ public class UserPackageDetailServiceImpl extends ServiceImpl<UserPackageDetailD
public Result findAppUsedQuantity(UserPackageDetail userPackageDetail){
Map<String, Object> map = new HashMap<String, Object>();
UserPackage userPackage = userPackageService.getMyPackageById(userPackageDetail.getMainId());
map.put("mainData",userPackage);
int type = userPackage.getType();
List<UserPackageDetail> list = Lists.newArrayList();
if(type == 104){
@ -57,6 +56,7 @@ public class UserPackageDetailServiceImpl extends ServiceImpl<UserPackageDetailD
}else if(type == 106){
list = baseMapper.findLcDetailUsedQuantity(userPackageDetail);
}
map.put("mainData",userPackage);
map.put("detailData",list);
return Result.success().put("data",map);
}

View File

@ -41,7 +41,7 @@ public class Coupon implements Serializable {
private BigDecimal money;
@ApiModelProperty("优惠券类型")
private BigDecimal couType;
private Integer couType;
public Coupon() {}
}

View File

@ -98,12 +98,12 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
@Override
public Result insertNewUserCoupon(UserEntity userEntity){
if(userEntity.getIsCoupon()!=null && userEntity.getIsCoupon()==1){
return Result.error("您已经领取过新人优惠券了");
return Result.error("您已经领取");
}
Long userId=userEntity.getUserId();
UserEntity user = userService.getById(userId);
if(user.getIsCoupon()!=null && user.getIsCoupon()==1){
return Result.error("您已经领取过新人优惠券了");
return Result.error("您已经领取");
}
//当前时间
String nowTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
@ -111,12 +111,12 @@ public class CouponUserServiceImpl extends ServiceImpl<CouponUserDao, CouponUser
String userTime = user.getCreateTime();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDate date1 = LocalDate.parse(nowTime, formatter);
LocalDate date2 = LocalDate.parse(userTime, formatter);
LocalDate date1 = LocalDate.parse(nowTime.substring(0,10), formatter);
LocalDate date2 = LocalDate.parse(userTime.substring(0,10), formatter);
// 计算两个日期之间相差的天数 data1小于date2
long daysBetween = ChronoUnit.DAYS.between(date1, date2);
long daysBetween = ChronoUnit.DAYS.between(date2, date1);
if(daysBetween>7){
return Result.error("新人优惠期");
return Result.error("已过新人优惠期");
}
//获取所有新人优惠卷

View File

@ -678,6 +678,7 @@ public class AliPayController {
userPackage.setContentImg(massagePackage.getContentImg());
userPackage.setLabels(massagePackage.getLabels());
userPackage.setCity(massagePackage.getCity());
userPackage.setClassifyId(massagePackage.getClassifyId());
userPackageService.insert(userPackage);
Long mainId = userPackage.getId();
//拆分插入用户服务器项目详情

View File

@ -1151,6 +1151,7 @@ public class WxServiceImpl implements WxService {
userPackage.setContentImg(massagePackage.getContentImg());
userPackage.setLabels(massagePackage.getLabels());
userPackage.setCity(massagePackage.getCity());
userPackage.setClassifyId(massagePackage.getClassifyId());
userPackageService.insert(userPackage);
Long mainId = userPackage.getId();
//拆分插入用户服务器项目详情

View File

@ -111,4 +111,19 @@
</trim>
</insert>
<select id="findUserMontyDetailPage" resultType="com.sqx.modules.app.entity.UserMoneyDetails">
select
title,
content,
create_time,
type,
money,
bl_flag
from user_money_details
where user_id=#{userId}
and bl_role = 1
and state = 2
order by create_time desc
</select>
</mapper>

View File

@ -284,6 +284,9 @@
left join tb_user u on u.user_id=o.user_id
left join consortia c on c.consortia_id=o.consortia_id
where 1=1
<if test="userPackageId!=null">
and o.user_package_id = #{userPackageId}
</if>
<if test="classifyId!=null and classifyId!=''">
and o.orders_id in (select orders_id from orders_massage where massage_id in (select massage_type_id from massage_type where classify_id=#{classifyId} ))
</if>

View File

@ -4,19 +4,33 @@
<mapper namespace="com.sqx.modules.bl.collect.dao.CollectMassageDao">
<select id="findPage" resultType="com.sqx.modules.bl.collect.entity.CollectMassage">
select *
from bl_collect_massage
select
a.flag,
a.project_id,
(case when a.flag = 1 then b.title else c.title end) as title,
(case when a.flag = 1 then b.massage_img else c.package_img end) as massage_img,
(case when a.flag = 1 then b.old_price else c.old_price end) as old_price,
(case when a.flag = 1 then b.price else c.price end) as price,
(case when a.flag = 1 then b.jianjie else c.content end) as content,
(case when a.flag = 1 then '项目' else substr(d.value,3) end) as type,
(case when a.flag = 1 then concat(duration,'分钟|',replace(b.labels,',',' '))
else replace(c.labels,',',' ')
end) as remarks
from bl_collect_massage a
left join massage_type b on a.project_id = b.massage_type_id
left join bl_massage_package c on a.project_id = c.id
left join sys_dict d on c.type = d.id
where 1=1
<if test="params.userId!=null">
and user_id=#{params.userId}
and a.user_id=#{params.userId}
</if>
<if test="params.flag!=null">
and flag=#{params.flag}
and a.flag=#{params.flag}
</if>
<if test="params.classify!=null">
and classify=#{params.classify}
and a.classify=#{params.classify}
</if>
order by collect_id
order by a.collect_id desc
</select>
<insert id="insert" parameterType="com.sqx.modules.bl.collect.entity.CollectMassage">

View File

@ -54,7 +54,7 @@
</delete>
<select id="findPackageAndMassagePage" resultType="com.sqx.modules.bl.massage.entity.MassagePackage">
select a.id as massage_type_id,title,a.type,b.value as type_name,old_price,price,package_img,content,content_img,add_num,sales,labels,'套餐' as flag,
select a.id,title,a.type,b.value as type_name,old_price,price,package_img,content,content_img,add_num,sales,labels,'套餐' as flag
from bl_massage_package a
left join sys_dict b on a.type = b.id
where a.status = 1
@ -62,14 +62,14 @@
and (a.city like concat('%',#{params.city},'%') or a.city='不限')
</if>
union all
select massage_type_id,title,classify_id as type,b.value as type_name,old_price,price,massage_img,jianjie,content_img,add_num,sales,labels,'项目' as flag,
select massage_type_id as id,title,classify_id as type,b.value as type_name,old_price,price,massage_img,jianjie,content_img,add_num,sales,labels,'项目' as flag
from massage_type a
left join sys_dict b on a.classify_id = b.id
where a.status = 1
<if test="params.city!=null and params.city!=''">
and (a.city like concat('%',#{params.city},'%') or a.city='不限')
</if>
order by sales desc,massage_type_id asc
order by sales desc,id asc
</select>

View File

@ -186,4 +186,33 @@
group by a.main_id
</select>
<select id="getAppPackageDetail" resultType="com.sqx.modules.bl.massage.entity.MassagePackageDetail">
select
a.id,
a.main_id,
a.massage_type_id,
a.package_price,
a.service_count,
a.interval_days,
m.status,
m.create_time,
m.title,
m.massage_img,
m.content,
m.old_price,
m.price,
m.duration,
m.is_sex,
m.city,
m.content_img,
m.labels,
m.parent_id,
m.classify_id as type,
m.apply_people,
m.jianjie,
m.sales
from bl_massage_package_detail a left join massage_type m on a.massage_type_id = m.massage_type_id
where a.id = #{id}
</select>
</mapper>

View File

@ -36,13 +36,14 @@
a.massage_type_id,
a.title,
a.massage_img,
a.package_price,
a.price,
(case a.status when 1 then 1 else 0 end) as usedQuantity,
(case a.status when 0 then 1 else 0 end) as unUsedQuantity
a.content_img,
round(avg(a.package_price),2) as package_price,
round(avg(a.price),2) as price,
sum(case a.status when 1 then 1 else 0 end) as usedQuantity,
sum(case a.status when 0 then 1 else 0 end) as unUsedQuantity
from bl_user_package_detail a
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.content_img
order by a.massage_type_id
</select>
@ -51,14 +52,17 @@
a.massage_type_id,
a.title,
a.massage_img,
a.package_price,
a.price,
(case a.status when 1 then 1 else 0 end) as usedQuantity,
(case a.status when 0 then 1 else 0 end) as unUsedQuantity,
interval_days
a.content_img,
round(avg(a.package_price),2) as package_price,
round(avg(a.price),2) as price,
sum(case a.status when 1 then 1 else 0 end) as usedQuantity,
sum(case a.status when 0 then 1 else 0 end) as unUsedQuantity,
concat(round(count(massage_type_id)*avg(interval_days)),'天一疗程,每隔',round(avg(interval_days)),'天一次,共',round(count(massage_type_id)),'次') as interval_days_str,
(select max(end_times) from orders o where a.massage_type_id = o.massage_type_id and b.id = o.user_package_id) as max_time
from bl_user_package_detail a
inner join bl_user_package b on a.main_id = b.id
where a.main_id = #{mainId}
group by a.massage_type_id,a.title,a.massage_img,a.package_price,a.price,interval_days
group by a.massage_type_id,a.title,a.massage_img,a.content_img
order by a.massage_type_id
</select>