Commit e34362c8 by huluobin

update

parent b63fd441
...@@ -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);
...@@ -348,9 +344,7 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -348,9 +344,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());
//美甲师姓名 //美甲师姓名
...@@ -368,6 +362,13 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order ...@@ -368,6 +362,13 @@ public class OrderManageServiceImpl extends ServiceImpl<OrderManageMapper, Order
orderServe.setIsOwnProduce(1); orderServe.setIsOwnProduce(1);
orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId())); orderServe.setOwnProduce(ownProduceMapper.selectById(orderServe.getOwnProduceId()));
} }
//如果修改的订单服务 闲时折扣作废
if (!orderServe.getServeId().equals(orderServeParam.getServeId())) {
//设置折扣属性
orderServe.setLeisureDiscountConfigId(null);
orderServe.setDiscountRate(null);
orderServe.setLeisurePrice(null);
}
orderServe.calcPriceAndTimeLength(); orderServe.calcPriceAndTimeLength();
orderServeMapper.updateById(orderServe); orderServeMapper.updateById(orderServe);
......
...@@ -1087,9 +1087,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1087,9 +1087,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
//闲时折扣 //闲时折扣
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) {
...@@ -1189,6 +1186,9 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1189,6 +1186,9 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper,
scheduleServe.setLeisureDiscountConfigId(null); scheduleServe.setLeisureDiscountConfigId(null);
scheduleServe.setDiscountRate(null); scheduleServe.setDiscountRate(null);
} }
} else {
scheduleServe.setLeisurePrice(null);
scheduleServe.setDiscountRate(null);
} }
scheduleServe.calcPriceAndTimeLength(); scheduleServe.calcPriceAndTimeLength();
...@@ -1367,17 +1367,11 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1367,17 +1367,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);
} }
//预约对应的折扣 //预约对应的折扣
...@@ -1385,7 +1379,6 @@ public class ScheduleManageServiceImpl extends ServiceImpl<ScheduleManageMapper, ...@@ -1385,7 +1379,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);
......
...@@ -30,6 +30,7 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe ...@@ -30,6 +30,7 @@ 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) {
return baseServeMapper.selectById(id); return baseServeMapper.selectById(id);
} }
} }
...@@ -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;
} }
...@@ -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;
......
...@@ -224,6 +224,7 @@ public class ScheduleManageController { ...@@ -224,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) {
...@@ -231,6 +232,12 @@ public class ScheduleManageController { ...@@ -231,6 +232,12 @@ public class ScheduleManageController {
} }
/**
* @param scheduleServeId
* @param status
* @param forceLeisureConfig 强制使用闲时预约次数 1-是 -否
* @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,
...@@ -252,7 +259,7 @@ public class ScheduleManageController { ...@@ -252,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);
......
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