技师端技师等级
This commit is contained in:
parent
d51665f934
commit
1f251b90ac
|
|
@ -73,6 +73,14 @@ public class AppArtificerIntegralController {
|
|||
artificerDao.update(null, Wrappers.<Artificer>lambdaUpdate().set(Artificer::getUpTime, DateUtil.format(new Date(), "yyyy-MM-dd")+" 00:00:00"));
|
||||
}
|
||||
|
||||
|
||||
@Login
|
||||
@GetMapping("/getArtificerLevels")
|
||||
@ApiOperation("获取技师等级说明")
|
||||
public Result getArtificerLevels(Integer page, Integer limit, Long artificerId) {
|
||||
return appArtificerIntegralService.getArtificerLevels(page, limit, artificerId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 每个月11号 21号执行一次 定时任务
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.sqx.modules.artificer.entity;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.sqx.modules.coupon.entity.CouponUser;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -430,5 +431,9 @@ public class Orders implements Serializable {
|
|||
private BigDecimal gjPrice;
|
||||
@TableField(exist = false)
|
||||
private BigDecimal gjcePrice;
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<CouponUser> couponUserList;
|
||||
|
||||
public Orders() {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,4 +16,6 @@ public interface AppArtificerIntegralService {
|
|||
Result upgrade(String date);
|
||||
|
||||
Result upgradeZy(String date);
|
||||
|
||||
Result getArtificerLevels(Integer page, Integer limit, Long artificerId);
|
||||
}
|
||||
|
|
@ -4,7 +4,10 @@ package com.sqx.modules.artificer.service.impl;
|
|||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.common.utils.Result;
|
||||
|
||||
import com.sqx.modules.app.dao.UserDao;
|
||||
|
|
@ -533,4 +536,26 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result getArtificerLevels(Integer page, Integer limit, Long artificerId){
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
Artificer artificer = artificerDao.selectById(artificerId);
|
||||
Period period1 = obtainCycle(new Date());
|
||||
Date startFundData = period1.getStartFundData();
|
||||
Date endFundData = period1.getEndFundData();
|
||||
artificer.setBeginTime(DateUtil.formatDate(startFundData));
|
||||
artificer.setFinishTime(DateUtil.formatDate(endFundData));
|
||||
map.put("artificerData",artificer);
|
||||
//91精油 95 中医
|
||||
String classifyId = artificer.getClassifyId().toString();
|
||||
IPage<ArtificerPartitioningDetails> page1 = new Page(page, limit);
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("classify_id", classifyId);
|
||||
queryWrapper.orderByAsc("id");
|
||||
IPage<ArtificerPartitioningDetails> apdPage= artificerPartitioningDetailsMapper.selectPage(page1,queryWrapper);
|
||||
map.put("levelData",apdPage);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -276,33 +276,38 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
BigDecimal couponMinMoney = BigDecimal.ZERO;//所有代金券的使用额度总和
|
||||
//获取并判断代金券信息
|
||||
List<CouponUser> CouponUserList = Lists.newArrayList();
|
||||
String couponIds = orders.getCouponId();
|
||||
if(couponIds.length()>0){
|
||||
String[] couponArr = couponIds.trim().split(",");
|
||||
BigDecimal couponMoney = new BigDecimal(0);
|
||||
StringBuffer couponNameSb = new StringBuffer();
|
||||
for(int i=0;i<couponArr.length;i++){
|
||||
if(couponArr[i]!=null && !couponArr[i].equals("")){
|
||||
Long couponId = Long.valueOf(couponArr[i]);
|
||||
CouponUser couponUser = couponUserService.getById(couponId);
|
||||
if (!couponUser.getStatus().equals(0)) {
|
||||
return Result.error("优惠券已被使用!");
|
||||
}
|
||||
if(couponUser.getClassifyId()!=0){
|
||||
if(orders.getClassifyId() != couponUser.getClassifyId()){
|
||||
return Result.error("优惠券不满足使用条件!");
|
||||
if(orders.getCouponId() != null){
|
||||
String couponIds = orders.getCouponId();
|
||||
if(couponIds.length()>0){
|
||||
String[] couponArr = couponIds.trim().split(",");
|
||||
BigDecimal couponMoney = new BigDecimal(0);
|
||||
StringBuffer couponNameSb = new StringBuffer();
|
||||
for(int i=0;i<couponArr.length;i++){
|
||||
if(couponArr[i]!=null && !couponArr[i].equals("")){
|
||||
Long couponId = Long.valueOf(couponArr[i]);
|
||||
CouponUser couponUser = couponUserService.getById(couponId);
|
||||
if (!couponUser.getStatus().equals(0)) {
|
||||
return Result.error("优惠券已被使用!");
|
||||
}
|
||||
if(couponUser.getClassifyId()!=0){
|
||||
if(orders.getClassifyId() != couponUser.getClassifyId()){
|
||||
return Result.error("优惠券不满足使用条件!");
|
||||
}
|
||||
}
|
||||
couponMinMoney = couponMinMoney.add(couponUser.getMinMoney());
|
||||
CouponUserList.add(couponUser);
|
||||
BigDecimal money= couponUser.getMoney();
|
||||
couponMoney = couponMoney.add(money);
|
||||
couponNameSb.append(couponUser.getCouponName());
|
||||
couponNameSb.append(",");
|
||||
}
|
||||
couponMinMoney = couponMinMoney.add(couponUser.getMinMoney());
|
||||
CouponUserList.add(couponUser);
|
||||
BigDecimal money= couponUser.getMoney();
|
||||
couponMoney = couponMoney.add(money);
|
||||
couponNameSb.append(couponUser.getCouponName());
|
||||
couponNameSb.append(",");
|
||||
}
|
||||
orders.setCouponName(couponNameSb.toString());
|
||||
orders.setCouponMoney(couponMoney);
|
||||
}else{
|
||||
orders.setCouponName("");
|
||||
orders.setCouponMoney(BigDecimal.ZERO);
|
||||
}
|
||||
orders.setCouponName(couponNameSb.toString());
|
||||
orders.setCouponMoney(couponMoney);
|
||||
}else{
|
||||
orders.setCouponName("");
|
||||
orders.setCouponMoney(BigDecimal.ZERO);
|
||||
|
|
@ -539,6 +544,7 @@ public class OrdersServiceImpl extends ServiceImpl<OrdersDao, Orders> implements
|
|||
couponUser.setStatus(1);
|
||||
couponUserService.updateById(couponUser);
|
||||
}
|
||||
orders.setCouponUserList(CouponUserList);
|
||||
}
|
||||
//下单时不做电话通知,2024-06-20 10:11 by caolei
|
||||
// if(ObjectUtil.equals(orders.getParentId(),null) || ObjectUtil.equals(orders.getParentId(),0L)){
|
||||
|
|
|
|||
Loading…
Reference in New Issue