Commit f24e91b7 by huluobin

Merge branch '3.8' into 3.9

# Conflicts:
#	src/main/java/com/gogirl/application/order/serve/impl/ScheduleManageServiceImpl.java
#	src/main/java/com/gogirl/infrastructure/mapper/market/discount/LeisureDiscountConfigLimitMapper.java
#	src/main/resources/mapper/LeisureDiscountConfigLimitMapper.xml
parents 4e82f2ee dc26aa0e
...@@ -178,7 +178,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -178,7 +178,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
.payPrice(baseServe.getPrice()) .payPrice(baseServe.getPrice())
.isOwnProduce(baseServe.getIsOwnProduce()) .isOwnProduce(baseServe.getIsOwnProduce())
.achievement(baseServe.getPrice()); .achievement(baseServe.getPrice());
// .leisureDiscountPrice(BigDecimal.ZERO);
//款式信息 //款式信息
if (orderServeParam.getProduceId() != null) { if (orderServeParam.getProduceId() != null) {
...@@ -250,10 +250,6 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -250,10 +250,6 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
} }
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId())); orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
} }
// else {
// orderServe.setIsOwnProduce(2);
// orderServe.setOwnProduceId(null);
// }
orderServe.calcPriceAndTimeLength(); orderServe.calcPriceAndTimeLength();
orderServeMapper.insert(orderServe); orderServeMapper.insert(orderServe);
...@@ -265,6 +261,15 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -265,6 +261,15 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
OrderServe orderServe = orderServeMapper.selectById(orderServeParam.getId()); OrderServe orderServe = orderServeMapper.selectById(orderServeParam.getId());
//如果修改的订单服务 闲时折扣作废
if (!orderServe.getServeId().equals(orderServeParam.getServeId())) {
//设置折扣属性
orderServe.setLeisureDiscountConfigId(null);
orderServe.setDiscountRate(null);
orderServe.setLeisurePrice(null);
}
//服务改价 //服务改价
orderServe.setServeChangePrice(orderServeParam.getServeChangePrice()); orderServe.setServeChangePrice(orderServeParam.getServeChangePrice());
//服务id //服务id
...@@ -348,9 +353,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -348,9 +353,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setServeChangePrice(orderServeParam.getServeChangePrice()); orderServe.setServeChangePrice(orderServeParam.getServeChangePrice());
} }
List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectList( List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectList(new LambdaQueryWrapper<StoreTechnician>().in(StoreTechnician::getId, Lists.newArrayList(orderServeParam.getTechnicianId().split(","))));
new LambdaQueryWrapper<StoreTechnician>().in(StoreTechnician::getId, Lists.newArrayList(orderServeParam.getTechnicianId().split(",")))
);
//美甲师id //美甲师id
orderServe.setTechnicianId(orderServeParam.getTechnicianId()); orderServe.setTechnicianId(orderServeParam.getTechnicianId());
//美甲师姓名 //美甲师姓名
...@@ -369,6 +372,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -369,6 +372,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId())); orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
} }
orderServe.calcPriceAndTimeLength(); orderServe.calcPriceAndTimeLength();
orderServeMapper.updateById(orderServe); orderServeMapper.updateById(orderServe);
} }
......
...@@ -14,6 +14,7 @@ import com.gogirl.application.user.customer.CustomerService; ...@@ -14,6 +14,7 @@ import com.gogirl.application.user.customer.CustomerService;
import com.gogirl.domain.market.discount.LeisureDiscountConfig; import com.gogirl.domain.market.discount.LeisureDiscountConfig;
import com.gogirl.domain.market.discount.LeisureDiscountConfigLabel; import com.gogirl.domain.market.discount.LeisureDiscountConfigLabel;
import com.gogirl.domain.market.discount.LeisureDiscountConfigLimit; import com.gogirl.domain.market.discount.LeisureDiscountConfigLimit;
import com.gogirl.domain.market.discount.LeisureDiscountConfigLimit;
import com.gogirl.domain.order.serve.*; import com.gogirl.domain.order.serve.*;
import com.gogirl.domain.product.purchase.PurchaseSku; import com.gogirl.domain.product.purchase.PurchaseSku;
import com.gogirl.domain.product.serve.*; import com.gogirl.domain.product.serve.*;
...@@ -57,6 +58,7 @@ import java.math.BigDecimal; ...@@ -57,6 +58,7 @@ import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset; import java.time.ZoneOffset;
import java.util.*; import java.util.*;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
...@@ -473,6 +475,19 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -473,6 +475,19 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
return bool; return bool;
} }
private void backLeisureDiscountConfig(ScheduleServe scheduleServe) {
String date = new SimpleDateFormat("yyyy-MM-dd").format(scheduleServe.getStartTime());
if (scheduleServe.getLeisureDiscountConfigId() != null) {
LeisureDiscountConfigLimit leisureDiscountConfigLimit = leisureDiscountConfigLimitMapper.selectConfigLimit(date, scheduleServe.getLeisureDiscountConfigId());
if (leisureDiscountConfigLimit != null) {
leisureDiscountConfigLimit.setLeftTimes(leisureDiscountConfigLimit.getLeftTimes() + 1);
leisureDiscountConfigLimitMapper.updateById(leisureDiscountConfigLimit);
}
}
}
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void cancelSchedule(CancelScheduleCommand cmd) { public void cancelSchedule(CancelScheduleCommand cmd) {
...@@ -487,19 +502,16 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -487,19 +502,16 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
scheduleManage.setStatus(ScheduleManage.STATUS_CANCEL_SCHEDULED); scheduleManage.setStatus(ScheduleManage.STATUS_CANCEL_SCHEDULED);
List<ScheduleServe> scheduleServeList = scheduleServeMapper.selectList(new LambdaQueryWrapper<ScheduleServe>().eq(ScheduleServe::getSchId, scheduleManage.getId())); List<ScheduleServe> scheduleServeList = scheduleServeMapper.selectList(new LambdaQueryWrapper<ScheduleServe>().eq(ScheduleServe::getSchId, scheduleManage.getId()));
scheduleServeList.forEach(scheduleServe -> {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(scheduleServe.getLeisureDiscountConfigId());
if (leisureDiscountConfig != null) { scheduleServeList.forEach(this::backLeisureDiscountConfig);
leisureDiscountConfig.setLeftTimes(leisureDiscountConfig.getLeftTimes() + 1);
leisureDiscountConfigMapper.updateById(leisureDiscountConfig);
}
});
scheduleManageMapper.updateById(scheduleManage); scheduleManageMapper.updateById(scheduleManage);
technicianPushService.cancelScheduledMsg(scheduleManage.getId()); technicianPushService.cancelScheduledMsg(scheduleManage.getId());
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void updateScheduledServeStatus(Integer scheduleServeId, Integer status, Integer forceLeisureConfig) { public void updateScheduledServeStatus(Integer scheduleServeId, Integer status, Integer forceLeisureConfig) {
/*1、校验*/ /*1、校验*/
...@@ -596,6 +608,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -596,6 +608,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
} }
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void checkBeforeTakeOrders(Integer technicianId, Integer scheduleId) { public void checkBeforeTakeOrders(Integer technicianId, Integer scheduleId) {
List<ScheduleServe> scheduleServeList = scheduleServeService.list( List<ScheduleServe> scheduleServeList = scheduleServeService.list(
...@@ -612,6 +625,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -612,6 +625,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
}); });
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void submitSchedule(SubmitScheduleCommand cmd) { public void submitSchedule(SubmitScheduleCommand cmd) {
...@@ -670,8 +684,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -670,8 +684,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
scheduleServeList.forEach(scheduleServe -> scheduleServe.setSchId(scheduleManage.getId())); scheduleServeList.forEach(scheduleServe -> scheduleServe.setSchId(scheduleManage.getId()));
List<ScheduleServe> insertScheduleServeList = scheduleServeList.stream() List<ScheduleServe> insertScheduleServeList = scheduleServeList.stream().filter(scheduleServe -> scheduleServe.getId() == null).collect(Collectors.toList());
.filter(scheduleServe -> scheduleServe.getId() == null).collect(Collectors.toList());
List<ScheduleServe> updateScheduleServeList = scheduleServeList.stream().filter(scheduleServe -> scheduleServe.getId() != null).collect(Collectors.toList()); List<ScheduleServe> updateScheduleServeList = scheduleServeList.stream().filter(scheduleServe -> scheduleServe.getId() != null).collect(Collectors.toList());
insertScheduleServeList.forEach(scheduleServeMapper::insert); insertScheduleServeList.forEach(scheduleServeMapper::insert);
...@@ -689,7 +702,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -689,7 +702,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
} }
} }
@Override @Override
public List<Map<String, Object>> queryReservableTime(String startDate, Integer lengthTime, Integer departmentId, Integer orderId, Boolean needRemoveOldServe) { public List<Map<String, Object>> queryReservableTime(String startDate, Integer lengthTime, Integer departmentId, Integer orderId, Boolean needRemoveOldServe) {
if (startDate == null || lengthTime == null) { if (startDate == null || lengthTime == null) {
...@@ -970,6 +982,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -970,6 +982,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
}); });
} }
/** /**
* 参数补全 * 参数补全
* *
...@@ -1016,8 +1029,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1016,8 +1029,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
.collect(Collectors.toList()); .collect(Collectors.toList());
//设置从服务的时间为主服务时间 因为主服务的时间已经包括的从服务的时间 //设置从服务的时间为主服务时间 因为主服务的时间已经包括的从服务的时间
subScheduleServeCommandList subScheduleServeCommandList.forEach(scheduleServeCommand -> {
.forEach(scheduleServeCommand -> {
ScheduleServeCommand mainScheduleServeCommand = mainScheduleServeCommandList.stream() ScheduleServeCommand mainScheduleServeCommand = mainScheduleServeCommandList.stream()
.filter(var -> var.getServeId().equals(scheduleServeCommand.getMainServeId())) .filter(var -> var.getServeId().equals(scheduleServeCommand.getMainServeId()))
.findAny() .findAny()
...@@ -1097,11 +1109,14 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1097,11 +1109,14 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//预约结束时间 //预约结束时间
scheduleServe.setEndTime(scheduleServeCommand.getEndTime()); scheduleServe.setEndTime(scheduleServeCommand.getEndTime());
if (scheduleServe.getLeisureDiscountConfigId() != null) {
this.backLeisureDiscountConfig(scheduleServe);
}
//闲时折扣 //闲时折扣
if (scheduleServeCommand.getLeisureDiscountConfigId() != null) { if (scheduleServeCommand.getLeisureDiscountConfigId() != null) {
scheduleServe.setLeisureDiscountConfigId(scheduleServeCommand.getLeisureDiscountConfigId()); scheduleServe.setLeisureDiscountConfigId(scheduleServeCommand.getLeisureDiscountConfigId());
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(scheduleServe.getLeisureDiscountConfigId());
scheduleServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
} }
if (scheduleServeCommand.getActualStartTime() != null) { if (scheduleServeCommand.getActualStartTime() != null) {
scheduleServe.setActualStartTime(scheduleServeCommand.getActualStartTime()); scheduleServe.setActualStartTime(scheduleServeCommand.getActualStartTime());
...@@ -1185,6 +1200,30 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1185,6 +1200,30 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//款式做法 //款式做法
scheduleServe.setExplain(baseServe.getExplain()); scheduleServe.setExplain(baseServe.getExplain());
//计算价格 //计算价格
if (scheduleServe.getLeisureDiscountConfigId() != null) {
LocalDateTime localDateTime = LocalDateTime.ofInstant(scheduleServe.getStartTime().toInstant(), ZoneId.systemDefault());
LeisureDiscountConfigLimit leisureDiscountConfigLimit = leisureDiscountConfigLimitMapper.selectOneLeisureDiscountConfig(scheduleServe.getLeisureDiscountConfigId(),
scheduleServe.getServeId(),
localDateTime.toLocalTime(),
localDateTime.toLocalDate());
if (leisureDiscountConfigLimit != null) {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(leisureDiscountConfigLimit.getLeisureDiscountConfigId());
scheduleServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
leisureDiscountConfigLimit.setLeftTimes(leisureDiscountConfigLimit.getLeftTimes() - 1);
leisureDiscountConfigLimitMapper.updateById(leisureDiscountConfigLimit);
} else {
scheduleServe.setLeisurePrice(null);
scheduleServe.setLeisureDiscountConfigId(null);
scheduleServe.setDiscountRate(null);
}
} else {
scheduleServe.setLeisurePrice(null);
scheduleServe.setDiscountRate(null);
}
scheduleServe.calcPriceAndTimeLength(); scheduleServe.calcPriceAndTimeLength();
return scheduleServe; return scheduleServe;
...@@ -1218,6 +1257,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1218,6 +1257,7 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//处理闲时折扣次数 //处理闲时折扣次数
this.handleLeisureDiscountConfig(scheduleManage); this.handleLeisureDiscountConfig(scheduleManage);
return scheduleManage; return scheduleManage;
} }
...@@ -1362,17 +1402,11 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1362,17 +1402,11 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(scheduleServeVar.getLeisureDiscountConfigId()); LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(scheduleServeVar.getLeisureDiscountConfigId());
if (leisureDiscountConfig != null) { if (leisureDiscountConfig != null) {
//折扣金额
BigDecimal leisurePrice = orderServe.getPrice().subtract(orderServe.getPrice().multiply(leisureDiscountConfig.getDiscountRate()));
//设置折扣属性 //设置折扣属性
orderServe.setLeisureDiscountConfigId(scheduleServeVar.getLeisureDiscountConfigId()); orderServe.setLeisureDiscountConfigId(scheduleServeVar.getLeisureDiscountConfigId());
orderServe.setDiscountRate(scheduleServeVar.getDiscountRate()); orderServe.setDiscountRate(scheduleServeVar.getDiscountRate());
orderServe.setLeisurePrice(scheduleServeVar.getLeisurePrice()); orderServe.setLeisurePrice(scheduleServeVar.getLeisurePrice());
//更新订单实际折扣的使用次数
leisureDiscountConfig.setLeftTimes(leisureDiscountConfig.getLeftTimes() - 1);
leisureDiscountConfigMapper.updateById(leisureDiscountConfig);
} }
//预约对应的折扣 //预约对应的折扣
...@@ -1380,7 +1414,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1380,7 +1414,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//更新预约折扣的使用次数 //更新预约折扣的使用次数
if (schLeisureDiscountConfig != null) { if (schLeisureDiscountConfig != null) {
schLeisureDiscountConfig.setLeftTimes(schLeisureDiscountConfig.getLeftTimes() + 1);
leisureDiscountConfigMapper.updateById(schLeisureDiscountConfig); leisureDiscountConfigMapper.updateById(schLeisureDiscountConfig);
} }
orderServeList.add(orderServe); orderServeList.add(orderServe);
...@@ -1457,22 +1490,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1457,22 +1490,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
return 3; return 3;
} }
private void addLeisureTechServe(List<LeisureTechServe> leisureTechServeList, Integer technicianId, Integer serveId) {
leisureTechServeList.stream()
.filter(leisureTechServe -> leisureTechServe.getServeId().equals(serveId))
.findAny()
.map(leisureTechServe -> leisureTechServe.getTechnicianIdList().add(technicianId))
.orElseGet(() -> {
LeisureTechServe leisureTechServe = new LeisureTechServe();
leisureTechServe.setServeId(serveId);
Set<Integer> set = new HashSet<>();
set.add(technicianId);
leisureTechServe.setTechnicianIdList(set);
leisureTechServeList.add(leisureTechServe);
return null;
});
}
/** /**
* 店铺短码-服务短码(s)-美甲师短码-时间-4位最大单号 * 店铺短码-服务短码(s)-美甲师短码-时间-4位最大单号
* *
......
package com.gogirl.application.product.serve.impl; package com.gogirl.application.product.serve.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gogirl.application.product.serve.BaseServeService; import com.gogirl.application.product.serve.BaseServeService;
import com.gogirl.domain.market.discount.LeisureDiscountConfig; import com.gogirl.domain.product.serve.BaseProduce;
import com.gogirl.domain.product.serve.BaseServe; import com.gogirl.domain.product.serve.BaseServe;
import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper; import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseProduceMapper;
import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper; import com.gogirl.infrastructure.mapper.product.serve.BaseServeMapper;
import com.gogirl.infrastructure.util.SessionUtils;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -20,6 +23,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -20,6 +23,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
private final BaseServeMapper baseServeMapper; private final BaseServeMapper baseServeMapper;
private final LeisureDiscountConfigMapper leisureDiscountConfigMapper; private final LeisureDiscountConfigMapper leisureDiscountConfigMapper;
private final BaseProduceMapper baseProduceMapper;
@Override @Override
...@@ -30,15 +34,12 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -30,15 +34,12 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override @Override
public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) { public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) {
BaseServe baseServe = baseServeMapper.selectById(id);
if (date != null) {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id, BaseServe baseServe = baseServeMapper.selectById(id);
date.toLocalTime().toString(), if (SessionUtils.getSourceFrom().equals(SessionUtils.technician)) {
date.getDayOfWeek().getValue(), List<BaseProduce> baseProduceList = baseProduceMapper.selectList(new LambdaQueryWrapper<BaseProduce>().eq(BaseProduce::getServiceId, id));
departmentId); baseServe.setListProduce(baseProduceList);
if (leisureDiscountConfig != null)
baseServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
} }
return baseServe; return baseServe;
} }
......
...@@ -211,4 +211,5 @@ public class CareerCmdServiceImpl implements CareerCmdService { ...@@ -211,4 +211,5 @@ public class CareerCmdServiceImpl implements CareerCmdService {
return baseProducePage; return baseProducePage;
} }
} }
...@@ -111,6 +111,7 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe ...@@ -111,6 +111,7 @@ public class StoreTechnicianServiceImpl extends ServiceImpl<StoreTechnicianMappe
if (storeTechnician.getDepartmentId() != null) { if (storeTechnician.getDepartmentId() != null) {
wrapper.eq(StoreTechnician::getDepartmentId, storeTechnician.getDepartmentId()); wrapper.eq(StoreTechnician::getDepartmentId, storeTechnician.getDepartmentId());
} }
wrapper.eq(StoreTechnician::getIsAdmin, false);
return this.list(wrapper); return this.list(wrapper);
} }
} }
...@@ -44,5 +44,5 @@ public class LeisureDiscountConfig implements Serializable { ...@@ -44,5 +44,5 @@ public class LeisureDiscountConfig implements Serializable {
@TableField("`limit`") @TableField("`limit`")
private Integer limit; private Integer limit;
private Integer leftTimes;
} }
package com.gogirl.domain.market.discount; package com.gogirl.domain.market.discount;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -20,17 +23,21 @@ import java.time.LocalDateTime; ...@@ -20,17 +23,21 @@ import java.time.LocalDateTime;
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value="LeisureDiscountConfigLimit对象", description="") @ApiModel(value = "LeisureDiscountConfigLimit对象", description = "")
public class LeisureDiscountConfigLimit implements Serializable { public class LeisureDiscountConfigLimit implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "日期") @ApiModelProperty(value = "日期")
private LocalDateTime date; private LocalDateTime date;
@ApiModelProperty(value = "闲时折扣id") @ApiModelProperty(value = "闲时折扣id")
private Integer leisureDiscountConfigId; private Integer leisureDiscountConfigId;
@TableField("`limit`")
@ApiModelProperty(value = "限制数量") @ApiModelProperty(value = "限制数量")
private Integer limit; private Integer limit;
......
...@@ -81,14 +81,19 @@ public class OrderServe implements Serializable { ...@@ -81,14 +81,19 @@ public class OrderServe implements Serializable {
*/ */
@ApiModelProperty("服务数量") @ApiModelProperty("服务数量")
private Integer serveNumber; private Integer serveNumber;
@ApiModelProperty("预约服务id") @ApiModelProperty("预约服务id")
private Integer serveId; private Integer serveId;
@ApiModelProperty("服务名称") @ApiModelProperty("服务名称")
private String serveName; private String serveName;
@ApiModelProperty("图片名称") @ApiModelProperty("图片名称")
private String servePicturePath; private String servePicturePath;
@ApiModelProperty("服务价格") @ApiModelProperty("服务价格")
private BigDecimal servePrice; private BigDecimal servePrice;
@ApiModelProperty("服务分类") @ApiModelProperty("服务分类")
private String serveType; private String serveType;
...@@ -148,6 +153,7 @@ public class OrderServe implements Serializable { ...@@ -148,6 +153,7 @@ public class OrderServe implements Serializable {
private Integer removeCouponId; private Integer removeCouponId;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("闲时折扣配置id") @ApiModelProperty("闲时折扣配置id")
private Integer leisureDiscountConfigId; private Integer leisureDiscountConfigId;
...@@ -237,9 +243,11 @@ public class OrderServe implements Serializable { ...@@ -237,9 +243,11 @@ public class OrderServe implements Serializable {
@TableField(strategy = FieldStrategy.IGNORED) @TableField(strategy = FieldStrategy.IGNORED)
private Integer producePromotionTimeId; private Integer producePromotionTimeId;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("折扣") @ApiModelProperty("折扣")
private BigDecimal discountRate; private BigDecimal discountRate;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("闲时价格") @ApiModelProperty("闲时价格")
private BigDecimal leisurePrice; private BigDecimal leisurePrice;
......
...@@ -175,10 +175,6 @@ public class ScheduleManage implements Serializable { ...@@ -175,10 +175,6 @@ public class ScheduleManage implements Serializable {
@ApiModelProperty("预约用户信息") @ApiModelProperty("预约用户信息")
private Customer customer; private Customer customer;
public void setRemark(String remark) {
this.remark = this.remark + "," + remark;
}
public void addScheduleServeList(Collection<ScheduleServe> scheduleServes) { public void addScheduleServeList(Collection<ScheduleServe> scheduleServes) {
listScheduleServer.addAll(scheduleServes); listScheduleServer.addAll(scheduleServes);
} }
......
...@@ -82,6 +82,7 @@ public class ScheduleServe implements Serializable { ...@@ -82,6 +82,7 @@ public class ScheduleServe implements Serializable {
* 款式 * 款式
*/ */
@TableField(strategy = FieldStrategy.IGNORED)
private BigDecimal discountRate; private BigDecimal discountRate;
...@@ -132,6 +133,7 @@ public class ScheduleServe implements Serializable { ...@@ -132,6 +133,7 @@ public class ScheduleServe implements Serializable {
@ApiModelProperty("售后说明") @ApiModelProperty("售后说明")
private String explain; private String explain;
@TableField(strategy = FieldStrategy.IGNORED)
private Integer leisureDiscountConfigId; private Integer leisureDiscountConfigId;
...@@ -185,6 +187,7 @@ public class ScheduleServe implements Serializable { ...@@ -185,6 +187,7 @@ public class ScheduleServe implements Serializable {
private Integer producePromotionTimeId; private Integer producePromotionTimeId;
@TableField(strategy = FieldStrategy.IGNORED)
private BigDecimal leisurePrice; private BigDecimal leisurePrice;
@ApiModelProperty("是否自带款式 1-是 2-否") @ApiModelProperty("是否自带款式 1-是 2-否")
......
...@@ -121,5 +121,6 @@ public class StoreTechnician implements Serializable { ...@@ -121,5 +121,6 @@ public class StoreTechnician implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private StoreTechnicianDTO applyStoreTechnicianDTO; private StoreTechnicianDTO applyStoreTechnicianDTO;
@ApiModelProperty("是否管理员")
private Boolean isAdmin; private Boolean isAdmin;
} }
...@@ -3,6 +3,10 @@ package com.gogirl.infrastructure.mapper.market.discount; ...@@ -3,6 +3,10 @@ package com.gogirl.infrastructure.mapper.market.discount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gogirl.domain.market.discount.LeisureDiscountConfigLimit; import com.gogirl.domain.market.discount.LeisureDiscountConfigLimit;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.time.LocalTime;
/** /**
* <p> * <p>
...@@ -22,5 +26,12 @@ public interface LeisureDiscountConfigLimitMapper extends BaseMapper<LeisureDisc ...@@ -22,5 +26,12 @@ public interface LeisureDiscountConfigLimitMapper extends BaseMapper<LeisureDisc
* @param leisureDiscountConfigId * @param leisureDiscountConfigId
* @return * @return
*/ */
LeisureDiscountConfigLimit selectConfigLimit(@Param("date") String date, @Param("leisureDiscountConfigId") Integer leisureDiscountConfigId); LeisureDiscountConfigLimit selectConfigLimit(String date, Integer leisureDiscountConfigId);
LeisureDiscountConfigLimit selectOneLeisureDiscountConfig(@Param("leisureDiscountConfigId") Integer leisureDiscountConfigId,
@Param("serveId") Integer serveId,
@Param("time") LocalTime time,
@Param("date") LocalDate date);
} }
...@@ -2,71 +2,17 @@ package com.gogirl.infrastructure.mapper.market.discount; ...@@ -2,71 +2,17 @@ package com.gogirl.infrastructure.mapper.market.discount;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gogirl.domain.market.discount.LeisureDiscountConfig; import com.gogirl.domain.market.discount.LeisureDiscountConfig;
import com.gogirl.domain.product.serve.BaseServe;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface LeisureDiscountConfigMapper extends BaseMapper<LeisureDiscountConfig> { public interface LeisureDiscountConfigMapper extends BaseMapper<LeisureDiscountConfig> {
/** /**
* 获取店铺对应星期数的打折服务列表
*
* @param departmentId 店铺id
* @param week 周几
* @return 服务列表
*/
List<BaseServe> selectByDepartmentId(@Param("departmentId") Integer departmentId, @Param("week") int week);
/**
* 获取折扣最低的闲时折扣 * 获取折扣最低的闲时折扣
* *
* @return discount * @return discount
*/ */
LeisureDiscountConfig queryMinDiscount(); LeisureDiscountConfig queryMinDiscount();
/**
* 获取时间,服务,周几对应的折扣
*
* @param time 时间形如'10:00'
* @param serviceId 服务id
* @param weekday 周几
* @return 折扣列表
*/
LeisureDiscountConfig selectLeisureDiscount(@Param("serviceId") Integer serviceId,
@Param("time") String time,
@Param("weekday") int weekday,
@Param("departmentId") int departmentId);
/**
* 获取店铺id,星期数,时间段形如'10:00'对应的折扣列表 忽略剩余次数条件
*
* @param departmentId 店铺Id
* @param finalWeekday 星期几
* @param time 时间形如
* @return list
*/
List<BaseServe> selectByDepartmentIdAndWeekAndDateTime(@Param("departmentId") Integer departmentId, @Param("week") int finalWeekday, @Param("time") String time);
/**
* 获取店铺id,星期数对应的折扣列表 忽略剩余次数条件
*
* @param departmentId 店铺Id
* @param weekday 星期几
* @return list
*/
List<LeisureDiscountConfig> selectByDepartmentIdAndWeekIgnoreLimit(@Param("departmentId") Integer departmentId, @Param("week") int weekday);
/**
* 获取时间,服务,周几对应的折扣列表
*
* @param time 时间形如'10:00'
* @param serveId 服务id
* @param weekday 周几
* @return 折扣列表
*/
List<LeisureDiscountConfig> selectIsLeisureTime(@Param("time") String time, @Param("serveId") Integer serveId, @Param("week") int weekday);
} }
...@@ -29,6 +29,7 @@ import com.gogirl.infrastructure.common.util.JsonUtilByJackson; ...@@ -29,6 +29,7 @@ import com.gogirl.infrastructure.common.util.JsonUtilByJackson;
import com.gogirl.infrastructure.common.util.ListUtil; import com.gogirl.infrastructure.common.util.ListUtil;
import com.gogirl.infrastructure.config.property.GogirlProperties; import com.gogirl.infrastructure.config.property.GogirlProperties;
import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.coupon.CouponCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigLimitMapper;
import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper; import com.gogirl.infrastructure.mapper.market.timescard.TimesCardCustomerRelevanceMapper;
import com.gogirl.infrastructure.mapper.order.mall.MallOrderMapper; import com.gogirl.infrastructure.mapper.order.mall.MallOrderMapper;
import com.gogirl.infrastructure.mapper.order.serve.OrderManageMapper; import com.gogirl.infrastructure.mapper.order.serve.OrderManageMapper;
...@@ -122,6 +123,7 @@ public class Schedule { ...@@ -122,6 +123,7 @@ public class Schedule {
private final GogirlProperties gogirlProperties; private final GogirlProperties gogirlProperties;
private final TechnicianPushService technicianPushService; private final TechnicianPushService technicianPushService;
private final LeisureDiscountConfigLimitMapper leisureDiscountConfigLimitMapper;
private final TimesCardCustomerRelevanceMapper timesCardCustomerRelevanceMapper; private final TimesCardCustomerRelevanceMapper timesCardCustomerRelevanceMapper;
private final RestTemplate restTemplate; private final RestTemplate restTemplate;
...@@ -384,6 +386,16 @@ public class Schedule { ...@@ -384,6 +386,16 @@ public class Schedule {
localDate = localDate.plusDays(1); localDate = localDate.plusDays(1);
} }
log.debug("同步闲时折扣周 结束"); log.debug("同步闲时折扣周 结束");
log.debug("同步最新闲时间折扣限制开始");
try {
leisureDiscountConfigLimitMapper.syncWeekConfigLimit();
} catch (Exception e) {
log.error("同步最新闲时间折扣限制失败");
}
log.debug("同步最新闲时间折扣限制结束");
} }
/** /**
......
...@@ -68,7 +68,6 @@ public class ScheduleManageController { ...@@ -68,7 +68,6 @@ public class ScheduleManageController {
} }
@ApiOperation("提交预约") @ApiOperation("提交预约")
@PostMapping("/customer/schedule/submitSchedule") @PostMapping("/customer/schedule/submitSchedule")
public JsonResult<Void> submitSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException { public JsonResult<Void> submitSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
...@@ -208,11 +207,11 @@ public class ScheduleManageController { ...@@ -208,11 +207,11 @@ public class ScheduleManageController {
public JsonResult<Void> updateSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException { public JsonResult<Void> updateSchedule(@RequestBody SubmitScheduleCommand cmd) throws ParseException, ExecutionException, InterruptedException {
ScheduledLock scheduledLock = ScheduledLock.getInstance(); ScheduledLock scheduledLock = ScheduledLock.getInstance();
try {
log.info("店员更新预约:{}", cmd);
if (cmd.getScheduleManageDTO().getId() == null) { if (cmd.getScheduleManageDTO().getId() == null) {
throw new InvalidParameterException(); throw new InvalidParameterException();
} }
try {
log.info("店员更新预约:{}", cmd);
scheduledLock.lock(cmd.getScheduleManageDTO().getId()); scheduledLock.lock(cmd.getScheduleManageDTO().getId());
cmd.getScheduleManageDTO().setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId()); cmd.getScheduleManageDTO().setDepartmentId(SessionUtils.getTechnicianToken().getDepartmentId());
...@@ -225,6 +224,7 @@ public class ScheduleManageController { ...@@ -225,6 +224,7 @@ public class ScheduleManageController {
return JsonResult.success(); return JsonResult.success();
} }
@Deprecated
@ApiOperation("更新前检查预约") @ApiOperation("更新前检查预约")
@PostMapping("/technician/schedule/checkBeforeUpdate") @PostMapping("/technician/schedule/checkBeforeUpdate")
public JsonResult<Void> checkBeforeUpdate(@RequestBody UpdateScheduleCommand cmd) { public JsonResult<Void> checkBeforeUpdate(@RequestBody UpdateScheduleCommand cmd) {
...@@ -232,6 +232,12 @@ public class ScheduleManageController { ...@@ -232,6 +232,12 @@ public class ScheduleManageController {
} }
/**
* @param scheduleServeId
* @param status
* @param forceLeisureConfig 强制使用闲时预约次数 1-是 2-否
* @return
*/
@ApiOperation("更新预约服务状态") @ApiOperation("更新预约服务状态")
@GetMapping("/technician/schedule/updateScheduledServeStatus") @GetMapping("/technician/schedule/updateScheduledServeStatus")
public JsonResult<Void> updateScheduledServeStatus(@RequestParam Integer scheduleServeId, public JsonResult<Void> updateScheduledServeStatus(@RequestParam Integer scheduleServeId,
...@@ -253,7 +259,7 @@ public class ScheduleManageController { ...@@ -253,7 +259,7 @@ public class ScheduleManageController {
} }
@ApiOperation("当前服务是否在闲时间范围内 1-是 2-否") @ApiOperation("当前服务是否在闲时间范围内 1-是 2-否 3-不存在")
@GetMapping("/technician/schedule/getScheduledServeLeisure") @GetMapping("/technician/schedule/getScheduledServeLeisure")
public JsonResult<Integer> getScheduledServeLeisure(@RequestParam Integer scheduleServeId) { public JsonResult<Integer> getScheduledServeLeisure(@RequestParam Integer scheduleServeId) {
Integer result = scheduleManageService.getScheduledServeLeisure(scheduleServeId); Integer result = scheduleManageService.getScheduledServeLeisure(scheduleServeId);
......
-----BEGIN CERTIFICATE-----
MIIFsTCCBJmgAwIBAgIQCKySqqQm3xoNyG7XLDT9ZzANBgkqhkiG9w0BAQsFADBy
MQswCQYDVQQGEwJDTjElMCMGA1UEChMcVHJ1c3RBc2lhIFRlY2hub2xvZ2llcywg
SW5jLjEdMBsGA1UECxMURG9tYWluIFZhbGlkYXRlZCBTU0wxHTAbBgNVBAMTFFRy
dXN0QXNpYSBUTFMgUlNBIENBMB4XDTIwMDcxMTAwMDAwMFoXDTIxMDcxMjEyMDAw
MFowHDEaMBgGA1UEAxMRd3d3LmJlZ29naXJscy5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQDQ6EiiyRBunzxXR0xqdLmEgEWT+WuuBE2c5uYh/IDO
XvawVyKNBOwA0rXVTUNB+ni37kVBG4a96Z7B15PWXG8GegdgRvLafVBYSsBzGbrb
Hn0UNLkw6cCANZMY8MJUtl60HPmhfqF0Od5NnAW7x6JhYoCIGgP8UtOJkC5/wnWf
gms2fia+DGBmTB+T5RstU9FLljeOIL3lsem7M8LWtlZ6aiMAoomVgPzGLjPZ6G3B
1z4YVPL0DzuyHcE22/bME0LgaQMUa4ANMGAnAbWuvJVPu172hKu28B1j0FIBp+u9
K2Ht7xRNVMhFM97tGga0rjSUdYNm3Z187RDNr5w46b1VAgMBAAGjggKXMIICkzAf
BgNVHSMEGDAWgBR/05nzoEcOMQBWViKOt8ye3coBijAdBgNVHQ4EFgQUjel55RKP
u7nRqpvDKbM8V7Z/MBUwKwYDVR0RBCQwIoIRd3d3LmJlZ29naXJscy5jb22CDWJl
Z29naXJscy5jb20wDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMB
BggrBgE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SmRa6JvNT
sz2XwDSTmo3YzQcIyHfoZmQ1CkBi4lLh3wIHcOSBtYsvfBmvWpZc1lim6N3rpODZ
DE4qCzRqoXb+izfyScmXf13db3ups48QM9zkIokND8Avu2eUR6aW
-----END RSA PRIVATE KEY-----
\ No newline at end of file
...@@ -14,8 +14,8 @@ spring: ...@@ -14,8 +14,8 @@ spring:
mybatis-plus: mybatis-plus:
mapper-locations: mapper-locations:
- classpath:mapper/**/*.xml - classpath:mapper/**/*.xml
configuration: # configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
server: server:
undertow: undertow:
......
...@@ -16,4 +16,29 @@ ...@@ -16,4 +16,29 @@
where t1.date = #{date} where t1.date = #{date}
and t1.leisure_discount_config_id = #{leisureDiscountConfigId} and t1.leisure_discount_config_id = #{leisureDiscountConfigId}
</select> </select>
<select id="selectOneLeisureDiscountConfig"
resultType="com.gogirl.domain.market.discount.LeisureDiscountConfigLimit">
SELECT t9.*
from leisure_discount_config t1
LEFT JOIN leisure_discount_config_week t2 on t1.id = t2.leisure_discount_config_id
LEFT JOIN leisure_discount_config_service t3 on t1.id = t3.leisure_discount_config_id
LEFT JOIN time_node t5 on t1.start_time &lt;= t5.time_node and t1.end_time &gt;= t5.time_node
LEFT JOIN base_serve t6 on t3.service_id = t6.id
LEFT JOIN week_config t7 on t2.`week` = t7.`week`
LEFT JOIN store_manage t8 on t1.department_id = t8.id
LEFT JOIN leisure_discount_config_limit t9
on t1.id = t9.leisure_discount_config_id and t9.left_times > 0 and
t7.week_date = t9.date
where t1.is_enabled = 1
and t2.id is not null
and t3.id is not null
and t9.id is not null
and t1.id = #{leisureDiscountConfigId}
and t3.service_id = #{serveId}
and t5.time_node = #{time}
and t7.week_date = #{date}
limit 1
</select>
</mapper> </mapper>
...@@ -2,31 +2,7 @@ ...@@ -2,31 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper"> <mapper namespace="com.gogirl.infrastructure.mapper.market.discount.LeisureDiscountConfigMapper">
<select id="selectIsLeisureTime" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
select *
from leisure_discount_config t1
left join leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
left join leisure_discount_config_week t4 on t1.id = t4.leisure_discount_config_id
where t1.start_time &lt;= #{time}
and t1.end_time &gt;= #{time}
and t2.service_id = #{serveId}
and t1.is_enabled = 1
and t1.left_times &gt; 0
and t4.week = #{week}
</select>
<select id="selectByDepartmentId" resultType="com.gogirl.domain.product.serve.BaseServe">
select t3.*
from leisure_discount_config t1
left join leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
left join leisure_discount_config_week t4 on t1.id = t4.leisure_discount_config_id
left join base_serve t3 on t2.service_id = t3.id
where t1.department_id = #{departmentId}
and t1.left_times &gt; 0
and t1.is_enabled = 1
and t3.id is not null
and t4.week = #{week}
</select>
<select id="queryMinDiscount" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig"> <select id="queryMinDiscount" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
select * select *
...@@ -37,44 +13,5 @@ ...@@ -37,44 +13,5 @@
limit 1 limit 1
</select> </select>
<select id="selectLeisureDiscount" resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
SELECT *
from leisure_discount_config t1
LEFT JOIN leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
LEFT JOIN leisure_discount_config_week t3 on t1.id = t3.leisure_discount_config_id
where t2.service_id = #{serviceId}
and t1.start_time &lt;= #{time}
and t1.end_time &gt;= #{time}
and t1.is_enabled = 1
and t3.week = #{weekday}
and t1.left_times &gt; 0
and t1.department_id = #{departmentId}
limit 1
</select>
<select id="selectByDepartmentIdAndWeekAndDateTime" resultType="com.gogirl.domain.product.serve.BaseServe">
select t3.*
from leisure_discount_config t1
left join leisure_discount_config_service t2 on t1.id = t2.leisure_discount_config_id
left join leisure_discount_config_week t4 on t1.id = t4.leisure_discount_config_id
left join base_serve t3 on t2.service_id = t3.id
where t1.department_id = #{departmentId}
and t1.is_enabled = 1
and t3.id is not null
and t4.week = #{week}
and t1.start_time &lt;= #{time}
and t1.end_time &gt;= #{time}
and t1.left_times &gt; 0
</select>
<select id="selectByDepartmentIdAndWeekIgnoreLimit"
resultType="com.gogirl.domain.market.discount.LeisureDiscountConfig">
select *
from leisure_discount_config t1
left join leisure_discount_config_week t2 on t1.id = t2.leisure_discount_config_id
where t1.department_id
and t2.week = #{week}
and t1.is_enabled = 1
</select>
</mapper> </mapper>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
LEFT JOIN base_serve t6 on t3.service_id =t6.id LEFT JOIN base_serve t6 on t3.service_id =t6.id
LEFT JOIN week_config t7 on t2.`week` =t7.`week` LEFT JOIN week_config t7 on t2.`week` =t7.`week`
LEFT JOIN store_manage t8 on t1.department_id =t8.id LEFT JOIN store_manage t8 on t1.department_id =t8.id
LEFT JOIN leisure_discount_config_limit t9 on t1.id =t9.leisure_discount_config_id and t9.left_times > 0 LEFT JOIN leisure_discount_config_limit t9 on t1.id =t9.leisure_discount_config_id and t9.left_times > 0 and t7.week_date = t9.date
where t1.is_enabled =1 where t1.is_enabled =1
and t2.id is not null and t2.id is not null
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment