盛安新版本问题优化-1
This commit is contained in:
parent
86630c27b6
commit
be49e1afd6
|
@ -667,4 +667,10 @@ public class UserController {
|
|||
public Result integral(String type,Integer current,Integer size,String date,String artificerId) throws ParseException {
|
||||
return Result.success(userService.integral(type,current,size,date,artificerId));
|
||||
}
|
||||
|
||||
@PostMapping("/integralPc")
|
||||
@ApiOperation("积分")
|
||||
public Result integralPc(String type,Integer current,Integer size,String date,String artificerId) throws ParseException {
|
||||
return Result.success(userService.integralPc(type,current,size,date,artificerId));
|
||||
}
|
||||
}
|
|
@ -218,5 +218,7 @@ public interface UserService extends IService<UserEntity> {
|
|||
|
||||
Result integral(String type, Integer current, Integer size, String date,String artificerId) throws ParseException;
|
||||
|
||||
Result integralPc(String type, Integer current, Integer size, String date,String artificerId) throws ParseException;
|
||||
|
||||
IPage<UserEntity> merchantPromotion(UserEntity userEntity, Integer page, Integer limit);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,8 @@ import com.sqx.modules.app.utils.UserConstantInterface;
|
|||
import com.sqx.modules.artificer.dao.UserRechargeDao;
|
||||
import com.sqx.modules.artificer.entity.Artificer;
|
||||
import com.sqx.modules.artificer.service.ArtificerService;
|
||||
import com.sqx.modules.bl.artificer.dao.ArtificerIntegralStatisticsDao;
|
||||
import com.sqx.modules.bl.artificer.service.ArtificerIntegralStatisticsService;
|
||||
import com.sqx.modules.common.entity.CommonInfo;
|
||||
import com.sqx.modules.common.service.CommonInfoService;
|
||||
import com.sqx.modules.file.utils.Md5Utils;
|
||||
|
@ -102,6 +104,8 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||
private ArtificerService artificerService;
|
||||
@Autowired
|
||||
private UserRechargeDao userRechargeDao;
|
||||
@Autowired
|
||||
ArtificerIntegralStatisticsDao artificerIntegralStatisticsDao;
|
||||
|
||||
@Override
|
||||
public UserEntity queryByPhone(String phone) {
|
||||
|
@ -1285,6 +1289,16 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
|
|||
return Result.success().put("data", userRechargeDao.integralArtificerId(new Page<>(current, size), type, startDate, endDate, artificerId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result integralPc(String type, Integer current, Integer size, String date,String artificerId) throws ParseException {
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(date)) {
|
||||
date = DateUtil.formatDate(DateUtil.date());
|
||||
}
|
||||
String startDate = DateUtil.formatDateTime(obtainCycle(DateUtil.parse(date)).getStartFundData());
|
||||
String endDate = DateUtil.formatDate(obtainCycle(DateUtil.parse(date)).getEndFundData()) + " 23:59:59";
|
||||
return Result.success().put("data", artificerIntegralStatisticsDao.getIntegralPage(new Page<>(current, size), type, startDate, endDate, artificerId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<UserEntity> merchantPromotion(UserEntity userEntity,Integer page, Integer limit) {
|
||||
IPage<UserEntity> pages = new Page<>(page, limit);
|
||||
|
|
|
@ -71,6 +71,28 @@ public class ArtificerController {
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/addSelectionMassages")
|
||||
@ApiOperation("批量添加按摩分类")
|
||||
public Result addSelectionMassages(@RequestBody MassageType massageType){
|
||||
String ids = massageType.getIds();
|
||||
if(!ids.equals("")){
|
||||
String[] idArr = ids.split(",");
|
||||
if(idArr.length>0){
|
||||
for(int i=0;i<idArr.length;i++) {
|
||||
String id = idArr[i];
|
||||
Long massageTypeId = Long.valueOf(id);
|
||||
MassageType mt = massageTypeService.getById(massageTypeId);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
mt.setCreateTime(sdf.format(new Date()));
|
||||
mt.setSales(0);
|
||||
mt.setParentId(massageType.getParentId());
|
||||
massageTypeService.save(mt);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/updateMassageType")
|
||||
@ApiOperation("修改按摩分类")
|
||||
public Result updateMassageType(@RequestBody MassageType massageType){
|
||||
|
@ -324,7 +346,7 @@ public class ArtificerController {
|
|||
|
||||
@ApiOperation("技师删除服务")
|
||||
@PostMapping(value = "deleteArtificerMassage")
|
||||
public Result deleteArtificerMassage(Long artificerMassageId){
|
||||
public Result deleteArtificerMassage(String artificerMassageId){
|
||||
return artificerMassageService.deleteArtificerMassage(artificerMassageId);
|
||||
}
|
||||
|
||||
|
|
|
@ -354,8 +354,7 @@ public class AppArtificerController {
|
|||
@Login
|
||||
@ApiOperation("技师删除服务")
|
||||
@PostMapping(value = "deleteArtificerMassage")
|
||||
public Result deleteArtificerMassage(Long id){
|
||||
|
||||
public Result deleteArtificerMassage(String id){
|
||||
return artificerMassageService.deleteArtificerMassage(id);
|
||||
}
|
||||
|
||||
|
@ -512,6 +511,11 @@ public class AppArtificerController {
|
|||
return Result.success(artificerService.storedValue(date,type,artificerId));
|
||||
}
|
||||
|
||||
@PostMapping("/storedPc/value")
|
||||
@ApiOperation("储值积分")
|
||||
public Result storedValuePc(String date,String type,String artificerId){
|
||||
return Result.success(artificerService.storedValuePc(date,type,artificerId));
|
||||
}
|
||||
|
||||
@Login
|
||||
@PostMapping("/updateArtificerTripWay")
|
||||
|
|
|
@ -171,6 +171,11 @@ public class Artificer implements Serializable {
|
|||
*/
|
||||
private Integer ynJfgz;
|
||||
|
||||
/**
|
||||
* 是当期积分
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal dqjf;
|
||||
|
||||
private Integer dskg;//打赏开关 1是开启打赏 其他为不打赏
|
||||
|
||||
|
@ -187,7 +192,7 @@ public class Artificer implements Serializable {
|
|||
private Integer ordersCount;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer ordersScore;
|
||||
private BigDecimal ordersScore;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Integer distance;
|
||||
|
|
|
@ -125,6 +125,9 @@ public class MassageType implements Serializable {
|
|||
|
||||
private Integer qyMinNum;//企业预约最小次数
|
||||
|
||||
@TableField(exist = false)
|
||||
private String ids;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String classifyName;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ public interface ArtificerMassageService extends IService<ArtificerMassage> {
|
|||
|
||||
Result updateArtificerMassage(ArtificerMassage artificerMassage);
|
||||
|
||||
Result deleteArtificerMassage(Long id);
|
||||
Result deleteArtificerMassage(String id);
|
||||
|
||||
Result selectArtificerMassage(Long userId, Integer page, Integer limit, Integer status);
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ public interface ArtificerService extends IService<Artificer> {
|
|||
Result integral(String artificerId,String type,Integer current,Integer size,String date,Integer fundType);
|
||||
|
||||
Result storedValue(String date,String type,String artificerId);
|
||||
Result storedValuePc(String date,String type,String artificerId);
|
||||
|
||||
Result selectArtificerByArtificerId(Long artificerId);
|
||||
|
||||
|
|
|
@ -80,8 +80,11 @@ public class ArtificerMassageServiceImpl extends ServiceImpl<ArtificerMassageDao
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result deleteArtificerMassage(Long id) {
|
||||
baseMapper.deleteById(id);
|
||||
public Result deleteArtificerMassage(String id) {
|
||||
String[] artificerMassageList = id.split(",");
|
||||
for(int i = 0;i<artificerMassageList.length;i++){
|
||||
baseMapper.deleteById(Long.valueOf(artificerMassageList[i]));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
|
|
@ -360,6 +360,16 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
userIdList = artificerClassifyService.getUserIdByClassify(classifyIdList);
|
||||
}
|
||||
}
|
||||
|
||||
Period period = new Period();
|
||||
period.setFundType(1);
|
||||
period.setFundData(new Date());
|
||||
Period period1 = calculationPeriod(period);
|
||||
Date startFundData = period1.getStartFundData();
|
||||
Date endFundData = period1.getEndFundData();
|
||||
String startTime = DateUtil.formatDateTime(startFundData);
|
||||
String endTime = DateUtil.formatDateTime(endFundData);
|
||||
|
||||
IPage<Artificer> artificerIPage = baseMapper.selectArtificerList(pages, massageTypeId, artificerName,
|
||||
longitude, latitude, sort, authentication, by, status, city, classifyId,phone,user,isStart,technicianType,isBack,userIdList,isGoods);
|
||||
|
||||
|
@ -382,6 +392,13 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
}
|
||||
artificer.setArtificerClassifyList(artificerClassifyList);
|
||||
}
|
||||
Long userId = artificer.getArtificerId();
|
||||
BigDecimal sumJf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics artificerIntegralStatistics = artificerIntegralStatisticsService.getIntegralStatistics(userId,startTime,endTime,null);
|
||||
if(artificerIntegralStatistics != null){
|
||||
sumJf = artificerIntegralStatistics.getIntegral();
|
||||
}
|
||||
artificer.setDqjf(sumJf);
|
||||
}
|
||||
return Result.success().put("data",new PageUtils(artificerIPage));
|
||||
}
|
||||
|
@ -853,6 +870,76 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
return Result.success().put("data", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result storedValuePc(String date, String type, String artificerId) {
|
||||
Map<String, String> map = Maps.newHashMap();
|
||||
Period period = new Period();
|
||||
period.setFundType(1);
|
||||
period.setFundData(DateUtil.parse(date));
|
||||
Period period1 = calculationPeriod(period);
|
||||
Date startFundData = period1.getStartFundData();
|
||||
Date endFundData = period1.getEndFundData();
|
||||
|
||||
String start = DateUtil.formatDateTime(startFundData);
|
||||
String end = DateUtil.formatDateTime(endFundData);
|
||||
|
||||
Long userId = Long.valueOf(artificerId);
|
||||
|
||||
//总积分
|
||||
BigDecimal sumJf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics artificerIntegralStatistics = artificerIntegralStatisticsService.getIntegralStatistics(userId,start,end,null);
|
||||
if(artificerIntegralStatistics != null){
|
||||
sumJf = artificerIntegralStatistics.getIntegral();
|
||||
}
|
||||
map.put("sumJf", sumJf.toString());
|
||||
|
||||
//1.获取在线时长积分
|
||||
BigDecimal zxscjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics zxjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,start,end,1);
|
||||
if(zxjfVo != null) {
|
||||
zxscjf = zxjfVo.getIntegral();
|
||||
}
|
||||
map.put("zxscjf", zxscjf.toString());
|
||||
BigDecimal i = new BigDecimal(commonInfoDao.findOne(100000).getValue());
|
||||
BigDecimal i1 = zxscjf.multiply(i).divide(new BigDecimal(60),1,BigDecimal.ROUND_HALF_UP);
|
||||
//在线时长
|
||||
map.put("zxsc", i1.toString());//时长小时
|
||||
|
||||
//2.获取储值积分(为他充值的)
|
||||
BigDecimal czjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics chuzjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,start,end,2);
|
||||
if(chuzjfVo != null){
|
||||
czjf = chuzjfVo.getIntegral();
|
||||
}
|
||||
map.put("chuzjf", czjf.toString());
|
||||
|
||||
//3.获取业绩积分
|
||||
BigDecimal yjjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics yejfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,start,end,3);
|
||||
if(yejfVo != null){
|
||||
yjjf = yejfVo.getIntegral();
|
||||
}
|
||||
map.put("yjjf", yjjf.toString());
|
||||
|
||||
//4.获取系统调整积分
|
||||
BigDecimal tzjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics tzjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,start,end,4);
|
||||
if(tzjfVo != null){
|
||||
tzjf = tzjfVo.getIntegral();
|
||||
}
|
||||
map.put("tzjf", tzjf.toString());
|
||||
|
||||
//5.获取订单充值积分
|
||||
BigDecimal ddczjf = BigDecimal.ZERO;
|
||||
ArtificerIntegralStatistics chongzjfVo = artificerIntegralStatisticsService.getIntegralStatistics(userId,start,end,5);
|
||||
if(chongzjfVo != null) {
|
||||
ddczjf = chongzjfVo.getIntegral();
|
||||
}
|
||||
map.put("chongzjf", ddczjf.toString());
|
||||
|
||||
return Result.success().put("data", map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result selectArtificerByArtificerId(Long artificerId) {
|
||||
return Result.success().put("data", baseMapper.selectById(artificerId));
|
||||
|
|
|
@ -5318,6 +5318,22 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
for (Orders orders : records) {
|
||||
List<OrdersMassage> ordersMassageList = ordersMassageService.list(new QueryWrapper<OrdersMassage>().eq("orders_id", orders.getOrdersId()));
|
||||
for (OrdersMassage ordersMassage : ordersMassageList) {
|
||||
if(orders.getUserPackageDetailId() !=null){
|
||||
UserPackageDetail userPackageDetail = userPackageDetailService.getById(ordersMassage.getMassageId());
|
||||
if(userPackageDetail!=null){
|
||||
UserPackage userPackage = userPackageService.getById(userPackageDetail.getMainId());
|
||||
orders.setPackageType(userPackage.getType());
|
||||
userPackageDetail.setMainTitle(userPackage.getTitle());
|
||||
userPackageDetail.setMainPrice(userPackage.getPrice());
|
||||
ordersMassage.setUserPackageDetail(userPackageDetail);
|
||||
if (userPackageDetail != null) {
|
||||
SysDictEntity sysDictEntity = sysDictService.getById(userPackageDetail.getClassifyId());
|
||||
if (sysDictEntity != null) {
|
||||
userPackageDetail.setClassifyName(sysDictEntity.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
MassageType massageType = massageTypeService.getById(ordersMassage.getMassageId());
|
||||
ordersMassage.setMassageType(massageType);
|
||||
if (massageType != null) {
|
||||
|
@ -5327,6 +5343,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
orders.setOrdersMassageList(ordersMassageList);
|
||||
}
|
||||
return Result.success().put("data", new PageUtils(ordersIPage));
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package com.sqx.modules.bl.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.modules.artificer.entity.UserRecharge;
|
||||
import com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -10,4 +14,10 @@ import java.util.List;
|
|||
public interface ArtificerIntegralStatisticsDao extends BaseMapper<ArtificerIntegralStatistics> {
|
||||
ArtificerIntegralStatistics getIntegralStatistics(Long artificerId,String startDate,String endDate,Integer classify);
|
||||
List<ArtificerIntegralStatistics> getIntegralList(Long artificerId, String startDate, String endDate, Integer classify);
|
||||
IPage<ArtificerIntegralStatistics> getIntegralPage(@Param("pages") Page<ArtificerIntegralStatistics> pages,
|
||||
@Param("classify") String classify,
|
||||
@Param("startDate") String startDate,
|
||||
@Param("endDate") String endDate,
|
||||
@Param("artificerId") String artificerId);
|
||||
|
||||
}
|
|
@ -123,6 +123,12 @@ public class UserPackageDetail implements Serializable {
|
|||
*/
|
||||
private Long classifyId;
|
||||
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String classifyName;
|
||||
|
||||
/**
|
||||
* 适用人群
|
||||
*/
|
||||
|
|
|
@ -24,7 +24,6 @@ public class UserPackageOrder implements Serializable {
|
|||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
||||
/**
|
||||
* 订单id
|
||||
*/
|
||||
|
@ -169,6 +168,30 @@ public class UserPackageOrder implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private Integer isNewer;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 已使用数量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer usedQuantity;
|
||||
|
||||
/**
|
||||
* 未使用数量
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer unUsedQuantity;
|
||||
|
||||
/**
|
||||
* 差几个人数
|
||||
*/
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
package com.sqx.modules.chat.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.chat.service.ChatContentService;
|
||||
import com.sqx.modules.chat.service.ChatConversationService;
|
||||
import com.sqx.modules.chats.service.ChatsService;
|
||||
import com.sqx.modules.message.entity.MessageInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -43,7 +45,12 @@ public class ChatController {
|
|||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/selectChatCount")
|
||||
@ApiOperation("查询聊天消息总和")
|
||||
public Result selectChatCount(Long userId){
|
||||
int data = chatContentService.selectChatCount(userId);
|
||||
return Result.success().put("data",data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -72,6 +72,13 @@ public class MessageInfo implements Serializable {
|
|||
|
||||
private String byUserId;
|
||||
|
||||
/**
|
||||
* 0 待审核
|
||||
* 1 通过
|
||||
* 2 拒绝
|
||||
* 空 待处理
|
||||
* 1 已处理
|
||||
**/
|
||||
private String type;
|
||||
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
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 ),5.00) as ordersScore,
|
||||
round(ifnull((select avg(c.score) from taking_commnt c where c.artificer_id=a.artificer_id ),5.0),1) 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,
|
||||
v.vip_name as technicianTypeName,v.rate as technicianTypeRate ,(CASE WHEN DATEDIFF(CURDATE(), a.create_time) <=7 THEN 1 ELSE 2 END) AS isNewer
|
||||
|
@ -110,7 +110,7 @@
|
|||
(select count(*) from orders o where o.artificer_id = a.artificer_id and o.status in (3,5)) as ordersCount,
|
||||
(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), 5.00) as ordersScore,
|
||||
round(ifnull((select avg(c.score) from taking_commnt c where c.artificer_id = a.artificer_id), 5.0),1) as ordersScore,
|
||||
(st_distance(point(a.longitude, a.latitude), point(#{longitude}, #{latitude})) * 111195) as distance,
|
||||
v.vip_name as technicianTypeName,v.rate as technicianTypeRate ,(CASE WHEN DATEDIFF(CURDATE(), a.create_time) <=7 THEN 1 ELSE 2 END) AS isNewer
|
||||
from artificer a
|
||||
|
@ -123,8 +123,7 @@
|
|||
<select id="selectArtificerByUserId" resultType="com.sqx.modules.artificer.entity.Artificer">
|
||||
select a.*,
|
||||
(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),
|
||||
5.00) as ordersScore
|
||||
round(ifnull((select avg(c.score) from taking_commnt c where c.artificer_id = a.artificer_id),5.0),1) as ordersScore
|
||||
from artificer a
|
||||
left join tb_user u on a.user_id = u.user_id
|
||||
where a.user_id = #{userId}
|
||||
|
|
|
@ -1725,7 +1725,7 @@
|
|||
</select>
|
||||
<!-- 获取业绩积分-->
|
||||
<select id="getYjjfList" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||
select t.*,price_total AS jifen
|
||||
select t.*,integral AS jifen
|
||||
from (
|
||||
select o.*,
|
||||
(case when o.status = 4
|
||||
|
@ -1733,13 +1733,15 @@
|
|||
else o.artificer_money + ifnull(o.add_artificer_money,0) + ifnull(o2.artificer_money,0) +
|
||||
ifnull(o2.add_artificer_money,0) + ifnull(o3.artificer_money,0) + ifnull(o3.add_artificer_money,0)
|
||||
end) as artificer_money_total,
|
||||
o.price + ifnull(o.add_price,0) as price_total,bl.massage_img as massageImg
|
||||
o.price + ifnull(o.add_price,0) as price_total,bl.massage_img as massageImg,
|
||||
bais.integral
|
||||
from orders o
|
||||
left join orders o2 on o.old_orders_id = o2.orders_id and o2.status != 4
|
||||
left join orders o3 on o2.old_orders_id = o3.orders_id and o3.status != 4
|
||||
left join orders_massage om on om.orders_id=o.orders_id
|
||||
left join massage_type m on m.massage_type_id=om.massage_id
|
||||
LEFT JOIN bl_user_package_detail bl ON bl.id = om.massage_id
|
||||
left join bl_artificer_integral_statistics bais on bais.orders_no = o.orders_no
|
||||
where o.artificer_id = ${userId}
|
||||
and o.old_orders_id is not null
|
||||
and o.status not in (4,11,15)
|
||||
|
@ -1753,10 +1755,12 @@
|
|||
union all
|
||||
select o.*,
|
||||
o.artificer_money + ifnull(o.add_artificer_money,0) as artificer_money_total,
|
||||
o.price + ifnull(o.add_price,0) as price_total ,mt.massage_img as messageImg
|
||||
o.price + ifnull(o.add_price,0) as price_total ,mt.massage_img as messageImg,
|
||||
bais.integral
|
||||
from orders o
|
||||
left join orders_massage om on om.orders_id=o.orders_id
|
||||
left join massage_type mt on o.massage_type_id = mt.massage_type_id
|
||||
left join bl_artificer_integral_statistics bais on bais.orders_no = o.orders_no
|
||||
where o.artificer_id = ${userId}
|
||||
and o.parent_id = 0
|
||||
and o.old_orders_id is null
|
||||
|
@ -1777,6 +1781,8 @@
|
|||
and date_format(o.end_times,'%Y-%m-%d %H:%i:%s') <= #{endTime}
|
||||
</if>
|
||||
and o.status in (3,5)
|
||||
|
||||
|
||||
) t
|
||||
order by t.serve_time desc
|
||||
</select>
|
||||
|
|
|
@ -37,4 +37,28 @@
|
|||
and classify = #{classify}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getIntegralPage" resultType="com.sqx.modules.bl.artificer.entity.ArtificerIntegralStatistics">
|
||||
select
|
||||
id,
|
||||
artificer_id,
|
||||
artificer_name,
|
||||
create_time,
|
||||
classify,
|
||||
type,
|
||||
IFNULL(achievement,0) achievement,
|
||||
IFNULL(income,0) income,
|
||||
IFNULL(integral,0) integral,
|
||||
orders_no,
|
||||
remarks
|
||||
from bl_artificer_integral_statistics
|
||||
where artificer_id = #{artificerId}
|
||||
and date_format(create_time,'%Y-%m-%d %H:%i:%s') >= #{startDate}
|
||||
and date_format(create_time,'%Y-%m-%d %H:%i:%s') <= #{endDate}
|
||||
<if test="classify!=null">
|
||||
and classify = #{classify}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -22,8 +22,20 @@
|
|||
a.coupon_money,
|
||||
a.refund_time,
|
||||
a.refund_money,
|
||||
a.create_time
|
||||
a.create_time,
|
||||
c.title,
|
||||
c.main_id as id,
|
||||
c.usedQuantity,
|
||||
c.unUsedQuantity
|
||||
from bl_user_package_order a left join tb_user b on a.user_id = b.user_id
|
||||
left join
|
||||
(select
|
||||
y.orders_no,y.title,x.main_id,
|
||||
sum(case x.status when 1 then 1 else 0 end) as usedQuantity,
|
||||
sum(case x.status when 0 then 1 else 0 end) as unUsedQuantity
|
||||
from bl_user_package_detail x
|
||||
inner join bl_user_package y on x.main_id = y.id
|
||||
group by y.orders_no,y.title,x.main_id) c on a.orders_no = c.orders_no
|
||||
where 1=1
|
||||
<if test="params.status!=null and params.status!=0">
|
||||
and a.status=#{params.status}
|
||||
|
|
Loading…
Reference in New Issue