Commit e34362c8 by huluobin

update

parent b63fd441
......@@ -178,7 +178,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
.payPrice(baseServe.getPrice())
.isOwnProduce(baseServe.getIsOwnProduce())
.achievement(baseServe.getPrice());
// .leisureDiscountPrice(BigDecimal.ZERO);
//款式信息
if (orderServeParam.getProduceId() != null) {
......@@ -250,10 +250,6 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
}
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
}
// else {
// orderServe.setIsOwnProduce(2);
// orderServe.setOwnProduceId(null);
// }
orderServe.calcPriceAndTimeLength();
orderServeMapper.insert(orderServe);
......@@ -348,9 +344,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setServeChangePrice(orderServeParam.getServeChangePrice());
}
List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectList(
new LambdaQueryWrapper<StoreTechnician>().in(StoreTechnician::getId, Lists.newArrayList(orderServeParam.getTechnicianId().split(",")))
);
List<StoreTechnician> storeTechnicianList = storeTechnicianMapper.selectList(new LambdaQueryWrapper<StoreTechnician>().in(StoreTechnician::getId, Lists.newArrayList(orderServeParam.getTechnicianId().split(","))));
//美甲师id
orderServe.setTechnicianId(orderServeParam.getTechnicianId());
//美甲师姓名
......@@ -368,6 +362,13 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setIsOwnProduce(1);
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
}
//如果修改的订单服务 闲时折扣作废
if (!orderServe.getServeId().equals(orderServeParam.getServeId())) {
//设置折扣属性
orderServe.setLeisureDiscountConfigId(null);
orderServe.setDiscountRate(null);
orderServe.setLeisurePrice(null);
}
orderServe.calcPriceAndTimeLength();
orderServeMapper.updateById(orderServe);
......
......@@ -1087,9 +1087,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//闲时折扣
if (scheduleServeCommand.getLeisureDiscountConfigId() != null) {
scheduleServe.setLeisureDiscountConfigId(scheduleServeCommand.getLeisureDiscountConfigId());
// LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(scheduleServe.getLeisureDiscountConfigId());
// scheduleServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
}
if (scheduleServeCommand.getActualStartTime() != null) {
......@@ -1189,6 +1186,9 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
scheduleServe.setLeisureDiscountConfigId(null);
scheduleServe.setDiscountRate(null);
}
} else {
scheduleServe.setLeisurePrice(null);
scheduleServe.setDiscountRate(null);
}
scheduleServe.calcPriceAndTimeLength();
......@@ -1367,17 +1367,11 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectById(scheduleServeVar.getLeisureDiscountConfigId());
if (leisureDiscountConfig != null) {
//折扣金额
BigDecimal leisurePrice = orderServe.getPrice().subtract(orderServe.getPrice().multiply(leisureDiscountConfig.getDiscountRate()));
//设置折扣属性
orderServe.setLeisureDiscountConfigId(scheduleServeVar.getLeisureDiscountConfigId());
orderServe.setDiscountRate(scheduleServeVar.getDiscountRate());
orderServe.setLeisurePrice(scheduleServeVar.getLeisurePrice());
//更新订单实际折扣的使用次数
leisureDiscountConfig.setLeftTimes(leisureDiscountConfig.getLeftTimes() - 1);
leisureDiscountConfigMapper.updateById(leisureDiscountConfig);
}
//预约对应的折扣
......@@ -1385,7 +1379,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//更新预约折扣的使用次数
if (schLeisureDiscountConfig != null) {
schLeisureDiscountConfig.setLeftTimes(schLeisureDiscountConfig.getLeftTimes() + 1);
leisureDiscountConfigMapper.updateById(schLeisureDiscountConfig);
}
orderServeList.add(orderServe);
......
......@@ -30,6 +30,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
@Override
public BaseServe getAggregate(Integer id, LocalDateTime date, Integer departmentId) {
return baseServeMapper.selectById(id);
}
}
......@@ -44,5 +44,5 @@ public class LeisureDiscountConfig implements Serializable {
@TableField("`limit`")
private Integer limit;
private Integer leftTimes;
}
......@@ -81,14 +81,19 @@ public class OrderServe implements Serializable {
*/
@ApiModelProperty("服务数量")
private Integer serveNumber;
@ApiModelProperty("预约服务id")
private Integer serveId;
@ApiModelProperty("服务名称")
private String serveName;
@ApiModelProperty("图片名称")
private String servePicturePath;
@ApiModelProperty("服务价格")
private BigDecimal servePrice;
@ApiModelProperty("服务分类")
private String serveType;
......@@ -148,6 +153,7 @@ public class OrderServe implements Serializable {
private Integer removeCouponId;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("闲时折扣配置id")
private Integer leisureDiscountConfigId;
......@@ -237,9 +243,11 @@ public class OrderServe implements Serializable {
@TableField(strategy = FieldStrategy.IGNORED)
private Integer producePromotionTimeId;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("折扣")
private BigDecimal discountRate;
@TableField(strategy = FieldStrategy.IGNORED)
@ApiModelProperty("闲时价格")
private BigDecimal leisurePrice;
......
......@@ -224,6 +224,7 @@ public class ScheduleManageController {
return JsonResult.success();
}
@Deprecated
@ApiOperation("更新前检查预约")
@PostMapping("/technician/schedule/checkBeforeUpdate")
public JsonResult<Void> checkBeforeUpdate(@RequestBody UpdateScheduleCommand cmd) {
......@@ -231,6 +232,12 @@ public class ScheduleManageController {
}
/**
* @param scheduleServeId
* @param status
* @param forceLeisureConfig 强制使用闲时预约次数 1-是 -否
* @return
*/
@ApiOperation("更新预约服务状态")
@GetMapping("/technician/schedule/updateScheduledServeStatus")
public JsonResult<Void> updateScheduledServeStatus(@RequestParam Integer scheduleServeId,
......@@ -252,7 +259,7 @@ public class ScheduleManageController {
}
@ApiOperation("当前服务是否在闲时间范围内 1-是 2-否")
@ApiOperation("当前服务是否在闲时间范围内 1-是 2-否 3-不存在")
@GetMapping("/technician/schedule/getScheduledServeLeisure")
public JsonResult<Integer> getScheduledServeLeisure(@RequestParam Integer scheduleServeId) {
Integer result = scheduleManageService.getScheduledServeLeisure(scheduleServeId);
......
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