添加在线时长,和标签功能
This commit is contained in:
parent
06ba5081fa
commit
6811a9893a
|
|
@ -383,21 +383,21 @@ public class AppArtificerController {
|
||||||
artificer.setCity(city);
|
artificer.setCity(city);
|
||||||
if(artificer.getStatus()==1){
|
if(artificer.getStatus()==1){
|
||||||
artificer.setStatus(2);
|
artificer.setStatus(2);
|
||||||
Integer i = Integer.valueOf(commonInfoDao.findOne(100000).getValue());
|
// Integer i = Integer.valueOf(commonInfoDao.findOne(100000).getValue());
|
||||||
Date upTime = artificer.getUpTime();
|
// Date upTime = artificer.getUpTime();
|
||||||
long betweenDay = DateUtil.between(upTime, new Date(), DateUnit.MINUTE);
|
// long betweenDay = DateUtil.between(upTime, new Date(), DateUnit.MINUTE);
|
||||||
int i1 = new Long(betweenDay).intValue();
|
// int i1 = new Long(betweenDay).intValue();
|
||||||
int count = i1 / i;
|
// int count = i1 / i;
|
||||||
if(count>0){
|
// if(count>0){
|
||||||
UserRecharge userRecharge = new UserRecharge();
|
// UserRecharge userRecharge = new UserRecharge();
|
||||||
userRecharge.setArtificerId(artificer.getArtificerId());
|
// userRecharge.setArtificerId(artificer.getArtificerId());
|
||||||
userRecharge.setUserRecharge(new BigDecimal(count));
|
// userRecharge.setUserRecharge(new BigDecimal(count));
|
||||||
userRecharge.setType("1");
|
// userRecharge.setType("1");
|
||||||
userRecharge.setUserId(userId);
|
// userRecharge.setUserId(userId);
|
||||||
upTime = DateUtil.offsetMinute(upTime, i1);
|
// upTime = DateUtil.offsetMinute(upTime, i1);
|
||||||
userRecharge.setCreateTime(upTime.toString());
|
// userRecharge.setCreateTime(upTime.toString());
|
||||||
userRechargeDao.insert(userRecharge);
|
// userRechargeDao.insert(userRecharge);
|
||||||
}
|
// }
|
||||||
}else{
|
}else{
|
||||||
String value1 = commonInfoService.findOne(385).getValue();
|
String value1 = commonInfoService.findOne(385).getValue();
|
||||||
BigDecimal minScore = new BigDecimal(value1);
|
BigDecimal minScore = new BigDecimal(value1);
|
||||||
|
|
@ -422,21 +422,21 @@ public class AppArtificerController {
|
||||||
public Result offline(@RequestAttribute Long userId){
|
public Result offline(@RequestAttribute Long userId){
|
||||||
Artificer artificer = artificerService.selectArtificerByUserId(userId);
|
Artificer artificer = artificerService.selectArtificerByUserId(userId);
|
||||||
artificer.setStatus(2);
|
artificer.setStatus(2);
|
||||||
Integer i = Integer.valueOf(commonInfoDao.findOne(100000).getValue());
|
// Integer i = Integer.valueOf(commonInfoDao.findOne(100000).getValue());
|
||||||
Date upTime = artificer.getUpTime();
|
// Date upTime = artificer.getUpTime();
|
||||||
long betweenDay = DateUtil.between(upTime, new Date(), DateUnit.MINUTE);
|
// long betweenDay = DateUtil.between(upTime, new Date(), DateUnit.MINUTE);
|
||||||
int i1 = new Long(betweenDay).intValue();
|
// int i1 = new Long(betweenDay).intValue();
|
||||||
int count = i1 / i;
|
// int count = i1 / i;
|
||||||
if(count>0){
|
// if(count>0){
|
||||||
UserRecharge userRecharge = new UserRecharge();
|
// UserRecharge userRecharge = new UserRecharge();
|
||||||
userRecharge.setArtificerId(artificer.getArtificerId());
|
// userRecharge.setArtificerId(artificer.getArtificerId());
|
||||||
userRecharge.setUserRecharge(new BigDecimal(count));
|
// userRecharge.setUserRecharge(new BigDecimal(count));
|
||||||
userRecharge.setType("1");
|
// userRecharge.setType("1");
|
||||||
userRecharge.setUserId(userId);
|
// userRecharge.setUserId(userId);
|
||||||
upTime = DateUtil.offsetMinute(upTime, i1);
|
// upTime = DateUtil.offsetMinute(upTime, i1);
|
||||||
userRecharge.setCreateTime(upTime.toString());
|
// userRecharge.setCreateTime(upTime.toString());
|
||||||
userRechargeDao.insert(userRecharge);
|
// userRechargeDao.insert(userRecharge);
|
||||||
}
|
// }
|
||||||
artificerService.updateById(artificer);
|
artificerService.updateById(artificer);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
@ -548,6 +548,13 @@ public class AppArtificerController {
|
||||||
}else{
|
}else{
|
||||||
return Result.error("结束时间不能为空");
|
return Result.error("结束时间不能为空");
|
||||||
}
|
}
|
||||||
|
if(userId == null){
|
||||||
|
return Result.error("您未登录,请登录后进行查询");
|
||||||
|
}
|
||||||
|
if(orderType == null){
|
||||||
|
return Result.error("查询类型为空");
|
||||||
|
}
|
||||||
|
|
||||||
return artificerService.getOrderTypeList(userId,page,limit,orderType,isSfwc,startTime,endTime);
|
return artificerService.getOrderTypeList(userId,page,limit,orderType,isSfwc,startTime,endTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,4 +43,5 @@ public interface ArtificerDao extends BaseMapper<Artificer> {
|
||||||
*/
|
*/
|
||||||
List<Artificer> getYxjsList();
|
List<Artificer> getYxjsList();
|
||||||
|
|
||||||
|
List<Artificer> selectInlineList(Artificer artificer);
|
||||||
}
|
}
|
||||||
|
|
@ -30,6 +30,7 @@ import com.sqx.modules.artificer.dao.ArtificerDao;
|
||||||
import com.sqx.modules.artificer.dao.OrdersDao;
|
import com.sqx.modules.artificer.dao.OrdersDao;
|
||||||
import com.sqx.modules.artificer.entity.*;
|
import com.sqx.modules.artificer.entity.*;
|
||||||
import com.sqx.modules.artificer.service.*;
|
import com.sqx.modules.artificer.service.*;
|
||||||
|
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||||
import com.sqx.modules.common.entity.CommonInfo;
|
import com.sqx.modules.common.entity.CommonInfo;
|
||||||
import com.sqx.modules.common.service.CommonInfoService;
|
import com.sqx.modules.common.service.CommonInfoService;
|
||||||
import com.sqx.modules.consortia.entity.Consortia;
|
import com.sqx.modules.consortia.entity.Consortia;
|
||||||
|
|
@ -135,6 +136,8 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
@Autowired
|
@Autowired
|
||||||
private MaterialMapper materialMapper;
|
private MaterialMapper materialMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public CommonInfoDao commonInfoDao;
|
||||||
|
|
||||||
|
|
||||||
private ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock(true);
|
private ReentrantReadWriteLock reentrantReadWriteLock = new ReentrantReadWriteLock(true);
|
||||||
|
|
@ -1847,6 +1850,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
return Result.error("请离开当前位置" + value + "m后点击完成!");
|
return Result.error("请离开当前位置" + value + "m后点击完成!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//修改技师销量
|
||||||
String accomplishAddress = CommonMapUtils.getLocationToAddress(accomplishLongitude, accomplishLatitude);//按坐标获取地理位置
|
String accomplishAddress = CommonMapUtils.getLocationToAddress(accomplishLongitude, accomplishLatitude);//按坐标获取地理位置
|
||||||
orders.setAccomplishAddress(accomplishAddress);
|
orders.setAccomplishAddress(accomplishAddress);
|
||||||
Artificer artificer = artificerService.getById(orders.getArtificerId());
|
Artificer artificer = artificerService.getById(orders.getArtificerId());
|
||||||
|
|
@ -1854,14 +1858,18 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
artificer.setArtificerSales(artificer.getArtificerSales() + ordersMassageList.size());
|
artificer.setArtificerSales(artificer.getArtificerSales() + ordersMassageList.size());
|
||||||
artificerService.updateById(artificer);
|
artificerService.updateById(artificer);
|
||||||
|
|
||||||
|
//修改项目销量
|
||||||
for (OrdersMassage ordersMassage : ordersMassageList) {
|
for (OrdersMassage ordersMassage : ordersMassageList) {
|
||||||
MassageType massageType = massageTypeService.getById(ordersMassage.getMassageId());
|
MassageType massageType = massageTypeService.getById(ordersMassage.getMassageId());
|
||||||
int num = massageType.getSales() == null ? 0 : massageType.getSales();
|
int num = massageType.getSales() == null ? 0 : massageType.getSales();
|
||||||
massageType.setSales(num + ordersMassage.getNum());
|
massageType.setSales(num + ordersMassage.getNum());
|
||||||
massageTypeService.updateById(massageType);
|
massageTypeService.updateById(massageType);
|
||||||
}
|
}
|
||||||
|
//修改用户钱包 1是加 2是减
|
||||||
UserEntity userEntity = userService.selectUserById(artificer.getUserId());
|
UserEntity userEntity = userService.selectUserById(artificer.getUserId());
|
||||||
userMoneyService.updateMoney(1, userEntity.getUserId(), orders.getSumArtificerMoney().doubleValue());
|
userMoneyService.updateMoney(1, userEntity.getUserId(), orders.getSumArtificerMoney().doubleValue());
|
||||||
|
|
||||||
|
//--------添加钱包流水日志-------------
|
||||||
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
UserMoneyDetails userMoneyDetails = new UserMoneyDetails();
|
||||||
//查询用户当前余额
|
//查询用户当前余额
|
||||||
UserMoney userNowMoney1 = userMoneyService.selectUserMoneyByUserId(userEntity.getUserId());
|
UserMoney userNowMoney1 = userMoneyService.selectUserMoneyByUserId(userEntity.getUserId());
|
||||||
|
|
@ -1902,6 +1910,8 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
userMoneyDetails.setCreateTime(simpleDateFormat.format(new Date()));
|
userMoneyDetails.setCreateTime(simpleDateFormat.format(new Date()));
|
||||||
userMoneyDetailsService.save(userMoneyDetails);
|
userMoneyDetailsService.save(userMoneyDetails);
|
||||||
|
//--------添加钱包流水日志-------------
|
||||||
|
|
||||||
orders.setStatus(3);
|
orders.setStatus(3);
|
||||||
orders.setAccomplishLatitude(accomplishLatitude);
|
orders.setAccomplishLatitude(accomplishLatitude);
|
||||||
orders.setAccomplishLongitude(accomplishLongitude);
|
orders.setAccomplishLongitude(accomplishLongitude);
|
||||||
|
|
@ -2667,14 +2677,24 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
//获取项目是否包含物料包
|
//获取项目是否包含物料包
|
||||||
Orders orders = ordersDao.selectById(ordersId);
|
Orders orders = ordersDao.selectById(ordersId);
|
||||||
Long messageTypeId = orders.getMassageTypeId();
|
Long messageTypeId = orders.getMassageTypeId();
|
||||||
// MassageType massageType =massageTypeService.getById(messageTypeId);
|
|
||||||
|
CommonInfo commonInfo = commonInfoDao.findOne(448);//查询技师接单是否需要物料的配置
|
||||||
|
if(StringUtils.equals("否", commonInfo.getValue())){
|
||||||
|
orders = new Orders();
|
||||||
|
orders.setOrdersId(ordersId);
|
||||||
|
orders.setStatus(2);//确认接单
|
||||||
|
ordersDao.updateById(orders);
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
map.put("code",200);
|
||||||
|
map.put("msg","已确认接单");
|
||||||
|
return Result.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
QueryWrapper<MaterialMassage> materialMassageQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<MaterialMassage> materialMassageQueryWrapper = new QueryWrapper<>();
|
||||||
materialMassageQueryWrapper.eq("massage_type_id",messageTypeId);
|
materialMassageQueryWrapper.eq("massage_type_id",messageTypeId);
|
||||||
//查询服务是否消耗指定的物料信息
|
//查询服务是否消耗指定的物料信息
|
||||||
List<MaterialMassage> wllist =materialMassageMapper.selectList(materialMassageQueryWrapper);
|
List<MaterialMassage> wllist =materialMassageMapper.selectList(materialMassageQueryWrapper);
|
||||||
if(wllist.size()>0){
|
if(wllist.size()>0){
|
||||||
|
|
||||||
int code = 200;
|
int code = 200;
|
||||||
String msg = "已确认接单";
|
String msg = "已确认接单";
|
||||||
for(MaterialMassage par: wllist){
|
for(MaterialMassage par: wllist){
|
||||||
|
|
@ -2707,12 +2727,12 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
||||||
|
|
||||||
orders = new Orders();
|
orders = new Orders();
|
||||||
orders.setOrdersId(ordersId);
|
orders.setOrdersId(ordersId);
|
||||||
orders.setStatus(2);//确认接单
|
|
||||||
ordersDao.updateById(orders);
|
|
||||||
if(code == 200){
|
if(code == 200){
|
||||||
Map<String,Object> map = new HashMap<>();
|
Map<String,Object> map = new HashMap<>();
|
||||||
map.put("code",code);
|
map.put("code",code);
|
||||||
map.put("msg",msg);
|
map.put("msg",msg);
|
||||||
|
orders.setStatus(2);//确认接单
|
||||||
|
ordersDao.updateById(orders);
|
||||||
return Result.success(map);
|
return Result.success(map);
|
||||||
}else{
|
}else{
|
||||||
return Result.error(msg);
|
return Result.error(msg);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.sqx.modules.bl.pingjiaTag.content;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
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.artificerselfgoods.entity.BlArtificerSelfGoods;
|
||||||
|
import com.sqx.modules.bl.collect.entity.CollectMassage;
|
||||||
|
import com.sqx.modules.bl.massage.entity.MassagePackage;
|
||||||
|
import com.sqx.modules.bl.order.entity.UserPackage;
|
||||||
|
import com.sqx.modules.bl.order.service.UserPackageService;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.entity.BlPingjiaTag;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.service.BlPingjiaTagService;
|
||||||
|
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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/bl/pingjiaTag")
|
||||||
|
@Api(value = "评价标签", tags = {"评价标签"})
|
||||||
|
public class BlPingjiaTagController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BlPingjiaTagService service;
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation("获取数据列表")
|
||||||
|
public Result list(BlPingjiaTag entity, Integer page, Integer limit){
|
||||||
|
QueryWrapper<BlPingjiaTag> qw = new QueryWrapper<>();
|
||||||
|
qw.orderByDesc("create_time");
|
||||||
|
IPage<BlPingjiaTag> pageList = service.page(new Page<>(page,limit),qw);
|
||||||
|
return Result.success().put("data",pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("添加")
|
||||||
|
public Result add(BlPingjiaTag blPingjiaTag){
|
||||||
|
blPingjiaTag.setCreateTime(new Date());
|
||||||
|
service.save(blPingjiaTag);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/modify")
|
||||||
|
@ApiOperation("修改")
|
||||||
|
public Result modify(BlPingjiaTag blPingjiaTag){
|
||||||
|
blPingjiaTag.setCreateTime(new Date());
|
||||||
|
service.updateById(blPingjiaTag);
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/delete")
|
||||||
|
@ApiOperation("删除")
|
||||||
|
public Result delete(BlPingjiaTag blPingjiaTag){
|
||||||
|
service.removeById(blPingjiaTag.getId());
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.sqx.modules.bl.pingjiaTag.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.entity.BlPingjiaTag;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BlPingjiaTagDao extends BaseMapper<BlPingjiaTag> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.sqx.modules.bl.pingjiaTag.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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author:zc.
|
||||||
|
* @createData:2024-1-17 上午 10:34
|
||||||
|
* @projectName:anmo
|
||||||
|
* @className:userRecharge
|
||||||
|
* @packageName:com.sqx.modules.artificer.entity
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("bl_pingjia_tag")
|
||||||
|
public class BlPingjiaTag implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
private String title;
|
||||||
|
private int delFlag;
|
||||||
|
private int userType;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package com.sqx.modules.bl.pingjiaTag.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.entity.BlPingjiaTag;
|
||||||
|
import com.sqx.modules.bl.userZxsc.entity.BlUserZxsc;
|
||||||
|
|
||||||
|
public interface BlPingjiaTagService extends IService<BlPingjiaTag> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.sqx.modules.bl.pingjiaTag.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.dao.BlPingjiaTagDao;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.entity.BlPingjiaTag;
|
||||||
|
import com.sqx.modules.bl.pingjiaTag.service.BlPingjiaTagService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BlPingjiaTagServiceImpl extends ServiceImpl<BlPingjiaTagDao, BlPingjiaTag> implements BlPingjiaTagService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.sqx.modules.bl.userZxsc.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.sqx.modules.bl.userZxsc.entity.BlUserZxsc;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface BlUserZxscDao extends BaseMapper<BlUserZxsc> {
|
||||||
|
|
||||||
|
|
||||||
|
List<BlUserZxsc> selectGrouplist(BlUserZxsc blUserZxscParam);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.sqx.modules.bl.userZxsc.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 io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description:
|
||||||
|
* @author:zc.
|
||||||
|
* @createData:2024-1-17 上午 10:34
|
||||||
|
* @projectName:anmo
|
||||||
|
* @className:userRecharge
|
||||||
|
* @packageName:com.sqx.modules.artificer.entity
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("bl_user_zxsc")
|
||||||
|
public class BlUserZxsc implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
@TableId(type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private Long artificerId;
|
||||||
|
private Long userId;
|
||||||
|
private BigDecimal userRecharge;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建时间")
|
||||||
|
private String createTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<BlUserZxsc> children;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.sqx.modules.bl.userZxsc.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.sqx.modules.bl.userZxsc.entity.BlUserZxsc;
|
||||||
|
|
||||||
|
public interface BlUserZxscService extends IService<BlUserZxsc> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.sqx.modules.bl.userZxsc.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
import com.sqx.common.utils.Result;
|
||||||
|
import com.sqx.modules.artificer.dao.ArtificerDao;
|
||||||
|
import com.sqx.modules.artificer.dao.UserRechargeDao;
|
||||||
|
import com.sqx.modules.artificer.entity.Artificer;
|
||||||
|
import com.sqx.modules.artificer.entity.UserRecharge;
|
||||||
|
import com.sqx.modules.bl.order.dao.UserPackageDao;
|
||||||
|
import com.sqx.modules.bl.order.entity.UserPackage;
|
||||||
|
import com.sqx.modules.bl.order.service.UserPackageService;
|
||||||
|
import com.sqx.modules.bl.userZxsc.dao.BlUserZxscDao;
|
||||||
|
import com.sqx.modules.bl.userZxsc.entity.BlUserZxsc;
|
||||||
|
import com.sqx.modules.bl.userZxsc.service.BlUserZxscService;
|
||||||
|
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||||
|
import com.sqx.modules.common.entity.CommonInfo;
|
||||||
|
import org.apache.http.client.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class BlUserZxscServiceImpl extends ServiceImpl<BlUserZxscDao, BlUserZxsc> implements BlUserZxscService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.sqx.modules.task.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import com.sqx.modules.bl.userZxsc.service.BlUserZxscService;
|
||||||
|
import com.sqx.modules.task.service.AllTaskSercice;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务汇总
|
||||||
|
* 20240618
|
||||||
|
*/
|
||||||
|
public class AllTask {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.sqx.modules.task.service;
|
||||||
|
|
||||||
|
public interface AllTaskSercice {
|
||||||
|
|
||||||
|
void upgradeJishi();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,222 @@
|
||||||
|
package com.sqx.modules.task.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.sqx.modules.artificer.dao.ArtificerDao;
|
||||||
|
import com.sqx.modules.artificer.dao.OrdersDao;
|
||||||
|
import com.sqx.modules.artificer.dao.UserRechargeDao;
|
||||||
|
import com.sqx.modules.artificer.entity.Artificer;
|
||||||
|
import com.sqx.modules.artificer.entity.Orders;
|
||||||
|
import com.sqx.modules.artificer.entity.UserRecharge;
|
||||||
|
import com.sqx.modules.bl.userZxsc.dao.BlUserZxscDao;
|
||||||
|
import com.sqx.modules.bl.userZxsc.entity.BlUserZxsc;
|
||||||
|
import com.sqx.modules.common.dao.ArtificerPartitioningDetailsMapper;
|
||||||
|
import com.sqx.modules.common.dao.CommonInfoDao;
|
||||||
|
import com.sqx.modules.common.entity.ArtificerPartitioningDetails;
|
||||||
|
import com.sqx.modules.common.entity.CommonInfo;
|
||||||
|
import com.sqx.modules.shopping.utils.DateUtil;
|
||||||
|
import com.sqx.modules.task.service.AllTaskSercice;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class AllTaskServiceImpl implements AllTaskSercice {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArtificerDao artificerDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ArtificerPartitioningDetailsMapper artificerPartitioningDetailsMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrdersDao ordersDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private BlUserZxscDao blUserZxscDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public CommonInfoDao commonInfoDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserRechargeDao userRechargeDao;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算技师升级规则 每天半夜1点执行,预留12点到01点之间的计算间隔,用于触发其他计算逻辑
|
||||||
|
* A0,A1,A2,A3,A4,A5等
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 0 1 * * ?")
|
||||||
|
public void upgradeJishi() {
|
||||||
|
//1.获取全部有效技师
|
||||||
|
List<Artificer> jslist = artificerDao.getYxjsList();
|
||||||
|
//2.获取计算周期,从几号到几号例如1号-10号为一个周期,11号到20号第二个周期,21号-月底是第三个周期
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
int dayOfMonth = calendar.get(Calendar.DAY_OF_MONTH);
|
||||||
|
System.out.println(dayOfMonth);
|
||||||
|
String startTime = "";
|
||||||
|
String endTime = "";
|
||||||
|
//获取执行时间
|
||||||
|
if(dayOfMonth == 1){
|
||||||
|
Calendar calendar4 = Calendar.getInstance();
|
||||||
|
calendar4.set(Calendar.DAY_OF_MONTH, 1);
|
||||||
|
calendar4.add(Calendar.DAY_OF_MONTH, -1);
|
||||||
|
int lastDayOfMonth = calendar4.get(Calendar.DAY_OF_MONTH);
|
||||||
|
Calendar calendar2 = Calendar.getInstance();
|
||||||
|
calendar2.add(Calendar.MONTH, -1); // 获取上个月
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
|
||||||
|
String lastMonth = format.format(calendar2.getTime());
|
||||||
|
startTime = lastMonth+"-21 00:00:00";
|
||||||
|
endTime = lastMonth+"-"+lastDayOfMonth+" 23:59:59";
|
||||||
|
}else if(dayOfMonth == 11){
|
||||||
|
Calendar calendar4 = Calendar.getInstance();
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
|
||||||
|
String lastMonth = format.format(calendar4.getTime());
|
||||||
|
startTime = lastMonth+"-01 00:00:00";
|
||||||
|
endTime = lastMonth+"-10 23:59:59";
|
||||||
|
}else if(dayOfMonth == 21){
|
||||||
|
Calendar calendar4 = Calendar.getInstance();
|
||||||
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
|
||||||
|
String lastMonth = format.format(calendar4.getTime());
|
||||||
|
startTime = lastMonth+"-11 00:00:00";
|
||||||
|
endTime = lastMonth+"-20 23:59:59";
|
||||||
|
}
|
||||||
|
System.out.println("startTime:" + startTime);
|
||||||
|
System.out.println("endTime:" + endTime);
|
||||||
|
//不为空则继续执行,否则不到时间不计算升级规则
|
||||||
|
if(StringUtils.isNotEmpty(startTime)){
|
||||||
|
//3.查询升级规则配置表
|
||||||
|
QueryWrapper<ArtificerPartitioningDetails> sjgzQuery = new QueryWrapper<ArtificerPartitioningDetails>();
|
||||||
|
sjgzQuery.orderByDesc("outstanding_achievement","duration_online");
|
||||||
|
List<ArtificerPartitioningDetails> sjgzAllList = artificerPartitioningDetailsMapper.selectList(sjgzQuery);
|
||||||
|
//4.根据技师的服务类型查找对应的配置规则,
|
||||||
|
for (Artificer jsPar : jslist) {
|
||||||
|
//获取技师是否参与积分规则,如果参与积分规则则继续执行,否则不变分成比例
|
||||||
|
Integer ynJfgz = jsPar.getYnJfgz();//是否参与积分规则计算(0不参与 1参与)
|
||||||
|
if(ynJfgz==1){
|
||||||
|
Long classifyId = jsPar.getClassifyId();
|
||||||
|
//组装对应的升级规则集合
|
||||||
|
List<ArtificerPartitioningDetails> sjgzList = new ArrayList<>();
|
||||||
|
for (ArtificerPartitioningDetails sjgzPar : sjgzAllList){
|
||||||
|
//当技师的服务类型=升级规则的服务类型,才可以添加到升级规则里去
|
||||||
|
if(StringUtils.equals(sjgzPar.getClassifyId(),String.valueOf(classifyId))){
|
||||||
|
sjgzList.add(sjgzPar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//4.1获取 技师销售金额(order表的 price) 只查询完成的单子
|
||||||
|
Orders ordersQueryWrapper = new Orders();
|
||||||
|
ordersQueryWrapper.setStartTime(startTime);
|
||||||
|
ordersQueryWrapper.setEndTime(endTime);
|
||||||
|
ordersQueryWrapper.setArtificerId(jsPar.getArtificerId());
|
||||||
|
String tjxsje = ordersDao.selectTjpriceList(ordersQueryWrapper);
|
||||||
|
//4.2获取 技师加钟率(order表的parent_id为空则是正常订单,不为空则是加钟订单 用加钟订单/正常订单为加钟率)
|
||||||
|
|
||||||
|
//4.3获取 在线时长(通过积分表和兑换比例反推在线时长 user_rechange的type=1)
|
||||||
|
|
||||||
|
//4.4获取 积分(充值积分 user_rechange的type=2)
|
||||||
|
|
||||||
|
//4.5根据对应的收益,判断属于哪个等级,并修改artificer的yn_jfgz(等级标识)及rate(百分比)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 计算技师在线时长,每10分钟计算一积分
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 * * * * ?")
|
||||||
|
public void upJishiZxsc() throws ParseException {
|
||||||
|
System.out.println("----------------计算技师在线时长,每10分钟计算一积分-------------");
|
||||||
|
CommonInfo commonInfo = commonInfoDao.findOne(100000);
|
||||||
|
String minute = commonInfo.getValue();//多少分钟等于1积分
|
||||||
|
|
||||||
|
Artificer artificer = new Artificer();
|
||||||
|
artificer.setStatus(1);
|
||||||
|
List<Artificer> artificerList = artificerDao.selectInlineList(artificer);
|
||||||
|
Date now = new Date();
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
for(Artificer par:artificerList){
|
||||||
|
//取最新的一回的获得积分时间
|
||||||
|
QueryWrapper<BlUserZxsc> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.eq("artificer_id",par.getArtificerId());
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
queryWrapper.last("limit 1");
|
||||||
|
BlUserZxsc blUserZxsc = blUserZxscDao.selectOne(queryWrapper);
|
||||||
|
if(blUserZxsc == null){
|
||||||
|
BigDecimal recharge = new BigDecimal(1);
|
||||||
|
BlUserZxsc newBlUserZxsc = new BlUserZxsc();
|
||||||
|
newBlUserZxsc.setArtificerId(par.getArtificerId());
|
||||||
|
newBlUserZxsc.setUserRecharge(recharge);
|
||||||
|
newBlUserZxsc.setCreateTime(sdf.format(new Date()));
|
||||||
|
blUserZxscDao.insert(newBlUserZxsc);
|
||||||
|
}else{
|
||||||
|
String createTime = blUserZxsc.getCreateTime();
|
||||||
|
//上一回时间加十分钟
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(sdf.parse(createTime));
|
||||||
|
calendar.add(Calendar.MINUTE, Integer.parseInt(minute));
|
||||||
|
Date nextDate = calendar.getTime();
|
||||||
|
if (now.getTime()>=nextDate.getTime()) {//nowTime < newTime
|
||||||
|
BigDecimal recharge = new BigDecimal(1);
|
||||||
|
BlUserZxsc newBlUserZxsc = new BlUserZxsc();
|
||||||
|
newBlUserZxsc.setArtificerId(par.getArtificerId());
|
||||||
|
newBlUserZxsc.setUserRecharge(recharge);
|
||||||
|
newBlUserZxsc.setCreateTime(sdf.format(new Date()));
|
||||||
|
blUserZxscDao.insert(newBlUserZxsc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 积分汇总 t+1进行汇总
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 * * * * ?")
|
||||||
|
public void tongjiJishiGrade() {
|
||||||
|
System.out.println("----------------每日积分汇总 定时任务-------------");
|
||||||
|
//当前时间减一天
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
// calendar.add(Calendar.DAY_OF_YEAR, -1);//上一天
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
|
String date = sdf.format(calendar.getTime());
|
||||||
|
BlUserZxsc blUserZxscParam = new BlUserZxsc();
|
||||||
|
blUserZxscParam.setCreateTime(date);
|
||||||
|
List<BlUserZxsc> blUserZxsc = blUserZxscDao.selectGrouplist(blUserZxscParam);
|
||||||
|
String dateStr = sdf2.format(calendar.getTime());
|
||||||
|
for(BlUserZxsc blUserZxscPar:blUserZxsc){
|
||||||
|
|
||||||
|
QueryWrapper<UserRecharge> delWrapper = new QueryWrapper<UserRecharge>();
|
||||||
|
delWrapper.eq("artificer_id",blUserZxscPar.getArtificerId());
|
||||||
|
delWrapper.eq("type",1);
|
||||||
|
delWrapper.ge("create_time",date);
|
||||||
|
delWrapper.le("create_time",date+" 23:59:59");
|
||||||
|
userRechargeDao.delete(delWrapper);
|
||||||
|
|
||||||
|
UserRecharge userRecharge = new UserRecharge();
|
||||||
|
userRecharge.setArtificerId(blUserZxscPar.getArtificerId());
|
||||||
|
userRecharge.setUserRecharge(blUserZxscPar.getUserRecharge());
|
||||||
|
userRecharge.setType("1");
|
||||||
|
userRecharge.setUserId(null);
|
||||||
|
userRecharge.setCreateTime(dateStr);
|
||||||
|
userRechargeDao.insert(userRecharge);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,9 +3,9 @@ spring:
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
druid:
|
druid:
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
url: jdbc:mysql://175.178.80.95:3306/anmo1?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
url: jdbc:mysql://127.0.0.1:3306/anmo?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=CTT
|
||||||
username: anmo1
|
username: root
|
||||||
password: sEeTPPk7GWyn8iF7
|
password: 123456
|
||||||
initial-size: 10
|
initial-size: 10
|
||||||
max-active: 100
|
max-active: 100
|
||||||
min-idle: 10
|
min-idle: 10
|
||||||
|
|
|
||||||
|
|
@ -207,4 +207,13 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectInlineList" resultType="com.sqx.modules.artificer.entity.Artificer">
|
||||||
|
select a.* from artificer a
|
||||||
|
inner join tb_user u on a.user_id=u.user_id
|
||||||
|
where u.status = 1
|
||||||
|
<if test="status">
|
||||||
|
and a.status = ${status}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -585,7 +585,7 @@
|
||||||
left join massage_type m on m.massage_type_id=om.massage_id
|
left join massage_type m on m.massage_type_id=om.massage_id
|
||||||
where o.artificer_id = #{artificerId} and o.parent_id = 0
|
where o.artificer_id = #{artificerId} and o.parent_id = 0
|
||||||
<if test="type==1">
|
<if test="type==1">
|
||||||
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status in (2,3,5,6,7,8)
|
and date_format(o.serve_time,'%Y-%m-%d') = date_format(now(),'%Y-%m-%d') and o.status in (2,3,5,6,7,8,9)
|
||||||
|
|
||||||
</if>
|
</if>
|
||||||
<if test="type==2">
|
<if test="type==2">
|
||||||
|
|
@ -1024,21 +1024,19 @@
|
||||||
|
|
||||||
<select id="getChongzhiList" resultType="com.sqx.modules.artificer.entity.Orders">
|
<select id="getChongzhiList" resultType="com.sqx.modules.artificer.entity.Orders">
|
||||||
select
|
select
|
||||||
a.*,uu.user_recharge as userRecharge
|
o.*,uu.user_recharge as userRecharge
|
||||||
from orders o
|
from orders o
|
||||||
left join artificer a on a.artificer_id=o.artificer_id
|
left join artificer a on a.artificer_id=o.artificer_id
|
||||||
left join tb_user u on u.user_id=o.user_id
|
|
||||||
left join consortia c on c.consortia_id=o.consortia_id
|
|
||||||
left join user_recharge uu on uu.orders_id = o.orders_id
|
left join user_recharge uu on uu.orders_id = o.orders_id
|
||||||
where o.artificer_id=#{userId}
|
where o.artificer_id=#{userId}
|
||||||
and o.status in (3,5)
|
and o.status in (3,5)
|
||||||
and o.end_times BETWEEN #{startTime} and #{endTime}
|
and o.end_times BETWEEN #{startTime} and #{endTime}
|
||||||
|
|
||||||
<if test="isSfwc != null and isSfwc == 0">
|
<if test="isSfwc != null and isSfwc == 0">
|
||||||
and uu.type = 2
|
and uu.type is null
|
||||||
</if>
|
</if>
|
||||||
<if test="isSfwc != null and isSfwc == 1">
|
<if test="isSfwc != null and isSfwc == 1">
|
||||||
and uu.type != 2
|
and uu.type = 2
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue