Compare commits

..

4 Commits

42 changed files with 942 additions and 209 deletions

View File

@ -5,6 +5,7 @@ import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.app.entity.VipDetails;
import com.sqx.modules.app.service.VipDetailsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
@ -14,7 +15,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/app/VipDetails")
@AllArgsConstructor
@Api("app 会员详情信息")
@Api(value = "APP会员详情信息", tags = {"APP会员详情信息"})
public class AppVipDetailsController {
private VipDetailsService appVipDetailsService;
/**
@ -22,8 +23,8 @@ public class AppVipDetailsController {
*
* @return
*/
@Login
@ApiParam("查询会员的详情信息")
// @Login
@ApiOperation("查询会员的详情信息")
@GetMapping("/selectVipDetails")
public Result selectVipDetails() {
return appVipDetailsService.selectVipDetails();
@ -34,8 +35,8 @@ public class AppVipDetailsController {
*
* @return
*/
@Login
@ApiParam("获取会员的详情信息")
// @Login
@ApiOperation("获取会员的详情信息")
@GetMapping("/getVipDetailByUser")
public Result getVipDetailByUser(Long userId) {
return appVipDetailsService.getVipDetailByUser(userId);
@ -46,7 +47,7 @@ public class AppVipDetailsController {
*
* @return
*/
@Login
// @Login
@ApiParam("添加会员的详情信息")
@GetMapping("/insertVipDetails")
public Result insertVipDetails(VipDetails vipDetails) {

View File

@ -40,6 +40,15 @@ public class VipDetails implements Serializable {
//优惠力度
private BigDecimal rate;
@TableField(exist = false)
private String endTime;
@TableField(exist = false)
private Integer isVip;
@TableField(exist = false)
private String rateStr;
/**
* 用户ID
*/

View File

@ -43,6 +43,8 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
@Autowired
private ArtificerService artificerService;
@Autowired
private UserService userService;
@Autowired
private UserMoneyDetailsServiceImpl userMoneyDetailsService;
@Override
public Result payUserMoneyArtificer(@RequestAttribute Long userId, Long artificerId, BigDecimal money){
@ -52,46 +54,59 @@ public class UserMoneyServiceImpl extends ServiceImpl<UserMoneyDao, UserMoney> i
}
Artificer artificer = artificerService.getById(artificerId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String format = sdf.format(new Date());
//用户钱包打赏
updateMoney(2,userId,money.doubleValue());
UserMoneyDetails userMoneyDetails=new UserMoneyDetails();
userMoneyDetails.setMoney(money);
//查询用户当前余额
UserMoney userNowMoney = selectUserMoneyByUserId(userId);
//插入余额
userMoneyDetails.setBalance(userNowMoney.getMoney());
//插入操作类型为已操作用户余额
userMoneyDetails.setClassify(8);
userMoneyDetails.setManipulateType(2);
userMoneyDetails.setMoney(money);
userMoneyDetails.setUserId(userId);
userMoneyDetails.setContent("指定技师“"+artificer.getArtificerName()+"”钱包充值:"+money);
userMoneyDetails.setTitle("钱包充值技师钱包");
userMoneyDetails.setTitle("钱包给技师打赏");
userMoneyDetails.setContent("使用钱包给指定技师“"+artificer.getArtificerName()+"”打赏:"+money);
userMoneyDetails.setType(2);
userMoneyDetails.setCreateTime(format);
userMoneyDetails.setState(2);
userMoneyDetails.setArtificerId(artificerId);
userMoneyDetails.setCreateTime(sdf.format(new Date()));
userMoneyDetails.setBlRole(1);
userMoneyDetails.setBlFlag(1);
userMoneyDetailsDao.insert(userMoneyDetails);
//2024-06-15注释掉user_money_artificer 表一直没用上用的是 user_money_details
// UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id",userId).eq("artificer_id", artificerId));
// if(userMoneyArtificer==null){
// userMoneyArtificer=new UserMoneyArtificer();
// userMoneyArtificer.setUserId(userId);
// userMoneyArtificer.setArtificerId(artificerId);
// userMoneyArtificer.setMoney(money);
// userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
// userMoneyArtificerService.save(userMoneyArtificer);
// }else{
// userMoneyArtificerService.updateMoney(1,userId,artificerId,money.doubleValue());
// }
UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id",userId).eq("artificer_id", artificerId));
if(userMoneyArtificer==null){
userMoneyArtificer=new UserMoneyArtificer();
userMoneyArtificer.setUserId(userId);
userMoneyArtificer.setArtificerId(artificerId);
userMoneyArtificer.setMoney(money);
userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
userMoneyArtificerService.save(userMoneyArtificer);
}else{
userMoneyArtificerService.updateMoney(1,userId,artificerId,money.doubleValue());
}
/*userMoneyDetails = new UserMoneyDetails();
userMoneyDetails.setClassify(8);
userMoneyDetails.setUserId(userId);
userMoneyDetails.setTitle("钱包充值技师钱包");
userMoneyDetails.setContent("指定技师“"+artificer.getArtificerName()+"”钱包充值:"+money);
userMoneyDetails.setType(1);
userMoneyDetails.setMoney(money);
userMoneyDetails.setCreateTime(format);
userMoneyDetails.setArtificerId(artificerId);
userMoneyDetailsDao.insert(userMoneyDetails);*/
//技师获得打赏
UserEntity userEntity = userService.queryByUserId(userId);
updateMoney(1, artificerId, money.doubleValue());
UserMoney userNowMoney2 = selectUserMoneyByUserId(artificerId);
UserMoneyDetails userMoneyDetails2 = new UserMoneyDetails();
userMoneyDetails2.setBalance(userNowMoney2.getMoney());
userMoneyDetails2.setClassify(8);
userMoneyDetails2.setManipulateType(2);
userMoneyDetails2.setUserId(artificerId);
userMoneyDetails2.setTitle("用户钱包打赏");
userMoneyDetails2.setContent("来自用户“"+userEntity.getUserName()+"”钱包打赏:"+money);
userMoneyDetails2.setType(1);
userMoneyDetails2.setState(2);
userMoneyDetails2.setMoney(money);
userMoneyDetails2.setCreateTime(sdf.format(new Date()));
userMoneyDetails.setBlRole(2);
userMoneyDetails.setBlFlag(1);
userMoneyDetailsDao.insert(userMoneyDetails2);
return Result.success();
}

View File

@ -8,6 +8,7 @@ import com.sqx.modules.app.entity.VipDetails;
import com.sqx.modules.app.service.VipDetailsService;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.List;
@Service
@ -19,12 +20,29 @@ public class VipDetailsServiceImpl extends ServiceImpl<VipDetailsDao, VipDetails
queryWrapper.eq("vip_type", 0);
queryWrapper.orderByAsc("id");
List<VipDetails> list = baseMapper.selectList(queryWrapper);
for(int i=0;i<list.size();i++){
VipDetails vd = list.get(i);
String rateStr = numberToChineseNum(vd.getRate());
vd.setRateStr(rateStr);
}
return Result.success().put("data", list);
}
@Override
public Result getVipDetailByUser(Long userId){
VipDetails vipDetails = baseMapper.getVipDetailByUser(userId);
if(vipDetails != null){
String rateStr = numberToChineseNum(vipDetails.getRate());
vipDetails.setRateStr(rateStr);
}else{
vipDetails = new VipDetails();
vipDetails.setVipName("非会员");
vipDetails.setRate(new BigDecimal(100));
vipDetails.setRateStr("");
vipDetails.setIsVip(2);
vipDetails.setEndTime("3000-01-01 00:00:00");
}
return Result.success().put("data", vipDetails);
}
@ -37,4 +55,21 @@ public class VipDetailsServiceImpl extends ServiceImpl<VipDetailsDao, VipDetails
return Result.error("添加失败");
}
}
String numberToChineseNum(BigDecimal bd){
StringBuffer sb = new StringBuffer();
Integer number = bd.intValue();
char[] CN_NUMBERS = {'零', '一', '二', '三', '四', '五', '六', '七', '八', '九'};
while (number > 0) {
int part = number % 10;
if (part == 0) {
} else {
sb.append(CN_NUMBERS[part]);
}
number /= 10;
}
return sb.reverse().toString();
}
}

View File

@ -118,21 +118,6 @@ public class AppArtificerController {
sort,authentication,by,-1,city,classifyId,phone,1,isStart);
}
/**
* 查询附近技师列表
* @param page 第几页
* @param limit 每页几条
* @param artificerName 技师姓名
* @param longitude 精度
* @param latitude 维度
* @param city 城市
* @return
*/
@GetMapping("/selectNearByArtificerList")
@ApiOperation("查询附近技师列表")
public Result selectNearByArtificerList(Integer page, Integer limit, String artificerName, String longitude,String latitude,String city){
return artificerService.selectNearByArtificerList(page, limit, artificerName,longitude,latitude,city);
}
@GetMapping("/selectArtificerMassageList")
@ApiOperation("查询技师服务列表")
@ -508,11 +493,20 @@ public class AppArtificerController {
return Result.success().put("data",result);
}
@Login
@PostMapping("/getHomeStartArtificerList")
@ApiOperation("首页明星技师")
public Result getHomeStartArtificerList(Integer page,Integer limit,Integer isStart,Integer status,String city){
return artificerService.getHomeStartArtificerList(page,limit,isStart,status,city);
/**
* 查询附近技师列表
* @param page 第几页
* @param limit 每页几条
* @param longitude 精度
* @param latitude 维度
* @param city 城市
* @return
*/
@GetMapping("/getHomeArtificerList")
@ApiOperation("首页技师-明星和附近技师")
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
return artificerService.getHomeArtificerList(page,limit,isStart,status,city,longitude,latitude);
}

View File

@ -4,6 +4,7 @@ package com.sqx.modules.artificer.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.common.utils.Result;
import com.sqx.modules.artificer.entity.Artificer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -19,7 +20,7 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
@Param("latitude")String latitude,@Param("sort") Integer sort,
@Param("authentication") Integer authentication,@Param("by") Integer by,
@Param("status") Integer status,@Param("city") String city,
@Param("classifyId") Long classifyId,@Param("phone") String phone,Integer user);
@Param("classifyId") Long classifyId,@Param("phone") String phone,Integer user,@Param("isStart") Integer isStart);
Artificer selectArtificerById(@Param("userId") Long userId,@Param("artificerId") Long artificerId,@Param("longitude") String longitude,@Param("latitude") String latitude);
@ -32,4 +33,6 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
IPage<Artificer> selectUserListByConsortiaId(Page<Artificer> page, String userName, String phone, Long consortiaId, Long shopId, Integer flag, String time);
Integer selectArtificerMassageDuration(Long artificerId);
IPage<Artificer> getHomeStartArtificerList(Page<Artificer> page,@Param("isStart")Integer isStart, @Param("status")Integer status, @Param("city")String city);
}

View File

@ -129,7 +129,26 @@ public class Artificer implements Serializable {
private BigDecimal rate;
/**
* 技师类型 3新手 4专家 5资深
*/
private Integer technicianType;
/**
* 技师类型描述
*/
@TableField(exist = false)
private String technicianTypeName;
/**
* 技师类型 比例
*/
@TableField(exist = false)
private Integer technicianTypeRate;
/**
* 是否是明星技师 1是 2否
*/
private Integer isStart;
@ -151,9 +170,18 @@ public class Artificer implements Serializable {
@TableField(exist = false)
private Integer distance;
/**
* 关注收藏数
*/
@TableField(exist = false)
private Integer collectCount;
/**
* 我的收藏
*/
@TableField(exist = false)
private Integer myCollectCount;
@TableField(exist = false)
private String phone;
@ -172,8 +200,24 @@ public class Artificer implements Serializable {
@TableField(exist = false)
private BigDecimal money;
/**
* 商家id
*/
@TableField(exist = false)
private Long consortiaId;
/**
* 商家名称
*/
@TableField(exist = false)
private String consortiaName;
/**
* 是否新人 1是 2否
*/
@TableField(exist = false)
private Integer isNewer;
/**
* 当前等级
*/

View File

@ -297,6 +297,11 @@ public class Orders implements Serializable {
* 项目收益
*/
private BigDecimal projectBenefits;
/**
* 用户服务包ID
*/
private Long userPackageId;
/**
* 项目名称
*/

View File

@ -14,7 +14,7 @@ public interface ArtificerService extends IService<Artificer> {
Result selectArtificerList(Integer page, Integer limit, Long massageTypeId, String artificerName,
String longitude,String latitude,Integer sort,Integer authentication,
Integer by,Integer status,String city,Long classifyId,String phone,Integer user);
Integer by,Integer status,String city,Long classifyId,String phone,Integer user, Integer isStart);
Artificer selectArtificerById(Long userId,Long artificerId,String longitude,String latitude);
@ -38,5 +38,5 @@ public interface ArtificerService extends IService<Artificer> {
Result selectArtificerByArtificerId(Long artificerId);
Result selectNearByArtificerList(Integer page, Integer limit, String artificerName, String longitude, String latitude, String city);
Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude);
}

View File

@ -25,6 +25,7 @@ import com.sqx.modules.common.service.CommonInfoService;
import com.sqx.modules.message.entity.MessageInfo;
import com.sqx.modules.message.service.MessageService;
import com.sqx.modules.pay.dao.CashOutDao;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -68,10 +69,10 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
@Override
public Result selectArtificerList(Integer page, Integer limit, Long massageTypeId,String artificerName,
String longitude,String latitude,Integer sort,Integer authentication,
Integer by,Integer status,String city,Long classifyId,String phone,Integer user){
Integer by,Integer status,String city,Long classifyId,String phone,Integer user, Integer isStart){
Page<Artificer> pages=new Page<>(page,limit);
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user);
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart);
List<Artificer> records = artificerIPage.getRecords();
String value = commonInfoService.findOne(392).getValue();
if("30".equals(value)){
@ -423,10 +424,13 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
return Result.success().put("data", baseMapper.selectById(artificerId));
}
@Override
public Result selectNearByArtificerList(Integer page, Integer limit, String artificerName, String longitude, String latitude, String city) {
public Result getHomeArtificerList(Integer page, Integer limit, Integer isStart,Integer status, String city, String longitude, String latitude){
Map<String, Object> map = new HashMap<String, Object>();
Page<Artificer> pages=new Page<>(page,limit);
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, artificerName,longitude, latitude, 1, 2, 1, -1, city, null,"",1);
return Result.success().put("data",new PageUtils(artificerIPage));
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, null, "",longitude, latitude, 1, 2, 1, status, city, null,"",1,isStart);
map.put("nearData",new PageUtils(artificerIPage));
map.put("startData",new PageUtils(baseMapper.getHomeStartArtificerList(pages,isStart,status,city)));
return Result.success(map);
}
}

