获取菜谱计划-菜谱详情
This commit is contained in:
parent
5956bf5be1
commit
09368ba4aa
|
|
@ -7,6 +7,8 @@ package com.bonus.common.houqin.constant;
|
||||||
public class GlobalConstants {
|
public class GlobalConstants {
|
||||||
public static final Long TENANT_ID = 99999999L;
|
public static final Long TENANT_ID = 99999999L;
|
||||||
|
|
||||||
|
public static final Integer WEEK_DAYS = 7;
|
||||||
|
|
||||||
public static final String PERSONAL_RECHARGE = "PERSONAL_RECHARGE";
|
public static final String PERSONAL_RECHARGE = "PERSONAL_RECHARGE";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
package com.bonus.canteen.core.cook.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import com.bonus.common.log.enums.OperaType;
|
|
||||||
//import com.bonus.canteen.core.cook.common.annotation.PreventRepeatSubmit;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.bonus.canteen.core.cook.domain.CookDishesSaleRecord;
|
|
||||||
import com.bonus.canteen.core.cook.service.ICookDishesSaleRecordService;
|
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜品销售记录Controller
|
|
||||||
*
|
|
||||||
* @author xsheng
|
|
||||||
* @date 2025-05-25
|
|
||||||
*/
|
|
||||||
@Api(tags = "菜品销售记录接口")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/cook_dishes_sale_record")
|
|
||||||
public class CookDishesSaleRecordController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private ICookDishesSaleRecordService cookDishesSaleRecordService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询菜品销售记录列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "查询菜品销售记录列表")
|
|
||||||
//@RequiresPermissions("cook:record:list")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(CookDishesSaleRecord cookDishesSaleRecord) {
|
|
||||||
startPage();
|
|
||||||
List<CookDishesSaleRecord> list = cookDishesSaleRecordService.selectCookDishesSaleRecordList(cookDishesSaleRecord);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出菜品销售记录列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "导出菜品销售记录列表")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:record:export")
|
|
||||||
@SysLog(title = "菜品销售记录", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出菜品销售记录")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, CookDishesSaleRecord cookDishesSaleRecord) {
|
|
||||||
List<CookDishesSaleRecord> list = cookDishesSaleRecordService.selectCookDishesSaleRecordList(cookDishesSaleRecord);
|
|
||||||
ExcelUtil<CookDishesSaleRecord> util = new ExcelUtil<CookDishesSaleRecord>(CookDishesSaleRecord.class);
|
|
||||||
util.exportExcel(response, list, "菜品销售记录数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取菜品销售记录详细信息
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取菜品销售记录详细信息")
|
|
||||||
//@RequiresPermissions("cook:record:query")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
||||||
return success(cookDishesSaleRecordService.selectCookDishesSaleRecordById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增菜品销售记录
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "新增菜品销售记录")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:record:add")
|
|
||||||
@SysLog(title = "菜品销售记录", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增菜品销售记录")
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody CookDishesSaleRecord cookDishesSaleRecord) {
|
|
||||||
try {
|
|
||||||
return toAjax(cookDishesSaleRecordService.insertCookDishesSaleRecord(cookDishesSaleRecord));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改菜品销售记录
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改菜品销售记录")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:record:edit")
|
|
||||||
@SysLog(title = "菜品销售记录", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改菜品销售记录")
|
|
||||||
@PostMapping("/edit")
|
|
||||||
public AjaxResult edit(@RequestBody CookDishesSaleRecord cookDishesSaleRecord) {
|
|
||||||
try {
|
|
||||||
return toAjax(cookDishesSaleRecordService.updateCookDishesSaleRecord(cookDishesSaleRecord));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除菜品销售记录
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除菜品销售记录")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:record:remove")
|
|
||||||
@SysLog(title = "菜品销售记录", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除菜品销售记录")
|
|
||||||
@PostMapping("/del/{ids}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
||||||
return toAjax(cookDishesSaleRecordService.deleteCookDishesSaleRecordByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
package com.bonus.canteen.core.cook.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import com.bonus.common.log.enums.OperaType;
|
|
||||||
//import com.bonus.canteen.core.cook.common.annotation.PreventRepeatSubmit;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.bonus.canteen.core.cook.domain.CookEvaluaDetail;
|
|
||||||
import com.bonus.canteen.core.cook.service.ICookEvaluaDetailService;
|
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单评价菜品Controller
|
|
||||||
*
|
|
||||||
* @author xsheng
|
|
||||||
* @date 2025-05-25
|
|
||||||
*/
|
|
||||||
@Api(tags = "订单评价菜品接口")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/cook_evalua_detail")
|
|
||||||
public class CookEvaluaDetailController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private ICookEvaluaDetailService cookEvaluaDetailService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询订单评价菜品列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "查询订单评价菜品列表")
|
|
||||||
//@RequiresPermissions("cook:detail:list")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(CookEvaluaDetail cookEvaluaDetail) {
|
|
||||||
startPage();
|
|
||||||
List<CookEvaluaDetail> list = cookEvaluaDetailService.selectCookEvaluaDetailList(cookEvaluaDetail);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出订单评价菜品列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "导出订单评价菜品列表")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:detail:export")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出订单评价菜品")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, CookEvaluaDetail cookEvaluaDetail) {
|
|
||||||
List<CookEvaluaDetail> list = cookEvaluaDetailService.selectCookEvaluaDetailList(cookEvaluaDetail);
|
|
||||||
ExcelUtil<CookEvaluaDetail> util = new ExcelUtil<CookEvaluaDetail>(CookEvaluaDetail.class);
|
|
||||||
util.exportExcel(response, list, "订单评价菜品数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取订单评价菜品详细信息
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取订单评价菜品详细信息")
|
|
||||||
//@RequiresPermissions("cook:detail:query")
|
|
||||||
@GetMapping(value = "/{evaluaDetailId}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("evaluaDetailId") Long evaluaDetailId) {
|
|
||||||
return success(cookEvaluaDetailService.selectCookEvaluaDetailByEvaluaDetailId(evaluaDetailId));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增订单评价菜品
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "新增订单评价菜品")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:detail:add")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增订单评价菜品")
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody CookEvaluaDetail cookEvaluaDetail) {
|
|
||||||
try {
|
|
||||||
return toAjax(cookEvaluaDetailService.insertCookEvaluaDetail(cookEvaluaDetail));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改订单评价菜品
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改订单评价菜品")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:detail:edit")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改订单评价菜品")
|
|
||||||
@PostMapping("/edit")
|
|
||||||
public AjaxResult edit(@RequestBody CookEvaluaDetail cookEvaluaDetail) {
|
|
||||||
try {
|
|
||||||
return toAjax(cookEvaluaDetailService.updateCookEvaluaDetail(cookEvaluaDetail));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除订单评价菜品
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除订单评价菜品")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:detail:remove")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除订单评价菜品")
|
|
||||||
@PostMapping("/del/{evaluaDetailIds}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] evaluaDetailIds) {
|
|
||||||
return toAjax(cookEvaluaDetailService.deleteCookEvaluaDetailByEvaluaDetailIds(evaluaDetailIds));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,119 +0,0 @@
|
||||||
package com.bonus.canteen.core.cook.controller;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import com.bonus.common.log.enums.OperaType;
|
|
||||||
//import com.bonus.canteen.core.cook.common.annotation.PreventRepeatSubmit;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.bonus.canteen.core.cook.domain.CookEvaluaPicture;
|
|
||||||
import com.bonus.canteen.core.cook.service.ICookEvaluaPictureService;
|
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
|
||||||
import com.bonus.common.core.utils.poi.ExcelUtil;
|
|
||||||
import com.bonus.common.core.web.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 订单评价菜品Controller
|
|
||||||
*
|
|
||||||
* @author xsheng
|
|
||||||
* @date 2025-05-25
|
|
||||||
*/
|
|
||||||
@Api(tags = "订单评价菜品接口")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/cook_evalua_picture")
|
|
||||||
public class CookEvaluaPictureController extends BaseController {
|
|
||||||
@Autowired
|
|
||||||
private ICookEvaluaPictureService cookEvaluaPictureService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询订单评价菜品列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "查询订单评价菜品列表")
|
|
||||||
//@RequiresPermissions("cook:picture:list")
|
|
||||||
@GetMapping("/list")
|
|
||||||
public TableDataInfo list(CookEvaluaPicture cookEvaluaPicture) {
|
|
||||||
startPage();
|
|
||||||
List<CookEvaluaPicture> list = cookEvaluaPictureService.selectCookEvaluaPictureList(cookEvaluaPicture);
|
|
||||||
return getDataTable(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导出订单评价菜品列表
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "导出订单评价菜品列表")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:picture:export")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出订单评价菜品")
|
|
||||||
@PostMapping("/export")
|
|
||||||
public void export(HttpServletResponse response, CookEvaluaPicture cookEvaluaPicture) {
|
|
||||||
List<CookEvaluaPicture> list = cookEvaluaPictureService.selectCookEvaluaPictureList(cookEvaluaPicture);
|
|
||||||
ExcelUtil<CookEvaluaPicture> util = new ExcelUtil<CookEvaluaPicture>(CookEvaluaPicture.class);
|
|
||||||
util.exportExcel(response, list, "订单评价菜品数据");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取订单评价菜品详细信息
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取订单评价菜品详细信息")
|
|
||||||
//@RequiresPermissions("cook:picture:query")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
||||||
return success(cookEvaluaPictureService.selectCookEvaluaPictureById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增订单评价菜品
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "新增订单评价菜品")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:picture:add")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增订单评价菜品")
|
|
||||||
@PostMapping
|
|
||||||
public AjaxResult add(@RequestBody CookEvaluaPicture cookEvaluaPicture) {
|
|
||||||
try {
|
|
||||||
return toAjax(cookEvaluaPictureService.insertCookEvaluaPicture(cookEvaluaPicture));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改订单评价菜品
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改订单评价菜品")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:picture:edit")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改订单评价菜品")
|
|
||||||
@PostMapping("/edit")
|
|
||||||
public AjaxResult edit(@RequestBody CookEvaluaPicture cookEvaluaPicture) {
|
|
||||||
try {
|
|
||||||
return toAjax(cookEvaluaPictureService.updateCookEvaluaPicture(cookEvaluaPicture));
|
|
||||||
} catch (Exception e) {
|
|
||||||
return error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除订单评价菜品
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除订单评价菜品")
|
|
||||||
//@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("cook:picture:remove")
|
|
||||||
@SysLog(title = "订单评价菜品", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除订单评价菜品")
|
|
||||||
@PostMapping("/del/{ids}")
|
|
||||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
|
||||||
return toAjax(cookEvaluaPictureService.deleteCookEvaluaPictureByIds(ids));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.bonus.canteen.core.cook.enums;
|
||||||
|
|
||||||
|
public enum RecipeDetailTypeEnum {
|
||||||
|
TEMPLATE_DATA(1L, "模板数据"),
|
||||||
|
DETAIL_DATA(2L, "详情数据");
|
||||||
|
|
||||||
|
private final Long key;
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private RecipeDetailTypeEnum(Long key, String value) {
|
||||||
|
this.key = key;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long key() {
|
||||||
|
return this.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.bonus.canteen.core.cook.enums;
|
||||||
|
|
||||||
|
public enum RecipeTypeEnum {
|
||||||
|
POINT_DATE(1L, "指定日期"),
|
||||||
|
DAILY(2L, "每日循环"),
|
||||||
|
WEEKLY(3L, "每周循环"),
|
||||||
|
MONTHLY(4L, "每月循环");
|
||||||
|
|
||||||
|
private final Long key;
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
private RecipeTypeEnum(Long key, String value) {
|
||||||
|
this.key = key;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long key() {
|
||||||
|
return this.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,11 +10,14 @@ import com.bonus.canteen.core.cook.dto.CookRecipeDTO;
|
||||||
import com.bonus.canteen.core.cook.dto.CookRecipeDateDTO;
|
import com.bonus.canteen.core.cook.dto.CookRecipeDateDTO;
|
||||||
import com.bonus.canteen.core.cook.dto.CookRecipeDetailDTO;
|
import com.bonus.canteen.core.cook.dto.CookRecipeDetailDTO;
|
||||||
import com.bonus.canteen.core.cook.dto.CookRecipeDishesDTO;
|
import com.bonus.canteen.core.cook.dto.CookRecipeDishesDTO;
|
||||||
|
import com.bonus.canteen.core.cook.enums.RecipeDetailTypeEnum;
|
||||||
|
import com.bonus.canteen.core.cook.enums.RecipeTypeEnum;
|
||||||
import com.bonus.canteen.core.cook.mapper.CookRecipeDetailMapper;
|
import com.bonus.canteen.core.cook.mapper.CookRecipeDetailMapper;
|
||||||
import com.bonus.canteen.core.cook.mapper.CookRecipeDishesMapper;
|
import com.bonus.canteen.core.cook.mapper.CookRecipeDishesMapper;
|
||||||
import com.bonus.canteen.core.cook.vo.CookRecipeDetailVO;
|
import com.bonus.canteen.core.cook.vo.CookRecipeDetailVO;
|
||||||
import com.bonus.common.core.exception.ServiceException;
|
import com.bonus.common.core.exception.ServiceException;
|
||||||
import com.bonus.common.core.utils.DateUtils;
|
import com.bonus.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.common.houqin.constant.GlobalConstants;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -153,20 +156,20 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
List<CookRecipeDateDTO> recipeDateListNew = new ArrayList<>();
|
List<CookRecipeDateDTO> recipeDateListNew = new ArrayList<>();
|
||||||
if (2 == cookRecipeDTO.getRecipeType() && Objects.nonNull(recipeDateList.get(0))) { //每日循环
|
if (RecipeTypeEnum.DAILY.key().equals(cookRecipeDTO.getRecipeType()) && Objects.nonNull(recipeDateList.get(0))) { //每日循环
|
||||||
List<CookRecipeDetailDTO> recipeDetailList = recipeDateList.get(0).getDetailList();
|
List<CookRecipeDetailDTO> recipeDetailList = recipeDateList.get(0).getDetailList();
|
||||||
//新增详情
|
//新增详情
|
||||||
LocalDate now = LocalDate.now();
|
LocalDate now = LocalDate.now();
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < GlobalConstants.WEEK_DAYS; ++i) {
|
||||||
CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO();
|
CookRecipeDateDTO cookRecipeDateDTO = new CookRecipeDateDTO();
|
||||||
cookRecipeDateDTO.setDetailList(recipeDetailList);
|
cookRecipeDateDTO.setDetailList(recipeDetailList);
|
||||||
cookRecipeDateDTO.setApplyDate(now.plusDays(i));
|
cookRecipeDateDTO.setApplyDate(now.plusDays(i));
|
||||||
recipeDateListNew.add(cookRecipeDateDTO);
|
recipeDateListNew.add(cookRecipeDateDTO);
|
||||||
}
|
}
|
||||||
} else if (3 == cookRecipeDTO.getRecipeType()) { //每周循环
|
} else if (RecipeTypeEnum.WEEKLY.key().equals(cookRecipeDTO.getRecipeType())) { //每周循环
|
||||||
LocalDate now = LocalDate.now();
|
LocalDate now = LocalDate.now();
|
||||||
HashMap<Integer, LocalDate> dateHashMap = new HashMap<>();
|
HashMap<Integer, LocalDate> dateHashMap = new HashMap<>();
|
||||||
for (int i = 0; i < 7; ++i) {
|
for (int i = 0; i < GlobalConstants.WEEK_DAYS; ++i) {
|
||||||
LocalDate applyWeek = now.plusDays((long) i);
|
LocalDate applyWeek = now.plusDays((long) i);
|
||||||
dateHashMap.put(applyWeek.getDayOfWeek().getValue(), applyWeek);
|
dateHashMap.put(applyWeek.getDayOfWeek().getValue(), applyWeek);
|
||||||
}
|
}
|
||||||
|
|
@ -200,9 +203,9 @@ public class CookRecipeServiceImpl implements ICookRecipeService {
|
||||||
cookRecipeDetail.setCreateBy(SecurityUtils.getUsername());
|
cookRecipeDetail.setCreateBy(SecurityUtils.getUsername());
|
||||||
cookRecipeDetail.setCreateTime(DateUtils.getNowDate());
|
cookRecipeDetail.setCreateTime(DateUtils.getNowDate());
|
||||||
if (Objects.isNull(cookRecipeDetail.getApplyDate())) {
|
if (Objects.isNull(cookRecipeDetail.getApplyDate())) {
|
||||||
cookRecipeDetail.setDetailType(1L); //模板数据
|
cookRecipeDetail.setDetailType(RecipeDetailTypeEnum.TEMPLATE_DATA.key()); //模板数据
|
||||||
} else {
|
} else {
|
||||||
cookRecipeDetail.setDetailType(2L); //详情数据
|
cookRecipeDetail.setDetailType(RecipeDetailTypeEnum.DETAIL_DATA.key()); //详情数据
|
||||||
}
|
}
|
||||||
cookRecipeDetailMapper.insertCookRecipeDetail(cookRecipeDetail); //插入菜谱之执行计划
|
cookRecipeDetailMapper.insertCookRecipeDetail(cookRecipeDetail); //插入菜谱之执行计划
|
||||||
List<CookRecipeDishesDTO> dishesList = detailDTO.getDishesList();
|
List<CookRecipeDishesDTO> dishesList = detailDTO.getDishesList();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue