Compare commits

..

No commits in common. "d482faae0aec0e5ebc40dda10c3f7536ac829f9f" and "ce91198e27deadda419b06bd66f75cdcfad0791e" have entirely different histories.

26 changed files with 47 additions and 184 deletions

View File

@ -1,9 +1,6 @@
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;
@ -17,6 +14,4 @@ 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,11 +99,4 @@ public class UserMoneyDetails implements Serializable {
private Integer blFlag;
@TableField(exist = false)
private Integer page;
@TableField(exist = false)
private Integer limit;
}

View File

@ -14,7 +14,6 @@ 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;
@ -144,10 +143,11 @@ 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.findUserMontyDetailPage(pages,userId));
return new PageUtils(userMoneyDetailsDao.selectPage(pages,new QueryWrapper<UserMoneyDetails>().eq("user_id",userId).orderByDesc("create_time ")));
}
@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, Long userPackageId){
String shopName,Integer warning,String title,String classifyId){
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, userPackageId);
oneUserName, oneArtificerUserName, startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId);
}
@GetMapping("/excelOrdersList")

View File

@ -19,8 +19,6 @@ 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;
@ -82,8 +80,7 @@ public class AppArtificerController {
private ArtificerDao artificerDao;
@Autowired
private UserRechargeDao userRechargeDao;
@Autowired
private CollectMassageService collectMassageService;
@GetMapping("/selectMassageTypePage")
@ApiOperation("查询按摩分类(分页)")
@ -103,16 +100,7 @@ public class AppArtificerController {
@GetMapping("/selectMassageTypeById")
@ApiOperation("查询详情")
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);
}
public Result selectMassageTypeById(Long massageTypeId){
MassageType massageType = massageTypeService.getById(massageTypeId);
SysDictEntity sysDictEntity = sysDictService.getById(massageType.getClassifyId());
if(sysDictEntity!=null){
@ -206,10 +194,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 userPackageId){
Long shopId,String shopName,Integer warning,String title,String classifyId){
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, userPackageId);
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId);
}
@Login
@ -220,10 +208,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 userPackageId){
String shopName,Integer warning,String title,String classifyId){
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, userPackageId);
startServeTime, endServeTime,overTimeOrders,shopId,shopName,warning,title,classifyId);
}
@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,Long userPackageId);
String title,String classifyId);
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,10 +301,6 @@ 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, Long userPackageId);
String shopName,Integer warning,String title,String classifyId);
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 userPackageId) {
Long shopId, String shopName, Integer warning, String title, String classifyId) {
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, userPackageId);
artificerName, oneUserName, oneArtificerUserName, startServeTime, endServeTime, overTimeOrders, shopId, shopName, warning, title, classifyId);
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,7 +7,6 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 浏览记录
@ -26,7 +25,7 @@ public class CollectMassage implements Serializable {
private long collectId;
/**
* 服务或项目id
* 技师id
*/
private Long projectId;
@ -60,18 +59,4 @@ 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,18 +20,11 @@ public class AppMassagePackageDetailController {
private MassagePackageDetailService service;
@Login
@GetMapping("/findAppPage")
@GetMapping("/findPage")
@ApiOperation("查询按服务包详情(分页)")
public Result findAppPage(MassagePackageDetail massagePackageDetail){
public Result findPage(MassagePackageDetail massagePackageDetail){
massagePackageDetail.setStatus(1);
return service.findAppPage(massagePackageDetail);
}
@Login
@GetMapping("/getAppPackageDetail")
@ApiOperation("查询服务包详情")
public Result getAppPackageDetail(MassagePackageDetail massagePackageDetail){
return service.getAppPackageDetail(massagePackageDetail);
return service.findPage(massagePackageDetail);
}
}

View File

@ -22,5 +22,4 @@ 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,5 +16,4 @@ public interface MassagePackageDetailService extends IService<MassagePackageDeta
void delete(MassagePackageDetail massagePackageDetail);
Result findAppPage(MassagePackageDetail massagePackageDetail);
Result getAppPackageDetail(MassagePackageDetail massagePackageDetail);
}

View File

@ -114,10 +114,4 @@ 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,18 +164,6 @@ 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,6 +47,7 @@ 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){
@ -56,7 +57,6 @@ 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 Integer couType;
private BigDecimal 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.substring(0,10), formatter);
LocalDate date2 = LocalDate.parse(userTime.substring(0,10), formatter);
LocalDate date1 = LocalDate.parse(nowTime, formatter);
LocalDate date2 = LocalDate.parse(userTime, formatter);
// 计算两个日期之间相差的天数 data1小于date2
long daysBetween = ChronoUnit.DAYS.between(date2, date1);
long daysBetween = ChronoUnit.DAYS.between(date1, date2);
if(daysBetween>7){
return Result.error("已过新人优惠期");
return Result.error("新人优惠期");
}
//获取所有新人优惠卷

View File

@ -678,7 +678,6 @@ 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,7 +1151,6 @@ 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,19 +111,4 @@
</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,9 +284,6 @@
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,33 +4,19 @@
<mapper namespace="com.sqx.modules.bl.collect.dao.CollectMassageDao">
<select id="findPage" resultType="com.sqx.modules.bl.collect.entity.CollectMassage">
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
select *
from bl_collect_massage
where 1=1
<if test="params.userId!=null">
and a.user_id=#{params.userId}
and user_id=#{params.userId}
</if>
<if test="params.flag!=null">
and a.flag=#{params.flag}
and flag=#{params.flag}
</if>
<if test="params.classify!=null">
and a.classify=#{params.classify}
and classify=#{params.classify}
</if>
order by a.collect_id desc
order by collect_id
</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,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 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,
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 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
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,
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,id asc
order by sales desc,massage_type_id asc
</select>

View File

@ -186,33 +186,4 @@
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,14 +36,13 @@
a.massage_type_id,
a.title,
a.massage_img,
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
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
from bl_user_package_detail a
where a.main_id = #{mainId}
group by a.massage_type_id,a.title,a.massage_img,a.content_img
group by a.massage_type_id,a.title,a.massage_img,a.package_price,a.price
order by a.massage_type_id
</select>
@ -52,17 +51,14 @@
a.massage_type_id,
a.title,
a.massage_img,
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
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
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.content_img
group by a.massage_type_id,a.title,a.massage_img,a.package_price,a.price,interval_days
order by a.massage_type_id
</select>