View File

@ -0,0 +1,28 @@
package com.sqx.modules.bl.collect.app;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import com.sqx.modules.bl.collect.service.CollectMassageService;
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("/app/collect/massage")
@Api(value = "收藏浏览项目服务", tags = {"收藏浏览项目服务"})
public class AppCollectMassageController {
@Autowired
private CollectMassageService service;
// @Login
@GetMapping("/findPage")
@ApiOperation("查询收藏浏览(分页)")
public Result findPage(CollectMassage collectMassage){
return service.findPage(collectMassage);
}
}

View File

@ -0,0 +1,23 @@
package com.sqx.modules.bl.collect.controller;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import com.sqx.modules.bl.collect.service.CollectMassageService;
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("/collect/massage")
public class CollectMassageController {
@Autowired
private CollectMassageService service;
@GetMapping("/findPage")
public Result findPage(CollectMassage collectMassage){
return service.findPage(collectMassage);
}
}

View File

@ -0,0 +1,19 @@
package com.sqx.modules.bl.collect.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.bl.collect.entity.CollectMassage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface CollectMassageDao extends BaseMapper<CollectMassage> {
IPage<CollectMassage> findPage(Page<CollectMassage> page, @Param("params") CollectMassage collectMassage);
int insert(CollectMassage collectMassage);
int updateById(CollectMassage collectMassage);
CollectMassage selectCollectMassageByUserId(CollectMassage collectMassage);
}

View File

@ -0,0 +1,62 @@
package com.sqx.modules.bl.collect.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
/**
* 浏览记录
* @author caolei 2024-06-14
*/
@Data
@TableName("bl_collect_massage")
public class CollectMassage implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 浏览记录id
*/
@TableId(type = IdType.INPUT)
private long collectId;
/**
* 技师id
*/
private Long projectId;
/**
* 用户id
*/
private Long userId;
/**
* 创建时间
*/
private String createTime;
/**
* 1收藏 2浏览记录
*/
private Integer classify;
/**
* 1项目 2服务包
*/
private Integer flag;
@TableField(exist = false)
private Integer page;
@TableField(exist = false)
private Integer limit;
}

View File

@ -0,0 +1,16 @@
package com.sqx.modules.bl.collect.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.collect.entity.CollectMassage;
public interface CollectMassageService extends IService<CollectMassage> {
Result findPage(CollectMassage collectMassage);
void insertCollect(CollectMassage collectMassage);
CollectMassage selectCollectMassageByUserId(CollectMassage collectMassage);
}

View File

@ -0,0 +1,39 @@
package com.sqx.modules.bl.collect.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.DateUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.collect.dao.CollectMassageDao;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import com.sqx.modules.bl.collect.service.CollectMassageService;
import org.springframework.stereotype.Service;
import java.util.Date;
@Service
public class CollectMassageServiceImpl extends ServiceImpl<CollectMassageDao, CollectMassage> implements CollectMassageService {
@Override
public Result findPage(CollectMassage collectMassage){
Page<CollectMassage> pages=new Page<>(collectMassage.getPage(),collectMassage.getLimit());
return Result.success().put("data",baseMapper.findPage(pages,collectMassage));
}
@Override
public void insertCollect(CollectMassage collectMassage){
CollectMassage cm = selectCollectMassageByUserId(collectMassage);
if(cm!=null){
cm.setCreateTime(DateUtils.format(new Date()));
baseMapper.updateById(cm);
}else{
collectMassage.setCreateTime(DateUtils.format(new Date()));
baseMapper.insert(collectMassage);
}
}
@Override
public CollectMassage selectCollectMassageByUserId(CollectMassage collectMassage){
return baseMapper.selectCollectMassageByUserId(collectMassage);
}
}

View File

@ -107,6 +107,23 @@ public class MassagePackage implements Serializable {
*/
private Integer isCanVip;
/**
* 服务分类ID
*/
private Integer classifyId;
/**
* 类型名称
*/
@TableField(exist = false)
private String typeName;
/**
* 分类标识
*/
@TableField(exist = false)
private String flag;
@TableField(exist = false)
private Integer page;

View File

@ -51,7 +51,7 @@ public class MassagePackageDetail implements Serializable {
/**
* 间隔天数
*/
private String intervalDays;
private Integer intervalDays;
/**
* 图片
@ -154,5 +154,11 @@ public class MassagePackageDetail implements Serializable {
@TableField(exist = false)
private Integer limit;
/**
* 简介
*/
@TableField(exist = false)
private Long userId;
public MassagePackageDetail() {}
}

View File

@ -14,4 +14,6 @@ public interface MassagePackageDetailService extends IService<MassagePackageDeta
void insertDetail(MassagePackageDetail massagePackageDetail);
Result findMassagePage(MassagePackageDetail massagePackageDetail);
void delete(MassagePackageDetail massagePackageDetail);
Result findAppPage(MassagePackageDetail massagePackageDetail);
}

View File

@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.artificer.entity.CollectArtificer;
import com.sqx.modules.bl.collect.entity.CollectMassage;
import com.sqx.modules.bl.collect.service.CollectMassageService;
import com.sqx.modules.bl.massage.dao.MassagePackageDetailDao;
import com.sqx.modules.bl.massage.entity.MassagePackage;
import com.sqx.modules.bl.massage.entity.MassagePackageDetail;
@ -13,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
@Service
public class MassagePackageServiceDetailImpl extends ServiceImpl<MassagePackageDetailDao, MassagePackageDetail> implements MassagePackageDetailService {
@ -20,6 +25,9 @@ public class MassagePackageServiceDetailImpl extends ServiceImpl<MassagePackageD
@Autowired
private MassagePackageService packageService;
@Autowired
private CollectMassageService collectMassageService;
@Override
public Result findPage(MassagePackageDetail massagePackageDetail){
Page<MassagePackageDetail> pages=new Page<>(massagePackageDetail.getPage(),massagePackageDetail.getLimit());
@ -87,4 +95,23 @@ public class MassagePackageServiceDetailImpl extends ServiceImpl<MassagePackageD
packageService.updatePrice(mp);
}
@Override
public Result findAppPage(MassagePackageDetail massagePackageDetail){
Map<String, Object> map = new HashMap<String, Object>();
MassagePackage massagePackage = packageService.getById(massagePackageDetail.getMainId());
if(massagePackageDetail.getUserId()!=null){
//插入浏览历史
CollectMassage collectMassage=new CollectMassage();
collectMassage.setClassify(2);
collectMassage.setUserId(massagePackageDetail.getUserId());
collectMassage.setProjectId(massagePackageDetail.getMainId());
collectMassage.setFlag(2);
collectMassageService.insertCollect(collectMassage);
}
map.put("mainData",massagePackage);
Page<MassagePackageDetail> pages=new Page<>(massagePackageDetail.getPage(),massagePackageDetail.getLimit());
map.put("detailData",new PageUtils(baseMapper.findPage(pages,massagePackageDetail)));
return Result.success(map);
}
}

