Commit 94376085 by huluobin

mapper 修改

parent c0fba514
......@@ -3,6 +3,7 @@ package com.gogirl.application.product.serve;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gogirl.domain.product.serve.BaseServe;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -29,6 +30,6 @@ public interface BaseServeService extends IService<BaseServe> {
* @param date
* @return
*/
BaseServe getAggregate(Integer id, Date date);
BaseServe getAggregate(Integer id, LocalDateTime date);
}
......@@ -12,6 +12,7 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.sql.Time;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
......@@ -29,11 +30,10 @@ public class BaseServeServiceImpl extends ServiceImpl<BaseServeMapper, BaseServe
}
@Override
public BaseServe getAggregate(Integer id, Date date) {
public BaseServe getAggregate(Integer id, LocalDateTime date) {
BaseServe baseServe = baseServeMapper.getAggregate(id);
Time time = (Time) date;
if (date != null) {
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id, time.toString(), DateUtils.getWeek(new Date()));
LeisureDiscountConfig leisureDiscountConfig = leisureDiscountConfigMapper.selectLeisureDiscount(id, date.toLocalTime().toString(), date.getDayOfWeek().getValue());
if (leisureDiscountConfig != null)
baseServe.setDiscountRate(leisureDiscountConfig.getDiscountRate());
}
......
......@@ -21,6 +21,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
......@@ -45,7 +46,7 @@ public class ServeController {
@ApiOperation(value = "查看服务详情")
@GetMapping("/customer/serve/getServeDetail")
public JsonResult<BaseServe> getServeDetail(@RequestParam Integer id,
@RequestParam(required = false) Date date) {
@RequestParam(required = false) LocalDateTime date) {
BaseServe baseServe = baseServeService.getAggregate(id, date);
return JsonResult.success(baseServe);
}
......@@ -92,7 +93,7 @@ public class ServeController {
@ApiOperation(value = "查看服务详情")
@GetMapping("/technician/serve/getServeDetail")
public JsonResult<BaseServe> technicianGetServeDetail(@RequestParam Integer id,
@RequestParam(required = false) Date date) {
@RequestParam(required = false) LocalDateTime date) {
BaseServe baseServe = baseServeService.getAggregate(id, date);
return JsonResult.success(baseServe);
}
......
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