View File

@ -0,0 +1,36 @@
package com.sqx.modules.bl.order.app;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.bl.order.entity.UserPackageDetail;
import com.sqx.modules.bl.order.service.UserPackageDetailService;
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("/app/user/package/detail")
@Api(value = "用户服务包详情管理", tags = {"用户服务包详情"})
public class AppUserPackageDetailController {
@Autowired
private UserPackageDetailService service;
@Login
@GetMapping("/findMyPackageDetailList")
@ApiOperation("查询服务包详情列表")
public Result findMyPackageDetailList(UserPackageDetail userPackageDetail){
return service.findAppUsedQuantity(userPackageDetail);
}
// @Login
// @GetMapping("/getMyPackageDetail")
// @ApiOperation("查询服务包详情")
// public Result getMyPackageDetail(UserPackageDetail userPackageDetail){
// return service.getMyPackageDetail(userPackageDetail);
// }
}

View File

@ -22,4 +22,6 @@ public interface UserPackageDao extends BaseMapper<UserPackage> {
IPage<UserPackage> findMyPackageList(Page<UserPackage> page, @Param("params") UserPackage userPackage);
UserPackage getMyPackageById(Long id);
}

View File

@ -9,10 +9,16 @@ import java.util.List;
@Mapper
public interface UserPackageDetailDao extends BaseMapper<UserPackageDetail> {
List<UserPackageDetail> findDetailList(UserPackageDetail userPackageDetail);
List<UserPackageDetail> findDetailUsedQuantity(UserPackageDetail userPackageDetail);
List<UserPackageDetail> findLcDetailUsedQuantity(UserPackageDetail userPackageDetail);
List<UserPackageDetail> findMassagePackageDetails(UserPackageDetail userPackageDetail);
int insert(UserPackageDetail userPackageDetail);
UserPackageDetail getMyPackageDetail(Long id);
}

View File

@ -21,11 +21,10 @@ public class UserPackage implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
/**
* 编号
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
@ -98,6 +97,29 @@ public class UserPackage implements Serializable {
*/
private String city;
/**
* 服务分类ID
*/
private Integer classifyId;
/**
* 服务分类名称
*/
@TableField(exist = false)
private Integer classifyName;
/**
* 好评率
*/
@TableField(exist = false)
private BigDecimal esteemRate;
/**
* 销量
*/
@TableField(exist = false)
private Integer sales;
/**
* 状态 1正常 2用完 3无效
*/

View File

@ -56,7 +56,7 @@ public class UserPackageDetail implements Serializable {
/**
* 间隔天数
*/
private String intervalDays;
private Integer intervalDays;
/**
* 创建时间

View File

@ -10,4 +10,5 @@ public interface UserPackageDetailService extends IService<UserPackageDetail> {
Result findDetailUsedQuantity(UserPackageDetail userPackageDetail);
List<UserPackageDetail> findMassagePackageDetails(UserPackageDetail userPackageDetail);
int insert(UserPackageDetail userPackageDetail);
Result findAppUsedQuantity(UserPackageDetail userPackageDetail);
}

View File

@ -13,4 +13,6 @@ public interface UserPackageService extends IService<UserPackage> {
int updateStatusByOrder(UserPackage userPackage);
Result findMyPackageList(UserPackage userPackage);
// UserPackage getMyPackageById(Long id);
}

View File

@ -2,17 +2,26 @@ package com.sqx.modules.bl.order.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.bl.order.dao.UserPackageDetailDao;
import com.sqx.modules.bl.order.entity.UserPackage;
import com.sqx.modules.bl.order.entity.UserPackageDetail;
import com.sqx.modules.bl.order.service.UserPackageDetailService;
import com.sqx.modules.bl.order.service.UserPackageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class UserPackageDetailServiceImpl extends ServiceImpl<UserPackageDetailDao, UserPackageDetail> implements UserPackageDetailService {
@Autowired
UserPackageService userPackageService;
@Override
public Result findDetailUsedQuantity(UserPackageDetail userPackageDetail){
List<UserPackageDetail> list = Lists.newArrayList();
@ -34,4 +43,46 @@ public class UserPackageDetailServiceImpl extends ServiceImpl<UserPackageDetailD
return baseMapper.insert(userPackageDetail);
}
@Override
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){
list = baseMapper.findDetailList(userPackageDetail);
}else if(type == 105){
list = baseMapper.findDetailUsedQuantity(userPackageDetail);
}else if(type == 106){
list = baseMapper.findLcDetailUsedQuantity(userPackageDetail);
}
map.put("detailData",list);
return Result.success().put("data",map);
}
//
// @Override
// public Result getMyPackageDetail(UserPackageDetail userPackageDetail){
// if(userPackageDetail.getId()!=null){
// userPackageDetail = baseMapper.getMyPackageDetail(userPackageDetail.getId());
// }
//
// 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){
// list = baseMapper.findDetailList(userPackageDetail);
// }else if(type == 105){
// list = baseMapper.findDetailUsedQuantity(userPackageDetail);
// }else if(type == 106){
// list = baseMapper.findLcDetailUsedQuantity(userPackageDetail);
// }
// map.put("detailData",list);
// return Result.success().put("data",map);
// }
}

View File

@ -314,6 +314,7 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
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

@ -45,4 +45,9 @@ public class UserPackageServiceImpl extends ServiceImpl<UserPackageDao, UserPack
return Result.success().put("data",baseMapper.findMyPackageList(pages,userPackage));
}
@Override
public UserPackage getMyPackageById(Long id){
return baseMapper.getMyPackageById(id);
}
}

View File

@ -4,6 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sqx.common.utils.PageUtils;
import com.sqx.common.utils.Result;
import com.sqx.modules.app.annotation.Login;
import com.sqx.modules.app.entity.UserEntity;
import com.sqx.modules.app.service.UserService;
import com.sqx.modules.artificer.entity.Artificer;
import com.sqx.modules.artificer.service.ArtificerService;
import com.sqx.modules.message.entity.MessageInfo;
import com.sqx.modules.message.service.MessageService;
import io.swagger.annotations.Api;
@ -25,6 +29,10 @@ public class AppMessageController {
@Autowired
private MessageService messageService;
@Autowired
private ArtificerService artificerService;
@Autowired
private UserService userService;
@RequestMapping(value = "/selectMessageList", method = RequestMethod.GET)
@ -105,7 +113,22 @@ public class AppMessageController {
return messageService.insertArtificerLocation(messageInfo);
}
@Login
@PostMapping("/insertUpMessage")
@ApiOperation("通知技师上线")
public Result insertUpMessage(@RequestBody MessageInfo messageInfo){
UserEntity userEntity = userService.queryByUserId(Long.valueOf(messageInfo.getByUserId()));
Artificer artificer = artificerService.getById(Long.valueOf(messageInfo.getUserId()));
String content = userEntity.getUserName()+"邀请您上线!";
messageInfo.setContent(content);
messageInfo.setIsSee("0");
messageInfo.setState("52");
messageInfo.setTitle("通知上线");
messageInfo.setByUserName(userEntity.getUserName());
messageInfo.setUserName(artificer.getArtificerName());
messageService.saveBody(messageInfo);
return Result.success();
}
}

View File

@ -50,6 +50,18 @@ public class MessageInfo implements Serializable {
/**
* 分类
* 4 开通会员取消会员
* 5 系统通知系统通知提现通知
* 6 举报
* 7 举报
* 8 技师被扣除信誉分
* 9 技师电话呼救
* 10 到达客户签到
* 11 投票
* 12 技师当前定位
* 16 新订单通知
* 51 新订单提醒
* 52 请他上线
*/
private String state;

View File

@ -554,44 +554,45 @@ public class AliPayController {
}else if(payDetails.getType()==6){
double money=payDetails.getMoney();
if(StringUtils.isNotBlank(payDetails.getRemark())){
PayClassify payClassify = payClassifyService.getById(Long.parseLong(payDetails.getRemark()));
if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
for(int i=0;i<payClassify.getGiveNum();i++){
Coupon coupon = couponService.getById(payClassify.getCouponId());
Integer endDate = coupon.getEndDate();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, endDate);
calendar.add(Calendar.DATE, 1);
Date date = calendar.getTime();
String expirationTime = sdf.format(date);
CouponUser couponUser=new CouponUser();
couponUser.setUserId(payDetails.getUserId());
couponUser.setCouponName(coupon.getCouponName());
couponUser.setCouponPicture(coupon.getCouponPicture());
couponUser.setCreateTime(DateUtils.format(new Date()));
couponUser.setExpirationTime(expirationTime);
couponUser.setMinMoney(coupon.getMinMoney());
couponUser.setMoney(coupon.getMoney());
couponUser.setStatus(0);
couponUserService.save(couponUser);
}
}
}
//此处属于打赏不涉及充值增代金券
// if(StringUtils.isNotBlank(payDetails.getRemark())){
// PayClassify payClassify = payClassifyService.getById(Long.parseLong(payDetails.getRemark()));
// if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
// for(int i=0;i<payClassify.getGiveNum();i++){
// Coupon coupon = couponService.getById(payClassify.getCouponId());
// Integer endDate = coupon.getEndDate();
// Calendar calendar = Calendar.getInstance();
// calendar.add(Calendar.DATE, endDate);
// calendar.add(Calendar.DATE, 1);
// Date date = calendar.getTime();
// String expirationTime = sdf.format(date);
// CouponUser couponUser=new CouponUser();
// couponUser.setUserId(payDetails.getUserId());
// couponUser.setCouponName(coupon.getCouponName());
// couponUser.setCouponPicture(coupon.getCouponPicture());
// couponUser.setCreateTime(DateUtils.format(new Date()));
// couponUser.setExpirationTime(expirationTime);
// couponUser.setMinMoney(coupon.getMinMoney());
// couponUser.setMoney(coupon.getMoney());
// couponUser.setStatus(0);
// couponUserService.save(couponUser);
// }
// }
//
// }
//2024-06-15注释掉user_money_artificer 表一直没用上用的是 user_money_details
long artificerId = Long.parseLong(payDetails.getRemark());
UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id", payDetails.getUserId()).eq("artificer_id", artificerId));
if(userMoneyArtificer==null){
userMoneyArtificer=new UserMoneyArtificer();
userMoneyArtificer.setUserId(payDetails.getUserId());
userMoneyArtificer.setArtificerId(artificerId);
userMoneyArtificer.setMoney(BigDecimal.valueOf(money));
userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
userMoneyArtificerService.save(userMoneyArtificer);
}else{
userMoneyArtificerService.updateMoney(1, payDetails.getUserId(), artificerId,money);
}
// UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id", payDetails.getUserId()).eq("artificer_id", artificerId));
// if(userMoneyArtificer==null){
// userMoneyArtificer=new UserMoneyArtificer();
// userMoneyArtificer.setUserId(payDetails.getUserId());
// userMoneyArtificer.setArtificerId(artificerId);
// userMoneyArtificer.setMoney(BigDecimal.valueOf(money));
// userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
// userMoneyArtificerService.save(userMoneyArtificer);
// }else{
// userMoneyArtificerService.updateMoney(1, payDetails.getUserId(), artificerId,money);
// }
Artificer artificer = artificerService.getById(artificerId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//用户流水
@ -599,8 +600,8 @@ public class AliPayController {
userMoneyDetails.setClassify(8);
userMoneyDetails.setManipulateType(1);
userMoneyDetails.setUserId(payDetails.getUserId());
userMoneyDetails.setTitle("支付宝给技师充值");
userMoneyDetails.setContent("指定技师“"+artificer.getArtificerName()+"钱包支付宝充值:"+money);
userMoneyDetails.setTitle("支付宝给技师打赏");
userMoneyDetails.setContent("使用支付宝给指定技师“"+artificer.getArtificerName()+"打赏:"+money);
userMoneyDetails.setType(2);
userMoneyDetails.setState(2);
userMoneyDetails.setMoney(BigDecimal.valueOf(money));
@ -617,18 +618,18 @@ public class AliPayController {
UserMoneyDetails userMoneyDetails2 = new UserMoneyDetails();
//插入余额
userMoneyDetails2.setBalance(userNowMoney.getMoney());
userMoneyDetails.setManipulateType(2);
userMoneyDetails2.setManipulateType(2);
userMoneyDetails2.setClassify(8);
userMoneyDetails2.setUserId(artificerId);
userMoneyDetails2.setTitle("用户支付宝充值");
userMoneyDetails2.setContent("用户“"+userEntity.getUserName()+"”支付宝充值:"+money);
userMoneyDetails2.setTitle("用户支付宝打赏");
userMoneyDetails2.setContent("来自用户“"+userEntity.getUserName()+"”支付宝打赏:"+money);
userMoneyDetails2.setType(1);
userMoneyDetails2.setState(2);
userMoneyDetails2.setMoney(BigDecimal.valueOf(money));
userMoneyDetails2.setCreateTime(sdf.format(new Date()));
userMoneyDetails2.setBlRole(2);
userMoneyDetails2.setBlFlag(1);
userMoneyDetailsService.save(userMoneyDetails);
userMoneyDetailsService.save(userMoneyDetails2);
}else if(payDetails.getType()==7){
//服务包下单分单
UserPackageOrder orders = userPackageOrderDao.getByNo(outTradeNo);
@ -982,20 +983,21 @@ public class AliPayController {
@ApiOperation("充值指定师傅钱包")
@RequestMapping(value = "/payUserMoneyArtificer", method = RequestMethod.POST)
@Transactional(rollbackFor = Exception.class)
public Result payUserMoneyArtificer(@RequestAttribute Long userId,Long artificerId, Long payClassifyId, BigDecimal money, Integer classify) {
// public Result payUserMoneyArtificer(@RequestAttribute Long userId,Long artificerId, Long payClassifyId, BigDecimal money, Integer classify) {
public Result payUserMoneyArtificer(@RequestAttribute Long userId,Long artificerId, Long payClassifyId, BigDecimal money, Integer type) {
//通知页面地址
CommonInfo one = commonInfoService.findOne(19);
String returnUrl = one.getValue() + "/#/pages/my/index";
CommonInfo one3 = commonInfoService.findOne(12);
String name =one3.getValue();
PayDetails payDetails = new PayDetails();
if(payClassifyId!=null){
PayClassify payClassify = payClassifyService.getById(payClassifyId);
money=payClassify.getPrice();
payDetails.setRemark(String.valueOf(payClassifyId));
}
// if(payClassifyId!=null){
// PayClassify payClassify = payClassifyService.getById(payClassifyId);
// money=payClassify.getPrice();
// payDetails.setRemark(String.valueOf(payClassifyId));
// }
String generalOrder = getGeneralOrder();
payDetails = new PayDetails();
// payDetails = new PayDetails();
payDetails.setState(0);
payDetails.setCreateTime(sdf.format(new Date()));
payDetails.setOrderId(generalOrder);
@ -1005,7 +1007,7 @@ public class AliPayController {
payDetails.setType(6);
payDetails.setRemark(String.valueOf(artificerId));
payDetailsDao.insert(payDetails);
if(classify==1){
if(type==1){
return payApp(name,generalOrder,money.doubleValue());
}
return payH5(name,generalOrder,money.doubleValue(),returnUrl);

View File

@ -344,11 +344,11 @@ public class WxServiceImpl implements WxService {
@Override
public Result payUserMoneyArtificer(Long userId,Long artificerId,Long payClassifyId,BigDecimal money,Integer classify,HttpServletRequest request) throws Exception {
PayDetails payDetails = new PayDetails();
if(payClassifyId!=null){
PayClassify payClassify = payClassifyService.getById(payClassifyId);
money=payClassify.getPrice();
payDetails.setRemark(String.valueOf(payClassifyId));
}
// if(payClassifyId!=null){
// PayClassify payClassify = payClassifyService.getById(payClassifyId);
// money=payClassify.getPrice();
// payDetails.setRemark(String.valueOf(payClassifyId));
// }
String generalOrder = getGeneralOrder();
payDetails.setState(0);
payDetails.setCreateTime(sdf.format(new Date()));
@ -1026,43 +1026,46 @@ public class WxServiceImpl implements WxService {
}else if(payDetails.getType()==6){
double money=payDetails.getMoney();
if(StringUtils.isNotBlank(payDetails.getRemark())){
PayClassify payClassify = payClassifyService.getById(Long.parseLong(payDetails.getRemark()));
if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
for(int i=0;i<payClassify.getGiveNum();i++){
Coupon coupon = couponService.getById(payClassify.getCouponId());
Integer endDate = coupon.getEndDate();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DATE, endDate);
calendar.add(Calendar.DATE, 1);
Date date = calendar.getTime();
String expirationTime = sdf.format(date);
CouponUser couponUser=new CouponUser();
couponUser.setUserId(payDetails.getUserId());
couponUser.setCouponName(coupon.getCouponName());
couponUser.setCouponPicture(coupon.getCouponPicture());
couponUser.setCreateTime(DateUtils.format(new Date()));
couponUser.setExpirationTime(expirationTime);
couponUser.setMinMoney(coupon.getMinMoney());
couponUser.setMoney(coupon.getMoney());
couponUser.setStatus(0);
couponUserService.save(couponUser);
}
}
}
//此处属于打赏不涉及充值增代金券
// if(StringUtils.isNotBlank(payDetails.getRemark())){
// PayClassify payClassify = payClassifyService.getById(Long.parseLong(payDetails.getRemark()));
// if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
// for(int i=0;i<payClassify.getGiveNum();i++){
// Coupon coupon = couponService.getById(payClassify.getCouponId());
// Integer endDate = coupon.getEndDate();
// Calendar calendar = Calendar.getInstance();
// calendar.add(Calendar.DATE, endDate);
// calendar.add(Calendar.DATE, 1);
// Date date = calendar.getTime();
// String expirationTime = sdf.format(date);
// CouponUser couponUser=new CouponUser();
// couponUser.setUserId(payDetails.getUserId());
// couponUser.setCouponName(coupon.getCouponName());
// couponUser.setCouponPicture(coupon.getCouponPicture());
// couponUser.setCreateTime(DateUtils.format(new Date()));
// couponUser.setExpirationTime(expirationTime);
// couponUser.setMinMoney(coupon.getMinMoney());
// couponUser.setMoney(coupon.getMoney());
// couponUser.setStatus(0);
// couponUserService.save(couponUser);
// }
// }
//
// }
//2024-06-15注释掉user_money_artificer 表一直没用上用的是 user_money_details
long artificerId = Long.parseLong(payDetails.getRemark());
UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id", payDetails.getUserId()).eq("artificer_id", artificerId));
if(userMoneyArtificer==null){
userMoneyArtificer=new UserMoneyArtificer();
userMoneyArtificer.setUserId(payDetails.getUserId());
userMoneyArtificer.setArtificerId(artificerId);
userMoneyArtificer.setMoney(BigDecimal.valueOf(money));
userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
userMoneyArtificerService.save(userMoneyArtificer);
}else{
userMoneyArtificerService.updateMoney(1, payDetails.getUserId(),artificerId, money);
}
// UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id", payDetails.getUserId()).eq("artificer_id", artificerId));
// if(userMoneyArtificer==null){
// userMoneyArtificer=new UserMoneyArtificer();
// userMoneyArtificer.setUserId(payDetails.getUserId());
// userMoneyArtificer.setArtificerId(artificerId);
// userMoneyArtificer.setMoney(BigDecimal.valueOf(money));
// userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
// userMoneyArtificerService.save(userMoneyArtificer);
// }else{
// userMoneyArtificerService.updateMoney(1, payDetails.getUserId(),artificerId, money);
// }
Artificer artificer = artificerService.getById(artificerId);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//用户流水
@ -1070,8 +1073,8 @@ public class WxServiceImpl implements WxService {
userMoneyDetails.setClassify(8);
userMoneyDetails.setManipulateType(1);
userMoneyDetails.setUserId(payDetails.getUserId());
userMoneyDetails.setTitle("微信给技师充值");
userMoneyDetails.setContent("指定技师“"+artificer.getArtificerName()+"钱包微信充值:"+money);
userMoneyDetails.setTitle("微信给技师打赏");
userMoneyDetails.setContent("使用微信给指定技师“"+artificer.getArtificerName()+"打赏:"+money);
userMoneyDetails.setType(2);
userMoneyDetails.setState(2);
userMoneyDetails.setMoney(BigDecimal.valueOf(money));
@ -1088,18 +1091,18 @@ public class WxServiceImpl implements WxService {
UserMoneyDetails userMoneyDetails2 = new UserMoneyDetails();
//插入余额
userMoneyDetails2.setBalance(userNowMoney.getMoney());
userMoneyDetails.setManipulateType(2);
userMoneyDetails2.setManipulateType(2);
userMoneyDetails2.setClassify(8);
userMoneyDetails2.setUserId(artificerId);
userMoneyDetails2.setTitle("用户微信充值");
userMoneyDetails2.setContent("用户“"+userEntity.getUserName()+"”微信充值:"+money);
userMoneyDetails2.setTitle("用户微信打赏");
userMoneyDetails2.setContent("来自用户“"+userEntity.getUserName()+"”微信打赏:"+money);
userMoneyDetails2.setType(1);
userMoneyDetails2.setState(2);
userMoneyDetails2.setMoney(BigDecimal.valueOf(money));
userMoneyDetails2.setCreateTime(sdf.format(new Date()));
userMoneyDetails2.setBlRole(2);
userMoneyDetails2.setBlFlag(1);
userMoneyDetailsService.save(userMoneyDetails);
userMoneyDetailsService.save(userMoneyDetails2);
}else if(payDetails.getType()==7){
//服务包下单分单
UserPackageOrder orders = userPackageOrderDao.getByNo(out_trade_no);

View File

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sqx.common.utils.Result;
import com.sqx.modules.sys.entity.SysDictEntity;
import com.sqx.modules.sys.service.SysDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -16,6 +18,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("app/dict")
@Api(value = "项目分类", tags = {"项目分类"})
public class AppDictController {
@Autowired
private SysDictService sysDictService;
@ -24,6 +27,7 @@ public class AppDictController {
* 列表
*/
@RequestMapping("/list")
@ApiOperation("项目分类列表")
public Result list(String type){
SysDictEntity sysDictEntity = sysDictService.getOne(new QueryWrapper<SysDictEntity>().eq("type", type));
List<SysDictEntity> sysDictEntityList = sysDictService.list(new QueryWrapper<SysDictEntity>().eq("status",1).eq( "parent_id", sysDictEntity.getId()).orderByDesc("order_num"));

View File

@ -10,7 +10,9 @@
a.rate,
a.award,
a.vip_type,
b.user_id
b.user_id,
b.end_time,
b.is_vip
FROM vip_details a
JOIN user_vip b ON a.vip_name_type = b.vip_name_type
WHERE b.user_id = #{userId}

View File

@ -4,19 +4,25 @@
<mapper namespace="com.sqx.modules.artificer.dao.ArtificerDao">
<select id="selectArtificerList" resultType="com.sqx.modules.artificer.entity.Artificer">
select * from (select a.*,u.phone,s.code as classifyName,u.status as artificerStatus,u.consortia_id as consortiaId,
select * from (select a.*,u.phone,s.code as classifyName,u.status as artificerStatus,u.consortia_id,c.consortia_name,
(select count(*) from collect_artificer o where o.artificer_id=a.artificer_id and classify=1) as collectCount,
(select count(*) from orders o where o.artificer_id=a.artificer_id and o.status in (3,5)) as ordersCount,
ifnull((select avg(c.score) from taking_commnt c where c.artificer_id=a.artificer_id ),0.00) as ordersScore,
(select count(*) from taking_commnt c where c.artificer_id=a.artificer_id ) as commentCount,
(st_distance (point (a.longitude, a.latitude),point(#{longitude},#{latitude}) ) *111195) as distance
(st_distance (point (a.longitude, a.latitude),point(#{longitude},#{latitude}) ) *111195) as distance,
v.vip_name as technicianTypeName, (CASE WHEN DATEDIFF(CURDATE(), a.create_time) &lt;=7 THEN 1 ELSE 2 END) AS isNewer
from artificer a
left join tb_user u on a.user_id=u.user_id
left join sys_dict s on s.id=a.classify_id
left join vip_details v on a.technician_type = v.vip_name_type and v.vip_type = 1
left join consortia c on u.consortia_id = c.consortia_id
where u.is_authentication=2
<if test="status!=null and status!=0 and status!=-1">
and a.status=#{status}
</if>
<if test="isStart!=null and isStart!=0">
and a.is_start=#{isStart}
</if>
<if test="classifyId!=null and classifyId!=0">
and classify_id=#{classifyId}
</if>
@ -70,20 +76,19 @@
</select>
<select id="selectArtificerById" resultType="com.sqx.modules.artificer.entity.Artificer">
select a.*,u.consortia_id as consortiaId,
select a.*,u.phone,u.status as artificerStatus,u.consortia_id as consortiaId,c.consortia_name,
(select count(*) from orders o where o.artificer_id = a.artificer_id and o.status in (3,5)) as ordersCount,
(select code from sys_dict o where o.id = a.classify_id) as classifyName,
(select count(*)
from collect_artificer o
where o.artificer_id = a.artificer_id
and o.user_id = #{userId}
and classify = 1) as collectCount,
ifnull((select avg(c.score) from taking_commnt c where c.artificer_id = a.artificer_id),
0.00) as ordersScore,
(st_distance(point(a.longitude, a.latitude), point(#{longitude}, #{latitude})) *
111195) as distance
(select code from sys_dict o where o.id = a.classify_id) as classifyName,
(select count(*) from collect_artificer o where o.artificer_id = a.artificer_id and classify = 1) as collectCount,
(select count(*) from collect_artificer o where o.artificer_id = a.artificer_id and o.user_id = #{userId} and classify = 1) as myCollectCount,
ifnull((select avg(c.score) from taking_commnt c where c.artificer_id = a.artificer_id), 0.00) as ordersScore,
(st_distance(point(a.longitude, a.latitude), point(#{longitude}, #{latitude})) * 111195) as distance,
v.vip_name as technicianTypeName,(CASE WHEN DATEDIFF(CURDATE(), a.create_time) &lt;=7 THEN 1 ELSE 2 END) AS isNewer
from artificer a
left join tb_user u on a.user_id = u.user_id
left join tb_user u on a.user_id = u.user_id
left join sys_dict s on s.id=a.classify_id
left join vip_details v on a.technician_type = v.vip_name_type and v.vip_type = 1
left join consortia c on u.consortia_id = c.consortia_id
where a.artificer_id = #{artificerId}
</select>
@ -173,7 +178,25 @@
ORDER BY
t.duration DESC
LIMIT 1
</select>
<select id="getHomeStartArtificerList" resultType="com.sqx.modules.artificer.entity.Artificer">
select a.artificer_id,artificer_name,artificer_img,s.code as classifyName,a.content,v.vip_name as technicianTypeName,a.city
from artificer a
inner join tb_user u on a.user_id=u.user_id
inner join sys_dict s on s.id=a.classify_id
left join vip_details v on a.technician_type = v.vip_name_type and v.vip_type = 1
where u.is_authentication=2
<if test="status!=null and status!=0 and status!=-1">
and u.status=#{status}
</if>
<if test="isStart!=null and isStart!=0">
and a.is_start=#{isStart}
</if>
<if test="city!=null and city!=''">
and a.city=#{city}
</if>
order by artificer_sales desc
</select>
</mapper>

View File

@ -132,6 +132,9 @@
<if test="null != tripWay and '' != tripWay">
trip_way,
</if>
<if test="null != userPackageId and '' != userPackageId">
user_package_id,
</if>
<if test="null != km and '' != km">
km
</if>
@ -263,6 +266,9 @@
<if test="null != tripWay and '' != tripWay">
#{tripWay},
</if>
<if test="null != userPackageId and '' != userPackageId">
#{userPackageId},
</if>
<if test="null != km and '' != km">
#{km}
</if>

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<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
where 1=1
<if test="params.userId!=null">
and user_id=#{params.userId}
</if>
<if test="params.flag!=null">
and flag=#{params.flag}
</if>
<if test="params.classify!=null">
and classify=#{params.classify}
</if>
order by collect_id
</select>
<insert id="insert" parameterType="com.sqx.modules.bl.collect.entity.CollectMassage">
insert into bl_collect_massage(
project_id,
user_id,
create_time,
classify,
flag
)values(
#{projectId},
#{userId},
#{createTime},
#{classify},
#{flag}
)
</insert>
<update id="updateById" parameterType="com.sqx.modules.bl.collect.entity.CollectMassage">
update bl_collect_massage
set create_time=#{createTime}
where collect_id=#{collectId}
</update>
<select id="selectCollectMassageByUserId" resultType="com.sqx.modules.bl.collect.entity.CollectMassage">
select *
from bl_collect_massage
where 1=1
<if test="projectId!=null">
and project_id=#{projectId}
</if>
<if test="userId!=null">
and user_id=#{userId}
</if>
<if test="flag!=null">
and flag=#{flag}
</if>
<if test="classify!=null">
and classify=#{classify}
</if>
limit 1
</select>
</mapper>

View File

@ -13,13 +13,16 @@
<if test="params.type!=null and params.type!=''">
and m.type=#{params.type}
</if>
<if test="params.classifyId!=null and params.classifyId!=''">
and m.classify_id=#{params.classifyId}
</if>
<if test="params.city!=null and params.city!=''">
and (m.city like concat('%',#{params.city},'%') or m.city='不限')
</if>
<if test="params.title!=null and params.title!=''">
and m.title like concat('%',#{params.title},'%')
</if>
order by type acs,sales desc,id acs
order by type asc,id desc
</select>
<update id="updateSales" parameterType="com.sqx.modules.bl.massage.entity.MassagePackage">
@ -51,15 +54,17 @@
</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
from bl_massage_package a inner join sys_dict b on a.type = b.id
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
<if test="params.city!=null and params.city!=''">
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
from massage_type a inner join sys_dict b on a.classify_id = b.id
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='不限')

View File

@ -20,7 +20,8 @@
content,
content_img,
labels,
city
city,
classify_id
from bl_user_package
where orders_id = #{ordersId}
order by id
@ -37,13 +38,14 @@
a.content,
a.content_img,
a.labels,
a.city
a.city,
a.classify_id
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.UserPackage">
insert into bl_user_package(
user_id,
package_id,
@ -58,7 +60,8 @@
content,
content_img,
labels,
city
city,
classify_id
)values(
#{userId},
#{packageId},
@ -73,7 +76,8 @@
#{content},
#{contentImg},
#{labels},
#{city}
#{city},
#{classifyId}
)
</insert>
@ -85,26 +89,63 @@
<select id="findMyPackageList" resultType="com.sqx.modules.bl.order.entity.UserPackage">
select
id,
user_id,
package_id,
orders_id,
orders_no,
create_time,
status,
title,
type,
old_price,
price,
package_img,
content,
content_img,
labels,
city
from bl_user_package
where user_id = #{params.userId}
and type = #{params.type}
order by id
a.id,
a.user_id,
a.package_id,
a.orders_id,
a.orders_no,
a.create_time,
a.status,
a.title,
a.type,
a.old_price,
a.price,
a.package_img,
a.content,
a.content_img,
a.labels,
a.city,
a.classify_id,
b.value as classifyName,
c.sales,
c.esteem_rate
from bl_user_package a
left join sys_dict b on a.classify_id = b.id and b.type="服务类型"
left join bl_massage_package c on a.package_id = c.id
where a.user_id = #{params.userId}
and a.type = #{params.type}
<if test="params.title!=null and params.title!=''">
and a.title like concat('%',#{params.title},'%')
</if>
order by a.id desc
</select>
<select id="getMyPackageById" resultType="com.sqx.modules.bl.order.entity.UserPackage">
select
a.id,
a.user_id,
a.package_id,
a.orders_id,
a.orders_no,
a.create_time,
a.status,
a.title,
a.type,
a.old_price,
a.price,
a.package_img,
a.content,
a.content_img,
a.labels,
a.city,
a.classify_id,
b.value as classifyName,
c.sales,
c.esteem_rate
from bl_user_package a
left join sys_dict b on a.classify_id = b.id and b.type="服务类型"
left join bl_massage_package c on a.package_id = c.id
where a.id = #{id}
</select>
</mapper>

View File

@ -3,6 +3,34 @@
<mapper namespace="com.sqx.modules.bl.order.dao.UserPackageDetailDao">
<select id="findDetailList" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
select
id,
main_id,
package_detail_id,
massage_type_id,
status,
package_price,
interval_days,
create_time,
title,
massage_img,
content,
old_price,
price,
duration,
is_sex,
city,
content_img,
labels,
parent_id,
classify_id,
apply_people,
jianjie
from bl_user_package_detail
where main_id = #{mainId}
</select>
<select id="findDetailUsedQuantity" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
select
a.massage_type_id,
@ -18,6 +46,22 @@
order by a.massage_type_id
</select>
<select id="findLcDetailUsedQuantity" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
select
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
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,interval_days
order by a.massage_type_id
</select>
<select id="findMassagePackageDetails" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
select
a.service_count,
@ -93,4 +137,33 @@
)
</insert>
<select id="getMyPackageDetail" resultType="com.sqx.modules.bl.order.entity.UserPackageDetail">
select
a.id,
a.main_id,
a.package_detail_id,
a.massage_type_id,
a.status,
a.package_price,
a.interval_days,
a.create_time,
a.title,
a.massage_img,
a.content,
a.old_price,
a.price,
a.duration,
a.is_sex,
a.city,
a.content_img,
a.labels,
a.parent_id,
a.classify_id,
a.apply_people,
a.jianjie
from bl_user_package_detail a left join massage_type b on a.massage_type_id = b.massage_type_id
where main_id = #{mainId}
</select>
</mapper>